本文整理汇总了PHP中newznab\db\Settings::isDbVersionAtLeast方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::isDbVersionAtLeast方法的具体用法?PHP Settings::isDbVersionAtLeast怎么用?PHP Settings::isDbVersionAtLeast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类newznab\db\Settings
的用法示例。
在下文中一共展示了Settings::isDbVersionAtLeast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require_once dirname(__FILE__) . '/../../../www/config.php';
use newznab\db\Settings;
$cli = new ColorCLI();
$pdo = new Settings(['checkVersion' => true]);
$ftinnodb = $pdo->isDbVersionAtLeast('5.6');
if (isset($argv[1]) && isset($argv[2]) && $argv[2] == "fmyisam") {
$tbl = $argv[1];
printf($cli->header("Converting {$tbl}"));
$pdo->queryExec("ALTER TABLE {$tbl} ENGINE=MYISAM ROW_FORMAT=FIXED");
} else {
if (isset($argv[1]) && isset($argv[2]) && $argv[2] == "dmyisam") {
$tbl = $argv[1];
printf($cli->header("Converting {$tbl}"));
$pdo->queryExec("ALTER TABLE {$tbl} ENGINE=MYISAM ROW_FORMAT=DYNAMIC");
} else {
if (isset($argv[1]) && isset($argv[2]) && $argv[2] == "cinnodb") {
$tbl = $argv[1];
if ($ftinnodb || !$ftinnodb && $tbl !== 'releasesearch' && $tbl !== 'bookinfo' && $tbl !== 'consoleinfo' && $tbl !== 'musicinfo') {
printf($cli->header("Converting {$tbl}"));
$pdo->queryExec("ALTER TABLE {$tbl} ENGINE=INNODB ROW_FORMAT=COMPRESSED");
} else {
printf($cli->header("Not converting bookinfo / consoleinfo / musicinfo / releasesearch as your INNODB version does not support fulltext indexes"));
}
} else {
if (isset($argv[1]) && isset($argv[2]) && $argv[2] == "dinnodb") {
$tbl = $argv[1];
if ($ftinnodb || !$ftinnodb && $tbl !== 'releasesearch' && $tbl !== 'bookinfo' && $tbl !== 'consoleinfo' && $tbl !== 'musicinfo') {
printf($cli->header("Converting {$tbl}"));
$pdo->queryExec("ALTER TABLE {$tbl} ENGINE=INNODB ROW_FORMAT=DYNAMIC");