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


PHP Installer::checkVersion方法代碼示例

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


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

示例1: testInstallerCheckVersion

 public function testInstallerCheckVersion()
 {
     $this->assertTrue(Installer::checkVersion());
     $this->assertFalse(Installer::checkVersion('4'));
     $ver = Installer::getRequiredVersion();
     $ver = $ver['php'] + 0.1;
     $this->assertTrue(Installer::checkVersion($ver));
 }
開發者ID:unruthless,項目名稱:ThinkUp,代碼行數:8,代碼來源:TestOfInstaller.php

示例2: step1

 /**
  * Step 1 - Check system requirements
  */
 private function step1()
 {
     $this->setViewTemplate('install.step1.tpl');
     // php version check
     $php_compat = false;
     if ($this->installer->checkVersion()) {
         $php_compat = true;
     }
     $this->addToView('php_compat', $php_compat);
     $requiredVersion = $this->installer->getRequiredVersion();
     $this->addToView('php_required_version', $requiredVersion['php']);
     // libs check
     if (isset($this->reqs)) {
         //testing only
         $libs = $this->installer->checkDependency($this->reqs);
     } else {
         $libs = $this->installer->checkDependency();
     }
     $libs_compat = true;
     foreach ($libs as $lib) {
         if (!$lib) {
             $libs_compat = false;
         }
     }
     $this->addToView('libs', $libs);
     // path permissions check
     $permissions = $this->installer->checkPermission();
     $this->addToView('permission', $permissions);
     $permissions_compat = true;
     foreach ($permissions as $perm) {
         if (!$perm) {
             $permissions_compat = false;
         }
     }
     $this->addToView('permissions_compat', $permissions_compat);
     $this->addToView('writable_data_directory', FileDataManager::getDataPath());
     // session save path permissions check
     $session_permissions_compat = $this->installer->isSessionDirectoryWritable();
     $this->addToView('session_permissions_compat', $session_permissions_compat);
     $this->addToView('writable_session_save_directory', ini_get('session.save_path'));
     // other vars set to view
     $requirements_met = $php_compat && $libs_compat && $permissions_compat && $session_permissions_compat;
     $this->addToView('requirements_met', $requirements_met);
     $this->addToView('subtitle', 'Check System Requirements');
     //If all requirements are met, go to step 2
     if ($requirements_met) {
         $this->addSuccessMessage("<strong>Great!</strong> Your system has everything it needs to run ThinkUp.", null, true);
         $this->step2();
     }
 }
開發者ID:jkuehl-carecloud,項目名稱:ThinkUp,代碼行數:53,代碼來源:class.InstallerController.php

示例3: step1

 /**
  * Step 1 - Check system requirements
  */
 private function step1()
 {
     $this->setViewTemplate('install.step1.tpl');
     // php version check
     $php_compat = 0;
     if ($this->installer->checkVersion()) {
         $php_compat = 1;
     }
     $this->addToView('php_compat', $php_compat);
     $requiredVersion = $this->installer->getRequiredVersion();
     $this->addToView('php_required_version', $requiredVersion['php']);
     // libs check
     $libs = $this->installer->checkDependency();
     $libs_compat = true;
     foreach ($libs as $lib) {
         if (!$lib) {
             $libs_compat = false;
         }
     }
     $this->addToView('libs', $libs);
     // path permissions check
     $permissions = $this->installer->checkPermission();
     $this->addToView('permission', $permissions);
     $permissions_compat = true;
     foreach ($permissions as $perm) {
         if (!$perm) {
             $permissions_compat = false;
         }
     }
     $this->addToView('permissions_compat', $permissions_compat);
     $writeable_directories = array('compiled_view' => $this->view_mgr->compile_dir, 'cache' => $this->view_mgr->compile_dir . 'cache');
     $this->addToView('writeable_directories', $writeable_directories);
     // other vars set to view
     $requirements_met = $php_compat && $libs_compat && $permissions_compat;
     $this->addToView('requirements_met', $requirements_met);
     $this->addToView('subtitle', 'Check System Requirements');
 }
開發者ID:rayyan,項目名稱:ThinkUp,代碼行數:40,代碼來源:class.InstallerController.php

示例4: step1

 /**
  * Step 1 - Check system requirements
  */
 private function step1()
 {
     $this->setViewTemplate('install.step1.tpl');
     // php version check
     $php_compat = false;
     if ($this->installer->checkVersion()) {
         $php_compat = true;
     }
     $this->addToView('php_compat', $php_compat);
     $requiredVersion = $this->installer->getRequiredVersion();
     $this->addToView('php_required_version', $requiredVersion['php']);
     // libs check
     if (isset($this->reqs)) {
         //testing only
         $libs = $this->installer->checkDependency($this->reqs);
     } else {
         $libs = $this->installer->checkDependency();
     }
     $libs_compat = true;
     foreach ($libs as $lib) {
         if (!$lib) {
             $libs_compat = false;
         }
     }
     $this->addToView('libs', $libs);
     // path permissions check
     $permissions = $this->installer->checkPermission();
     $this->addToView('permission', $permissions);
     $permissions_compat = true;
     foreach ($permissions as $perm) {
         if (!$perm) {
             $permissions_compat = false;
         }
     }
     $this->addToView('permissions_compat', $permissions_compat);
     $writeable_directories = array('compiled_view' => $this->view_mgr->compile_dir, 'cache' => $this->view_mgr->compile_dir . 'cache');
     $this->addToView('writeable_directories', $writeable_directories);
     // other vars set to view
     $requirements_met = $php_compat && $libs_compat && $permissions_compat;
     $this->addToView('requirements_met', $requirements_met);
     $this->addToView('subtitle', 'Check System Requirements');
     //If all requirements are met, go to step 2
     if ($requirements_met) {
         $this->addSuccessMessage("<strong>Great!</strong> Your system has everything it needs to run ThinkUp.", null, true);
         $this->step2();
     }
 }
開發者ID:randi2kewl,項目名稱:ThinkUp,代碼行數:50,代碼來源:class.InstallerController.php

示例5: tpl_close

        <option value="luxembourg">Luxembourg</option>
        <option value="united_kingdom">United Kingdom</option>
    </select>
    <?php 
    \Pasteque\form_send();
    ?>
</form>
<?php 
    tpl_close();
}
function show_downgrade($dbVer)
{
    tpl_open();
    ?>
<h1>Incompatible version</h1>
<p>Please update your server.</p>
<?php 
    tpl_close();
}
$dbVer = Installer::getVersion();
switch (Installer::checkVersion($dbVer)) {
    case Installer::NEED_DB_UPGRADE:
        show_update($dbVer);
        die;
    case Installer::NEED_DB_DOWNGRADE:
        show_dowgrade($dbVer);
        die;
    case Installer::DB_NOT_INSTALLED:
        show_install();
        die;
}
開發者ID:booko,項目名稱:pasteque-server,代碼行數:31,代碼來源:install.php


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