當前位置: 首頁>>代碼示例>>PHP>>正文


PHP iaUtil::isZip方法代碼示例

本文整理匯總了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']));
                 }
             }
         }
     }
 }
開發者ID:TalehFarzaliey,項目名稱:subrion,代碼行數:38,代碼來源:ia.admin.extra.php

示例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);
                 }
             }
         }
     }
 }
開發者ID:kreativmind,項目名稱:subrion,代碼行數:44,代碼來源:ia.admin.extra.php


注:本文中的iaUtil::isZip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。