本文整理汇总了PHP中nzedb\utility\Misc::hasCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::hasCommand方法的具体用法?PHP Misc::hasCommand怎么用?PHP Misc::hasCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nzedb\utility\Misc
的用法示例。
在下文中一共展示了Misc::hasCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realpath
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
require_once realpath(dirname(dirname(dirname(__DIR__))) . DS . 'libs' . DS . 'smarty' . DS . 'Autoloader.php');
Smarty_Autoloader::register();
use nzedb\ColorCLI;
use nzedb\Tmux;
use nzedb\db\Settings;
use nzedb\utility\Misc;
$pdo = new Settings();
$DIR = nZEDb_MISC;
$smarty = new Smarty();
$dbname = DB_NAME;
$cli = new ColorCLI();
if (isset($argv[1]) && ($argv[1] == "true" || $argv[1] == "safe")) {
$restart = (new Tmux())->stopIfRunning();
system("cd {$DIR} && git pull");
if (Misc::hasCommand("php5")) {
$PHP = "php5";
} else {
$PHP = "php";
}
echo $cli->header("Patching database - {$dbname}.");
$safe = $argv[1] === "safe" ? true : false;
system("{$PHP} " . nZEDb_ROOT . 'cli' . DS . "update_db.php true {$safe}");
// Remove folders from smarty.
$cleared = $smarty->clearCompiledTemplate();
if ($cleared) {
echo $cli->header("The smarty template cache has been cleaned for you");
} else {
echo $cli->header("You should clear your smarty template cache at: " . SMARTY_DIR . "templates_c");
}
if ($restart) {
示例2: _backupDb
protected function _backupDb()
{
if (Misc::hasCommand("php5")) {
$PHP = "php5";
} else {
$PHP = "php";
}
system("{$PHP} " . nZEDb_MISC . 'testing' . DS . 'DB' . DS . $this->_DbSystem . 'dump_tables.php db dump');
$this->backedup = true;
}