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


PHP Gdn_ApplicationManager类代码示例

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


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

示例1: Structure

 public function Structure($AppName = 'all', $CaptureOnly = '1', $Drop = '0', $Explicit = '0')
 {
     $this->Permission('Garden.AdminUser.Only');
     $Files = array();
     $AppName = $AppName == '' ? 'all' : $AppName;
     if ($AppName == 'all') {
         // Load all application structure files.
         $ApplicationManager = new Gdn_ApplicationManager();
         $Apps = $ApplicationManager->EnabledApplications();
         $AppNames = ConsolidateArrayValuesByKey($Apps, 'Folder');
         foreach ($AppNames as $AppName) {
             $Files[] = CombinePaths(array(PATH_APPLICATIONS, $AppName, 'settings', 'structure.php'), DS);
         }
         $AppName = 'all';
     } else {
         // Load that specific application structure file.
         $Files[] = CombinePaths(array(PATH_APPLICATIONS, $AppName, 'settings', 'structure.php'), DS);
     }
     $Validation = new Gdn_Validation();
     $Database = Gdn::Database();
     $Drop = $Drop == '0' ? FALSE : TRUE;
     $Explicit = $Explicit == '0' ? FALSE : TRUE;
     $CaptureOnly = !($CaptureOnly == '0');
     $Structure = Gdn::Structure();
     $Structure->CaptureOnly = $CaptureOnly;
     $SQL = Gdn::SQL();
     $SQL->CaptureModifications = $CaptureOnly;
     $this->SetData('CaptureOnly', $Structure->CaptureOnly);
     $this->SetData('Drop', $Drop);
     $this->SetData('Explicit', $Explicit);
     $this->SetData('ApplicationName', $AppName);
     $this->SetData('Status', '');
     $FoundStructureFile = FALSE;
     foreach ($Files as $File) {
         if (file_exists($File)) {
             $FoundStructureFile = TRUE;
             try {
                 include $File;
             } catch (Exception $Ex) {
                 $this->Form->AddError($Ex);
             }
         }
         if (property_exists($Structure->Database, 'CapturedSql')) {
             $this->SetData('CapturedSql', (array) $Structure->Database->CapturedSql);
         } else {
             $this->SetData('CapturedSql', array());
         }
     }
     if ($this->Form->ErrorCount() == 0 && !$CaptureOnly && $FoundStructureFile) {
         $this->SetData('Status', 'The structure was successfully executed.');
     }
     $this->AddSideMenu('dashboard/settings/configure');
     $this->AddCssFile('admin.css');
     $this->SetData('Title', T('Database Structure Upgrades'));
     $this->Render();
 }
开发者ID:sipp11,项目名称:Garden,代码行数:56,代码来源:class.utilitycontroller.php

