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


PHP jApp::loadPlugin方法代码示例

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


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

示例1: __construct

 function __construct($config = null)
 {
     if (is_string($config)) {
         $f = WIKIRENDERER_PATH . 'rules/' . basename($config) . '.php';
         if (file_exists($f)) {
             require_once $f;
             $this->config = new $config();
         } else {
             $this->config = jApp::loadPlugin($config, 'wr_rules', '.rule.php', $config);
             if (is_null($this->config)) {
                 throw new Exception('Rules "' . $config . '" not found for jWiki');
             }
         }
         $this->config->charset = jApp::config()->charset;
     } elseif (is_object($config)) {
         $this->config = $config;
     } else {
         require_once WIKIRENDERER_PATH . 'rules/wr3_to_xhtml.php';
         $this->config = new wr3_to_xhtml();
         $this->config->charset = jApp::config()->charset;
     }
     $this->inlineParser = new WikiInlineParser($this->config);
     foreach ($this->config->bloctags as $name) {
         $this->_blocList[] = new $name($this);
     }
     if ($this->config->defaultBlock) {
         $name = $this->config->defaultBlock;
         $this->_defaultBlock = new $name($this);
     }
 }
开发者ID:laurentj,项目名称:lizmap-web-client,代码行数:30,代码来源:jWiki.class.php

示例2: __construct

 function __construct($config = null)
 {
     if (is_string($config)) {
         if (class_exists($config)) {
             // this is a class name
             $this->config = new $config();
         } else {
             // this is a plugin name
             $this->config = jApp::loadPlugin($config, 'wr_rules', '.rule.php', $config);
             if (is_null($this->config)) {
                 throw new Exception('Rules "' . $config . '" not found for jWiki');
             }
         }
         $this->config->charset = jApp::config()->charset;
     } elseif (is_object($config)) {
         $this->config = $config;
     } else {
         $this->config = new wr3_to_xhtml();
         $this->config->charset = jApp::config()->charset;
     }
     $this->inlineParser = new WikiInlineParser($this->config);
     foreach ($this->config->bloctags as $name) {
         $this->_blocList[] = new $name($this);
     }
     if ($this->config->defaultBlock) {
         $name = $this->config->defaultBlock;
         $this->_defaultBlock = new $name($this);
     }
 }
开发者ID:jelix,项目名称:wikirenderer-plugin,代码行数:29,代码来源:jWiki.php

