当前位置: 首页>>代码示例>>PHP>>正文


PHP FClose函数代码示例

本文整理汇总了PHP中FClose函数的典型用法代码示例。如果您正苦于以下问题:PHP FClose函数的具体用法?PHP FClose怎么用?PHP FClose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FClose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Close

 public function Close()
 {
     if ($this->Socket) {
         FClose($this->Socket);
         $this->Socket = null;
     }
 }
开发者ID:ezpz-cz,项目名称:web-pages,代码行数:7,代码来源:Socket.class.php

示例2: Disconnect

 public function Disconnect()
 {
     if ($this->Socket) {
         FClose($this->Socket);
         $this->Socket = null;
     }
 }
开发者ID:BONNe,项目名称:MinecraftVoter,代码行数:7,代码来源:minecraftrcon.php

示例3: _log

 private static function _log($data, $level, $withTimestamp)
 {
     $prependText = $withTimestamp ? date('j.n.Y H:i:s') . ' : ' : '';
     if ($level == 'err') {
         $fileNameSuffix = '-error';
         // naformatovanie dat tak aby boli pekne zarovnane
         $sid = str_pad(session_id(), 26, ' ');
         $ip = str_pad($_SERVER['REMOTE_ADDR'], 15, ' ');
         $prependText .= "SID:{$sid} , IP:{$ip} , ";
     } else {
         $fileNameSuffix = '';
     }
     if (is_array($data) || is_object($data)) {
         $data = PHP_EOL . var_export($data, true);
     }
     if (is_bool($data)) {
         $data = $data ? 'boolean true' : 'boolean false';
     }
     try {
         $f = FOpen(LOG_DIR . date('Y-m-d') . "{$fileNameSuffix}.txt", "a");
         FWrite($f, $prependText . $data . PHP_EOL);
         FClose($f);
     } catch (Exception $e) {
     }
 }
开发者ID:novacek78,项目名称:v4,代码行数:25,代码来源:Logger.php

示例4: Close

 public function Close()
 {
     if ($this->RconSocket) {
         FClose($this->RconSocket);
         $this->RconSocket = null;
     }
     $this->RconRequestId = 0;
 }
开发者ID:ezpz-cz,项目名称:web-pages,代码行数:8,代码来源:SourceRcon.class.php

示例5: Close

 public function Close()
 {
     if ($this->RconSocket) {
         FClose($this->RconSocket);
         $this->RconSocket = null;
     }
     $this->RconChallenge = 0;
     $this->RconRequestId = 0;
     $this->RconPassword = 0;
 }
开发者ID:mefisto2009,项目名称:GameAP,代码行数:10,代码来源:Rcon.class.php

示例6: logg

 public function logg($text, $id_uzivatele = null)
 {
     $fp = FOpen($this->soubor, 'a');
     if ($id_uzivatele) {
         $osoba = $id_uzivatele;
     } else {
         $osoba = $this->id_uzivatele;
     }
     if (!$osoba) {
         $osoba = '000000';
     }
     FPutS($fp, Date("Y-m-d H:i:s") . " gis: {$osoba} " . NStrings::toAscii($text) . "\n");
     FClose($fp);
 }
开发者ID:krecek,项目名称:nrsn,代码行数:14,代码来源:Logger.php

示例7: Connect

 public function Connect($Ip, $Port = 25565, $Timeout = 3)
 {
     if ($this->Socket = FSockOpen('udp://' . $Ip, (int) $Port)) {
         Socket_Set_TimeOut($this->Socket, $Timeout);
         $Challenge = $this->GetChallenge();
         if ($Challenge === false) {
             FClose($this->Socket);
             return false;
         }
         if (!$this->GetStatus($Challenge)) {
             FClose($this->Socket);
             return false;
         }
         FClose($this->Socket);
         return true;
     } else {
         return false;
     }
 }
开发者ID:CrystReal,项目名称:Site_frontend,代码行数:19,代码来源:MinecraftQuery.php

示例8: Connect

 public function Connect($Ip, $Port = 25565, $Timeout = 3)
 {
     if (!is_int($Timeout) || $Timeout < 0) {
         throw new InvalidArgumentException('Timeout must be an integer.');
     }
     $this->Socket = @FSockOpen('udp://' . $Ip, (int) $Port, $ErrNo, $ErrStr, $Timeout);
     if ($ErrNo || $this->Socket === false) {
         throw new MinecraftQueryException('Could not create socket: ' . $ErrStr);
     }
     Stream_Set_Timeout($this->Socket, $Timeout);
     Stream_Set_Blocking($this->Socket, true);
     try {
         $Challenge = $this->GetChallenge();
         $this->GetStatus($Challenge);
     } catch (MinecraftQueryException $e) {
         FClose($this->Socket);
         throw new MinecraftQueryException($e->getMessage());
     }
     FClose($this->Socket);
 }
开发者ID:0651,项目名称:Cyanide-Services,代码行数:20,代码来源:MinecraftQuery.class.php

示例9: SaveUploadedFile

function SaveUploadedFile($Table, $ID, $File)
{
    #-------------------------------------------------------------------------------
    $FilePaths = GetFilePath($Table, $ID);
    #-------------------------------------------------------------------------------
    # создаём директорию
    if (!File_Exists($FilePaths['FileDir'])) {
        if (!MkDir($FilePaths['FileDir'], 0700, true)) {
            return new gException('CANNOT_CREATE_DIRECTORY', 'Не удалось создать директорию для сохранения файла');
        }
    }
    #-------------------------------------------------------------------------------
    # сохраняем файл
    $fp = FOpen($FilePaths['FilePath'], 'w');
    FWrite($fp, $File);
    FClose($fp);
    #-------------------------------------------------------------------------------
    return TRUE;
    #-------------------------------------------------------------------------------
}
开发者ID:carriercomm,项目名称:jbs,代码行数:20,代码来源:Upload.php

