本文整理匯總了PHP中ZipArchive::setup方法的典型用法代碼示例。如果您正苦於以下問題:PHP ZipArchive::setup方法的具體用法?PHP ZipArchive::setup怎麽用?PHP ZipArchive::setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ZipArchive
的用法示例。
在下文中一共展示了ZipArchive::setup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
foreach ($dirEntries as $dirEntriy) {
if ($dirEntriy == "." || $dirEntriy == "..") {
continue;
}
$subject = $dir_path . DIRECTORY_SEPARATOR . $dirEntriy;
//if this is directory then index its contents
if (is_dir($subject)) {
$this->__indexDirRec($subject);
} else {
//save path as relative path inside zip
$this->fileIndex[] = str_replace($this->tempDirPath . DIRECTORY_SEPARATOR, "", $subject);
}
}
}
}
ZipArchive::setup();
//try to find locations of zip/unzip binaries
/**
* Open a ZIP file archive
* @link http://php.net/manual/en/function.zip-open.php
* @param filename string <p>
* The file name of the ZIP archive to open.
* </p>
* @return mixed a resource handle for later use with
* zip_read and zip_close
* or returns the number of error if filename does not
* exist or in case of other error.
*/
function zip_open($filename)
{
}