本文整理汇总了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;
}
}
示例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')));
}
示例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.
*/