示例2: applications

 /**
  * Application management screen.
  *
  * @since 2.0.0
  * @access public
  * @param string $Filter 'enabled', 'disabled', or 'all' (default)
  * @param string $ApplicationName Unique ID of app to be modified.
  * @param string $TransientKey Security token.
  */
 public function applications($Filter = '', $ApplicationName = '', $TransientKey = '')
 {
     $this->permission('Garden.Settings.Manage');
     // Page setup
     $this->addJsFile('addons.js');
     $this->addJsFile('applications.js');
     $this->title(t('Applications'));
     $this->addSideMenu('dashboard/settings/applications');
     // Validate & set parameters
     $Session = Gdn::session();
     if ($ApplicationName && !$Session->validateTransientKey($TransientKey)) {
         $ApplicationName = '';
     }
     if (!in_array($Filter, array('enabled', 'disabled'))) {
         $Filter = 'all';
     }
     $this->Filter = $Filter;
     $ApplicationManager = new Gdn_ApplicationManager();
     $this->AvailableApplications = $ApplicationManager->availableVisibleApplications();
     $this->EnabledApplications = $ApplicationManager->enabledVisibleApplications();
     if ($ApplicationName != '') {
         $this->EventArguments['ApplicationName'] = $ApplicationName;
         if (array_key_exists($ApplicationName, $this->EnabledApplications) === true) {
             try {
                 $ApplicationManager->disableApplication($ApplicationName);
                 Gdn_LibraryMap::clearCache();
                 $this->fireEvent('AfterDisableApplication');
             } catch (Exception $e) {
                 $this->Form->addError(strip_tags($e->getMessage()));
             }
         } else {
             try {
                 $ApplicationManager->checkRequirements($ApplicationName);
             } catch (Exception $e) {
                 $this->Form->addError(strip_tags($e->getMessage()));
             }
             if ($this->Form->errorCount() == 0) {
                 $Validation = new Gdn_Validation();
                 $ApplicationManager->registerPermissions($ApplicationName, $Validation);
                 $ApplicationManager->enableApplication($ApplicationName, $Validation);
                 Gdn_LibraryMap::clearCache();
                 $this->Form->setValidationResults($Validation->results());
                 $this->EventArguments['Validation'] = $Validation;
                 $this->fireEvent('AfterEnableApplication');
             }
         }
         if ($this->Form->errorCount() == 0) {
             redirect('settings/applications/' . $this->Filter);
         }
     }
     $this->render();
 }
开发者ID:R-J,项目名称:vanilla,代码行数:61,代码来源:class.settingscontroller.php

示例3: EnableTheme

 public function EnableTheme($ThemeName)
 {
     // 1. Make sure that the theme's requirements are met
     $ApplicationManager = new Gdn_ApplicationManager();
     $EnabledApplications = $ApplicationManager->EnabledApplications();
     $AvailableThemes = $this->AvailableThemes();
     $NewThemeInfo = ArrayValue($ThemeName, $AvailableThemes, array());
     $RequiredApplications = ArrayValue('RequiredApplications', $NewThemeInfo, FALSE);
     CheckRequirements($ThemeName, $RequiredApplications, $EnabledApplications, 'application');
     // Applications
     // 5. Set the theme
     $ThemeFolder = ArrayValue('Folder', $NewThemeInfo, '');
     if ($ThemeFolder == '') {
         throw new Exception(Gdn::Translate('The theme folder was not properly defined.'));
     } else {
         SaveToConfig('Garden.Theme', $ThemeFolder);
     }
     return TRUE;
 }
开发者ID:Aetasiric,项目名称:Garden,代码行数:19,代码来源:class.thememanager.php

示例4: GetAllowedPermissionNamespaces

 /**
  * Returns a complete list of all enabled applications & plugins. This list
  * can act as a namespace list for permissions.
  * @return array
  */
 public function GetAllowedPermissionNamespaces()
 {
     $ApplicationManager = new Gdn_ApplicationManager();
     $EnabledApplications = $ApplicationManager->EnabledApplications();
     $PluginManager = Gdn::Factory('PluginManager');
     $PluginNamespaces = array();
     foreach ($PluginManager->EnabledPlugins as $Plugin) {
         if (!array_key_exists('RegisterPermissions', $Plugin) || !is_array($Plugin['RegisterPermissions'])) {
             continue;
         }
         foreach ($Plugin['RegisterPermissions'] as $PermissionName) {
             $Namespace = substr($PermissionName, 0, strrpos($PermissionName, '.'));
             $PluginNamespaces[$Namespace] = TRUE;
         }
     }
     return array_merge(array_keys($EnabledApplications), array_keys($PluginNamespaces));
 }
开发者ID:Beyzie,项目名称:Garden,代码行数:22,代码来源:class.permissionmodel.php

