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


PHP Job::installByPackage方法代码示例

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


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

示例1: install

 public function install()
 {
     $pkg = parent::install();
     Loader::model("job");
     Job::installByPackage('si_mysql_optimize', $pkg);
 }
开发者ID:katzueno,项目名称:si_mysql_optimize,代码行数:6,代码来源:controller.php

示例2: importJobs

	protected function importJobs(SimpleXMLElement $sx) {
		Loader::model('job');
		if (isset($sx->jobs)) {
			foreach($sx->jobs->job as $jx) {
				$pkg = ContentImporter::getPackageObject($jx['package']);
				if (is_object($pkg)) {
					Job::installByPackage($jx['handle'], $pkg);
				} else {
					Job::installByHandle($jx['handle']);				
				}
			}
		}
	}
开发者ID:nveid,项目名称:concrete5,代码行数:13,代码来源:importer.php

示例3: installJobs

 private function installJobs($pkg)
 {
     Loader::model('job');
     //Make sure the job isn't already installed
     $dumpSample = Job::getByHandle('dump_sample_table');
     if (!is_object($dumpSample)) {
         Job::installByPackage('dump_sample_table', $pkg);
     }
 }
开发者ID:janzenz,项目名称:c5_boilerplate,代码行数:9,代码来源:controller.php

示例4: 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


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