Kelunik\AcmeClient\Commands\Version::execute PHP Method

execute() public method

public execute ( League\CLImate\Argument\Manager $args )
$args League\CLImate\Argument\Manager
    public function execute(Manager $args)
    {
        $version = $this->getVersion();
        $buildTime = $this->readFileOr("info/build.time", time());
        $buildDate = date('M jS Y H:i:s T', (int) trim($buildTime));
        $package = json_decode($this->readFileOr("composer.json", new RuntimeException("No composer.json found.")));
        $this->climate->out("┌ <green>kelunik/acme-client</green> @ <yellow>{$version}</yellow> (built: {$buildDate})");
        $this->climate->out(($args->defined("deps") ? "│" : "└") . " " . $this->getDescription($package));
        if ($args->defined("deps")) {
            $lockFile = json_decode($this->readFileOr("composer.lock", new RuntimeException("No composer.lock found.")));
            $packages = $lockFile->packages;
            for ($i = 0; $i < count($packages); $i++) {
                $link = $i === count($packages) - 1 ? "└──" : "├──";
                $this->climate->out("{$link} <green>{$packages[$i]->name}</green> @ <yellow>{$packages[$i]->version}</yellow>");
                $link = $i === count($packages) - 1 ? "   " : "│  ";
                $this->climate->out("{$link} " . $this->getDescription($packages[$i]));
            }
        }
    }