当前位置: 首页>>代码示例>>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;未经允许,请勿转载。