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


PHP Finder::add_path方法代码示例

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


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

示例1: _load_modules_events

 /**
  * Load Modules Events
  *
  */
 private static function _load_modules_events()
 {
     // Add path to installed modules
     $installed_modules = Modules()->get_installed_modules();
     if (is_null($installed_modules)) {
         return FALSE;
     }
     // Be sure Events classes will be found but also will be able to load module libraries
     foreach ($installed_modules as $module) {
         if (isset($module['folder'])) {
             Finder::add_path(MODPATH . $module['folder'] . '/');
         }
     }
     foreach ($installed_modules as $module) {
         if (!($details_class = self::_start_events_class($module['path']))) {
             continue;
         }
     }
     return TRUE;
 }
开发者ID:pompalini,项目名称:emngo,代码行数:24,代码来源:Event.php

示例2: __construct

 public function __construct()
 {
     // If the CI object is needed :
     self::$ci =& get_instance();
     // Config Events
     $config = Modules()->get_module_config('Sfs');
     $events = explode(',', $config['events']);
     // ionize < 1.0.4 hack : Be able to load module libraries
     $installed_modules = Modules()->get_installed_modules();
     foreach ($installed_modules as $module) {
         if (isset($module['folder'])) {
             Finder::add_path(MODPATH . $module['folder'] . '/');
         }
     }
     // Stop Forum Spam lib
     // @TODO : Enhance here to handle more services:
     // 1. Create one lib / service
     // 2. Rewrite the config system, which should have one key / service
     self::$ci->load->library('Sfs_Sfs');
     foreach ($events as $event) {
         $event = trim($event);
         Event::register($event, array('Sfs_Sfs', 'on_post_check_before'));
     }
 }
开发者ID:pompalini,项目名称:emngo,代码行数:24,代码来源:sfs_events.php

