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


PHP Package\PackageList类代码示例

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


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

示例1: getPackageHandle

 /**
  * Get the package handle (or false if it's a core library).
  *
  * @return string|false
  */
 public function getPackageHandle()
 {
     if (!isset($this->pkgHandle)) {
         $this->pkgHandle = $this->pkgID ? PackageList::getHandle($this->pkgID) : false;
     }
     return $this->pkgHandle;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:12,代码来源:Library.php

示例2: setLocale

 public function setLocale($locale)
 {
     if ($locale == 'en_US' && !Config::get('concrete.misc.enable_translate_locale_en_us')) {
         $this->translate = null;
     } else {
         $this->translate = new Translator();
         $this->translate->setLocale($locale);
         $this->translate->setCache(self::getCache());
         // Core language files
         $languageFile = DIR_LANGUAGES . "/{$locale}/LC_MESSAGES/messages.mo";
         if (!is_file($languageFile)) {
             $languageFile = DIR_LANGUAGES_CORE . "/{$locale}/LC_MESSAGES/messages.mo";
             if (!is_file($languageFile)) {
                 $languageFile = '';
             }
         }
         if ($languageFile !== '') {
             $this->translate->addTranslationFile('gettext', $languageFile);
         }
         // Package language files
         if (Config::get('app.bootstrap.packages_loaded') === true) {
             $pkgList = \Concrete\Core\Package\PackageList::get();
             foreach ($pkgList->getPackages() as $pkg) {
                 $pkg->setupPackageLocalization($locale, $this->translate);
             }
             // Site language files
             static::setupSiteLocalization($this->translate);
         }
     }
     PunicData::setDefaultLocale($locale);
     $event = new \Symfony\Component\EventDispatcher\GenericEvent();
     $event->setArgument('locale', $locale);
     Events::dispatch('on_locale_load', $event);
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:34,代码来源:Localization.php

示例3: getByHandle

 public static function getByHandle($ptPublishTargetTypeHandle)
 {
     $db = Loader::db();
     $r = $db->GetRow('select ptPublishTargetTypeID, ptPublishTargetTypeHandle, ptPublishTargetTypeName, pkgID from PageTypePublishTargetTypes where ptPublishTargetTypeHandle = ?', array($ptPublishTargetTypeHandle));
     if (is_array($r) && $r['ptPublishTargetTypeHandle']) {
         $txt = Loader::helper('text');
         $class = overrideable_core_class('Core\\Page\\Type\\PublishTarget\\Type\\' . $txt->camelcase($r['ptPublishTargetTypeHandle']) . 'Type', DIRNAME_CLASSES . '/Page/Type/PublishTarget/Type/' . $txt->camelcase($r['ptPublishTargetTypeHandle']) . '.php', PackageList::getHandle($r['pkgID']));
         $sc = Core::make($class);
         $sc->setPropertiesFromArray($r);
         return $sc;
     }
 }
开发者ID:ngreimel,项目名称:kovent,代码行数:12,代码来源:Type.php

示例4: getByHandle

 public static function getByHandle($scsHandle)
 {
     $db = Loader::db();
     $r = $db->GetRow('select scsHandle, scsIsActive, pkgID, scsName from SystemContentEditorSnippets where scsHandle = ?', array($scsHandle));
     if (is_array($r) && $r['scsHandle']) {
         $pkgHandle = false;
         if ($r['pkgID']) {
             $pkgHandle = PackageList::getHandle($r['pkgID']);
         }
         $class = overrideable_core_class('Core\\Editor\\' . camelcase($r['scsHandle']) . 'Snippet', DIRNAME_CLASSES . '/Editor/' . camelcase($r['scsHandle']) . 'Snippet.php', $pkgHandle);
         $sc = Core::make($class);
         $sc->setPropertiesFromArray($r);
         return $sc;
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:15,代码来源:Snippet.php

示例5: loadTranslations

 /**
  * {@inheritDoc}
  */
 public function loadTranslations(TranslatorAdapterInterface $translatorAdapter)
 {
     $config = $this->app->make('config');
     if ($config->get('app.bootstrap.packages_loaded') === true) {
         $pkgList = PackageList::get();
         $translator = $translatorAdapter->getTranslator();
         $locale = $translatorAdapter->getLocale();
         foreach ($pkgList->getPackages() as $pkg) {
             $path = $pkg->getPackagePath() . '/' . DIRNAME_LANGUAGES;
             $languageFile = "{$path}/{$locale}/LC_MESSAGES/messages.mo";
             if (is_file($languageFile)) {
                 $translator->addTranslationFile('gettext', $languageFile);
             }
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:19,代码来源:PackagesTranslationLoader.php

示例6: getByHandle

 public static function getByHandle($scsHandle)
 {
     $db = Loader::db();
     $r = $db->GetRow('select scsHandle, scsIsActive, pkgID, scsName from SystemContentEditorSnippets where scsHandle = ?', array($scsHandle));
     if (is_array($r) && $r['scsHandle']) {
         $pkgHandle = false;
         if ($r['pkgID']) {
             $pkgHandle = PackageList::getHandle($r['pkgID']);
         }
         $txt = Loader::helper('text');
         $class = '\\Concrete\\Core\\Editor\\' . $txt->camelcase($r['scsHandle']) . 'Snippet';
         $sc = Core::make($class);
         $sc->setPropertiesFromArray($r);
         return $sc;
     }
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:16,代码来源:Snippet.php

示例7: addDetails

 /**
  * Add the c5 specific debug stuff
  */
 protected function addDetails()
 {
     /**
      * General
      */
     $this->addDataTable('Concrete5', array('Version' => APP_VERSION, 'Installed Version' => Config::get('app.version')));
     /**
      * Cache
      */
     $this->addDataTable('Preferences', array('Block Cache' => Config::get('concrete.cache.blocks') ? 'ON' : 'OFF', 'Overrides Cache' => Config::get('concrete.cache.overrides') ? 'ON' : 'OFF', 'Full Page' => Config::get('concrete.cache.pages') ? 'ON' : 'OFF', 'Full Page Lifetime' => Config::get('concrete.cache.full_page_lifetime', 'default')));
     /**
      * Installed Packages
      */
     $pla = PackageList::get();
     $pl = $pla->getPackages();
     $packages = array();
     foreach ($pl as $p) {
         if ($p->isPackageInstalled()) {
             $packages[$p->getPackageName()] = $p->getPackageVersion();
         }
     }
     $this->addDataTable('Installed Packages', $packages);
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:26,代码来源:ErrorHandler.php

示例8: run

 public function run()
 {
     $this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>");
     $this->x->addAttribute('version', '1.0');
     // First, attribute categories
     AttributeKeyCategory::exportList($this->x);
     // Features
     Feature::exportList($this->x);
     FeatureCategory::exportList($this->x);
     ConversationEditor::exportList($this->x);
     ConversationRatingType::exportList($this->x);
     // composer
     PageTypePublishTargetType::exportList($this->x);
     PageTypeComposerControlType::exportList($this->x);
     PageType::exportList($this->x);
     // attribute types
     AttributeType::exportList($this->x);
     // then block types
     BlockTypeList::exportList($this->x);
     // now block type sets (including user)
     BlockTypeSet::exportList($this->x);
     // gathering
     GatheringDataSource::exportList($this->x);
     GatheringItemTemplate::exportList($this->x);
     // now attribute keys (including user)
     AttributeKey::exportList($this->x);
     // now attribute keys (including user)
     AttributeSet::exportList($this->x);
     PageTemplate::exportList($this->x);
     // now theme
     PageTheme::exportList($this->x);
     // now packages
     PackageList::export($this->x);
     // permission access entity types
     PermissionAccessEntityType::exportList($this->x);
     // now task permissions
     PermissionKey::exportList($this->x);
     // workflow types
     WorkflowType::exportList($this->x);
     // now jobs
     Job::exportList($this->x);
     // now single pages
     $singlepages = $this->x->addChild("singlepages");
     $db = Loader::db();
     $r = $db->Execute('select cID from Pages where cFilename is not null and cFilename <> "" and cID not in (select cID from Stacks) order by cID asc');
     while ($row = $r->FetchRow()) {
         $pc = Page::getByID($row['cID'], 'RECENT');
         $pc->export($singlepages);
     }
     // now stacks/global areas
     StackList::export($this->x);
     // now content pages
     $pages = $this->x->addChild("pages");
     $db = Loader::db();
     $r = $db->Execute('select Pages.cID from Pages where cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc');
     while ($row = $r->FetchRow()) {
         $pc = Page::getByID($row['cID'], 'RECENT');
         if ($pc->getPageTypeHandle() == STACKS_PAGE_TYPE) {
             continue;
         }
         $pc->export($pages);
     }
     SystemCaptchaLibrary::exportList($this->x);
     \Concrete\Core\Sharing\SocialNetwork\Link::exportList($this->x);
     \Concrete\Core\Page\Feed::exportList($this->x);
     \Concrete\Core\File\Image\Thumbnail\Type\Type::exportList($this->x);
     Config::exportList($this->x);
     Tree::exportList($this->x);
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:69,代码来源:ContentExporter.php

示例9: getAttributeKeyByID

 /**
  * @param int $akID
  * @return Key|false Returns an attribute key for the matching ID,
  * false if no key exists for the category with the given ID
  */
 public function getAttributeKeyByID($akID)
 {
     $txt = Core::make('helper/text');
     $prefix = $this->pkgID > 0 ? PackageList::getHandle($this->pkgID) : false;
     $akCategoryHandle = $txt->camelcase($this->akCategoryHandle);
     $className = core_class('Core\\Attribute\\Key\\' . $akCategoryHandle . 'Key', $prefix);
     $ak = call_user_func(array($className, 'getByID'), $akID);
     return $ak;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:14,代码来源:Category.php

示例10: getByID

 public static function getByID($wpID)
 {
     $db = Database::connection();
     $r = $db->fetchAssoc('select WorkflowProgress.*, WorkflowProgressCategories.wpCategoryHandle, WorkflowProgressCategories.pkgID from WorkflowProgress inner join WorkflowProgressCategories on WorkflowProgress.wpCategoryID = WorkflowProgressCategories.wpCategoryID where wpID  = ?', array($wpID));
     if (!is_array($r) || !$r['wpID']) {
         return false;
     }
     $class = '\\Core\\Workflow\\Progress\\' . Core::make('helper/text')->camelcase($r['wpCategoryHandle']) . 'Progress';
     if ($r['pkgID']) {
         $pkgHandle = PackageList::getHandle($r['pkgID']);
     }
     $class = core_class($class, $pkgHandle);
     $wp = Core::make($class);
     $wp->setPropertiesFromArray($r);
     $wp->loadDetails();
     return $wp;
 }
开发者ID:digideskio,项目名称:concrete5,代码行数:17,代码来源:Progress.php

示例11: mergeTranslationsWithPackages

 public function mergeTranslationsWithPackages(Section $section, Translations $translations)
 {
     foreach (PackageList::get()->getPackages() as $package) {
         /* @var $package \Concrete\Core\Package\Package */
         $baseDir = $package->getPackagePath() . '/' . DIRNAME_LANGUAGES . '/' . $section->getLocale() . '/LC_MESSAGES';
         $poFile = $baseDir . '/messages.po';
         $moFile = $baseDir . '/messages.mo';
         $packageTranslations = null;
         if (is_file($poFile)) {
             $packageTranslations = PoExtractor::fromFile($poFile);
         } elseif (is_file($moFile)) {
             $packageTranslations = MoExtractor::fromFile($moFile);
         }
         if (isset($packageTranslations)) {
             foreach ($translations as $translation) {
                 /* @var $translation \Gettext\Translation */
                 if (!$translation->hasTranslation()) {
                     $packageTranslation = $packageTranslations->find($translation);
                     if ($packageTranslation && $packageTranslation->hasTranslation()) {
                         $translation->mergeWith($packageTranslation);
                     }
                 }
             }
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:26,代码来源:Extractor.php

示例12: mapAuthenticationTypeFilePath

 /**
  * Return the first existing file path in this order:
  *  - /models/authentication/types/HANDLE
  *  - /packages/PKGHANDLE/authentication/types/HANDLE
  *  - /concrete/models/authentication/types/HANDLE
  *  - /concrete/core/models/authentication/types/HANDLE
  *
  * @param string $_file The filename you want.
  * @return string This will return false if the file is not found.
  */
 protected function mapAuthenticationTypeFilePath($_file)
 {
     $atHandle = $this->getAuthenticationTypeHandle();
     $env = Environment::get();
     $pkgHandle = PackageList::getHandle($this->pkgID);
     $r = $env->getRecord(implode('/', array(DIRNAME_AUTHENTICATION, $atHandle, $_file)), $pkgHandle);
     return $r;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:18,代码来源:AuthenticationType.php

示例13: __construct

 public function __construct()
 {
     $loc = Localization::getInstance();
     $loc->pushActiveContext('system');
     try {
         $app = Facade::getFacadeApplication();
         $config = $app->make('config');
         $maxExecutionTime = ini_get('max_execution_time');
         @set_time_limit(5);
         $this->installed = (bool) $app->isInstalled();
         $this->webRootDirectory = DIR_BASE;
         $this->coreRootDirectory = DIR_BASE_CORE;
         $versions = ['Core Version - ' . $config->get('concrete.version')];
         if ($this->installed) {
             $versions[] = 'Version Installed - ' . $config->get('concrete.version_installed');
         }
         $versions[] = 'Database Version - ' . $config->get('concrete.version_db');
         $this->coreVersions = implode("\n", $versions);
         $packages = [];
         if ($this->installed) {
             foreach (PackageList::get()->getPackages() as $p) {
                 if ($p->isPackageInstalled()) {
                     $packages[] = $p->getPackageName() . ' (' . $p->getPackageVersion() . ')';
                 }
             }
         }
         natcasesort($packages);
         $this->packages = implode(', ', $packages);
         $overrides = Environment::get()->getOverrideList();
         if (empty($overrides)) {
             $this->overrides = '';
         } else {
             $this->overrides = implode(', ', $overrides);
         }
         $cache = [sprintf('Block Cache - %s', $config->get('concrete.cache.blocks') ? 'On' : 'Off'), sprintf('Overrides Cache - %s', $config->get('concrete.cache.overrides') ? 'On' : 'Off'), sprintf('Full Page Caching - %s', $config->get('concrete.cache.pages') == 'blocks' ? 'On - If blocks on the particular page allow it.' : ($config->get('concrete.cache.pages') == 'all' ? 'On - In all cases.' : 'Off'))];
         if ($config->get('concrete.cache.full_page_lifetime')) {
             $cache[] = sprintf("Full Page Cache Lifetime - %s", $config->get('concrete.cache.full_page_lifetime') == 'default' ? sprintf('Every %s (default setting).', $app->make('helper/date')->describeInterval($config->get('concrete.cache.lifetime'))) : ($config->get('concrete.cache.full_page_lifetime') == 'forever' ? 'Only when manually removed or the cache is cleared.' : sprintf('Every %s minutes.', $config->get('concrete.cache.full_page_lifetime_value'))));
         }
         $this->cache = implode("\n", $cache);
         $this->serverSoftware = \Request::getInstance()->server->get('SERVER_SOFTWARE', '');
         $this->serverAPI = PHP_SAPI;
         $this->phpVersion = PHP_VERSION;
         if (function_exists('get_loaded_extensions')) {
             $extensions = @get_loaded_extensions();
         } else {
             $extensions = false;
         }
         if (is_array($extensions)) {
             natcasesort($extensions);
             $this->phpExtensions = implode(', ', $extensions);
         } else {
             $this->phpExtensions = false;
         }
         ob_start();
         phpinfo();
         $buffer = ob_get_clean();
         $phpinfo = [];
         if ($app->isRunThroughCommandLineInterface()) {
             $section = null;
             foreach (preg_split('/[\\r\\n]+/', $buffer) as $line) {
                 $chunks = array_map('trim', explode('=>', $line));
                 switch (count($chunks)) {
                     case 1:
                         if ($chunks[0] === '') {
                             continue;
                         }
                         $section = $chunks[0];
                         break;
                     case 2:
                         if ($section !== null) {
                             $phpinfo[$section][$chunks[0]] = $chunks[1];
                         }
                         break;
                     default:
                         if ($section !== null) {
                             $phpinfo[$section][$chunks[0]] = [$chunks[1], $chunks[2]];
                         }
                         break;
                 }
             }
         } else {
             $section = 'phpinfo';
             $phpinfo[$section] = [];
             if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>)?)?</tr>)#s', $buffer, $matches, PREG_SET_ORDER)) {
                 foreach ($matches as $match) {
                     if ($match[1] !== null && $match[1] !== '') {
                         $section = $match[1];
                         $phpinfo[$section] = [];
                     } elseif (isset($match[3])) {
                         $phpinfo[$section][$match[2]] = isset($match[4]) ? [$match[3], $match[4]] : $match[3];
                     } else {
                         $phpinfo[$section][] = $match[2];
                     }
                 }
             }
         }
         $phpSettings = ["max_execution_time - {$maxExecutionTime}"];
         foreach ($phpinfo as $name => $section) {
             foreach ($section as $key => $val) {
                 if (preg_match('/.*max_execution_time*/', $key)) {
//.........这里部分代码省略.........
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:101,代码来源:Info.php

示例14: get_environment_info

 public function get_environment_info()
 {
     $activeLocale = Localization::activeLocale();
     if ($activeLocale != 'en_US') {
         Localization::changeLocale('en_US');
     }
     $maxExecutionTime = ini_get('max_execution_time');
     set_time_limit(5);
     $environmentMessage = "# concrete5 Version\n" . APP_VERSION . "\n\n";
     $environmentMessage .= "# concrete5 Packages\n";
     $pla = PackageList::get();
     $pl = $pla->getPackages();
     $packages = array();
     foreach ($pl as $p) {
         if ($p->isPackageInstalled()) {
             $packages[] = $p->getPackageName() . ' (' . $p->getPackageVersion() . ')';
         }
     }
     if (count($packages) > 0) {
         natcasesort($packages);
         $environmentMessage .= implode(', ', $packages);
         $environmentMessage .= ".\n";
     } else {
         $environmentMessage .= "None\n";
     }
     $environmentMessage .= "\n";
     // overrides
     $environmentMessage .= "# concrete5 Overrides\n";
     $fh = Loader::helper('file');
     $overrides = array();
     $ovBlocks = $fh->getDirectoryContents(DIR_FILES_BLOCK_TYPES);
     $ovControllers = $fh->getDirectoryContents(DIR_FILES_CONTROLLERS);
     $ovElements = $fh->getDirectoryContents(DIR_FILES_ELEMENTS);
     $ovJobs = $fh->getDirectoryContents(DIR_FILES_JOBS);
     $ovCSS = $fh->getDirectoryContents(DIR_APPLICATION . '/' . DIRNAME_CSS);
     $ovJS = $fh->getDirectoryContents(DIR_APPLICATION . '/' . DIRNAME_JAVASCRIPT);
     $ovLng = $fh->getDirectoryContents(DIR_APPLICATION . '/' . DIRNAME_LANGUAGES);
     $ovMail = $fh->getDirectoryContents(DIR_FILES_EMAIL_TEMPLATES);
     $ovSingle = $fh->getDirectoryContents(DIR_FILES_CONTENT);
     $ovThemes = $fh->getDirectoryContents(DIR_FILES_THEMES);
     $ovTools = $fh->getDirectoryContents(DIR_FILES_TOOLS);
     foreach ($ovBlocks as $ovb) {
         $overrides[] = DIRNAME_BLOCKS . '/' . $ovb;
     }
     foreach ($ovControllers as $ovb) {
         $overrides[] = DIRNAME_CONTROLLERS . '/' . $ovb;
     }
     foreach ($ovElements as $ovb) {
         $overrides[] = DIRNAME_ELEMENTS . '/' . $ovb;
     }
     foreach ($ovJobs as $ovb) {
         $overrides[] = DIRNAME_JOBS . '/' . $ovb;
     }
     foreach ($ovJS as $ovb) {
         $overrides[] = DIRNAME_JAVASCRIPT . '/' . $ovb;
     }
     foreach ($ovCSS as $ovb) {
         $overrides[] = DIRNAME_CSS . '/' . $ovb;
     }
     foreach ($ovLng as $ovb) {
         $overrides[] = DIRNAME_LANGUAGES . '/' . $ovb;
     }
     foreach ($ovMail as $ovb) {
         $overrides[] = DIRNAME_MAIL_TEMPLATES . '/' . $ovb;
     }
     foreach ($ovSingle as $ovb) {
         $overrides[] = DIRNAME_PAGES . '/' . $ovb;
     }
     foreach ($ovThemes as $ovb) {
         $overrides[] = DIRNAME_THEMES . '/' . $ovb;
     }
     foreach ($ovTools as $ovb) {
         $overrides[] = DIRNAME_TOOLS . '/' . $ovb;
     }
     if (count($overrides) > 0) {
         $environmentMessage .= implode(', ', $overrides);
         $environmentMessage .= "\n";
     } else {
         $environmentMessage .= "None\n";
     }
     $environmentMessage .= "\n";
     print $environmentMessage;
     // cache
     $environmentMessage = "# concrete5 Cache Settings\n";
     $environmentMessage .= sprintf("Block Cache - %s\n", Config::get('concrete.cache.blocks') ? 'On' : 'Off');
     $environmentMessage .= sprintf("Overrides Cache - %s\n", Config::get('concrete.cache.overrides') ? 'On' : 'Off');
     $environmentMessage .= sprintf("Full Page Caching - %s\n", Config::get('concrete.cache.pages') == 'blocks' ? 'On - If blocks on the particular page allow it.' : (Config::get('concrete.cache.pages') == 'all' ? 'On - In all cases.' : 'Off'));
     if (Config::get('concrete.cache.full_page_lifetime')) {
         $environmentMessage .= sprintf("Full Page Cache Lifetime - %s\n", Config::get('concrete.cache.full_page_lifetime') == 'default' ? sprintf('Every %s (default setting).', Loader::helper('date')->describeInterval(Config::get('concrete.cache.lifetime'))) : (Config::get('concrete.cache.full_page_lifetime') == 'forever' ? 'Only when manually removed or the cache is cleared.' : sprintf('Every %s minutes.', Config::get('concrete.cache.full_page_lifetime_value'))));
     }
     $environmentMessage .= "\n";
     print $environmentMessage;
     $environmentMessage = "# Server Software\n" . $_SERVER['SERVER_SOFTWARE'] . "\n\n";
     $environmentMessage .= "# Server API\n" . php_sapi_name() . "\n\n";
     $environmentMessage .= "# PHP Version\n" . PHP_VERSION . "\n\n";
     $environmentMessage .= "# PHP Extensions\n";
     if (function_exists('get_loaded_extensions')) {
         $gle = @get_loaded_extensions();
         natcasesort($gle);
         $environmentMessage .= implode(', ', $gle);
//.........这里部分代码省略.........
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:101,代码来源:info.php

示例15: setupPackages

 /**
  * Run startup and localization events on any installed packages.
  */
 public function setupPackages()
 {
     $pla = \Concrete\Core\Package\PackageList::get();
     $pl = $pla->getPackages();
     $cl = ClassLoader::getInstance();
     foreach ($pl as $p) {
         if ($p->isPackageInstalled()) {
             $pkg = Package::getClass($p->getPackageHandle());
             if (is_object($pkg)) {
                 $cl->registerPackage($pkg);
                 // handle updates
                 if (Config::get('concrete.misc.enable_auto_update_packages')) {
                     $pkgInstalledVersion = $p->getPackageVersion();
                     $pkgFileVersion = $pkg->getPackageVersion();
                     if (version_compare($pkgFileVersion, $pkgInstalledVersion, '>')) {
                         $currentLocale = Localization::activeLocale();
                         if ($currentLocale != 'en_US') {
                             Localization::changeLocale('en_US');
                         }
                         $p->upgradeCoreData();
                         $p->upgrade();
                         if ($currentLocale != 'en_US') {
                             Localization::changeLocale($currentLocale);
                         }
                     }
                 }
                 $pkg->setupPackageLocalization();
                 if (method_exists($pkg, 'on_start')) {
                     $pkg->on_start();
                 }
             }
         }
     }
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:37,代码来源:Application.php


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