本文整理汇总了PHP中DevblocksPlatform::readPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::readPlugins方法的具体用法?PHP DevblocksPlatform::readPlugins怎么用?PHP DevblocksPlatform::readPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::readPlugins方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTabPluginsAction
function showTabPluginsAction()
{
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
// Auto synchronize when viewing Config->Extensions
DevblocksPlatform::readPlugins();
$plugins = DevblocksPlatform::getPluginRegistry();
unset($plugins['cerberusweb.core']);
$tpl->assign('plugins', $plugins);
// $points = DevblocksPlatform::getExtensionPoints();
// $tpl->assign('points', $points);
$license = CerberusLicense::getInstance();
$tpl->assign('license', $license);
$tpl->display('file:' . $this->_TPL_PATH . 'configuration/tabs/plugins/index.tpl');
}
示例2: showTabPluginsAction
function showTabPluginsAction()
{
$tpl = DevblocksPlatform::getTemplateService();
$tpl->assign('path', $this->_TPL_PATH);
// Auto synchronize when viewing Config->Extensions
DevblocksPlatform::readPlugins();
if (DEVELOPMENT_MODE) {
DAO_Platform::cleanupPluginTables();
}
$plugins = DevblocksPlatform::getPluginRegistry();
unset($plugins['devblocks.core']);
unset($plugins['feg.core']);
unset($plugins['feg.auditlog']);
$tpl->assign('plugins', $plugins);
$license = FegLicense::getInstance();
$tpl->assign('license', $license);
$tpl->display('file:' . $this->_TPL_PATH . 'setup/tabs/plugins/index.tpl');
}
示例3: 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;
}
}
示例4: versionConsistencyCheck
/**
* Checks to see if the application needs to patch
*
* @return boolean
*/
static function versionConsistencyCheck()
{
$cache = DevblocksPlatform::getCacheService();
/* @var _DevblocksCacheManager $cache */
if (null === ($build_cache = $cache->load("devblocks_app_build")) || $build_cache != APP_BUILD) {
// If build changed, clear cache regardless of patch status
// [TODO] We need to find a nicer way to not clear a shared memcached cluster when only one desk needs to
$cache = DevblocksPlatform::getCacheService();
/* @var $cache _DevblocksCacheManager */
$cache->clean();
// Re-read manifests
DevblocksPlatform::readPlugins();
if (self::_needsToPatch()) {
return false;
// the update script will handle new caches
} else {
$cache->save(APP_BUILD, "devblocks_app_build");
DAO_Translation::reloadPluginStrings();
// reload strings even without DB changes
return true;
}
}
return true;
}
示例5: PlatformPatchContainer
// 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.
*/
$plugins = DevblocksPlatform::getPluginRegistry();
// Tailor which plugins are enabled by default
if (is_array($plugins)) {
foreach ($plugins as $plugin_manifest) {
/* @var $plugin_manifest DevblocksPluginManifest */
switch ($plugin_manifest->id) {
case "app.core":
$plugin_manifest->setEnabled(true);
break;
default:
示例6: update
static function update()
{
// Update the platform
if (!DevblocksPlatform::update()) {
throw new Exception("Couldn't update Devblocks.");
}
// Read in plugin information from the filesystem to the database
DevblocksPlatform::readPlugins();
// Clean up missing plugins
DAO_Platform::cleanupPluginTables();
// Registry
$plugins = DevblocksPlatform::getPluginRegistry();
// Update the application core (version by version)
if (!isset($plugins['feg.core'])) {
throw new Exception("Couldn't read application manifest.");
}
$plugin_patches = array();
// Load patches
foreach ($plugins as $p) {
/* @var $p DevblocksPluginManifest */
if ('devblocks.core' == $p->id) {
continue;
}
// Don't patch disabled plugins
if ($p->enabled) {
$plugin_patches[$p->id] = $p->getPatches();
}
}
$core_patches = $plugin_patches['feg.core'];
unset($plugin_patches['feg.core']);
/*
* For each core release, patch plugins in dependency order
*/
foreach ($core_patches as $patch) {
/* @var $patch DevblocksPatch */
if (!file_exists($patch->getFilename())) {
throw new Exception("Missing application patch: " . $path);
}
$version = $patch->getVersion();
if (!$patch->run()) {
throw new Exception("Application patch failed to apply: " . $path);
}
// Patch this version and then patch plugins up to this version
foreach ($plugin_patches as $plugin_id => $patches) {
$pass = true;
foreach ($patches as $k => $plugin_patch) {
// Recursive patch up to _version_
if ($pass && version_compare($plugin_patch->getVersion(), $version, "<=")) {
if ($plugin_patch->run()) {
unset($plugin_patches[$plugin_id][$k]);
} else {
$plugins[$plugin_id]->setEnabled(false);
$pass = false;
}
}
}
}
}
return TRUE;
}