示例5: GetAllowedPermissionNamespaces

 /**
  * Returns a complete list of all enabled applications & plugins. This list
  * can act as a namespace list for permissions.
  * @return array
  */
 public function GetAllowedPermissionNamespaces()
 {
     $ApplicationManager = new Gdn_ApplicationManager();
     $EnabledApplications = $ApplicationManager->EnabledApplications();
     $PluginNamespaces = array();
     foreach (Gdn::PluginManager()->EnabledPlugins() as $Plugin) {
         if (!array_key_exists('RegisterPermissions', $Plugin) || !is_array($Plugin['RegisterPermissions'])) {
             continue;
         }
         foreach ($Plugin['RegisterPermissions'] as $Index => $PermissionName) {
             if (is_string($Index)) {
                 $PermissionName = $Index;
             }
             $Namespace = substr($PermissionName, 0, strrpos($PermissionName, '.'));
             $PluginNamespaces[$Namespace] = TRUE;
         }
     }
     $Result = array_merge(array_keys($EnabledApplications), array_keys($PluginNamespaces));
     if (in_array('Dashboard', $Result)) {
         $Result[] = 'Garden';
     }
     return $Result;
 }
开发者ID:rnovino,项目名称:Garden,代码行数:28,代码来源:class.permissionmodel.php

示例6: DisablePlugin

 public function DisablePlugin($PluginName)
 {
     // 1. Check to make sure that no other enabled plugins rely on this one
     // Get all available plugins and compile their requirements
     foreach ($this->EnabledPlugins as $CheckingName => $CheckingInfo) {
         $RequiredPlugins = ArrayValue('RequiredPlugins', $CheckingInfo, FALSE);
         if (is_array($RequiredPlugins) && array_key_exists($PluginName, $RequiredPlugins) === TRUE) {
             throw new Exception(sprintf(T('You cannot disable the %1$s plugin because the %2$s plugin requires it in order to function.'), $PluginName, $CheckingName));
         }
     }
     // 2. Perform necessary hook action
     $this->_PluginHook($PluginName, self::ACTION_DISABLE, TRUE);
     // 3. Disable it
     RemoveFromConfig('EnabledPlugins' . '.' . $PluginName);
     unset($this->EnabledPlugins[$PluginName]);
     // Redefine the locale manager's settings $Locale->Set($CurrentLocale, $EnabledApps, $EnabledPlugins, TRUE);
     $ApplicationManager = new Gdn_ApplicationManager();
     $Locale = Gdn::Locale();
     $Locale->Set($Locale->Current(), $ApplicationManager->EnabledApplicationFolders(), $this->EnabledPluginFolders(), TRUE);
 }
开发者ID:nickhx,项目名称:Garden,代码行数:20,代码来源:class.pluginmanager.php

示例7: enableApplications

 /**
  * Enable applications and create permisisions for roles.
  *
  * @return void
  */
 protected function enableApplications()
 {
     $ApplicationManager = new Gdn_ApplicationManager();
     $AppNames = c('Garden.Install.Applications', ['Conversations', 'Vanilla']);
     foreach ($AppNames as $AppName) {
         $Validation = new Gdn_Validation();
         $ApplicationManager->RegisterPermissions($AppName, $Validation);
         $ApplicationManager->EnableApplication($AppName, $Validation);
     }
     Gdn::pluginManager()->start(true);
     // Flag the application as installed
     saveToConfig('Garden.Installed', true);
     // Setup default permissions for all roles
     PermissionModel::ResetAllRoles();
 }
开发者ID:TFidryForks,项目名称:spira,代码行数:20,代码来源:VanillaConfigurator.php

