當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。