Skip to content

Commit

Permalink
added Hidev helper
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Apr 12, 2018
1 parent f9eb6d0 commit e149f73
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/helpers/Hidev.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Automation tool mixed with code generator for easier continuous development
*
* @link https://github.com/hiqdev/hidev
* @package hidev
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
*/

namespace hidev\helpers;

use Yii;

/**
* Hidev helper.
*/
class Hidev
{
public static function exec($route, array $args, $wait = false)
{
$path = dirname(__DIR__) . '/bin/hidev';
$command = "$path $route";
foreach ($args as $arg) {
$command .= ' ' . escapeshellarg($arg);
}
$amp = $wait ? '' : '&';

return exec("$command > /dev/null 2>&1 $amp");
}
}

0 comments on commit e149f73

Please sign in to comment.