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


PHP plugin_directory函数代码示例

本文整理汇总了PHP中plugin_directory函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_directory函数的具体用法?PHP plugin_directory怎么用?PHP plugin_directory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: boot

 /**
  * Boots the Helper.
  */
 public static function boot()
 {
     self::$base = plugin_directory();
     self::$base = self::$base . '/' . basename(plugin_dir_url(__DIR__)) . '/';
     self::$config = @(require self::$base . '/herbert.config.php');
     self::$booted = true;
 }
开发者ID:shortlist-digital,项目名称:agreable-poll-plugin,代码行数:10,代码来源:Helper.php

示例2: process

 function process()
 {
     if (!$this->dir_delete(DOKU_PLUGIN . plugin_directory($this->manager->plugin))) {
         $this->manager->error = sprintf($this->lang['error_delete'], $this->manager->plugin);
     } else {
         msg("Plugin {$this->manager->plugin} successfully deleted.");
         $this->refresh();
     }
 }
开发者ID:halfbyte,项目名称:rugtool,代码行数:9,代码来源:ap_delete.class.php

示例3: __construct

 private function __construct()
 {
     $paths = array(plugin_directory() . '/Entity');
     $isDevMode = false;
     $dbParams = array('driver' => 'pdo_mysql', 'user' => DB_USER, 'password' => DB_PASSWORD, 'dbname' => DB_NAME);
     $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
     $this->entityManager = EntityManager::create($dbParams, $config);
     $tablePrefix = new TablePrefix($GLOBALS['table_prefix']);
     // set le prefix des tables, identique a la config de WP
     $this->entityManager->getEventManager()->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $tablePrefix);
 }
开发者ID:axoloth,项目名称:herbertextra,代码行数:11,代码来源:Doctrine.php

示例4: get_plugintpl_default

 /**
  * load default settings for plugins and templates
  */
 function get_plugintpl_default($tpl)
 {
     $file = '/conf/default.php';
     $default = array();
     foreach ($this->get_plugin_list() as $plugin) {
         $plugin_dir = plugin_directory($plugin);
         if (@file_exists(DOKU_PLUGIN . $plugin_dir . $file)) {
             $conf = array();
             @(include DOKU_PLUGIN . $plugin_dir . $file);
             foreach ($conf as $key => $value) {
                 $default['plugin' . CM_KEYMARKER . $plugin . CM_KEYMARKER . $key] = $value;
             }
         }
     }
     // the same for the active template
     if (@file_exists(DOKU_TPLINC . $file)) {
         $conf = array();
         @(include DOKU_TPLINC . $file);
         foreach ($conf as $key => $value) {
             $default['tpl' . CM_KEYMARKER . $tpl . CM_KEYMARKER . $key] = $value;
         }
     }
     return $default;
 }
开发者ID:Kirill,项目名称:dokuwiki,代码行数:27,代码来源:config.class.php

示例5: get_plugin_components

 /**
  * return a list (name & type) of all the component plugins that make up this plugin
  *
  * @todo can this move to pluginutils?
  */
 function get_plugin_components($plugin)
 {
     global $plugin_types;
     $components = array();
     $path = DOKU_PLUGIN . plugin_directory($plugin) . '/';
     foreach ($plugin_types as $type) {
         if (@file_exists($path . $type . '.php')) {
             $components[] = array('name' => $plugin, 'type' => $type);
             continue;
         }
         if ($dh = @opendir($path . $type . '/')) {
             while (false !== ($cp = readdir($dh))) {
                 if ($cp == '.' || $cp == '..' || strtolower(substr($cp, -4)) != '.php') {
                     continue;
                 }
                 $components[] = array('name' => $plugin . '_' . substr($cp, 0, -4), 'type' => $type);
             }
             closedir($dh);
         }
     }
     return $components;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:27,代码来源:ap_info.class.php

示例6: plugin_readlog

 function plugin_readlog($plugin, $field)
 {
     static $log = array();
     $file = DOKU_PLUGIN . plugin_directory($plugin) . '/manager.dat';
     if (!isset($log[$plugin])) {
         $tmp = @file_get_contents($file);
         if (!$tmp) {
             return '';
         }
         $log[$plugin] =& $tmp;
     }
     if ($field == 'ALL') {
         return $log[$plugin];
     }
     $match = array();
     if (preg_match_all('/' . $field . '=(.*)$/m', $log[$plugin], $match)) {
         return implode("\n", $match[1]);
     }
     return '';
 }
开发者ID:houshuang,项目名称:folders2web,代码行数:20,代码来源:ap_manage.class.php

示例7: get_metatype

 /**
  * load metadata for page metadata
  *
  * @return array metadata of properties
  */
 function get_metatype()
 {
     $file = '/conf/metatypes.php';
     $class = '/conf/meta.class.php';
     $metatype = array();
     foreach ($this->get_plugin_list() as $plugin) {
         $plugin_dir = plugin_directory($plugin);
         if (file_exists(DOKU_PLUGIN . $plugin_dir . $file)) {
             $meta = array();
             @(include DOKU_PLUGIN . $plugin_dir . $file);
             @(include DOKU_PLUGIN . $plugin_dir . $class);
             foreach ($meta as $key => $value) {
                 $metatype[$key] = $value;
             }
         }
     }
     return $metatype;
 }
开发者ID:LeutenmayrS,项目名称:dokuwiki-pageproperties,代码行数:23,代码来源:meta.class.php

示例8: DirectoryIterator

 */
$herbert = Herbert\Framework\Application::getInstance();
/**
 * Load all herbert.php files in plugin roots.
 */
$iterator = new DirectoryIterator(plugin_directory());
foreach ($iterator as $directory) {
    if (!$directory->valid() || $directory->isDot() || !$directory->isDir()) {
        continue;
    }
    $root = $directory->getPath() . '/' . $directory->getFilename();
    if (!file_exists($root . '/herbert.config.php')) {
        continue;
    }
    $config = $herbert->getPluginConfig($root);
    $plugin = substr($root . '/plugin.php', strlen(plugin_directory()));
    $plugin = ltrim($plugin, '/');
    register_activation_hook($plugin, function () use($herbert, $config, $root) {
        if (!$herbert->pluginMatches($config)) {
            $herbert->pluginMismatched($root);
        }
        $herbert->pluginMatched($root);
        $herbert->loadPlugin($config);
        $herbert->activatePlugin($root);
    });
    register_deactivation_hook($plugin, function () use($herbert, $root) {
        $herbert->deactivatePlugin($root);
    });
    // Ugly hack to make the install hook work correctly
    // as WP doesn't allow closures to be passed here
    register_uninstall_hook($plugin, create_function('', 'herbert()->deletePlugin(\'' . $root . '\');'));
开发者ID:bigbitecreative,项目名称:wordpress-git-content,代码行数:31,代码来源:autoload.php


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