本文整理匯總了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;
}