magallanes/Mage/Command/BuiltIn/CompileCommand.php

42 lines
1 KiB
PHP
Raw Normal View History

<?php
/*
* This file is part of the Magallanes package.
*
* (c) Andrés Montañez <andres@andresmontanez.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mage\Command\BuiltIn;
use Mage\Command\AbstractCommand;
use Mage\Console;
use Mage\Compiler;
/**
* Command for Compile Magallanes into a PHAR executable
*
* @author Ismael Ambrosi<ismaambrosi@gmail.com>
*/
class CompileCommand extends AbstractCommand
{
/**
* @see \Mage\Compile::compile()
*/
2014-08-06 19:01:39 +02:00
public function run()
{
2014-08-06 19:01:39 +02:00
if (ini_get('phar.readonly')) {
Console::output('The <purple>php.ini</purple> variable <light_red>phar.readonly</light_red> must be <yellow>Off</yellow>.', 1, 2);
2014-11-01 22:19:05 +01:00
return 200;
2014-08-06 19:01:39 +02:00
}
$compiler = new Compiler;
$compiler->compile();
2013-11-07 22:57:44 +01:00
Console::output('<light_purple>mage.phar</light_purple> compiled <light_green>successfully</light_green>', 0, 2);
2014-08-07 02:43:29 +02:00
return 0;
}
}