示例10: build

 private function build($url, $file)
 {
     // Get content from $url
     $curl = curl_init($url);
     // Create the file name
     $output_file = FOpen($file, 'w');
     // Set some headers
     curl_setopt($curl, CURLOPT_FILE, $output_file);
     curl_setopt($curl, CURLOPT_HEADER, 0);
     // Exec the request
     curl_exec($curl);
     // Print results
     echo "<li><a href=\"{$file}\">" . $file . "</a></li>";
     /*echo "<pre>";
       print_r( curl_getInfo( $curl ) );
       echo "</pre>";*/
     // Close conection
     curl_close($curl);
     // Close file
     FClose($output_file);
 }
开发者ID:nallegrotti,项目名称:chico,代码行数:21,代码来源:builder.php

示例11: BuildItemDesc

function BuildItemDesc($file)
{
    print " * Loading multis config file...\n";
    $cfg_file = ReadConfigFile($file);
    if ($cfg_file == FALSE) {
        print "Cant open {$file} ({$php_errormsg}). Blame Stephen Donald.\n";
        exit;
    }
    print " * Purging itemdesc.cfg for new write...\n";
    $handle = FOpen("itemdesc.cfg", "w");
    FClose($handle);
    $handle = FOpen("itemdesc.cfg", "a");
    print " * Finding elem names...";
    $elem_names = GetConfigStringKeys($cfg_file, CLASS_LABELS_ON);
    print "(" . Count($elem_names) . ")\n";
    foreach ($elem_names as $elem_name) {
        if (!Preg_Match("/^House\\s+/i", $elem_name)) {
            continue;
        }
        $multi_id = Preg_Replace("/^House\\s+/i", "", $elem_name);
        $objtype = HexDec($multi_id);
        $objtype += 16384;
        // 0x4000
        $objtype = "0x" . DecHex($objtype);
        FWrite($handle, "House {$objtype}\n");
        FWrite($handle, "{\n");
        FWrite($handle, "\t// Main Stuff\n");
        FWrite($handle, "\tName\t\tHouse{$objtype}\n");
        FWrite($handle, "\tGraphic\t\t{$objtype}\n");
        FWrite($handle, "\n");
        FWrite($handle, "\t// Multi Info\n");
        FWrite($handle, "\tMultiID\t\t{$multi_id}\n");
        FWrite($handle, "}\n\n");
    }
    FClose($handle);
    return 1;
}
开发者ID:polserver,项目名称:poltools,代码行数:37,代码来源:setupItemdesc.php

示例12: array

     #-------------------------------------------------------------------------------
     if (!Is_Resource($Socket)) {
         #-------------------------------------------------------------------------------
         #Debug(SPrintF('[comp/Tasks/ServersUpTime]: cannot connect %s:%u with error: %s (%s)',$Server['Address'],$Port,$sError,$nError));
         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     $IPage = array('TestDate' => Time(), 'ServerID' => $Server['ID'], 'Service' => Trim($ServiceName), 'UpTime' => Is_Resource($Socket) ? 100 : 0, 'Day' => Date('d'), 'Month' => Date('m'), 'Year' => Date('Y'));
     #-------------------------------------------------------------------------------
     $IsInsert = DB_Insert('ServersUpTime', $IPage);
     if (Is_Error($IsInsert)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     if (Is_Resource($Socket)) {
         FClose($Socket);
     }
     #-------------------------------------------------------------------------------
 }
 #-------------------------------------------------------------------------------
 # рассчиытваем значение IsOK
 $UpTimes = DB_Select('ServersUpTime', array('(SUM(`UpTime`*`Count`)/SUM(`Count`)) as `UpTime`'), array('UNIQ', 'Where' => SPrintF('`TestDate` > UNIX_TIMESTAMP() - %u * 24 * 60 *60  AND `ServerID` = %u', $Settings['DaysAgregate'] ? $Settings['DaysAgregate'] : 1, $Server['ID'])));
 switch (ValueOf($Server)) {
     case 'error':
         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'array':
         break;
     default:
         return ERROR | @Trigger_Error(101);
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServersUpTime.comp.php

示例13: WriteElemToFile

function WriteElemToFile(&$elem_name, &$elem_lines)
{
    $handle = FOpen("CleanedConfig.cfg", "a");
    FWrite($handle, "{$elem_name}\n");
    FWrite($handle, "{\n");
    foreach ($elem_lines as $property => $values) {
        foreach ($values as $value) {
            FWrite($handle, "\t{$property}\t{$value}\n");
        }
    }
    FWrite($handle, "}\n\n");
    FClose($handle);
    return 1;
}
开发者ID:polserver,项目名称:poltools,代码行数:14,代码来源:cfgformat.php

示例14: robin_file_write

 function robin_file_write($filename_and_path, $data)
 {
     @umask(0131);
     $file = @FOpen($filename_and_path, 'wb+');
     @flock($file, 2);
     @FPutS($file, $data);
     @flock($file, 3);
     @FClose($file);
 }
开发者ID:RoboSK,项目名称:tvheadend-php-channel-editor,代码行数:9,代码来源:func.php

示例15: CloseCreate

 function CloseCreate()
 {
     FClose($this->serverLogHandle);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:4,代码来源:security_file_verifier.php


注:本文中的FClose函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。