當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dwoo::getPluginProxy方法代碼示例

本文整理匯總了PHP中Dwoo::getPluginProxy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dwoo::getPluginProxy方法的具體用法?PHP Dwoo::getPluginProxy怎麽用?PHP Dwoo::getPluginProxy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dwoo的用法示例。


在下文中一共展示了Dwoo::getPluginProxy方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPluginType

 /**
  * returns the plugin type of a plugin and adds it to the used plugins array if required
  *
  * @param string $name plugin name, as found in the template
  * @return int type as a multi bit flag composed of the Dwoo plugin types constants
  */
 protected function getPluginType($name)
 {
     $pluginType = -1;
     if ($this->securityPolicy === null && (function_exists($name) || strtolower($name) === 'isset' || strtolower($name) === 'empty') || $this->securityPolicy !== null && in_array(strtolower($name), $this->securityPolicy->getAllowedPhpFunctions()) !== false) {
         $phpFunc = true;
     }
     while ($pluginType <= 0) {
         if (isset($this->customPlugins[$name])) {
             $pluginType = $this->customPlugins[$name]['type'] | Dwoo::CUSTOM_PLUGIN;
         } elseif (class_exists('Dwoo_Plugin_' . $name, false) !== false) {
             if (is_subclass_of('Dwoo_Plugin_' . $name, 'Dwoo_Block_Plugin')) {
                 $pluginType = Dwoo::BLOCK_PLUGIN;
             } else {
                 $pluginType = Dwoo::CLASS_PLUGIN;
             }
             $interfaces = class_implements('Dwoo_Plugin_' . $name, false);
             if (in_array('Dwoo_ICompilable', $interfaces) !== false || in_array('Dwoo_ICompilable_Block', $interfaces) !== false) {
                 $pluginType |= Dwoo::COMPILABLE_PLUGIN;
             }
         } elseif (function_exists('Dwoo_Plugin_' . $name) !== false) {
             $pluginType = Dwoo::FUNC_PLUGIN;
         } elseif (function_exists('Dwoo_Plugin_' . $name . '_compile')) {
             $pluginType = Dwoo::FUNC_PLUGIN | Dwoo::COMPILABLE_PLUGIN;
         } elseif (function_exists('smarty_modifier_' . $name) !== false) {
             $pluginType = Dwoo::SMARTY_MODIFIER;
         } elseif (function_exists('smarty_function_' . $name) !== false) {
             $pluginType = Dwoo::SMARTY_FUNCTION;
         } elseif (function_exists('smarty_block_' . $name) !== false) {
             $pluginType = Dwoo::SMARTY_BLOCK;
         } else {
             if ($pluginType === -1) {
                 try {
                     $this->dwoo->getLoader()->loadPlugin($name, isset($phpFunc) === false);
                 } catch (Exception $e) {
                     if (isset($phpFunc)) {
                         $pluginType = Dwoo::NATIVE_PLUGIN;
                     } elseif (is_object($this->dwoo->getPluginProxy()) && $this->dwoo->getPluginProxy()->handles($name)) {
                         $pluginType = Dwoo::PROXY_PLUGIN;
                         break;
                     } else {
                         throw $e;
                     }
                 }
             } else {
                 throw new Dwoo_Exception('Plugin "' . $name . '" could not be found');
             }
             $pluginType++;
         }
     }
     if (($pluginType & Dwoo::COMPILABLE_PLUGIN) === 0 && ($pluginType & Dwoo::NATIVE_PLUGIN) === 0 && ($pluginType & Dwoo::PROXY_PLUGIN) === 0) {
         $this->usedPlugins[$name] = $pluginType;
     }
     return $pluginType;
 }
開發者ID:stormeus,項目名稱:Kusaba-Z,代碼行數:60,代碼來源:Compiler.php

示例2: testPluginProxyGetSet

 public function testPluginProxyGetSet()
 {
     $proxy = new ProxyHelper();
     $dwoo = new Dwoo();
     $dwoo->setPluginProxy($proxy);
     $this->assertEquals($proxy, $dwoo->getPluginProxy());
 }
開發者ID:apeschar,項目名稱:php-fw,代碼行數:7,代碼來源:CoreTests.php


注:本文中的Dwoo::getPluginProxy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。