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


PHP Job::installByHandle方法代码示例

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


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

示例1: run

 public function run()
 {
     $db = Loader::db();
     $columns = $db->MetaColumns('Pages');
     if (!isset($columns['CISSYSTEMPAGE'])) {
         $db->Execute('alter table Pages add column cIsSystemPage tinyint(1) not null default 0');
         $db->Execute('alter table Pages add index (cIsSystemPage)');
     }
     $columns = $db->MetaColumns('Pages');
     if (!isset($columns['CISACTIVE'])) {
         $db->Execute('alter table Pages add column cIsActive tinyint(1) not null default 1');
         $db->Execute('alter table Pages add index (cIsActive)');
         $db->Execute('update Pages set cIsActive = 1');
     }
     $columns = $db->MetaColumns('PageSearchIndex');
     if (!isset($columns['CREQUIRESREINDEX'])) {
         $db->Execute('alter table PageSearchIndex add column cRequiresReindex tinyint(1) not null default 0');
         $db->Execute('alter table PageSearchIndex add index (cRequiresReindex)');
     }
     // install version job
     Loader::model("job");
     Job::installByHandle('remove_old_page_versions');
     // flag system pages appropriately
     Page::rescanSystemPages();
     // add a newsflow task permission
     $db = Loader::db();
     $cnt = $db->GetOne('select count(*) from TaskPermissions where tpHandle = ?', array('view_newsflow'));
     if ($cnt < 1) {
         $g3 = Group::getByID(ADMIN_GROUP_ID);
         $tip = TaskPermission::addTask('view_newsflow', t('View Newsflow'), false);
         if (is_object($g3)) {
             $tip->addAccess($g3);
         }
     }
     // Install new block types
     $this->installBlockTypes();
     // install stacks, trash and drafts
     $this->installSinglePages();
     // move the old dashboard
     $newDashPage = Page::getByPath('/dashboard/welcome');
     if (!is_object($newDashPage) || $newDashPage->isError()) {
         $dashboard = Page::getByPath('/dashboard');
         $dashboard->moveToTrash();
         // install new dashboard + page types
         $this->installDashboard();
         $this->migrateOldDashboard();
     }
     Loader::model('system/captcha/library');
     $scl = SystemCaptchaLibrary::getByHandle('securimage');
     if (!is_object($scl)) {
         $scl = SystemCaptchaLibrary::add('securimage', t('SecurImage (Default)'));
         $scl->activate();
     }
     Config::save('SEEN_INTRODUCTION', 1);
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:55,代码来源:version_550.php

示例2: install

 function install($handle = null)
 {
     if ($handle) {
         Loader::model("job");
         Job::installByHandle($handle);
         $this->redirect('/dashboard/system/optimization/jobs', 'job_installed');
     } else {
         $this->error->add(t('No job specified.'));
     }
     $this->view();
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:11,代码来源:jobs.php

示例3: install

 function install($handle = null)
 {
     if ($handle) {
         Loader::model("job");
         Job::installByHandle($handle);
         $this->set('message', t('Job succesfully installed.'));
     } else {
         $this->error->add(t('No job specified.'));
     }
     $this->view();
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:11,代码来源:jobs.php

示例4: run

	public function run() {
		// contains all the items that have changed from 5.0.0a1 to the next version
		$db = Loader::db();
		
		// create jobs dashboard page
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('index_search');
		$d11 = SinglePage::add('/dashboard/jobs');
		if (is_object($d11)) {
			$d11->update(array('cName'=>t('Maintenance'), 'cDescription'=>t('Run common cleanup tasks.')));
		}
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:13,代码来源:version_500a1.php

示例5: run

	public function run() {
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('generate_sitemap');
		$d1 = SinglePage::add('/download_file');
		if (is_object($d1)) {
			$d1->update(array('cName'=>'Download File'));
		}
		$d2 = SinglePage::add('/dashboard/logs');
		if (is_object($d2)) {
			$d2->update(array('cName'=>'Logging', 'cDescription' => 'Keep tabs on your site.'));
		}

	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:14,代码来源:version_500b2.php

示例6: run

	public function run() {
		$j = Job::getByHandle('index_search_all');
		if (!is_object($j)) {
			Job::installByHandle('index_search_all');
		}

		$js = JobSet::getByName('Default');
		if (!is_object($js)) {
			$js = JobSet::add('Default');
		}
		$js->clearJobs();
		$jobs = Job::getList();
		foreach($jobs as $j) {
			if (!$j->supportsQueue()) {
				$js->addJob($j);	
			}
		}

		// create the view page in sitemap permission
		$rpk = PermissionKey::getByHandle('view_page');
		$vpk = PermissionKey::getByHandle('view_page_in_sitemap');
		if (!is_object($vpk)) {
			$vpk = PermissionKey::add('page', 'view_page_in_sitemap', 'View Page in Sitemap', 'View Page in Sitemap and Intelligent Search.', false, false);
		}
		// now we have to get a list of all pages in the site that have their own permissions set.
		$db = Loader::db();
		$r = $db->Execute('select cID from Pages where cInheritPermissionsFrom = "OVERRIDE" order by cID asc');
		while ($row = $r->Fetchrow()) {
			$c = Page::getByID($row['cID']);
			if (is_object($c) && !$c->isError()) {
				$rpk->setPermissionObject($c);
				$vpk->setPermissionObject($c);
				$rpa = $rpk->getPermissionAccessObject();
				if (is_object($rpa)) {
					$pt = $vpk->getPermissionAssignmentObject();
					if (is_object($pt)) {
						$pt->clearPermissionAssignment();
						$pt->assignPermissionAccess($rpa);						
					}
				}
			}
		}
	}
开发者ID:ronlobo,项目名称:concrete5,代码行数:43,代码来源:version_562.php

示例7: updateJobs

 protected function updateJobs()
 {
     $this->output(t('Updating jobs...'));
     if (!($job = \Job::getByHandle('update_statistics'))) {
         \Job::installByHandle('update_statistics');
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:7,代码来源:Version20160725000000.php

示例8: run

	public function run() {
		$db = Loader::db();
		
		Cache::disableLocalCache();
		Loader::model('attribute/categories/collection');
		Loader::model('attribute/categories/file');
		Loader::model('attribute/categories/user');
		$collectionErrors = array();
		$fileErrors = array();
		$userErrors = array();
		//add the new collection attribute keys
		$this->installCoreAttributeItems();	
		
		$dict = NewDataDictionary($db->db, DB_TYPE);
		$tables = $db->MetaTables();
		
		if (in_array('_CollectionAttributeKeys', $tables)) {
			$collectionErrors = $this->upgradeCollectionAttributes();
		}		
		if (in_array('_FileAttributeKeys', $tables)) {
			$fileErrors = $this->upgradeFileAttributes();
		}			
		if (in_array('_UserAttributeKeys', $tables)) {
			$userErrors = $this->upgradeUserAttributes();
		} 

		$cak=CollectionAttributeKey::getByHandle('exclude_sitemapxml');
		if (!is_object($cak)) {
			$cak = CollectionAttributeKey::add('exclude_sitemapxml', t('Exclude From sitemap.xml'), true, null, 'BOOLEAN');
		}
		
		//change the page/tab name of the dashboard users registration page
		$dashboardRegistrationPage=Page::getByPath('/dashboard/users/registration');
		if( intval($dashboardRegistrationPage->cID) ) 
			$dashboardRegistrationPage->update(array('cName'=>t('Login & Registration')));
		Config::save('LOGIN_ADMIN_TO_DASHBOARD', 1);
	
		//profile friends page install	
		Loader::model('single_page');
		$friendsPage=Page::getByPath('/profile/friends');
		if( !intval($friendsPage->cID)) {
			SinglePage::add('/profile/friends');
		}

		$membersPage =Page::getByPath('/members');
		if( !intval($membersPage->cID)) {
			SinglePage::add('/members');
		}

		$messagesPage =Page::getByPath('/profile/messages');
		if( !intval($messagesPage->cID)) {
			SinglePage::add('/profile/messages');
		}
		
		$ppme = UserAttributeKey::getByHandle('profile_private_messages_enabled');
		if (!is_object($ppme)) {
			UserAttributeKey::add('BOOLEAN', array('akHandle' => 'profile_private_messages_enabled', 'akName' => t('I would like to receive private messages.'), 'akIsSearchable' => true));
		}
		$ppmne = UserAttributeKey::getByHandle('profile_private_messages_notification_enabled');
		if (!is_object($ppmne)) {
			UserAttributeKey::add('BOOLEAN', array('akHandle' => 'profile_private_messages_notification_enabled', 'akName' => t('Send me email notifications when I receive a private message.'), 'akIsSearchable' => true));
		}
		
		$em = Page::getByPath('/dashboard/settings');
		if (!$em->isError()) {
			$em = SinglePage::getByID($em->getCollectionID());
			$em->refresh();
		}
		
		$em1=Page::getByPath('/dashboard/settings/mail');
		if ($em1->isError()) {
			$em1 = SinglePage::add('/dashboard/settings/mail');
			$em1->update(array('cName'=>t('Email'), 'cDescription'=>t('Enable post via email and other settings.')));
		}

		// remove adodb database logs
		$databaseReports = Page::getByPath('/dashboard/reports/database');
		if (!$databaseReports->isError()) {
			$databaseReports->delete();
		}
		if (in_array('adodb_logsql', $tables)) {			
			@$db->query('DROP TABLE adodb_logsql');	
		}
		
		Loader::library('mail/importer');
		$mi = MailImporter::getByHandle("private_message");
		if (!is_object($mi)) {
			MailImporter::add(array('miHandle' => 'private_message'));
		}

		Loader::model("job");
		Job::installByHandle('process_email');		

		Cache::enableLocalCache();
	
		return array_merge($collectionErrors, $fileErrors, $userErrors);
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:97,代码来源:version_532.php

示例9: flush

    }
    echo 'Done<br/>';
    flush();
    ob_flush();
}
// install jobs
echo '<br/>';
echo 'Installing jobs... <br/>';
$jobs = array('stat_user_activities');
foreach ($jobs as $j) {
    $jb = Job::getByHandle($j);
    if (is_object($jb)) {
        echo "Job {$j} had been installed; skip intalling. <br/>";
    } else {
        #Job::installByPackage($j, $pkg);
        Job::installByHandle($j);
        echo "Job {$j} newly installed. <br/>";
    }
    flush();
    ob_flush();
}
// Apply full_stack_style as the site theme
echo '<br/>';
echo 'Applying full_stack_style as site theme...';
$pt = PageTheme::getByHandle('full_stack_style');
$pt->applyToSite();
echo 'Done.<br/>';
// Install event extends here
#Events::extend('on_start', 'FSENLocalization', 'setupInterfaceLocalization4Request', 'models/fsen_localization.php');
#Events::extend('on_before_render', 'FSENLocalization', 'setupInterfaceLocalization4Page', 'models/fsen_localization.php');
// Apply page type for HOME page
开发者ID:rratcliffe,项目名称:fsen,代码行数:31,代码来源:install.php

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

示例11: install

 function install()
 {
     $jobObj = Loader::model("job");
     Job::installByHandle($_POST['jHandle']);
     $this->redirect('/dashboard/system/jobs');
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:6,代码来源:jobs.php


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