当前位置: 首页>>代码示例>>PHP>>正文


PHP rex_addon::getProperty方法代码示例

本文整理汇总了PHP中rex_addon::getProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_addon::getProperty方法的具体用法?PHP rex_addon::getProperty怎么用?PHP rex_addon::getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rex_addon的用法示例。


在下文中一共展示了rex_addon::getProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getProperty

 /**
  * @override
  * @see redaxo/include/classes/rex_addon#getProperty($addon, $property, $default)
  */
 static function getProperty($addon, $plugin, $property = null, $default = null)
 {
     return parent::getProperty(array($addon, $plugin), $property, $default);
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:8,代码来源:class.ooplugin.inc.php

示例2: checkRequirements

 private function checkRequirements($config)
 {
     $temppath = rex_path::addon('.new.' . $this->addonkey);
     // ---- update "version", "requires" and "conflicts" properties
     $versions = new SplObjectStorage();
     $requirements = new SplObjectStorage();
     $conflicts = new SplObjectStorage();
     if (isset($config['requires'])) {
         $requirements[$this->addon] = $this->addon->getProperty('requires');
         $this->addon->setProperty('requires', $config['requires']);
     }
     if (isset($config['conflicts'])) {
         $conflicts[$this->addon] = $this->addon->getProperty('conflicts');
         $this->addon->setProperty('conflicts', $config['conflicts']);
     }
     $versions[$this->addon] = $this->addon->getVersion();
     $this->addon->setProperty('version', isset($config['version']) ? $config['version'] : $this->file['version']);
     $availablePlugins = $this->addon->getAvailablePlugins();
     foreach ($availablePlugins as $plugin) {
         if (is_dir($temppath . '/plugins/' . $plugin->getName())) {
             $config = rex_file::getConfig($temppath . '/plugins/' . $plugin->getName() . '/' . rex_package::FILE_PACKAGE);
             if (isset($config['requires'])) {
                 $requirements[$plugin] = $plugin->getProperty('requires');
                 $plugin->setProperty('requires', $config['requires']);
             }
             if (isset($config['conflicts'])) {
                 $conflicts[$plugin] = $plugin->getProperty('conflicts');
                 $plugin->setProperty('conflicts', $config['conflicts']);
             }
             if (isset($config['version'])) {
                 $versions[$plugin] = $plugin->getProperty('version');
                 $plugin->setProperty('requires', $config['version']);
             }
         }
     }
     // ---- check requirements
     $messages = [];
     $manager = rex_addon_manager::factory($this->addon);
     if (!$manager->checkRequirements()) {
         $messages[] = $manager->getMessage();
     }
     if (!$manager->checkConflicts()) {
         $messages[] = $manager->getMessage();
     }
     if (empty($messages)) {
         foreach ($availablePlugins as $plugin) {
             $manager = rex_plugin_manager::factory($plugin);
             if (!$manager->checkRequirements()) {
                 $messages[] = $plugin->getPackageId() . ': ' . $manager->getMessage();
             }
             if (!$manager->checkConflicts()) {
                 $messages[] = $plugin->getPackageId() . ': ' . $manager->getMessage();
             }
         }
         foreach (rex_package::getAvailablePackages() as $package) {
             if ($package->getAddon() === $this->addon) {
                 continue;
             }
             $manager = rex_package_manager::factory($package);
             if (!$manager->checkPackageRequirement($this->addon->getPackageId())) {
                 $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
             } elseif (!$manager->checkPackageConflict($this->addon->getPackageId())) {
                 $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
             } else {
                 foreach ($versions as $reqPlugin) {
                     if (!$manager->checkPackageRequirement($reqPlugin->getPackageId())) {
                         $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
                     }
                     if (!$manager->checkPackageConflict($reqPlugin->getPackageId())) {
                         $messages[] = $package->getPackageId() . ': ' . $manager->getMessage();
                     }
                 }
             }
         }
     }
     // ---- reset "version", "requires" and "conflicts" properties
     foreach ($versions as $package) {
         $package->setProperty('version', $versions[$package]);
     }
     foreach ($requirements as $package) {
         $package->setProperty('requires', $requirements[$package]);
     }
     foreach ($conflicts as $package) {
         $package->setProperty('conflicts', $conflicts[$package]);
     }
     return empty($messages) ? true : implode('<br />', $messages);
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:87,代码来源:api_package_update.php

示例3: getSupportPage

 function getSupportPage($addon, $default = null)
 {
     return rex_addon::getProperty($addon, 'supportpage', $default);
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:4,代码来源:class.rex_addon.inc.php

示例4: isSystemPackage

 /**
  * {@inheritdoc}
  */
 public function isSystemPackage()
 {
     return in_array($this->getName(), (array) $this->addon->getProperty('system_plugins', []));
 }
开发者ID:staabm,项目名称:redaxo,代码行数:7,代码来源:plugin.php


注:本文中的rex_addon::getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。