本文整理汇总了PHP中Cli::pinfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Cli::pinfo方法的具体用法?PHP Cli::pinfo怎么用?PHP Cli::pinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cli
的用法示例。
在下文中一共展示了Cli::pinfo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
$bdd = Bdd::getInstance();
$filename = DATA_DIR . "/data.json";
Cli::pinfo("Import {$filename} in database");
$data = json_decode(file_get_contents($filename));
$bdd->import($data);
}
示例2: skelUpdate
public function skelUpdate()
{
Cli::enableHelp();
Cli::pinfo("Update CF project");
$srcdir = $this->getDir() . DIRECTORY_SEPARATOR . "project";
$dstdir = ROOT_DIR;
foreach (array("index.php", "setup", "README.md", ".htaccess", ".gitignore", "www/index.php", "www/.htaccess") as $file) {
copy($srcdir . DIRECTORY_SEPARATOR . $file, $dstdir . DIRECTORY_SEPARATOR . $file);
}
$this->updateFiles();
chmod(getcwd() . DIRECTORY_SEPARATOR . "setup", 0755);
System::ensureDir(DATA_DIR);
Cli::update();
}
示例3: install
public function install()
{
Cli::pinfo(" * Create database structure");
$bdd = Bdd::getInstance();
if (is_dir(self::MODEL_DIR)) {
if ($dh = opendir(self::MODEL_DIR)) {
while (($file = readdir($dh)) !== false) {
if (substr($file, -15) == "Model.class.php" && substr($file, 0, 4) != "Base") {
$class = __NAMESPACE__ . "\\" . substr($file, 0, -10);
$model = new $class();
$bdd->dropTable($model->getTableName());
$model->createTable();
}
}
closedir($dh);
}
}
}
示例4: minify_images
public static function minify_images()
{
$path = Cli::addOption("path", WWW_PATH, "Path where to find images");
$norun = Cli::addSwitch("n", "Do not run the scripts, only print files to process");
Cli::enableHelp();
Cli::pinfo("Minify images");
foreach (self::globRecursive($path . "/*.[pP][nN][gG]", GLOB_NOSORT) as $png) {
Cli::pinfo(" * {$png}");
$output = "";
$return_var = -1;
$cmd = "pngcrush -ow -brute -reduce {$png}";
if ($norun) {
Logger::Debug(" > {$cmd}");
} else {
exec("{$cmd} 2>& 1", $output, $return_var);
if ($return_var != 0) {
Cli::perr(implode($output, "\n"));
} else {
Logger::Debug(implode($output, "\n"));
}
}
}
foreach (self::globRecursive($path . "/{*.[jJ][pP][gG], *.[jJ][pP][eE][gG]}", GLOB_BRACE | GLOB_NOSORT) as $jpg) {
Cli::pinfo(" * {$jpg}");
$output = "";
$return_var = -1;
$cmd = "jpegoptim -s -v -v {$jpg}";
if ($norun) {
Logger::Debug(" > {$cmd}");
} else {
exec("{$cmd} 2>& 1", $output, $return_var);
if ($return_var != 0) {
Cli::perr(implode($output, "\n"));
} else {
Logger::Debug(implode($output, "\n"));
}
}
}
}
示例5: update
public function update()
{
Cli::pinfo(" * install Angular");
System::publish($this->getDir() . "/www/vendor/angular/i18n");
}
示例6: cliImport
public static function cliImport($args)
{
$files = Cli::getInputs("files", "file names to import");
Cli::enableHelp();
$bdd = self::getInstance();
foreach ($files as $filename) {
Cli::pinfo("Import {$filename} in database");
$data = json_decode(file_get_contents($filename));
$bdd->import($data);
}
}