本文整理匯總了PHP中IO::getVerboseLevel方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::getVerboseLevel方法的具體用法?PHP IO::getVerboseLevel怎麽用?PHP IO::getVerboseLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::getVerboseLevel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createTar
public function createTar($root, $name, $separate = null)
{
if (file_exists($root . '/' . $name . "_" . date('Ymd') . ".tar.bz2")) {
$filename = $name . "_" . date('Ymd_H_i_s') . '.tar';
} else {
$filename = $name . "_" . date('Ymd') . '.tar';
}
//$cmd="tar -cvf ".$root."/".$filename." ".$root." --exclude='*web*' --exclude='*~'";
chdir($root);
IO::out('Packing main... ' . "\t", false);
if ($this->all) {
$cmd = "tar --exclude='.svn' --exclude='*~' -cvf " . $root . "/" . $filename . " * 2>&1";
} else {
$cmd = "tar --exclude='web' --exclude='.svn' --exclude='*~' -cvf " . $root . "/" . $filename . " * 2>&1";
}
exec($cmd, $out, $return);
if ($return == 0) {
io::done();
}
if (IO::getVerboseLevel() == IO::MESSAGE_INFO || $return) {
foreach ($out as $o) {
io::out($o);
}
}
if ($return) {
io::out('Return code ' . $return, IO::MESSAGE_FAIL);
io::out('Executed command: ' . $cmd);
return;
}
if (!$this->all) {
$cmd = "tar --exclude='*~' --exclude='.svn' -uvf " . $root . "/" . $filename . " ./web/css/ ./web/js/ 2>&1";
io::out('Adding web/css, web/js...', false);
exec($cmd, $out, $return);
if ($return == 0 && !$this->all) {
io::done();
}
if (IO::getVerboseLevel() == IO::MESSAGE_INFO || $return) {
foreach ($out as $o) {
io::out($o);
}
}
if ($return) {
io::out('Return code ' . $return, IO::MESSAGE_FAIL);
io::out('Executed command: ' . $cmd);
return;
}
}
io::out('Bzip ' . $filename . '...', false);
$cmd = "bzip2 -9 " . $root . "/" . $filename;
exec($cmd, $out, $return);
if ($return == 0) {
io::done();
}
if (IO::getVerboseLevel() == IO::MESSAGE_INFO || $return) {
foreach ($out as $o) {
io::out($o);
}
}
if ($return) {
io::out('Return code ' . $return, IO::MESSAGE_FAIL);
io::out('Executed command: ' . $cmd);
return;
}
return $filename . ".bz2";
}