本文整理汇总了PHP中InstallUtil类的典型用法代码示例。如果您正苦于以下问题:PHP InstallUtil类的具体用法?PHP InstallUtil怎么用?PHP InstallUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InstallUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkService
protected function checkService()
{
$passed = true;
$applicationLogWritable = InstallUtil::isApplicationLogRuntimeWritable(INSTANCE_ROOT);
if ($applicationLogWritable) {
$this->message = Zurmo::t('InstallModule', 'The application.log runtime file is writable.');
} else {
$this->message = Zurmo::t('InstallModule', 'The application.log runtime file is not writable.');
$passed = false;
}
if (!extension_loaded('apc')) {
$minScriptCacheDirectoryWritable = InstallUtil::isMinScriptCacheRuntimeDirectoryWritable(INSTANCE_ROOT);
if ($minScriptCacheDirectoryWritable) {
$this->message .= "\n" . Zurmo::t('InstallModule', 'The /minScript/cache runtime directory is writable.');
} else {
$this->message .= "\n" . Zurmo::t('InstallModule', 'The /minScript/cache runtime directory is not writable.');
$passed = false;
}
}
$debugExists = InstallUtil::doesDebugConfigExist(INSTANCE_ROOT);
if ($debugExists) {
$this->message .= "\n" . Zurmo::t('InstallModule', 'The debug.php file is present.');
} else {
$this->message .= "\n" . Zurmo::t('InstallModule', 'The debug.php file is not present.');
$passed = false;
}
return $passed;
}
示例2: 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());
}
}
示例3: testSaveAllMetadata
public function testSaveAllMetadata()
{
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
$this->assertTrue(ContactsModule::loadStartingData());
$messageLogger = new MessageLogger();
InstallUtil::autoBuildDatabase($messageLogger, true);
chdir(COMMON_ROOT . DIRECTORY_SEPARATOR . 'protected' . DIRECTORY_SEPARATOR . 'commands');
$command = "php zurmocTest.php manageMetadata super saveAllMetadata";
if (!IS_WINNT) {
$command .= ' 2>&1';
}
exec($command, $output);
// Check if data are saved for some specific View
$moduleMetadata = ZurmoRedBean::getRow("SELECT * FROM globalmetadata WHERE classname='NotesModule'");
$this->assertTrue($moduleMetadata['id'] > 0);
$this->assertTrue(strlen($moduleMetadata['serializedmetadata']) > 0);
// Check if data are saved for some specific View
$modelMetadata = ZurmoRedBean::getRow("SELECT * FROM globalmetadata WHERE classname='Note'");
$this->assertTrue($modelMetadata['id'] > 0);
$this->assertTrue(strlen($modelMetadata['serializedmetadata']) > 0);
// Check if data are saved for some specific View
$viewMetadata = ZurmoRedBean::getRow("SELECT * FROM globalmetadata WHERE classname='ContactsListView'");
$this->assertTrue($viewMetadata['id'] > 0);
$this->assertTrue(strlen($viewMetadata['serializedmetadata']) > 0);
}
示例4: renderControlEditable
protected function renderControlEditable()
{
assert('$this->model instanceof ImportWizardForm');
assert('$this->attribute == null');
$existingFilesInformation = array();
if (!empty($this->model->fileUploadData)) {
$existingFilesInformation[] = $this->model->fileUploadData;
$existingFilesInformation[0]['id'] = $this->model->id;
}
$content = $this->renderDelimiterAndEnclosureContent($existingFilesInformation);
$inputNameAndId = $this->getEditableInputId('file');
$beforeUploadAction = "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').attr('readonly', true);";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').addClass('readonly-field');";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').attr('readonly', true);";
$beforeUploadAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').addClass('readonly-field');";
$afterDeleteAction = "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').removeAttr('readonly');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnDelimiter')}').removeClass('readonly-field');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').removeAttr('readonly');";
$afterDeleteAction .= "\$('#{$this->getEditableInputId('rowColumnEnclosure')}').removeClass('readonly-field');";
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("filesElement");
$cClipWidget->widget('application.core.widgets.FileUpload', array('uploadUrl' => Yii::app()->createUrl("import/default/uploadFile", array('filesVariableName' => $inputNameAndId, 'id' => $this->model->id)), 'deleteUrl' => Yii::app()->createUrl("import/default/deleteFile"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'fileId', 'formName' => $this->form->id, 'existingFiles' => $existingFilesInformation, 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'beforeUploadAction' => $beforeUploadAction, 'afterDeleteAction' => $afterDeleteAction));
$cClipWidget->endClip();
$content .= '<tr><td></td><td colspan="3"><div class="file-upload-box">' . $cClipWidget->getController()->clips['filesElement'] . '</div></td></tr>';
return $content;
}
示例5: renderImagesUploadInput
protected function renderImagesUploadInput()
{
$inputNameAndId = 'file';
$cClipWidget = new CClipWidget();
$cClipWidget->beginClip("imageFilesElement");
$cClipWidget->widget('application.core.widgets.ImageFileUpload', array('uploadUrl' => Yii::app()->createUrl("zurmo/imageModel/upload"), 'deleteUrl' => Yii::app()->createUrl("zurmo/imageModel/delete"), 'inputName' => $inputNameAndId, 'inputId' => $inputNameAndId, 'hiddenInputName' => 'filesIds', 'allowMultipleUpload' => true, 'existingFiles' => array(), 'maxSize' => (int) InstallUtil::getMaxAllowedFileSize(), 'showMaxSize' => true, 'id' => __CLASS__, 'onSuccessAction' => "\$('#{$this->listViewGridId}').yiiGridView('update');", 'formData' => "{'" . Yii::app()->request->csrfTokenName . "' : '" . Yii::app()->request->csrfToken . "'}"));
$cClipWidget->endClip();
return $cClipWidget->getController()->clips['imageFilesElement'];
}
示例6: checkService
protected function checkService()
{
$passed = InstallUtil::isPdoInstalled();
if ($passed) {
$this->message = Zurmo::t('InstallModule', 'pdo is installed.');
} else {
$this->message = Zurmo::t('InstallModule', 'pdo is not installed.');
}
return $passed;
}
示例7: checkService
protected function checkService()
{
$passed = true;
if (!InstallUtil::isFileUploadsOn()) {
$this->message = Zurmo::t('InstallModule', 'PHP file_uploads is Off. This should be on.');
$passed = false;
} else {
$this->message = Zurmo::t('InstallModule', 'PHP file_uploads is on which is ok.');
}
return $passed;
}
示例8: checkService
protected function checkService()
{
$passed = false;
if (InstallUtil::checkDatabaseLoadLocalInFile('mysql', $this->form->databaseHostname, $this->form->databaseUsername, $this->form->databasePassword, $this->form->databasePort)) {
$this->message = Zurmo::t('InstallModule', 'Database supports LOAD LOCAL INFILE.');
$passed = true;
} else {
$this->message = Zurmo::t('InstallModule', 'Database does not support LOAD LOCAL INFILE.');
}
return $passed;
}
示例9: checkService
protected function checkService()
{
$isMcryptInstalled = InstallUtil::isMcryptInstalled();
if ($isMcryptInstalled) {
$this->message = Zurmo::t('InstallModule', 'Mcrypt extension is loaded.');
return true;
} else {
$this->message = Zurmo::t('InstallModule', 'Mcrypt extension is not loaded.');
return false;
}
}
示例10: checkService
protected function checkService()
{
$ctypeInstalled = InstallUtil::checkCtype();
if ($ctypeInstalled) {
$this->message = Zurmo::t('InstallModule', 'Ctype extension is loaded.');
return true;
} else {
$this->message = Zurmo::t('InstallModule', 'Ctype extension is not loaded.');
return false;
}
}
示例11: checkService
protected function checkService()
{
$allPassed = false;
if (InstallUtil::checkPhpTimezoneSetting()) {
$this->message = Zurmo::t('InstallModule', 'PHP date.timezone is set.');
return true;
} else {
$this->message = Zurmo::t('InstallModule', 'PHP date.timezone is not set.');
return true;
}
}
示例12: checkService
protected function checkService()
{
$soapInstalled = InstallUtil::checkSoap();
if ($soapInstalled) {
$this->message = Zurmo::t('InstallModule', 'SOAP is installed.');
return true;
} else {
$this->message = Zurmo::t('InstallModule', 'SOAP is not installed.');
return false;
}
}
示例13: testCreateSystemUser
/**
* test create system user
*/
public function testCreateSystemUser()
{
$user = InstallUtil::createSystemUser('testsystemuser', 'test');
$id = $user->id;
$user->forget();
unset($user);
$user = User::getById($id);
$this->assertTrue((bool) $user->isSystemUser);
$this->assertTrue((bool) $user->hideFromSelecting);
$this->assertTrue((bool) $user->hideFromLeaderboard);
}
示例14: getListContents
public function getListContents($iRowStart = 0, $iRowCount = null)
{
$aResult = array();
$aInstaller = InstallUtil::loadYamlFile(BASE_DIR . '/' . DIRNAME_MODULES . '/admin/installer/installer_options.yml');
foreach ($aInstaller['options'] as $sSectionName => $aOptions) {
$aResult[] = array('action' => $sSectionName, 'title' => TranslationPeer::getString('wns.backup.' . $sSectionName, null, StringUtil::makeReadableName($sSectionName)));
}
if ($iRowCount === null) {
$iRowCount = count($aResult);
}
return array_splice($aResult, $iRowStart, $iRowCount);
}
示例15: checkService
protected function checkService()
{
$message = '';
$serverVariableAccesible = InstallUtil::checkServerVariable($message);
if ($serverVariableAccesible) {
$this->message = Zurmo::t('InstallModule', '$_SERVER is accessible.');
return true;
} else {
$this->message = $message;
return false;
}
}