本文整理汇总了PHP中iaUtil::isZip方法的典型用法代码示例。如果您正苦于以下问题:PHP iaUtil::isZip方法的具体用法?PHP iaUtil::isZip怎么用?PHP iaUtil::isZip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaUtil
的用法示例。
在下文中一共展示了iaUtil::isZip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _processQueries
protected function _processQueries(array $entries)
{
$iaDb =& $this->iaDb;
$iaDbControl = $this->iaCore->factory('dbcontrol', iaCore::ADMIN);
require_once IA_INCLUDES . 'utils' . IA_DS . 'pclzip.lib.php';
$mysqlOptions = 'ENGINE=MyISAM DEFAULT CHARSET=utf8';
$pathsMap = array(self::TYPE_PLUGIN => IA_PLUGINS, self::TYPE_PACKAGE => IA_PACKAGES);
$path = isset($pathsMap[$this->itemData['type']]) ? $pathsMap[$this->itemData['type']] : IA_HOME;
$versionInstalled = $iaDb->one_bind('version', '`name` = :name', array('name' => $this->itemData['name']), self::getTable());
foreach ($entries as $version => $entry) {
if ($versionInstalled && version_compare($versionInstalled, $version, '>')) {
continue;
}
foreach ($entry as $data) {
if ($data['external']) {
$filePath = str_replace(array('{DIRECTORY_SEPARATOR}', '{DS}'), IA_DS, $data['query']);
$fileFullPath = $path . $this->itemData['name'] . IA_DS . $filePath;
if (iaUtil::isZip($fileFullPath)) {
$archive = new PclZip($fileFullPath);
$files = $archive->extract(PCLZIP_OPT_PATH, IA_TMP);
if (0 == $files) {
continue;
}
foreach ($files as $file) {
$iaDbControl->splitSQL($file['filename']);
iaUtil::deleteFile($file['filename']);
}
} else {
$iaDbControl->splitSQL($fileFullPath);
}
} else {
if ($data['query']) {
$iaDb->query(str_replace(array('{prefix}', '{mysql_version}'), array($iaDb->prefix, $mysqlOptions), $data['query']));
}
}
}
}
}
示例2: _processQueries
protected function _processQueries($type, $stage, $ignoreNonVersionedQueries = false)
{
if (!isset($this->itemData['sql'][$type][$stage])) {
return;
}
$iaDb =& $this->iaDb;
$iaDbControl = $this->iaCore->factory('dbcontrol', iaCore::ADMIN);
require_once IA_INCLUDES . 'utils' . IA_DS . 'pclzip.lib.php';
$mysqlOptions = 'ENGINE=MyISAM DEFAULT CHARSET=utf8';
$path = isset($this->_extrasTypePaths[$this->itemData['type']]) ? $this->_extrasTypePaths[$this->itemData['type']] : IA_HOME;
$extrasVersion = $this->itemData['info']['version'];
foreach ($this->itemData['sql'][$type][$stage] as $version => $entries) {
if ($ignoreNonVersionedQueries && self::VERSION_EMPTY == $version) {
continue;
}
if (self::VERSION_EMPTY != $version && version_compare($version, $extrasVersion) > 0) {
continue;
}
foreach ($entries as $entry) {
if ($entry['external']) {
$filePath = str_replace('{DS}', IA_DS, $entry['query']);
$fileFullPath = $path . $this->itemData['name'] . IA_DS . $filePath;
if (iaUtil::isZip($fileFullPath)) {
$archive = new PclZip($fileFullPath);
$files = $archive->extract(PCLZIP_OPT_PATH, IA_TMP);
if (0 == $files) {
continue;
}
foreach ($files as $file) {
$iaDbControl->splitSQL($file['filename']);
iaUtil::deleteFile($file['filename']);
}
} else {
$iaDbControl->splitSQL($fileFullPath);
}
} else {
if ($entry['query']) {
$query = str_replace(array('{prefix}', '{mysql_version}'), array($iaDb->prefix, $mysqlOptions), $entry['query']);
$iaDb->query($query);
}
}
}
}
}