當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InstallUtil::runAutoBuildFromUpdateSchemaCommand方法代碼示例

本文整理匯總了PHP中InstallUtil::runAutoBuildFromUpdateSchemaCommand方法的典型用法代碼示例。如果您正苦於以下問題:PHP InstallUtil::runAutoBuildFromUpdateSchemaCommand方法的具體用法?PHP InstallUtil::runAutoBuildFromUpdateSchemaCommand怎麽用?PHP InstallUtil::runAutoBuildFromUpdateSchemaCommand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在InstallUtil的用法示例。


在下文中一共展示了InstallUtil::runAutoBuildFromUpdateSchemaCommand方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * Execute the action.
  * @param array command line parameters specific for this command
  */
 public function run($args)
 {
     set_time_limit('900');
     if (!isset($args[0])) {
         $this->usageError('A username must be specified.');
     }
     try {
         Yii::app()->user->userModel = User::getByUsername($args[0]);
     } catch (NotFoundException $e) {
         $this->usageError('The specified username does not exist.');
     }
     $group = Group::getByName(Group::SUPER_ADMINISTRATORS_GROUP_NAME);
     if (!$group->users->contains(Yii::app()->user->userModel)) {
         $this->usageError('The specified user is not a super administrator.');
     }
     $startTime = microtime(true);
     $template = "{message}\n";
     $messageStreamer = new MessageStreamer($template);
     $messageStreamer->setExtraRenderBytes(0);
     $messageStreamer->add(Zurmo::t('Commands', 'Starting schema update process.'));
     $messageLogger = new MessageLogger($messageStreamer);
     InstallUtil::runAutoBuildFromUpdateSchemaCommand($messageLogger);
     $messageStreamer->add(Zurmo::t('Commands', 'Autobuild complete, rebuilding read permissions.'));
     if (SHOW_QUERY_DATA) {
         $messageStreamer->add(PageView::getTotalAndDuplicateQueryCountContent());
     }
     ReadPermissionsOptimizationUtil::rebuild();
     $messageStreamer->add(Zurmo::t('Commands', 'Rebuild read permissions complete.'));
     $endTime = microtime(true);
     $messageStreamer->add(Zurmo::t('Commands', 'Schema update complete.'));
     $messageStreamer->add(Zurmo::t('Commands', 'Total run time: {formattedTime} seconds.', array('{formattedTime}' => number_format($endTime - $startTime, 3))));
     if (SHOW_QUERY_DATA) {
         $messageStreamer->add(PageView::getTotalAndDuplicateQueryCountContent());
     }
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:39,代碼來源:UpdateSchemaCommand.php

示例2: testRunAutoBuildFromUpdateSchemaCommand

 /**
  * @depends testRunInstallation
  */
 public function testRunAutoBuildFromUpdateSchemaCommand()
 {
     $this->runInstallation(true);
     $super = User::getByUsername('super');
     $super->primaryEmail->emailAddress = 'super@zurmo.com';
     $this->assertTrue($super->save());
     $this->assertEquals(0, EmailMessage::getCount());
     $this->assertEquals(1, Notification::getCount());
     $messageLogger = new MessageLogger();
     $messageLogger->addInfoMessage(Zurmo::t('InstallModule', 'Starting schema update process.'));
     $result = InstallUtil::runAutoBuildFromUpdateSchemaCommand($messageLogger);
     $messageLogger->addInfoMessage(Zurmo::t('InstallModule', 'Schema update complete.'));
     $this->assertTrue($result);
     //No email notification is sent since allowSendingEmail is false
     $this->assertEquals(0, EmailMessage::getCount());
     $this->assertEquals(2, Notification::getCount());
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:20,代碼來源:InstallUtilTest.php

示例3: testRunAutoBuildFromUpdateSchemaCommand

 /**
  * @depends testRunInstallation
  */
 public function testRunAutoBuildFromUpdateSchemaCommand()
 {
     $this->runInstallation(true);
     $messageLogger = new MessageLogger();
     $messageLogger->addInfoMessage(Zurmo::t('InstallModule', 'Starting schema update process.'));
     $result = InstallUtil::runAutoBuildFromUpdateSchemaCommand($messageLogger);
     $messageLogger->addInfoMessage(Zurmo::t('InstallModule', 'Schema update complete.'));
     $this->assertTrue($result);
 }
開發者ID:maruthisivaprasad,項目名稱:zurmo,代碼行數:12,代碼來源:InstallUtilTest.php


注:本文中的InstallUtil::runAutoBuildFromUpdateSchemaCommand方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。