本文整理汇总了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;
}
示例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();
示例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;
}
}
示例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");
}