本文整理匯總了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));
}
示例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();
}
}
示例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');
}
示例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();
}
}
示例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;
}