public static function run__clean_build($task, $args, $long_args) { $dir = dirname(pakeApp::get_instance()->getPakefilePath()); $cfg_file = $dir . '/' . __CLASS__ . '.yaml'; if (file_exists('Makefile')) { pake_sh('make distclean'); } if (file_exists('configure')) { if (isset($long_args['with-phpize'])) { $phpize = $long_args['with-phpize']; } elseif (file_exists($cfg_file)) { $cfg_data = pakeYaml::loadFile($cfg_file); $phpize = $cfg_data['phpize']; } else { $phpize = pake_which('phpize'); } if (!file_exists($phpize)) { throw new pakeException('"' . $phpize . '" is not available'); } pake_sh(escapeshellarg($phpize) . ' --clean'); } }
public static function run_app($task, $args) { if (isset($args[0])) { $config_file = $args[0]; } else { $config_file = getcwd() . '/config.yaml'; } pake_echo_comment('Loading configuration…'); if (!file_exists($config_file)) { throw new \pakeException("Configuration file is not found: " . $config_file); } $config = \pakeYaml::loadFile($config_file); $runner = new Runner(); foreach ($config['servers'] as $server) { if (!class_exists($server['app']['class'])) { require dirname($config_file) . '/' . $server['app']['file']; pake_echo_action('load class', $server['app']['class']); } $runner->addServer($server['app']['class'], $server['app']['middlewares'], $server['protocol'], $server['socket'], $server['min-children'], $server['max-children']); pake_echo_action('register', $server['app']['class'] . ' server via ' . $server['protocol'] . ' at ' . $server['socket'] . '. (' . $server['min-children'] . '-' . $server['max-children'] . ' children)'); } pake_echo_comment('Starting server…'); $runner->go(); }
function run_obs($task) { run_release($task); $_root = dirname(__FILE__); $options = pakeYaml::loadFile($_root . '/options.yaml'); $version = $options['version']; $target = $_root . '/target'; pake_sh(escapeshellarg(pake_which('gunzip')) . ' ' . escapeshellarg($target . '/pake-' . $version . '.tgz')); pake_sh(escapeshellarg(pake_which('tar')) . ' -r -f ' . escapeshellarg($target . '/pake-' . $version . '.tar') . ' -C ' . escapeshellarg($_root) . ' debian'); pake_sh(escapeshellarg(pake_which('gzip')) . ' ' . escapeshellarg($target . '/pake-' . $version . '.tar')); }
function getSettings() { static $settings = array(); if (!empty($settings)) { return $settings; } $cfgFileName = file_exists('buildConfig.local.yml') ? 'buildConfig.local.yml' : 'buildConfig.yml'; return $settings = pakeYaml::loadFile($cfgFileName); }
function run_release($task) { $_root = dirname(__FILE__); $options = pakeYaml::loadFile($_root . '/options.yaml'); $version = $options['version']; pakeSimpletestTask::call_simpletest($task); if ($task->is_verbose()) { pake_echo_comment('releasing pake version "' . $version . '"'); } run_create_pear_package(); }