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


PHP DevblocksPlatform::getPatchService方法代码示例

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


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

示例1: runPluginPatches

 /**
  * Runs patches for all active plugins
  *
  * @return boolean
  */
 static function runPluginPatches()
 {
     // Log out all sessions before patching
     $db = DevblocksPlatform::getDatabaseService();
     $db->Execute(sprintf("DELETE FROM %s_session", APP_DB_PREFIX));
     $patchMgr = DevblocksPlatform::getPatchService();
     //		echo "Patching platform... ";
     // [JAS]: Run our overloaded container for the platform
     $patchMgr->registerPatchContainer(new PlatformPatchContainer());
     // Clean script
     if (!$patchMgr->run()) {
         return false;
     } else {
         // success
         // Read in plugin information from the filesystem to the database
         DevblocksPlatform::readPlugins();
         $plugins = DevblocksPlatform::getPluginRegistry();
         //			DevblocksPlatform::clearCache();
         // Run enabled plugin patches
         $patches = DevblocksPlatform::getExtensions("devblocks.patch.container");
         if (is_array($patches)) {
             foreach ($patches as $patch_manifest) {
                 /* @var $patch_manifest DevblocksExtensionManifest */
                 $container = $patch_manifest->createInstance();
                 /* @var $container DevblocksPatchContainerExtension */
                 if (!is_null($container)) {
                     $patchMgr->registerPatchContainer($container);
                 }
             }
         }
         //			echo "Patching plugins... ";
         if (!$patchMgr->run()) {
             // fail
             return false;
         }
         //			echo "done!<br>";
         $cache = self::getCacheService();
         $cache->save(APP_BUILD, "devblocks_app_build");
         return true;
     }
 }
开发者ID:sluther,项目名称:portsensor,代码行数:46,代码来源:Devblocks.class.php

示例2: savePluginsAction

 function savePluginsAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     $worker = CerberusApplication::getActiveWorker();
     if (!$worker || !$worker->is_superuser) {
         echo $translate->_('common.access_denied');
         return;
     }
     if (DEMO_MODE) {
         DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'plugins')));
         return;
     }
     @($plugins_enabled = DevblocksPlatform::importGPC($_REQUEST['plugins_enabled'], 'array'));
     $pluginStack = DevblocksPlatform::getPluginRegistry();
     if (is_array($plugins_enabled)) {
         foreach ($plugins_enabled as $plugin_id) {
             $plugin = $pluginStack[$plugin_id];
             $plugin->setEnabled(true);
             unset($pluginStack[$plugin_id]);
         }
     }
     // [JAS]: Clear unchecked plugins
     foreach ($pluginStack as $plugin) {
         // [JAS]: We can't force disable core here [TODO] Improve
         if ($plugin->id == 'cerberusweb.core') {
             continue;
         }
         $plugin->setEnabled(false);
     }
     DevblocksPlatform::clearCache();
     // Run any enabled plugin patches
     // [TODO] Should the platform do this automatically on enable in order?
     $patchMgr = DevblocksPlatform::getPatchService();
     $patches = DevblocksPlatform::getExtensions("devblocks.patch.container", false, true);
     if (is_array($patches)) {
         foreach ($patches as $patch_manifest) {
             /* @var $patch_manifest DevblocksExtensionManifest */
             $container = $patch_manifest->createInstance();
             /* @var $container DevblocksPatchContainerExtension */
             $patchMgr->registerPatchContainer($container);
         }
     }
     if (!$patchMgr->run()) {
         // fail
         die("Failed updating plugins.");
         // [TODO] Make this more graceful
     }
     // Reload plugin translations
     DAO_Translation::reloadPluginStrings();
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'plugins')));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:51,代码来源:config.php

示例3: realpath

         $tpl->assign('db_name', $db_name);
         $tpl->assign('db_user', $db_user);
         $tpl->assign('db_pass', $db_pass);
         $tpl->assign('failed', true);
         $tpl->assign('result', $result);
         $tpl->assign('config_path', realpath(APP_PATH . "/framework.config.php"));
         $tpl->assign('template', 'steps/step_config_file.tpl.php');
     }
     break;
     // Initialize the database
 // Initialize the database
 case STEP_INIT_DB:
     // [TODO] Add current user to patcher/upgrade authorized IPs
     if (CerberusInstaller::isDatabaseEmpty()) {
         // install
         $patchMgr = DevblocksPlatform::getPatchService();
         // [JAS]: Run our overloaded container for the platform
         $patchMgr->registerPatchContainer(new PlatformPatchContainer());
         // Clean script
         if (!$patchMgr->run()) {
             // [TODO] Show more info on the error
             $tpl->assign('template', 'steps/step_init_db.tpl.php');
         } else {
             // success
             // Read in plugin information from the filesystem to the database
             DevblocksPlatform::readPlugins();
             /*
              * [TODO] This possibly needs to only start with core, because as soon 
              * as we add back another feature with licensing we'll have installer 
              * errors trying to license plugins before core runs its DB install.
              */
开发者ID:sluther,项目名称:portsensor,代码行数:31,代码来源:index.php


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