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


PHP Package::upgrade方法代码示例

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


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

示例1: upgrade

 public function upgrade()
 {
     parent::upgrade();
     $pkg = Package::getByHandle($this->pkgHandle);
     //@todo write conversion from lang to locale
     //1.0 - 1.1 changed languaage to locale
     $db = Loader::db();
     // update the MultilingualSections table
     $rows = $db->getAll("SELECT * FROM MultilingualSections");
     if (is_array($rows) && count($rows)) {
         foreach ($rows as $r) {
             if (strlen($r['msLanguage']) && !strlen($r['msLocale'])) {
                 $locale = $r['msLanguage'] . (strlen($r['msIcon']) ? "_" . $r['msIcon'] : "");
                 $db->query("UPDATE MultilingualSections SET msLocale = ? WHERE cID = ?", array($locale, $r['cID']));
             }
         }
     }
     // install job
     Loader::model('job');
     $jb = Job::installByPackage('generate_multilingual_sitemap', $pkg);
     // update the MultilingualPageRelations table
     $hasLocales = $db->getOne("SELECT COUNT(msLocale) FROM MultilingualSections WHERE LENGTH(msLocale)");
     if (!$hasLocales) {
         $query = "UPDATE MultilingualPageRelations mpr, MultilingualSections \n\t\t\t\tSET mpr.mpLocale = MultilingualSections.msLocale\n\t\t\t\tWHERE mpr.mpLanguage = MultilingualSections.msLanguage";
         $db->query($query);
     }
     // 1.1.2
     $ak = CollectionAttributeKey::getByHandle('multilingual_exclude_from_copy');
     if (!is_object($ak)) {
         CollectionAttributeKey::add('BOOLEAN', array('akHandle' => 'multilingual_exclude_from_copy', 'akName' => t('Exclude from Internationalization Copy'), 'akIsSearchable' => true), $pkg);
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:32,代码来源:controller.php

示例2: upgrade

 public function upgrade()
 {
     $pkg = $this;
     parent::upgrade();
     /*if (!is_object(BlockType::getByHandle('simple_info'))) {
           BlockType::installBlockTypeFromPackage('simple_info', $pkg);
       }*/
 }
开发者ID:robmorris180,项目名称:lgt_events,代码行数:8,代码来源:controller.php

示例3: upgrade

 function upgrade()
 {
     parent::upgrade();
     /* Refresh all blocks */
     Loader::model('block_types');
     $items = array(BlockType::getByHandle('tweetcrete'));
     foreach ($items as $item) {
         $item->refresh();
     }
 }
开发者ID:robchenski,项目名称:ids,代码行数:10,代码来源:controller.php

示例4: upgrade

 public function upgrade()
 {
     //		If you have an attribute type in your package that needs to
     //		update it's database table, you will need to run this:
     //
     //		$est = AttributeType::getByHandle('attribute_handle');
     //		$path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB);
     //		Package::installDB($path);
     parent::upgrade();
     $pkg = Package::getByHandle($this->pkgHandle);
     $this->installAdditionalPageAttributes($pkg);
     $this->installJobs($pkg);
 }
开发者ID:janzenz,项目名称:c5_boilerplate,代码行数:13,代码来源:controller.php

示例5: upgrade

 public function upgrade()
 {
     // In case the schema changed, drop all cobble tables
     $db = Loader::db();
     $db->Execute('DROP TABLE CobblePageThemes, CobblePageTypes, CobbleAreas, CobblePages, CobbleTemplateAreas');
     // This needs to be called AFTER dropping tables!
     parent::upgrade();
     // not using the job any more so remove it if it exists...
     Loader::model('job');
     $job = Job::getByHandle('cobble_refresh');
     if (!empty($job)) {
         $job->uninstall();
     }
 }
开发者ID:Remo,项目名称:cobble,代码行数:14,代码来源:controller.php

示例6: upgrade

 public function upgrade()
 {
     parent::upgrade();
     if (is_writable("./jobs")) {
         $job = Job::getByHandle('si_mysql_optimize');
         if ($job) {
             $job->uninstall();
         }
         @unlink("./jobs/si_mysql_optimize.php");
         // We have to uninstall the package on the upgrade because on earlier versions the job was copied in the "/job/" directory.
         // In the new version we leave it in the "job" directory in the package. But this is the only way to upgrade, because
         // otherwise we would redeclare the class (here: "/job/si_mysql_optimize.php" and there "/packages/si_mysql_optimize/jobs/si_mysql_optimize.php")
         $this->uninstall();
     }
 }
开发者ID:katzueno,项目名称:si_mysql_optimize,代码行数:15,代码来源:controller.php

示例7: upgrade

 public function upgrade()
 {
     $this->installOrUpgrade($this);
     parent::upgrade();
 }
开发者ID:jbh,项目名称:c5_boilerplate_crud,代码行数:5,代码来源:controller.php

示例8: upgrade

 public function upgrade()
 {
     $pkg = Package::getByHandle($this->pkgHandle);
     $this->installPageLinkAttribute($pkg);
     parent::upgrade();
 }
开发者ID:robchenski,项目名称:ids,代码行数:6,代码来源:controller.php

示例9: upgrade

 public function upgrade()
 {
     $fromVersion = $this->getPackageVersion();
     parent::upgrade();
     $this->installOrUpgrade($this, $fromVersion);
 }
开发者ID:mlocati,项目名称:concrete5-handle_https,代码行数:6,代码来源:controller.php

示例10: upgrade

 public function upgrade()
 {
     parent::upgrade();
     $this->pkg = Package::getByHandle('remo_composer_list');
     $this->addBlock('remo_attribute_edit');
 }
开发者ID:haeflimi,项目名称:concrete5-composer-list,代码行数:6,代码来源:controller.php


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