示例3: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     // $this->output->enable_profiler(true);
     // Unlock filtering if admin or editor users is logged in
     //		$this->load->library('connect');
     $this->connect = Connect::get_instance();
     // Libraries
     $this->load->library('structure');
     $this->load->library('widget');
     // FTL parser
     //		require_once APPPATH.'libraries/ftl/parser.php';
     // Models
     //		$this->load->model('structure_model', '', true);
     $this->load->model('menu_model', '', true);
     // Modules config
     $this->get_modules_config();
     /*
      * Installed modules
      *
      */
     require APPPATH . 'config/modules.php';
     $installed_modules = $modules;
     foreach ($installed_modules as $module) {
         // Path to Module
         Finder::add_path(MODPATH . $module . '/');
     }
     /*
      * Theme
      *
      */
     // Set the current theme
     Theme::set_theme(Settings::get('theme'));
     // Theme config file
     // Overwrite Ionize standard config.
     if (is_file($file = Theme::get_theme_path() . 'config/config.php')) {
         include $file;
         if (!empty($config)) {
             foreach ($config as $k => $v) {
                 $this->config->set_item($k, $v);
             }
             unset($config);
         }
     }
     /*
      * Menus
      *
      */
     Settings::set('menus', $this->menu_model->get_list());
     /*
      * Language
      *
      */
     // Get all the website languages from DB and store them into config file "languages" key
     $languages = $this->settings_model->get_languages();
     // Put all DB languages array to Settings
     Settings::set_languages($languages);
     // Set all languages online if conected as editor or more
     if (Connect()->is('editors', true)) {
         Settings::set_all_languages_online();
     }
     // Simple languages code array, used to detect if Routers found language is in DB languages
     $online_lang_codes = array();
     foreach (Settings::get_online_languages() as $language) {
         $online_lang_codes[] = $language['lang'];
     }
     // If Router detected that the lang code is not in DB languages, set it to the DB default one
     if (!in_array(config_item('language_abbr'), $online_lang_codes)) {
         // Settings::get_lang('default') returns the DB default lang code
         Settings::set('current_lang', Settings::get_lang('default'));
         $this->config->set_item('language_abbr', Settings::get_lang('default'));
     } else {
         // Store the current lang code (found by Router) to Settings
         Settings::set('current_lang', config_item('language_abbr'));
     }
     // Lang dependant settings for the current language : Meta, etc.
     Settings::set_settings_from_list($this->settings_model->get_lang_settings(config_item('language_abbr')), 'name', 'content');
     /*
      * Static language
      *
      */
     $lang_folder = Theme::get_theme_path() . 'language/' . Settings::get_lang() . '/';
     $lang_files = array();
     // Core languages files : Including except "admin_lang.php"
     if (is_dir(APPPATH . 'language/' . Settings::get_lang())) {
         $lang_files = glob(APPPATH . 'language/' . Settings::get_lang() . '/*_lang.php', GLOB_BRACE);
         foreach ($lang_files as $key => $lang_file) {
             if ($lang_file == APPPATH . 'language/' . Settings::get_lang() . '/admin_lang.php') {
                 unset($lang_files[$key]);
             }
         }
     }
     // Theme languages files : Including. Can be empty
     $lf = glob(FCPATH . Theme::get_theme_path() . 'language/' . Settings::get_lang() . '/*_lang.php');
     if (!empty($lf)) {
         $lang_files = array_merge($lf, (array) $lang_files);
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:101,代码来源:MY_Controller.php

示例4: set_theme

 /** 
  * Sets the theme
  *
  * @access	public
  * @param	string	The theme folder
  */
 public static function set_theme($t)
 {
     self::$theme = $t;
     // Add current theme path to Finder searching path
     Finder::add_path(self::get_theme_path());
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:Theme.php

示例5: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->load->helper('module_helper');
     // Redirect the not authorized user to the login panel. See /application/config/user.php
     User()->restrict_type_redirect = array('uri' => config_item('admin_url') . '/auth/login', 'flash_msg' => 'You have been denied access to %s', 'flash_use_lang' => FALSE, 'flash_var' => 'error');
     $this->output->enable_profiler(FALSE);
     // Load Theme Events library
     $user_theme = Settings::get('theme');
     if (is_file($file = FCPATH . 'themes/' . $user_theme . '/libraries/theme_events.php')) {
         Event::load_event_library($file);
     }
     // Set the admin theme as current theme
     Theme::set_theme('admin');
     Settings::set('admin_url', config_item('admin_url'));
     // Set admin lang codes array
     Settings::set('admin_languages', $this->settings_model->get_admin_langs());
     Settings::set('displayed_admin_languages', explode(',', Settings::get('displayed_admin_languages')));
     // Set Router's found language code as current language
     Settings::set('current_lang', config_item('detected_lang_code'));
     // Load the current language translations file
     $this->lang->load('admin', Settings::get_lang());
     // $this->lang->load('filemanager', Settings::get_lang());
     // Modules translation files
     $modules = array();
     require APPPATH . 'config/modules.php';
     $this->modules = $modules;
     foreach ($this->modules as $module) {
         $lang_file = MODPATH . $module . '/language/' . Settings::get_lang() . '/' . strtolower($module) . '_lang.php';
         // Add the module path to the Finder
         Finder::add_path(MODPATH . $module . '/');
         if (is_file($lang_file)) {
             $lang = array();
             include $lang_file;
             $this->lang->language = array_merge($this->lang->language, $lang);
             unset($lang);
         }
     }
     // @TODO : Remove this thing from the global CMS. Not more mandatory, but necessary for compatibility with historical version
     // Available menus
     // Each menu was a root node in which you can put several pages, which are composing a menu.
     // Was never really implemented in ionize historical version, but already used as : menus[0]...
     Settings::set('menus', config_item('menus'));
     // No cache for backend
     $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
     $this->output->set_header('Cache-Control: post-check=0, pre-check=0', FALSE);
     $this->output->set_header('Pragma: no-cache');
 }
开发者ID:rockylo,项目名称:ionize,代码行数:52,代码来源:MY_Controller.php


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