示例8: runStructure

 /**
  *
  *
  * @param null $AddonCode
  * @param bool $Explicit
  * @param bool $Drop
  * @throws Exception
  */
 public function runStructure($AddonCode = null, $Explicit = false, $Drop = false)
 {
     // Get the structure files for all of the enabled applications.
     $ApplicationManager = new Gdn_ApplicationManager();
     $Apps = $ApplicationManager->EnabledApplications();
     $AppNames = consolidateArrayValuesByKey($Apps, 'Folder');
     $Paths = array();
     foreach ($Apps as $Key => $AppInfo) {
         $Path = PATH_APPLICATIONS . "/{$AppInfo['Folder']}/settings/structure.php";
         if (file_exists($Path)) {
             $Paths[] = $Path;
         }
         Gdn::ApplicationManager()->RegisterPermissions($Key, $this->Validation);
     }
     // Execute the structures.
     $Database = Gdn::database();
     $SQL = Gdn::sql();
     $Structure = Gdn::structure();
     foreach ($Paths as $Path) {
         include $Path;
     }
     // Execute the structures for all of the plugins.
     $PluginManager = Gdn::pluginManager();
     $Registered = $PluginManager->RegisteredPlugins();
     foreach ($Registered as $ClassName => $Enabled) {
         if (!$Enabled) {
             continue;
         }
         try {
             $Plugin = $PluginManager->GetPluginInstance($ClassName, Gdn_PluginManager::ACCESS_CLASSNAME);
             if (method_exists($Plugin, 'Structure')) {
                 trace("{$ClassName}->Structure()");
                 $Plugin->Structure();
             }
         } catch (Exception $Ex) {
             // Do nothing, plugin wouldn't load/structure.
             if (Debug()) {
                 throw $Ex;
             }
         }
     }
     $this->fireEvent('AfterStructure');
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:51,代码来源:class.updatemodel.php

示例9: T

?>
</div>
<h1><?php 
echo T('Homepage');
?>
</h1>
<div class="Info">
   <?php 
printf(T('Use the content at this url as your homepage.', 'Choose the page people should see when they visit: <strong style="white-space: nowrap;">%s</strong>'), Url('/', TRUE));
?>
</div>
<div class="Homepage">
   <div class="HomeOptions">
      <?php 
// Only show the vanilla pages if Vanilla is enabled
$ApplicationManager = new Gdn_ApplicationManager();
$EnabledApplications = $ApplicationManager->EnabledVisibleApplications();
$CurrentTarget = $this->Data('CurrentTarget');
if (array_key_exists('Vanilla', $EnabledApplications)) {
    echo WriteHomepageOption('Discussions', 'discussions', 'SpDiscussions', $CurrentTarget);
    echo WriteHomepageOption('Categories', 'categories', 'SpCategories', $CurrentTarget);
    // echo WriteHomepageOption('Categories &amp; Discussions', 'categories/discussions', 'categoriesdiscussions', $CurrentTarget);
}
echo WriteHomepageOption('Activity', 'activity', 'SpActivity', $CurrentTarget);
?>
   </div>
   <?php 
if (array_key_exists('Vanilla', $EnabledApplications)) {
    ?>
   <div class="LayoutOptions DiscussionsLayout">
      <p>
开发者ID:rnovino,项目名称:Garden,代码行数:31,代码来源:homepage.php

示例10: Configure

 /**
  * Garden management screen.
  */
 public function Configure()
 {
     $this->Permission('Garden.Settings.Manage');
     $this->AddSideMenu('garden/settings/configure');
     $this->AddJsFile('email.js');
     $this->Title(Translate('General Settings'));
     $Validation = new Gdn_Validation();
     $ConfigurationModel = new Gdn_ConfigurationModel($Validation);
     $ConfigurationModel->SetField(array('Garden.Locale', 'Garden.Title', 'Garden.RewriteUrls', 'Garden.Email.SupportName', 'Garden.Email.SupportAddress', 'Garden.Email.UseSmtp', 'Garden.Email.SmtpHost', 'Garden.Email.SmtpUser', 'Garden.Email.SmtpPassword', 'Garden.Email.SmtpPort'));
     // Set the model on the form.
     $this->Form->SetModel($ConfigurationModel);
     // Load the locales for the locale dropdown
     $Locale = Gdn::Locale();
     $AvailableLocales = $Locale->GetAvailableLocaleSources();
     $this->LocaleData = ArrayCombine($AvailableLocales, $AvailableLocales);
     // Check to see if mod_rewrit is enabled.
     if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) {
         $this->SetData('HasModRewrite', TRUE);
     } else {
         $this->SetData('HasModRewrite', FALSE);
     }
     // If seeing the form for the first time...
     if ($this->Form->AuthenticatedPostBack() === FALSE) {
         // Apply the config settings to the form.
         $this->Form->SetData($ConfigurationModel->Data);
     } else {
         // Define some validation rules for the fields being saved
         $ConfigurationModel->Validation->ApplyRule('Garden.Locale', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Garden.Title', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Garden.RewriteUrls', 'Boolean');
         $ConfigurationModel->Validation->ApplyRule('Garden.Email.SupportName', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Garden.Email.SupportAddress', 'Required');
         $ConfigurationModel->Validation->ApplyRule('Garden.Email.SupportAddress', 'Email');
         // If changing locale, redefine locale sources:
         $NewLocale = $this->Form->GetFormValue('Garden.Locale', FALSE);
         if ($NewLocale !== FALSE && Gdn::Config('Garden.Locale') != $NewLocale) {
             $ApplicationManager = new Gdn_ApplicationManager();
             $PluginManager = Gdn::Factory('PluginManager');
             $Locale = Gdn::Locale();
             $Locale->Set($NewLocale, $ApplicationManager->EnabledApplicationFolders(), $PluginManager->EnabledPluginFolders(), TRUE);
         }
         if ($this->Form->Save() !== FALSE) {
             $this->StatusMessage = Translate("Your settings have been saved.");
         }
     }
     $this->Render();
 }
开发者ID:jeastwood,项目名称:Garden,代码行数:50,代码来源:settings.php

示例11: RunStructure

 public function RunStructure($AddonCode = NULL, $Explicit = FALSE, $Drop = FALSE)
 {
     // Get the structure files for all of the enabled applications.
     $ApplicationManager = new Gdn_ApplicationManager();
     $Apps = $ApplicationManager->EnabledApplications();
     $AppNames = ConsolidateArrayValuesByKey($Apps, 'Folder');
     $Paths = array();
     foreach ($Apps as $AppInfo) {
         $Path = PATH_APPLICATIONS . "/{$AppInfo['Folder']}/settings/structure.php";
         if (file_exists($Path)) {
             $Paths[] = $Path;
         }
     }
     // Execute the structures.
     $Database = Gdn::Database();
     $SQL = Gdn::SQL();
     $Structure = Gdn::Structure();
     foreach ($Paths as $Path) {
         include $Path;
     }
     // Execute the structures for all of the plugins.
     $PluginManager = Gdn::PluginManager();
     $Registered = $PluginManager->RegisteredPlugins();
     foreach ($Registered as $ClassName => $Enabled) {
         if (!$Enabled) {
             continue;
         }
         try {
             $Plugin = $PluginManager->GetPluginInstance($ClassName, Gdn_PluginManager::ACCESS_CLASSNAME);
             if (method_exists($Plugin, 'Structure')) {
                 Trace("{$ClassName}->Structure()");
                 $Plugin->Structure();
             }
         } catch (Exception $Ex) {
             // Do nothing, plugin wouldn't load/structure.
         }
     }
 }
开发者ID:bishopb,项目名称:vanilla,代码行数:38,代码来源:class.updatemodel.php

示例12: GetAddons

 public function GetAddons($Enabled = FALSE)
 {
     $Addons = array();
     // Get the core.
     self::_AddAddon(array('AddonKey' => 'vanilla', 'AddonType' => 'core', 'Version' => APPLICATION_VERSION, 'Folder' => '/'), $Addons);
     // Get a list of all of the applications.
     $ApplicationManager = new Gdn_ApplicationManager();
     if ($Enabled) {
         $Applications = $ApplicationManager->AvailableApplications();
     } else {
         $Applications = $ApplicationManager->EnabledApplications();
     }
     foreach ($Applications as $Key => $Info) {
         // Exclude core applications.
         if (in_array(strtolower($Key), array('conversations', 'dashboard', 'skeleton', 'vanilla'))) {
             continue;
         }
         $Addon = array('AddonKey' => $Key, 'AddonType' => 'application', 'Version' => GetValue('Version', $Info, '0.0'), 'Folder' => '/applications/' . GetValue('Folder', $Info, strtolower($Key)));
         self::_AddAddon($Addon, $Addons);
     }
     // Get a list of all of the plugins.
     $PluginManager = Gdn::PluginManager();
     if ($Enabled) {
         $Plugins = $PluginManager->EnabledPlugins();
     } else {
         $Plugins = $PluginManager->AvailablePlugins();
     }
     foreach ($Plugins as $Key => $Info) {
         // Exclude core plugins.
         if (in_array(strtolower($Key), array())) {
             continue;
         }
         $Addon = array('AddonKey' => $Key, 'AddonType' => 'plugin', 'Version' => GetValue('Version', $Info, '0.0'), 'Folder' => '/applications/' . GetValue('Folder', $Info, $Key));
         self::_AddAddon($Addon, $Addons);
     }
     // Get a list of all the themes.
     $ThemeManager = new Gdn_ThemeManager();
     if ($Enabled) {
         $Themes = $ThemeManager->EnabledThemeInfo(TRUE);
     } else {
         $Themes = $ThemeManager->AvailableThemes();
     }
     foreach ($Themes as $Key => $Info) {
         // Exclude core themes.
         if (in_array(strtolower($Key), array('default'))) {
             continue;
         }
         $Addon = array('AddonKey' => $Key, 'AddonType' => 'theme', 'Version' => GetValue('Version', $Info, '0.0'), 'Folder' => '/themes/' . GetValue('Folder', $Info, $Key));
         self::_AddAddon($Addon, $Addons);
     }
     // Get a list of all locales.
     $LocaleModel = new LocaleModel();
     if ($Enabled) {
         $Locales = $LocaleModel->EnabledLocalePacks(TRUE);
     } else {
         $Locales = $LocaleModel->AvailableLocalePacks();
     }
     foreach ($Locales as $Key => $Info) {
         // Exclude core themes.
         if (in_array(strtolower($Key), array('skeleton'))) {
             continue;
         }
         $Addon = array('AddonKey' => $Key, 'AddonType' => 'locale', 'Version' => GetValue('Version', $Info, '0.0'), 'Folder' => '/locales/' . GetValue('Folder', $Info, $Key));
         self::_AddAddon($Addon, $Addons);
     }
     return $Addons;
 }
开发者ID:kennyma,项目名称:Garden,代码行数:67,代码来源:class.updatemodel.php

示例13: EnablePlugin

 public function EnablePlugin($PluginName, $Validation, $Setup = FALSE, $EnabledPluginValueIndex = 'Folder')
 {
     // Check that the plugin is in AvailablePlugins...
     $Plugin = $this->GetPluginInfo($PluginName, self::ACCESS_PLUGINNAME);
     // If not, we're dealing with a special case. Enabling with a classname...
     if (!$Plugin) {
         $ClassName = $PluginName;
         $PluginFile = Gdn_LibraryMap::GetCache('plugin', $ClassName);
         if ($PluginFile) {
             $Plugin = $this->PluginAvailable($PluginFile);
             $PluginName = $Plugin['Index'];
         }
     }
     // Couldn't load the plugin info.
     if (!$Plugin) {
         return;
     }
     $PluginName = $Plugin['Index'];
     $this->TestPlugin($PluginName, $Validation, $Setup);
     if (is_object($Validation) && count($Validation->Results()) > 0) {
         return FALSE;
     }
     // If everything succeeded, add the plugin to the $EnabledPlugins array in conf/config.php
     // $EnabledPlugins['PluginClassName'] = 'Plugin Folder Name';
     // $PluginInfo = ArrayValue($PluginName, $this->AvailablePlugins(), FALSE);
     $PluginInfo = $this->GetPluginInfo($PluginName);
     $PluginFolder = ArrayValue('Folder', $PluginInfo);
     $PluginEnabledValue = ArrayValue($EnabledPluginValueIndex, $PluginInfo, $PluginFolder);
     SaveToConfig('EnabledPlugins.' . $PluginName, $PluginEnabledValue);
     $this->EnabledPlugins[$PluginName] = $PluginInfo;
     $this->RegisterPlugin($PluginInfo['ClassName'], $PluginInfo);
     $ApplicationManager = new Gdn_ApplicationManager();
     $Locale = Gdn::Locale();
     $Locale->Set($Locale->Current(), $ApplicationManager->EnabledApplicationFolders(), $this->EnabledPluginFolders(), TRUE);
     return TRUE;
 }
开发者ID:tautomers,项目名称:knoopvszombies,代码行数:36,代码来源:class.pluginmanager.php

示例14: DisablePlugin

 public function DisablePlugin($PluginName)
 {
     // 1. Check to make sure that no other enabled plugins rely on this one
     // Get all available plugins and compile their requirements
     foreach ($this->EnabledPlugins as $CheckingName => $CheckingInfo) {
         $RequiredPlugins = ArrayValue('RequiredPlugins', $CheckingInfo, FALSE);
         if (is_array($RequiredPlugins) && array_key_exists($PluginName, $RequiredPlugins) === TRUE) {
             throw new Exception(sprintf(Gdn::Translate('You cannot disable the %1$s plugin because the %2$s plugin requires it in order to function.'), $PluginName, $CheckingName));
         }
     }
     // 2. Disable it
     $Config = Gdn::Factory(Gdn::AliasConfig);
     $Config->Load(PATH_CONF . DS . 'config.php', 'Save');
     $Config->Remove('EnabledPlugins' . '.' . $PluginName);
     $Config->Save();
     unset($this->EnabledPlugins[$PluginName]);
     // Redefine the locale manager's settings $Locale->Set($CurrentLocale, $EnabledApps, $EnabledPlugins, TRUE);
     $ApplicationManager = new Gdn_ApplicationManager();
     $Locale = Gdn::Locale();
     $Locale->Set($Locale->Current(), $ApplicationManager->EnabledApplicationFolders(), $this->EnabledPluginFolders(), TRUE);
 }
开发者ID:Beyzie,项目名称:Garden,代码行数:21,代码来源:class.pluginmanager.php

示例15: RunStructure

 public function RunStructure($AddonCode = NULL, $Explicit = FALSE, $Drop = FALSE)
 {
     // Get the structure files for all of the enabled applications.
     $ApplicationManager = new Gdn_ApplicationManager();
     $Apps = $ApplicationManager->EnabledApplications();
     $AppNames = ConsolidateArrayValuesByKey($Apps, 'Folder');
     $Paths = array();
     foreach ($Apps as $AppInfo) {
         $Path = PATH_APPLICATIONS . "/{$AppInfo['Folder']}/settings/structure.php";
         if (file_exists($Path)) {
             $Paths[] = $Path;
         }
     }
     // Execute the structures.
     $Database = Gdn::Database();
     $SQL = Gdn::SQL();
     $Structure = Gdn::Structure();
     foreach ($Paths as $Path) {
         include $Path;
     }
     // Execute the structures for all of the plugins.
     $PluginManager = Gdn::PluginManager();
     $Plugins = $PluginManager->EnabledPlugins();
     foreach ($Plugins as $Key => $PluginInfo) {
         $PluginName = GetValue('Index', $PluginInfo);
         $Plugin = $PluginManager->GetPluginInstance($PluginName, Gdn_PluginManager::ACCESS_PLUGINNAME);
         if (method_exists($Plugin, 'Structure')) {
             $Plugin->Structure();
         }
     }
 }
开发者ID:elpum,项目名称:TgaForumBundle,代码行数:31,代码来源:class.updatemodel.php


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