本文整理匯總了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());
}
}
示例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());
}
示例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);
}