本文整理汇总了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);
}
示例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']);
}
}
}
}
示例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);
}
}
示例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);
}
}