当前位置: 首页>>代码示例>>PHP>>正文


PHP Color::colorize方法代码示例

本文整理汇总了PHP中Phalcon\Script\Color::colorize方法的典型用法代码示例。如果您正苦于以下问题:PHP Color::colorize方法的具体用法?PHP Color::colorize怎么用?PHP Color::colorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phalcon\Script\Color的用法示例。


在下文中一共展示了Color::colorize方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getHelp

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Creates a module') . PHP_EOL . PHP_EOL;
     print Color::head('Example') . PHP_EOL;
     print Color::colorize('  phalcon module backend', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     $this->printParameters($this->getPossibleParams());
 }
开发者ID:VyacheslavLynnyk,项目名称:scripts,代码行数:13,代码来源:Module.php

示例2: getHelp

 /**
  * Prints the help for current command.
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Creates a controller') . PHP_EOL . PHP_EOL;
     print Color::head('Usage:') . PHP_EOL;
     print Color::colorize('  controller [name] [directory]', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Arguments:') . PHP_EOL;
     print Color::colorize('  ?', Color::FG_GREEN);
     print Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     $this->printParameters($this->_possibleParameters);
 }
开发者ID:doit76,项目名称:phalcon-devtools,代码行数:16,代码来源:Controller.php

示例3: getHelp

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Creates a scaffold from a database table') . PHP_EOL . PHP_EOL;
     print Color::head('Usage:') . PHP_EOL;
     print Color::colorize('  scaffold [tableName] [options]', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Arguments:') . PHP_EOL;
     print Color::colorize('  help', Color::FG_GREEN);
     print Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     $this->printParameters($this->getPossibleParams());
 }
开发者ID:VyacheslavLynnyk,项目名称:scripts,代码行数:16,代码来源:Scaffold.php

示例4: getHelp

 /**
  * Prints help on the usage of the command
  *
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Enables/disables webtools in a project') . PHP_EOL . PHP_EOL;
     print Color::head('Usage:') . PHP_EOL;
     print Color::colorize('  webtools [action]', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Arguments:') . PHP_EOL;
     print Color::colorize('  ?', Color::FG_GREEN);
     print Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     $this->printParameters($this->_possibleParameters);
 }
开发者ID:nicodmf,项目名称:phalcon-devtools,代码行数:15,代码来源:Webtools.php

示例5: getHelp

 /**
  * Prints the help for current command.
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Creates a project') . PHP_EOL . PHP_EOL;
     print Color::head('Usage:') . PHP_EOL;
     print Color::colorize('  project [name] [type] [directory] [enable-webtools]', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Arguments:') . PHP_EOL;
     print Color::colorize('  help', Color::FG_GREEN);
     print Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     print Color::head('Example') . PHP_EOL;
     print Color::colorize('  phalcon project store simple', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     $this->printParameters($this->_possibleParameters);
 }
开发者ID:niden,项目名称:phalcon-devtools,代码行数:18,代码来源:Project.php

示例6: getHelp

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Lists the commands available in Phalcon devtools') . PHP_EOL . PHP_EOL;
     $this->run([]);
 }
开发者ID:VyacheslavLynnyk,项目名称:scripts,代码行数:11,代码来源:Enumerate.php

示例7: dirname

    $extensionLoaded = true;
    if (!extension_loaded('phalcon')) {
        $extensionLoaded = false;
        include dirname(__FILE__) . '/scripts/Phalcon/Script.php';
        throw new Exception(sprintf("Phalcon extension isn't installed, follow these instructions to install it: %s", Script::DOC_INSTALL_URL));
    }
    $loader = new Loader();
    $loader->registerDirs(array(__DIR__ . '/scripts/'))->registerNamespaces(array('Phalcon' => __DIR__ . '/scripts/'))->register();
    if (Version::getId() < Script::COMPATIBLE_VERSION) {
        throw new Exception(sprintf("Your Phalcon version isn't compatible with Developer Tools, download the latest at: %s", Script::DOC_DOWNLOAD_URL));
    }
    if (!defined('TEMPLATE_PATH')) {
        define('TEMPLATE_PATH', __DIR__ . '/templates');
    }
    $vendor = sprintf('Phalcon DevTools (%s)', Version::get());
    print PHP_EOL . Color::colorize($vendor, Color::FG_GREEN, Color::AT_BOLD) . PHP_EOL . PHP_EOL;
    $eventsManager = new EventsManager();
    $eventsManager->attach('command', new CommandsListener());
    $script = new Script($eventsManager);
    $commandsToEnable = array('\\Phalcon\\Commands\\Builtin\\Enumerate', '\\Phalcon\\Commands\\Builtin\\Controller', '\\Phalcon\\Commands\\Builtin\\Model', '\\Phalcon\\Commands\\Builtin\\AllModels', '\\Phalcon\\Commands\\Builtin\\Project', '\\Phalcon\\Commands\\Builtin\\Scaffold', '\\Phalcon\\Commands\\Builtin\\Migration', '\\Phalcon\\Commands\\Builtin\\Webtools');
    foreach ($commandsToEnable as $command) {
        $script->attach(new $command($script, $eventsManager));
    }
    $script->run();
} catch (PhalconException $e) {
    print Color::error($e->getMessage()) . PHP_EOL;
} catch (Exception $e) {
    if ($extensionLoaded) {
        print Color::error($e->getMessage()) . PHP_EOL;
    } else {
        print 'ERROR: ' . $e->getMessage() . PHP_EOL;
开发者ID:ntamvl,项目名称:phalcon-devtools,代码行数:31,代码来源:phalcon.php

示例8: printParameters

 /**
  * Prints the available options in the script
  *
  * @param array $parameters
  */
 public function printParameters($parameters)
 {
     $length = 0;
     foreach ($parameters as $parameter => $description) {
         if ($length == 0) {
             $length = strlen($parameter);
         }
         if (strlen($parameter) > $length) {
             $length = strlen($parameter);
         }
     }
     print Color::head('Options:') . PHP_EOL;
     foreach ($parameters as $parameter => $description) {
         print Color::colorize(' --' . $parameter . str_repeat(' ', $length - strlen($parameter)), Color::FG_GREEN);
         print Color::colorize("    " . $description) . PHP_EOL;
     }
 }
