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


PHP rex_addon::isInstalled方法代碼示例

本文整理匯總了PHP中rex_addon::isInstalled方法的典型用法代碼示例。如果您正苦於以下問題:PHP rex_addon::isInstalled方法的具體用法?PHP rex_addon::isInstalled怎麽用?PHP rex_addon::isInstalled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rex_addon的用法示例。


在下文中一共展示了rex_addon::isInstalled方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doAction

 public function doAction()
 {
     $path = rex_path::addon($this->addonkey);
     $temppath = rex_path::addon('.new.' . $this->addonkey);
     if (($msg = $this->extractArchiveTo($temppath)) !== true) {
         return $msg;
     }
     if ($this->addon->isAvailable() && ($msg = $this->checkRequirements()) !== true) {
         return $msg;
     }
     // ---- include update.php
     if ($this->addon->isInstalled() && file_exists($temppath . rex_package::FILE_UPDATE)) {
         try {
             $this->addon->includeFile('../.new.' . $this->addonkey . '/' . rex_package::FILE_UPDATE);
         } catch (rex_functional_exception $e) {
             return $e->getMessage();
         } catch (rex_sql_exception $e) {
             return 'SQL error: ' . $e->getMessage();
         }
         if (($msg = $this->addon->getProperty('updatemsg', '')) != '') {
             return $msg;
         }
         if (!$this->addon->getProperty('update', true)) {
             return rex_i18n::msg('package_no_reason');
         }
     }
     // ---- backup
     $assets = $this->addon->getAssetsPath();
     if (rex_addon::get('install')->getConfig('backups')) {
         $archivePath = rex_path::addonData('install', $this->addonkey . '/');
         rex_dir::create($archivePath);
         $archive = $archivePath . strtolower(preg_replace('/[^a-z0-9-_.]/i', '_', $this->addon->getVersion('0'))) . '.zip';
         rex_install_archive::copyDirToArchive($path, $archive);
         if (is_dir($assets)) {
             rex_install_archive::copyDirToArchive($assets, $archive, 'assets');
         }
     }
     // ---- copy plugins to new addon dir
     foreach ($this->addon->getRegisteredPlugins() as $plugin) {
         $pluginPath = $temppath . '/plugins/' . $plugin->getName();
         if (!is_dir($pluginPath)) {
             rex_dir::copy($plugin->getPath(), $pluginPath);
         } elseif ($plugin->isInstalled() && is_dir($pluginPath . '/assets')) {
             rex_dir::copy($pluginPath . '/assets', $plugin->getAssetsPath());
         }
     }
     // ---- update main addon dir
     rex_dir::delete($path);
     rename($temppath, $path);
     // ---- update assets
     $origAssets = $this->addon->getPath('assets');
     if ($this->addon->isInstalled() && is_dir($origAssets)) {
         rex_dir::copy($origAssets, $assets);
     }
     $this->addon->setProperty('version', $this->file['version']);
     rex_install_packages::updatedPackage($this->addonkey, $this->fileId);
 }
開發者ID:staabm,項目名稱:redaxo,代碼行數:57,代碼來源:api_package_update.php

示例2: isInstalled

 /**
  * @override
  * @see redaxo/include/classes/rex_addon#isInstalled($addon)
  */
 static function isInstalled($addon, $plugin = null)
 {
     return parent::isInstalled(array($addon, $plugin));
 }
開發者ID:Barnhiac,項目名稱:MTW_REDAXO,代碼行數:8,代碼來源:class.ooplugin.inc.php

示例3: isAvailable

 function isAvailable($addon)
 {
     return rex_addon::isInstalled($addon) && rex_addon::isActivated($addon);
 }
開發者ID:BackupTheBerlios,項目名稱:redaxo-svn,代碼行數:4,代碼來源:class.rex_addon.inc.php

示例4: isInstalled

 /**
  * @override
  * @see redaxo/include/classes/rex_addon#isInstalled($addon)
  */
 function isInstalled($addon, $plugin, $default = null)
 {
     return parent::isInstalled(array($addon, $plugin), $default);
 }
開發者ID:BackupTheBerlios,項目名稱:redaxo-svn,代碼行數:8,代碼來源:class.ooplugin.inc.php


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