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


PHP Plugin::getName方法代码示例

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


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

示例1: enqueueScripts

 /**
  * Register the JavaScript for the dashboard.
  *
  * @since    1.0.0
  */
 public function enqueueScripts()
 {
     /**
      * This function is provided for demonstration purposes only.
      *
      * An instance of this class should be passed to the run() function
      * defined in PluginName_Loader as all of the hooks are defined
      * in that particular class.
      *
      * The PluginName_Loader will then create the relationship
      * between the defined hooks and the functions defined in this
      * class.
      */
     wp_enqueue_script($this->plugin->getName(), plugin_dir_url(dirname(__FILE__)) . 'dist/scripts/plugin-name-admin.js', array('jquery'), $this->plugin->getVersion(), false);
 }
开发者ID:ThemeWP,项目名称:Plugin-Boilerplate,代码行数:20,代码来源:Admin.php

示例2: getItemtypes

 /**
  * Return all injectable types
  *
  * @param $only_primary    return only primary types (false by default)
  *
  * @return an array which contains array(itemtype => itemtype name)
  **/
 static function getItemtypes($only_primary = false)
 {
     global $INJECTABLE_TYPES;
     getTypesToInject();
     $plugin = new Plugin();
     $values = array();
     foreach ($INJECTABLE_TYPES as $type => $from) {
         $injectionclass = new $type();
         if (class_exists($type) && (!$only_primary || $only_primary && $injectionclass->isPrimaryType())) {
             $instance = new $type();
             //If user has no right to create an object of this type, do not display type in the list
             if (!$instance->canCreate()) {
                 continue;
             }
             $typename = get_parent_class($type);
             $name = '';
             if ($from != 'datainjection') {
                 $plugin->getFromDBbyDir($from);
                 $name = $plugin->getName() . ': ';
             }
             $name .= call_user_func(array($type, 'getTypeName'));
             $values[$typename] = $name;
         }
     }
     asort($values);
     return $values;
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:34,代码来源:injectiontype.class.php

示例3: testPlugin

 public function testPlugin()
 {
     $pl = new Plugin(123, 'A Plugin', true);
     $this->assertEquals(123, $pl->getID());
     $this->assertEquals('A Plugin', $pl->getName());
     $this->assertEquals(true, $pl->isActive());
 }
开发者ID:picolino0,项目名称:BreezedCMS,代码行数:7,代码来源:coreTest.php

示例4: __construct

 /**
  * @param array $remote - Array containing $host,$port,$auth data
  * @param str $cmd - remote command to execute
  * @param Plugin $plugin - plugin to receive results
  * @param str $callback - method from plugin to callback with results
  * @param mixed $data - data passed to callback function
  */
 public function __construct($remote, $cmd, $plugin, $callback, $data)
 {
     $this->server = $remote;
     $this->cmd = $cmd;
     $this->sock = false;
     $this->plugin = $plugin->getName();
     $this->callback = $callback;
     $this->data = $data;
 }
开发者ID:Gabriel865,项目名称:pocketmine-plugins,代码行数:16,代码来源:RconTask.php

示例5: getMissingDependencies

 private function getMissingDependencies(Plugin $plugin, array $plugins_collection)
 {
     $missing_dependencies = array();
     foreach ($plugins_collection as $candidate_plugin) {
         if (in_array($plugin->getName(), $candidate_plugin->getDependencies())) {
             $missing_dependencies[] = $candidate_plugin->getName();
         }
     }
     return $missing_dependencies;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:PluginDependencySolver.class.php

示例6: actionIndex

 public function actionIndex()
 {
     // список всех плагинов
     $plugins = Yii::app()->getPlugins();
     // все плагины регистрируем в бд
     // TODO если в базе нашлись плагины, которых уже нет, то помечаем их как удаленные
     // список плагинов, зарегистрированных в системе
     $pluginsDb = Plugin::model()->findAll();
     $finded = array();
     foreach ($plugins as $code => $config) {
         if (is_int($code)) {
             $code = $config;
             $config = array();
         }
         if (!isset($config['class'])) {
             $config['class'] = $code;
         }
         foreach ($pluginsDb as $plugin) {
             if ($plugin->code == $code) {
                 if ($plugin->class_name != $config['class']) {
                     $plugin->class_name = $config['class'];
                     $plugin->save();
                 }
                 $finded[] = $code;
                 continue 2;
             }
         }
         // плагина ещё нет в базе
         $newPlugin = new Plugin();
         $newPlugin->code = $code;
         $newPlugin->status = Plugin::STATUS_NEW;
         $newPlugin->class_name = $config['class'];
         //-------------------
         $newPlugin->name = $newPlugin->getName();
         // нигде не используется, исключительно для легкого чтения таблицы
         //-------------------
         $finded[] = $code;
         $newPlugin->save();
     }
     foreach ($pluginsDb as $plugin) {
         if (!in_array($plugin->code, $finded)) {
             // пропавшие плагины просто удаляем из базы
             try {
                 $plugin->deactivate($plugin);
             } catch (Exception $e) {
             }
             $plugin->delete();
             Yii::app()->compilePluginsConfig();
         }
     }
     $plugins = Plugin::model()->notDeleted()->findAll(array('order' => 'name'));
     $this->render('/index', array('plugins' => $plugins));
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:53,代码来源:PluginController.php

示例7: foreach

                if (is_dir(ADMIN . '/plugins/' . $file)) {
                    $xmlFile = ADMIN . '/plugins/' . $file . '/info.xml';
                    if (!file_exists($xmlFile)) {
                        continue;
                    }
                    $exists = false;
                    foreach (getPlugins() as $plugin) {
                        if ($plugin->getInfoPath() == $xmlFile) {
                            $exists = true;
                        }
                    }
                    if ($exists) {
                        continue;
                    }
                    if (file_exists($xmlFile)) {
                        $ainfo = Plugin::getAuthorInfo($xmlFile);
                        $manager->addItem("Not installed plugins", array(Plugin::getName($xmlFile), Plugin::getDescription($xmlFile), $ainfo['name'], '<a href="' . $ainfo['website'] . '">' . $ainfo['website'] . '</a>', "override_actions" => array("<a href='" . orongoURL("orongo-admin/plugin-install.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $xmlFile))) . "'>" . l("Install") . "</a>")), "", "");
                    }
                } else {
                    continue;
                }
            }
        }
        $manage->addObject($manager);
        $manage->render();
        break;
    default:
        header("Location: " . orongoURL("orongo-admin/index.php?msg=1"));
        exit;
        break;
}
开发者ID:JacoRuit,项目名称:orongocms,代码行数:31,代码来源:manage.php

示例8: getMoney

 /**
  * Gets player balance
  *
  * @param Plugin $api Economy plugin (from moneyPlugin)
  * @param str|IPlayer $player Player to lookup
  *
  * @return int
  */
 public static function getMoney($api, $player)
 {
     if (!$api) {
         return false;
     }
     switch ($api->getName()) {
         case "GoldStd":
             return $api->getMoney($player);
             break;
         case "PocketMoney":
         case "MassiveEconomy":
             if ($player instanceof IPlayer) {
                 $player = $player->getName();
             }
             return $api->getMoney($player);
         case "EconomyAPI":
             if ($player instanceof IPlayer) {
                 $player = $player->getName();
             }
             return $api->mymoney($player);
         default:
             return false;
             break;
     }
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:33,代码来源:MoneyAPI.php

示例9: __construct

 /**
  * Constructor
  *
  * @param Plugin $plugin The plugin the installer is associated with
  */
 public function __construct($plugin)
 {
     $this->plugin = $plugin;
     $this->_plugin = $plugin->getName();
 }
开发者ID:elvyrra,项目名称:hawk,代码行数:10,代码来源:PluginInstaller.php

示例10: getName

 /**
  * @return String plugin name
  */
 public final function getName()
 {
     return Plugin::getName($this->getInfoPath());
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:7,代码来源:class_OrongoPluggableObject.php

示例11: getMetrics

 public function getMetrics()
 {
     return array('metrics' => array('compile_time' => number_format($this->t2 - $this->t1, 3), 'execution_time' => number_format($this->t3 - $this->t2, 3), 'total_time' => number_format($this->t3 - $this->t1, 3), 'memory_usage' => number_format(memory_get_peak_usage(true) / 1024 / 1024, 1)), 'plugin' => array('Id' => $this->plugin->getId(), 'Name' => $this->plugin->getName(), 'Identifier' => $this->plugin->getIdentifier(), 'Event' => $this->plugin->getEvent(), 'Entity' => $this->plugin->getEntity()), 'output' => $this->output);
 }
开发者ID:dapepe,项目名称:tymio,代码行数:4,代码来源:ixml.inc.php

示例12: addPluginCommand

 /**
  * Add a response command that is generated by a plugin
  *
  * @param Plugin        $xPlugin            The plugin object
  * @param array         $aAttributes        The attributes for this response command
  * @param mixed         $mData              The data to be sent with this command
  *
  * @return \Jaxon\Plugin\Response
  */
 public function addPluginCommand($xPlugin, $aAttributes, $mData)
 {
     $aAttributes['plg'] = $xPlugin->getName();
     return $this->addCommand($aAttributes, $mData);
 }
开发者ID:jaxon-php,项目名称:jaxon-core,代码行数:14,代码来源:Response.php


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