示例3: _createConnector

 public static function _createConnector($profile)
 {
     if (!isset($profile['driver'])) {
         throw new jException('jelix~kvstore.error.driver.notset', $profile['_name']);
     }
     $connector = jApp::loadPlugin($profile['driver'], 'kvdb', '.kvdriver.php', $profile['driver'] . 'KVDriver', $profile);
     return $connector;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:8,代码来源:jKVDb.class.php

示例4: loadPlugin

 protected function loadPlugin($name)
 {
     $plugin = jApp::loadPlugin($name, 'profiles', '.profiles.php', $name . 'ProfilesCompiler', $name);
     if (!$plugin) {
         $plugin = new jProfilesCompilerPlugin($name);
     }
     $this->plugins[$name] = $plugin;
 }
开发者ID:mdouchin,项目名称:jelix,代码行数:8,代码来源:jProfilesCompiler.class.php

示例5: _createConnector

 /**
  * callback method for jProfiles. internal use
  */
 public static function _createConnector($profile)
 {
     // If no driver is specified, let's throw an exception
     if (!isset($profile['driver'])) {
         throw new jException('jelix~kvstore.error.driver.notset', $profile['_name']);
     }
     $connector = jApp::loadPlugin($profile['driver'], 'kvdb', '.kvdriver.php', $profile['driver'] . 'KVDriver', $profile);
     //if (is_null($connector)) {
     //    throw new jException('jelix~errors.kvdb.driver.notfound',$profile['driver']);
     //}
     return $connector;
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:15,代码来源:jKVDb.class.php

示例6: _getDriver

 /**
  * return the auth driver
  * @return jIAuthDriver
  */
 protected static function _getDriver()
 {
     static $driver = null;
     if ($driver == null) {
         $config = self::_getConfig();
         $db = strtolower($config['driver']);
         $driver = jApp::loadPlugin($db, 'auth', '.auth.php', $config['driver'] . 'AuthDriver', $config[$config['driver']]);
         if (is_null($driver)) {
             throw new jException('jelix~auth.error.driver.notfound', $db);
         }
     }
     return $driver;
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:17,代码来源:jAuth.class.php

示例7: _getDriver

 /**
  * load the acl2 driver
  * @return jIAcl2Driver
  */
 protected static function _getDriver()
 {
     if (self::$driver == null) {
         $config = jApp::config();
         $db = strtolower($config->acl2['driver']);
         if ($db == '') {
             throw new jException('jacl2~errors.driver.notfound', $db);
         }
         self::$driver = jApp::loadPlugin($db, 'acl2', '.acl2.php', $config->acl2['driver'] . 'Acl2Driver', $config->acl2);
         if (is_null(self::$driver)) {
             throw new jException('jacl2~errors.driver.notfound', $db);
         }
     }
     return self::$driver;
 }
开发者ID:laurentj,项目名称:lizmap-web-client,代码行数:19,代码来源:jAcl2.class.php

示例8: _getDriver

 /**
  * load the acl driver
  * @return jIAclDriver
  */
 protected static function _getDriver()
 {
     static $driver = null;
     if ($driver == null) {
         $config = jApp::config();
         $db = strtolower($config->acl['driver']);
         if ($db == '') {
             throw new jException('jacl~errors.driver.notfound', $db);
         }
         $driver = jApp::loadPlugin($db, 'acl', '.acl.php', $config->acl['driver'] . 'AclDriver', $config->acl);
         if (is_null($driver)) {
             throw new jException('jacl~errors.driver.notfound', $db);
         }
     }
     return $driver;
 }
开发者ID:medali1990,项目名称:medsite,代码行数:20,代码来源:jAcl.class.php

示例9: _getDriver

 /**
  * load the acl2 driver
  * @return jIAcl2Driver
  */
 protected static function _getDriver()
 {
     static $driver = null;
     if ($driver == null) {
         global $gJConfig;
         $db = strtolower($gJConfig->acl2['driver']);
         if ($db == '') {
             throw new jException('jelix~errors.acl.driver.notfound', $db);
         }
         $driver = jApp::loadPlugin($db, 'acl2', '.acl2.php', $gJConfig->acl2['driver'] . 'Acl2Driver', $gJConfig->acl2);
         if (is_null($driver)) {
             throw new jException('jelix~errors.acl.driver.notfound', $db);
         }
     }
     return $driver;
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:20,代码来源:jAcl2.class.php

示例10: __construct

 function __construct()
 {
     $this->_charset = jApp::config()->charset;
     $this->_lang = jApp::config()->locale;
     $plugins = jApp::config()->jResponseHtml['plugins'];
     if ($plugins) {
         $plugins = preg_split('/ *, */', $plugins);
         foreach ($plugins as $name) {
             if (!$name) {
                 continue;
             }
             $plugin = jApp::loadPlugin($name, 'htmlresponse', '.htmlresponse.php', $name . 'HTMLResponsePlugin', $this);
             if ($plugin) {
                 $this->plugins[$name] = $plugin;
             }
         }
     }
     parent::__construct();
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:19,代码来源:jResponseBasicHtml.class.php

示例11: compile

 /**
  * compile the given class id.
  * @param jSelectorDao $selector
  */
 public function compile($selector)
 {
     $daoPath = $selector->getPath();
     // load the XML file
     $doc = new DOMDocument();
     if (!$doc->load($daoPath)) {
         throw new jException('jelix~daoxml.file.unknown', $daoPath);
     }
     if ($doc->documentElement->namespaceURI != JELIX_NAMESPACE_BASE . 'dao/1.0') {
         throw new jException('jelix~daoxml.namespace.wrong', array($daoPath, $doc->namespaceURI));
     }
     $tools = jApp::loadPlugin($selector->driver, 'db', '.dbtools.php', $selector->driver . 'DbTools');
     if (is_null($tools)) {
         throw new jException('jelix~db.error.driver.notfound', $selector->driver);
     }
     $parser = new jDaoParser($selector);
     $parser->parse(simplexml_import_dom($doc), $tools);
     $class = $selector->dbType . 'DaoBuilder';
     if (!jApp::includePlugin($selector->dbType, 'daobuilder', '.daobuilder.php', $class)) {
         throw new jException('jelix~dao.error.builder.notfound', $selector->dbType);
     }
     $generator = new $class($selector, $tools, $parser);
     // generation of PHP classes corresponding to the DAO definition
     $compiled = '<?php ';
     $compiled .= "\nif (jApp::config()->compilation['checkCacheFiletime']&&(\n";
     $compiled .= "\n filemtime('" . $daoPath . '\') > ' . filemtime($daoPath);
     $importedDao = $parser->getImportedDao();
     if ($importedDao) {
         foreach ($importedDao as $selimpdao) {
             $path = $selimpdao->getPath();
             $compiled .= "\n|| filemtime('" . $path . '\') > ' . filemtime($path);
         }
     }
     $compiled .= ")){ return false;\n}\nelse {\n";
     $compiled .= $generator->buildClasses() . "\n return true; }";
     jFile::write($selector->getCompiledFilePath(), $compiled);
     return true;
 }
开发者ID:mdouchin,项目名称:jelix,代码行数:42,代码来源:jDaoCompiler.class.php

示例12: tools

 /**
  * @return jDbTools
  */
 public function tools()
 {
     if (!$this->_tools) {
         $dbms = $this->dbms === 'sqlite' ? 'sqlite3' : $this->dbms;
         $this->_tools = jApp::loadPlugin($dbms, 'db', '.dbtools.php', $dbms . 'DbTools', $this);
         if (is_null($this->_tools)) {
             throw new jException('jelix~db.error.driver.notfound', $dbms);
         }
     }
     return $this->_tools;
 }
开发者ID:aurellemeless,项目名称:favoris,代码行数:14,代码来源:jDbPDOConnection.class.php

示例13: getWidget

 public function getWidget($ctrl, \jelix\forms\HtmlWidget\ParentWidgetInterface $parentWidget = null)
 {
     if (isset($this->widgets[$ctrl->ref])) {
         return $this->widgets[$ctrl->ref];
     }
     $config = \jApp::config()->{$this->formConfig};
     if (isset($this->pluginsConf[$ctrl->ref])) {
         //first the builder conf
         $pluginName = $this->pluginsConf[$ctrl->ref];
     } elseif (isset($config[$ctrl->type])) {
         //then the ini conf
         $pluginName = $config[$ctrl->type];
     } else {
         //finaly the control type
         $pluginName = $ctrl->type . '_' . $this->formType;
     }
     $className = $pluginName . 'FormWidget';
     $plugin = \jApp::loadPlugin($pluginName, 'formwidget', '.formwidget.php', $className, array($ctrl, $this, $parentWidget));
     if (!$plugin) {
         throw new \Exception('Widget ' . $pluginName . ' not found');
     }
     $this->widgets[$ctrl->ref] = $plugin;
     return $plugin;
 }
开发者ID:mdouchin,项目名称:jelix,代码行数:24,代码来源:HtmlBuilder.php

示例14: _createConnector

 public static function _createConnector($profile)
 {
     if ($profile['driver'] == 'pdo' || isset($profile['usepdo']) && $profile['usepdo']) {
         $dbh = new jDbPDOConnection($profile);
         return $dbh;
     } else {
         $dbh = jApp::loadPlugin($profile['driver'], 'db', '.dbconnection.php', $profile['driver'] . 'DbConnection', $profile);
         if (is_null($dbh)) {
             throw new jException('jelix~db.error.driver.notfound', $profile['driver']);
         }
         return $dbh;
     }
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:13,代码来源:jDb.class.php

示例15: _loadDriver

 public static function _loadDriver($profile)
 {
     $driver = jApp::loadPlugin($profile['driver'], 'cache', '.cache.php', $profile['driver'] . 'CacheDriver', $profile);
     if (is_null($driver)) {
         throw new jException('jelix~cache.error.driver.missing', array($profile['_name'], $profile['driver']));
     }
     if (!$driver instanceof jICacheDriver) {
         throw new jException('jelix~cache.driver.object.invalid', array($profile['_name'], $profile['driver']));
     }
     return $driver;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:11,代码来源:jCache.class.php


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