本文整理汇总了PHP中Command::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::error方法的具体用法?PHP Command::error怎么用?PHP Command::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doesTheUserWantToOverwriteExistingFile
/**
* Ask the user is they wish to overwrite an existing file
*
* @param string $path The path that already exists
*/
public function doesTheUserWantToOverwriteExistingFile($path)
{
if (false !== $this->command->confirm("This form validator at:\n" . $path . "\nalready exists: Do you want to overwrite it? (y|N)", false)) {
// The user wants to overwrite the file so fire the process again with the force option set to true
$this->command->fire(true);
exit;
}
$this->command->error('You have chosen NOT to overwrite the file...Good choice!');
exit;
}
示例2: __new__
protected function __new__($file_path)
{
$this->cmd = def("arbo.io.FFmpeg@cmd", "/usr/local/bin/ffmpeg");
$info = Command::error(sprintf("%s -i %s", $this->cmd, $file_path));
$file = new File($file_path);
$this->name = $file->oname();
$this->ext = $file->ext();
$this->filename = $file_path;
$this->framerate = preg_match("/frame rate: .+ -> ?([\\d\\.]+)/", $info, $match) ? (double) $match[1] : null;
$this->bitrate = preg_match("/bitrate: (\\d+)/", $info, $match) ? (double) $match[1] : null;
$this->duration = preg_match("/Duration: ([\\d\\:\\.]+)/", $info, $match) ? Date::parse_time($match[1]) : null;
if (preg_match("/Video: (.+)/", $info, $match)) {
$video = explode(",", $match[1]);
if (isset($video[0])) {
$this->video_codec = trim($video[0]);
}
if (isset($video[1])) {
$this->format = trim($video[1]);
}
if (isset($video[2])) {
list($this->width, $this->height) = explode("x", trim($video[2]));
if (preg_match("/(\\d+) .+DAR (\\d+\\:\\d+)/", $this->height, $match)) {
list(, $this->height, $this->aspect) = $match;
}
}
if (empty($this->aspect) && isset($video[3])) {
$this->aspect = preg_match("/DAR (\\d+\\:\\d+)/", $video[3], $match) ? $match[1] : null;
}
}
if (preg_match("/Audio: (.+)/", $info, $match)) {
$audio = explode(",", $match[1]);
if (isset($audio[0])) {
$this->audio_codec = trim($audio[0]);
}
if (isset($audio[1])) {
$this->samplerate = preg_match("/\\d+/", $audio[1], $match) ? $match[0] : null;
}
}
$this->frame_count = ceil($this->duration * $this->framerate);
}