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


PHP module::_remove_from_path方法代碼示例

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


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

示例1: install

 /**
  * Install a module.  This will call <module>_installer::install(), which is responsible for
  * creating database tables, setting module variables and calling module::set_version().
  * Note that after installing, the module must be activated before it is available for use.
  * @param string $module_name
  */
 static function install($module_name)
 {
     module::_add_to_path($module_name);
     $installer_class = "{$module_name}_installer";
     if (class_exists($installer_class) && method_exists($installer_class, "install")) {
         call_user_func_array(array($installer_class, "install"), array());
     }
     module::set_version($module_name, module::available()->{$module_name}->code_version);
     // Set the weight of the new module, which controls the order in which the modules are
     // loaded. By default, new modules are installed at the end of the priority list.  Since the
     // id field is monotonically increasing, the easiest way to guarantee that is to set the weight
     // the same as the id.  We don't know that until we save it for the first time
     $module = ORM::factory("module")->where("name", "=", $module_name)->find();
     if ($module->loaded()) {
         $module->weight = $module->id;
         $module->save();
     }
     module::load_modules();
     // Now the module is installed but inactive, so don't leave it in the active path
     module::_remove_from_path($module_name);
     log::success("module", t("Installed module %module_name", array("module_name" => $module_name)));
 }
開發者ID:HarriLu,項目名稱:gallery3,代碼行數:28,代碼來源:module.php

示例2: install

 /**
  * Install a module.  This will call <module>_installer::install(), which is responsible for
  * creating database tables, setting module variables and calling module::set_version().
  * Note that after installing, the module must be activated before it is available for use.
  * @param string $module_name
  */
 static function install($module_name)
 {
     module::_add_to_path($module_name);
     $installer_class = "{$module_name}_installer";
     if (method_exists($installer_class, "install")) {
         call_user_func_array(array($installer_class, "install"), array());
     } else {
         module::set_version($module_name, 1);
     }
     module::load_modules();
     // Now the module is installed but inactive, so don't leave it in the active path
     module::_remove_from_path($module_name);
     log::success("module", t("Installed module %module_name", array("module_name" => $module_name)));
 }
開發者ID:andyst,項目名稱:gallery3,代碼行數:20,代碼來源:module.php


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