remove_package_path() public méthode

Remove a path from the library, model, helper and/or config path arrays if it exists. If no path is provided, the most recently added path will be removed removed.
public remove_package_path ( string $path = '' ) : object
$path string Path to remove
Résultat object
Exemple #1
0
 public function remove_package_path($path = '', $remove_config_path = TRUE)
 {
     if ($path == '') {
         $void = array_shift($this->_ci_widget_paths);
     } else {
         $path = rtrim($path, '/') . '/';
         if (($key = array_search($path, $this->_ci_widget_paths)) !== FALSE) {
             unset($this->_ci_widget_paths[$key]);
         }
     }
     $this->_ci_widget_paths = array_unique(array_merge($this->_ci_widget_paths, array(APPPATH)));
     parent::remove_package_path($path, $remove_config_path);
 }
Exemple #2
0
 /**
  * Remove Module
  *
  * Remove a module from the allowed module paths
  *
  * @param	type
  * @param 	bool
  */
 public function remove_module($module = '', $remove_config = TRUE)
 {
     if ($module == '') {
         // Mark module as not loaded
         array_shift($this->_ci_modules);
         // Remove package path
         parent::remove_package_path('', $remove_config);
     } else {
         if (($key = array_search($module, $this->_ci_modules)) !== FALSE) {
             if ($path = $this->find_module($module)) {
                 // Mark module as not loaded
                 unset($this->_ci_modules[$key]);
                 // Remove package path
                 parent::remove_package_path($path, $remove_config);
             }
         }
     }
 }