开发者ID:TommyAzul,项目名称:docker-centos6,代码行数:22,代码来源:Command.php

示例9: getHelp

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function getHelp()
 {
     echo Color::head('Help:') . PHP_EOL;
     echo Color::colorize('  Enables/disables webtools in a project') . PHP_EOL . PHP_EOL;
     print Color::head('Usage: Enable webtools') . PHP_EOL;
     print Color::colorize('  webtools enable', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Usage: Disable webtools') . PHP_EOL;
     print Color::colorize('  webtools disable', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     echo Color::head('Arguments:') . PHP_EOL;
     echo Color::colorize('  help', Color::FG_GREEN);
     echo Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     $this->printParameters($this->getPossibleParams());
 }
开发者ID:zhao5908,项目名称:phalcon-devtools,代码行数:18,代码来源:Webtools.php

示例10: getHelp

 /**
  * {@inheritdoc}
  *
  * @return void
  */
 public function getHelp()
 {
     print Color::head('Help:') . PHP_EOL;
     print Color::colorize('  Generates/Run a Migration') . PHP_EOL . PHP_EOL;
     print Color::head('Usage: Generate a Migration') . PHP_EOL;
     print Color::colorize('  migration generate', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Usage: Run a Migration') . PHP_EOL;
     print Color::colorize('  migration run', Color::FG_GREEN) . PHP_EOL . PHP_EOL;
     print Color::head('Arguments:') . PHP_EOL;
     print Color::colorize('  help', Color::FG_GREEN);
     print Color::colorize("\tShows this help text") . PHP_EOL . PHP_EOL;
     $this->printParameters($this->getPossibleParams());
 }
开发者ID:emrullahayin,项目名称:phalcon-devtools,代码行数:18,代码来源:Migration.php

示例11: mainAction

 /**
  * Initialize task
  */
 public function mainAction()
 {
     // define error handler
     $this->setSilentErrorHandler();
     try {
         // init configurations // init logger
         $this->setConfig($this->getDI()->get('config'))->setLogger();
         // run server
         $this->sonar = new Application($this->getConfig());
         $this->sonar->run();
     } catch (AppServiceException $e) {
         echo Color::colorize($e->getMessage(), Color::FG_RED, Color::AT_BOLD) . PHP_EOL;
         if ($this->logger != null) {
             // logging all error exceptions
             $this->getLogger()->log($e->getMessage(), Logger::CRITICAL);
         }
     }
 }
开发者ID:stanislav-web,项目名称:PhalconSonar,代码行数:21,代码来源:SonarTask.php


注:本文中的Phalcon\Script\Color::colorize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。