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


PHP Installer::getVersion方法代码示例

本文整理汇总了PHP中Installer::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::getVersion方法的具体用法?PHP Installer::getVersion怎么用?PHP Installer::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Installer的用法示例。


在下文中一共展示了Installer::getVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: Installer

$installer = new Installer();
// check if app was installed
if ($installer->isInstalled() && !isset($_SESSION['install']['installProcess'])) {
    $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $url = preg_replace('/install\\/?/', '', $url, 1);
    $url = strtok($url, '#');
    $url = strtok($url, '?');
    header("Location: {$url}");
    exit;
} else {
    // double check if infinite loop
    $_SESSION['install']['installProcess'] = true;
}
$smarty->caching = false;
$smarty->setTemplateDir('install/core/tpl');
$smarty->assign("version", $installer->getVersion());
$smarty->assign("langs", $langs);
$smarty->assign("langsJs", json_encode($langs));
// include actions and set tpl name
switch ($action) {
    case 'main':
        $languageList = $installer->getLanguageList();
        $smarty->assign("languageList", $languageList);
        break;
    case 'step3':
    case 'errors':
    case 'setupConfirmation':
        $smarty->assign("apiPath", $systemHelper->getApiPath());
        $modRewriteUrl = $systemHelper->getModRewriteUrl();
        $smarty->assign("modRewriteUrl", $modRewriteUrl);
        $serverType = $systemHelper->getServerType();
开发者ID:mehulsbhatt,项目名称:espocrm,代码行数:31,代码来源:index.php

示例3: checkVersion

 static function checkVersion($dbVer = null)
 {
     if ($dbVer === null) {
         $dbVer = Installer::getVersion();
     }
     if ($dbVer === null) {
         // Search for an old lvl4 "postech"
         $dbVer = Installer::getVersion("postech");
     }
     if ($dbVer !== null) {
         if (intval($dbVer) < intval(PT::DB_LEVEL)) {
             return Installer::NEED_DB_UPGRADE;
         } else {
             if (intval($dbVer) > intval(PT::DB_LEVEL)) {
                 return Installer::NEED_DB_DOWNGRADE;
             } else {
                 return Installer::OK;
             }
         }
     } else {
         return Installer::DB_NOT_INSTALLED;
     }
 }
开发者ID:booko,项目名称:pasteque-server,代码行数:23,代码来源:Installer.php

示例4: testInstallUnitedKingdom

 /** @depends testInstallStruct */
 public function testInstallUnitedKingdom()
 {
     Installer::install("united_kingdom");
     $pdo = PDOBuilder::getPDO();
     $this->assertEquals(PT::DB_LEVEL, Installer::getVersion(), "Version doesn't match");
     // Check data insert
     $sql = "SELECT * FROM PLACES WHERE ID = '10'";
     $stmt = $pdo->prepare($sql);
     $this->assertNotEquals(false, $stmt->execute(), "Query failed");
     $row = $stmt->fetch();
     $this->assertEquals("Table 10", $row['NAME'], "Country data failed to be inserted");
     $sql = "SELECT * FROM CASHREGISTERS";
     $stmt = $pdo->prepare($sql);
     $this->assertNotEquals(false, $stmt->execute(), "Query failed");
     $row = $stmt->fetch();
     $this->assertEquals("Till", $row['NAME'], "Cash register failed to be inserted");
 }
开发者ID:booko,项目名称:pasteque-server,代码行数:18,代码来源:InstallDbTest.php


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