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


PHP gzopen64函数代码示例

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


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

示例1: _gzopen

function _gzopen($path, $mode, $use_include_path = 0)
{
    if (function_exists("gzopen")) {
        return gzopen($path, $mode, $use_include_path);
    } elseif (function_exists("gzopen64")) {
        return gzopen64($path, $mode, $use_include_path);
    } else {
        throw new Exception("No GZIP library installed.");
    }
}
开发者ID:scriptzteam,项目名称:newzNZB-premium-indexer,代码行数:10,代码来源:util.php

示例2: __construct

 /**
  * Opens a gzip file.
  * 
  * @param	string		$filename
  * @param	string		$mode
  */
 public function __construct($filename, $mode = 'wb')
 {
     if (self::$gzopen64 === null) {
         self::$gzopen64 = function_exists('gzopen64');
     }
     $this->filename = $filename;
     $this->resource = self::$gzopen64 ? gzopen64($filename, $mode) : gzopen($filename, $mode);
     if ($this->resource === false) {
         throw new SystemException('Can not open file ' . $filename);
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:17,代码来源:GZipFile.class.php

示例3: gzopen

 function gzopen($_1894966303, $_491709210, $_1517607585 = 0)
 {
     return gzopen64($_1894966303, $_491709210, $_1517607585);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:4,代码来源:update_client.php

示例4: open

 /**
  * The function handles the rotation of the log files. By default it will open
  * the current log file, 'main', which is written to `$_log_path` and
  * check it's file size doesn't exceed `$_max_size`. If it does, the log
  * is appended with a date stamp and if `$_archive` has been set, it will
  * be archived and stored. If a log file has exceeded it's size, or `Log::OVERWRITE`
  * flag is set, the existing log file is removed and a new one created. Essentially,
  * if a log file has not reached it's `$_max_size` and the the flag is not
  * set to `Log::OVERWRITE`, this function does nothing.
  *
  * @link http://au.php.net/manual/en/function.intval.php
  * @param integer $flag
  *  One of the Log constants, either `Log::APPEND` or `Log::OVERWRITE`
  *  By default this is `Log::APPEND`
  * @param integer $mode
  *  The file mode used to apply to the archived log, by default this is 0777. Note that this
  *  parameter is modified using PHP's intval function with base 8.
  * @throws Exception
  * @return integer
  *  Returns 1 if the log was overwritten, or 2 otherwise.
  */
 public function open($flag = self::APPEND, $mode = 0777)
 {
     if (!file_exists($this->_log_path)) {
         $flag = self::OVERWRITE;
     }
     if ($flag == self::APPEND && file_exists($this->_log_path) && is_readable($this->_log_path)) {
         if ($this->_max_size > 0 && filesize($this->_log_path) > $this->_max_size) {
             $flag = self::OVERWRITE;
             if ($this->_archive) {
                 $this->close();
                 $file = $this->_log_path . DateTimeObj::get('Ymdh') . '.gz';
                 if (function_exists('gzopen64')) {
                     $handle = gzopen64($file, 'w9');
                 } else {
                     $handle = gzopen($file, 'w9');
                 }
                 gzwrite($handle, file_get_contents($this->_log_path));
                 gzclose($handle);
                 chmod($file, intval($mode, 8));
             }
         }
     }
     if ($flag == self::OVERWRITE) {
         if (file_exists($this->_log_path) && is_writable($this->_log_path)) {
             General::deleteFile($this->_log_path);
         }
         $this->writeToLog('============================================', true);
         $this->writeToLog('Log Created: ' . DateTimeObj::get('c'), true);
         $this->writeToLog('============================================', true);
         @chmod($this->_log_path, intval($mode, 8));
         return 1;
     }
     return 2;
 }
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:55,代码来源:class.log.php

示例5: gzopen

 function gzopen($_226598243, $_701334563, $_613458962 = 0)
 {
     return gzopen64($_226598243, $_701334563, $_613458962);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:4,代码来源:update_client.php

示例6: gzopen

 function gzopen($_231119146, $_1724980625, $_1221336291 = 0)
 {
     return gzopen64($_231119146, $_1724980625, $_1221336291);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:update_client.php

示例7: gzopen

 function gzopen($sfn, $m)
 {
     return gzopen64($sfn, $m);
 }
开发者ID:wyg3958,项目名称:WebsiteBaker_CommunityEdition,代码行数:4,代码来源:pclzip.lib.php

示例8: gzopen

 function gzopen($_1773484091, $_1621668548, $_1936282223 = 0)
 {
     return gzopen64($_1773484091, $_1621668548, $_1936282223);
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:4,代码来源:update_client.php

示例9: download_maxmind_database

 /**
  * Downloads the MaxMind geolocation database from their repository
  */
 public static function download_maxmind_database()
 {
     // Create the folder, if it doesn't exist
     if (!file_exists(dirname(self::$maxmind_path))) {
         mkdir(dirname(self::$maxmind_path));
     }
     // Download the most recent database directly from MaxMind's repository
     if (!function_exists('download_url')) {
         require_once ABSPATH . 'wp-admin/includes/file.php';
     }
     $maxmind_tmp = download_url('http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', 5);
     if (is_wp_error($maxmind_tmp)) {
         return __('There was an error downloading the MaxMind Geolite DB:', 'wp-slimstat') . ' ' . $maxmind_tmp->get_error_message();
     }
     $zh = false;
     if (!function_exists('gzopen')) {
         if (function_exists('gzopen64')) {
             if (false === ($zh = gzopen64($maxmind_tmp, 'rb'))) {
                 return __('There was an error opening the zipped MaxMind Geolite DB.', 'wp-slimstat');
             }
         } else {
             return __('Function gzopen not defined. Aborting.', 'wp-slimstat');
         }
     } else {
         if (false === ($zh = gzopen($maxmind_tmp, 'rb'))) {
             return __('There was an error opening the zipped MaxMind Geolite DB.', 'wp-slimstat');
         }
     }
     if (false === ($fh = fopen(self::$maxmind_path, 'wb'))) {
         return __('There was an error opening the unzipped MaxMind Geolite DB.', 'wp-slimstat');
     }
     while (($data = gzread($zh, 4096)) != false) {
         fwrite($fh, $data);
     }
     @gzclose($zh);
     @fclose($fh);
     @unlink($maxmind_tmp);
     return '';
 }
开发者ID:bigkey,项目名称:php-getting-started,代码行数:42,代码来源:wp-slimstat.php

示例10: gzopen

 function gzopen($_1188722638, $_497805605, $_2131907502 = 0)
 {
     return gzopen64($_1188722638, $_497805605, $_2131907502);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:4,代码来源:update_client.php

示例11: backupMySql

/**  Backup a glpi DB
 *
 * @param $DB        DB object
 * @param $dumpFile  dump file
 * @param $duree     max delay before refresh
 * @param $rowlimit  rowlimit to backup in one time
**/
function backupMySql($DB, $dumpFile, $duree, $rowlimit)
{
    global $TPSCOUR, $offsettable, $offsetrow, $cpt;
    // $dumpFile, fichier source
    // $duree=timeout pour changement de page (-1 = aucun)
    if (function_exists('gzopen')) {
        $fileHandle = gzopen($dumpFile, "a");
    } else {
        $fileHandle = gzopen64($dumpFile, "a");
    }
    if (!$fileHandle) {
        //TRANS: %s is the name of the file
        echo sprintf(__('Unauthorized access to the file %s'), $dumpFile) . "<br>";
        return false;
    }
    if ($offsettable == 0 && $offsetrow == -1) {
        $time_file = date("Y-m-d-H-i");
        $cur_time = date("Y-m-d H:i");
        $todump = "#GLPI Dump database on {$cur_time}\n";
        gzwrite($fileHandle, $todump);
    }
    $result = $DB->list_tables();
    $numtab = 0;
    while ($t = $DB->fetch_row($result)) {
        $tables[$numtab] = $t[0];
        $numtab++;
    }
    for (; $offsettable < $numtab; $offsettable++) {
        // Dump de la structure table
        if ($offsetrow == -1) {
            $todump = "\n" . get_def($DB, $tables[$offsettable]);
            gzwrite($fileHandle, $todump);
            $offsetrow++;
            $cpt++;
        }
        current_time();
        if ($duree > 0 && $TPSCOUR >= $duree) {
            //on atteint la fin du temps imparti
            return true;
        }
        $fin = 0;
        while (!$fin) {
            $todump = get_content($DB, $tables[$offsettable], $offsetrow, $rowlimit);
            $rowtodump = substr_count($todump, "INSERT INTO");
            if ($rowtodump > 0) {
                gzwrite($fileHandle, $todump);
                $cpt += $rowtodump;
                $offsetrow += $rowlimit;
                if ($rowtodump < $rowlimit) {
                    $fin = 1;
                }
                current_time();
                if ($duree > 0 && $TPSCOUR >= $duree) {
                    //on atteint la fin du temps imparti
                    return true;
                }
            } else {
                $fin = 1;
                $offsetrow = -1;
            }
        }
        if ($fin) {
            $offsetrow = -1;
        }
        current_time();
        if ($duree > 0 && $TPSCOUR >= $duree) {
            //on atteint la fin du temps imparti
            return true;
        }
    }
    if ($DB->error()) {
        echo "<hr>";
        //TRANS: %s is the SQL query which generates the error
        printf(__("SQL error starting from %s"), "[{$formattedQuery}]");
        echo "<br>" . $DB->error() . "<hr>";
    }
    $offsettable = -1;
    gzclose($fileHandle);
    return true;
}
开发者ID:stweil,项目名称:glpi,代码行数:87,代码来源:backup.php

示例12: gzopen

 function gzopen($_2014433914, $_368735908, $_669073776 = 0)
 {
     return gzopen64($_2014433914, $_368735908, $_669073776);
 }
开发者ID:vim84,项目名称:b-markt,代码行数:4,代码来源:update_client.php

示例13: gzopen

 function gzopen(string $filename, string $mode, int $use_include_path = null)
 {
     return gzopen64($filename, $mode, $use_include_path);
 }
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:4,代码来源:gzopen.php

示例14: gzopen

 function gzopen($file, $mode)
 {
     return gzopen64($file, $mode);
 }
开发者ID:big2men,项目名称:qhm,代码行数:4,代码来源:func.php

示例15: privExtractFileUsingTempFile

 function privExtractFileUsingTempFile(&$p_entry, &$p_options)
 {
     $v_result = 1;
     // ----- Creates a temporary file
     $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR . uniqid('pclzip-') . '.gz';
     if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
         fclose($v_file);
         PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary write mode');
         return PclZip::errorCode();
     }
     // ----- Write gz file format header
     $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x0), time(), Chr(0x0), Chr(3));
     @fwrite($v_dest_file, $v_binary_data, 10);
     // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
     $v_size = $p_entry['compressed_size'];
     while ($v_size != 0) {
         $v_read_size = $v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE;
         $v_buffer = @fread($this->zip_fd, $v_read_size);
         //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
         @fwrite($v_dest_file, $v_buffer, $v_read_size);
         $v_size -= $v_read_size;
     }
     // ----- Write gz file format footer
     $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
     @fwrite($v_dest_file, $v_binary_data, 8);
     // ----- Close the temporary file
     @fclose($v_dest_file);
     // ----- Opening destination file
     if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
         $p_entry['status'] = "write_error";
         return $v_result;
     }
     // ----- Open the temporary gz file
     if ($this->bUseGzopen64) {
         if (($v_src_file = @gzopen64($v_gzip_temp_name, 'rb')) == 0) {
             @fclose($v_dest_file);
             $p_entry['status'] = "read_error";
             PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary read mode');
             return PclZip::errorCode();
         }
     } else {
         if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
             @fclose($v_dest_file);
             $p_entry['status'] = "read_error";
             PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \'' . $v_gzip_temp_name . '\' in binary read mode');
             return PclZip::errorCode();
         }
     }
     // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
     $v_size = $p_entry['size'];
     while ($v_size != 0) {
         $v_read_size = $v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE;
         $v_buffer = @gzread($v_src_file, $v_read_size);
         //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
         @fwrite($v_dest_file, $v_buffer, $v_read_size);
         $v_size -= $v_read_size;
     }
     @fclose($v_dest_file);
     @gzclose($v_src_file);
     // ----- Delete the temporary file
     @unlink($v_gzip_temp_name);
     // ----- Return
     return $v_result;
 }
开发者ID:GTAWWEKID,项目名称:tsiserver.us,代码行数:64,代码来源:pclzip.lib.php


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