本文整理汇总了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)
{
}