当前位置: 首页>>代码示例>>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;未经允许,请勿转载。