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


PHP InstallUtil类代码示例

本文整理汇总了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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:28,代码来源:FilePermissionsAfterInstallServiceHelper.php

示例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());
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:39,代码来源:UpdateSchemaCommand.php

示例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);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:26,代码来源:ManageMetadataCommandTest.php

示例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;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:26,代码来源:ImportFileUploadElement.php

示例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'];
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:9,代码来源:ImageFilesUploadView.php

示例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;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:PdoServiceHelper.php

示例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;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:11,代码来源:PhpFileUploadsServiceHelper.php

示例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;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:DatabaseCheckLoadLocalInFileServiceHelper.php

示例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;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:McryptServiceHelper.php

示例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;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:CtypeServiceHelper.php

示例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;
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:11,代码来源:PhpTimeZoneServiceHelper.php

示例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;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:SoapServiceHelper.php

示例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);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:14,代码来源:InstallUtilMiscTest.php

示例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);
 }
开发者ID:rapila,项目名称:cms-base,代码行数:12,代码来源:InstallerAdminModule.php

示例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;
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:12,代码来源:ServerVariableServiceHelper.php


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