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


PHP rex_addon::setProperty方法代码示例

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


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

示例1: setProperty

 /**
  * @override
  * @see redaxo/include/classes/rex_addon#setProperty($addon, $property, $value)
  */
 static function setProperty($addon, $plugin, $property, $value = null)
 {
     return parent::setProperty(array($addon, $plugin), $property, $value);
 }
开发者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


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