Magallanes/Mage/Command/BuiltIn/UnlockCommand.php

46 lines
1.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\Command\RequiresEnvironment;
use Mage\Console;
/**
* Command for Unlocking an Environment
*
* @author Andrés Montañez <andres@andresmontanez.com>
*/
2015-02-22 12:53:47 +01:00
class UnlockCommand extends AbstractCommand implements RequiresEnvironment
{
2014-08-06 19:01:39 +02:00
/**
* Unlocks an Environment
* @see \Mage\Command\AbstractCommand::run()
*/
public function run()
{
$lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock';
if (file_exists($lockFile)) {
@unlink($lockFile);
}
2015-02-22 12:53:47 +01:00
Console::output(
'Unlocked deployment to <light_purple>'
. $this->getConfig()->getEnvironment() . '</light_purple> environment',
1,
2
);
2014-08-07 02:43:29 +02:00
return 0;
}
}