本文整理匯總了PHP中PluginManager::find_files方法的典型用法代碼示例。如果您正苦於以下問題:PHP PluginManager::find_files方法的具體用法?PHP PluginManager::find_files怎麽用?PHP PluginManager::find_files使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PluginManager
的用法示例。
在下文中一共展示了PluginManager::find_files方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Singleton class, the constructor is private
*/
private function __construct()
{
$loader = new Twig_Loader_Filesystem();
$this->twig = new Twig_Environment($loader, array('cache' => _files_ . '/tmp', 'debug' => Get::cfg('twig_debug', false)));
$this->twig->addFunction('translate', new Twig_Function_Function(function ($key, $module = false, $substitution = array(), $lang_code = false, $default = false) {
return Lang::t($key, $module, $substitution, $lang_code, $default);
}));
$this->twig->addFunction('pluginUrl', new Twig_Function_Function(function ($resource) {
$plugin_files = PluginManager::find_files();
return '/' . _folder_plugins_ . '/' . $plugin_files[$resource] . '/' . $resource;
}));
}
示例2: inc_all
/**
* Return an object that describe the system languages
* @return DoceboLangManager
*/
public static function inc_all($file, $function = 'include')
{
include $file;
if (!Get::cfg('enable_plugins', false)) {
return;
}
$file = str_replace(_base_ . '/', '', $file);
$plugin_files = PluginManager::find_files();
if (isset($plugin_files[$file])) {
// let's include the plugin file
include _plugins_ . '/' . $plugin_files[$file] . '/' . $file;
}
}