<?php pake_import('pear', false); pake_task('default'); pake_alias('init_mvc', 'default'); pake_alias('reinit_db', 'default'); // TASKS function run_default($task, $args) { pake_echo_error('Installer is a separate tool now. Please use that'); try { pake_which('mvc_install'); pake_echo_comment('It is already installed on your system. Type: mvc_install'); } catch (pakeException $e) { pake_echo_comment('I will install it for you…'); pakePearTask::install_pear_package('midgardmvc_installer', 'pear.indeyets.pp.ru'); pake_echo_comment('Done. To use it, type: mvc_install'); } }
public function do_option($opt, $value) { switch ($opt) { case 'interactive': $this->interactive = true; break; case 'dry-run': $this->verbose = true; $this->nowrite = true; $this->dryrun = true; $this->trace = true; break; case 'help': $this->help(); exit; case 'libdir': set_include_path($value . PATH_SEPARATOR . get_include_path()); break; case 'nosearch': $this->nosearch = true; break; case 'prereqs': $this->show_prereqs = true; break; case 'quiet': $this->verbose = false; break; case 'pakefile': self::$PAKEFILES = array($value); break; case 'require': require $value; break; case 'import': pake_import($value); break; case 'tasks': $this->show_tasks = true; break; case 'trace': $this->trace = true; $this->verbose = true; break; case 'usage': $this->usage(); exit; case 'verbose': $this->verbose = true; break; case 'force-tty': define('PAKE_FORCE_TTY', true); break; case 'version': $this->showVersion(); exit; default: throw new pakeException(sprintf("Unknown option: %s", $opt)); } }
$args_arr = array_map('escapeshellarg', $_SERVER['argv']); $args = ' ' . implode(' ', $args_arr); } $force_tty = ''; if (defined('PAKE_FORCE_TTY') or DIRECTORY_SEPARATOR != '\\' and function_exists('posix_isatty') and @posix_isatty(STDOUT)) { $force_tty = ' --force-tty'; } pake_echo_comment("oops… you're using installed pake. restarting with local version…"); pake_sh(escapeshellarg($php_exec) . ' ' . escapeshellarg(dirname(__FILE__) . '/bin/pake.php') . $force_tty . $args, true); die; } else { pake_echo_comment("using local version of pake. good!"); } /* registration */ pake_import('simpletest'); pake_import('pear'); pake_task('compact'); pake_task('phar'); pake_task('release'); pake_task('create_package_xml'); pake_task('obs'); pake_task('foo'); /** * Demo-task * * @param string $task * @param string $args * @return bool * @author Alexey Zakhlestin */ function run_foo($task, $args)
function _call_phing($task, $task_name, $check_schema = true) { $schemas = pakeFinder::type('file')->name('*schema.xml')->relative()->follow_link()->in('config'); if ($check_schema && !$schemas) { throw new Exception('You must create a schema.yml or schema.xml file.'); } // call phing targets pake_import('Phing', false); if (false === strpos('propel-generator', get_include_path())) { set_include_path(sfConfig::get('sf_symfony_lib_dir') . '/vendor/propel-generator/classes' . PATH_SEPARATOR . get_include_path()); } set_include_path(sfConfig::get('sf_root_dir') . PATH_SEPARATOR . get_include_path()); // needed to include the right Propel builders set_include_path(sfConfig::get('sf_symfony_lib_dir') . PATH_SEPARATOR . get_include_path()); $options = array('project.dir' => sfConfig::get('sf_root_dir') . '/config', 'build.properties' => 'propel.ini', 'propel.output.dir' => sfConfig::get('sf_root_dir')); pakePhingTask::call_phing($task, array($task_name), sfConfig::get('sf_symfony_lib_dir') . '/vendor/propel-generator/build.xml', $options); chdir(sfConfig::get('sf_root_dir')); }
// removing pake.php $args_arr = array_map('escapeshellarg', $_SERVER['argv']); $args = ' ' . implode(' ', $args_arr); } $force_tty = ''; if (defined('PAKE_FORCE_TTY') or DIRECTORY_SEPARATOR != '\\' and function_exists('posix_isatty') and @posix_isatty(STDOUT)) { $force_tty = ' --force-tty'; } pake_echo_comment("oops… you're using installed pake. restarting with local version…"); pake_sh(escapeshellarg($php_exec) . ' ' . escapeshellarg($_newstyle_local) . $force_tty . $args, true); die; } else { pake_echo_comment("using local version of pake. good!"); } /* registration */ pake_import('simpletest'); pake_task('phar'); pake_task('foo'); /** * Demo-task * * @param string $task * @param string $args * @return bool * @author Alexey Zakhlestin */ function run_foo($task, $args) { $age = pake_input('How old are you?'); pake_echo_comment("You are " . $age); // throw new Exception('test');
function _call_phing($task, $task_name, $check_schema = true, $propelIni = 'propel.ini', $propelDirectory = '') { $schemas = pakeFinder::type('file')->name('*schema.xml')->relative()->follow_link()->in('config'); if ($check_schema && !$schemas) { throw new Exception('You must create a schema.yml or schema.xml file.'); } // call phing targets pake_import('Phing', false); // if (false === strpos('propel-generator', get_include_path())) // { // set_include_path( PATH_THIRDPARTY . 'propel-generator/classes' . PATH_SEPARATOR. get_include_path()); // } // set_include_path(sfConfig::get('sf_root_dir').PATH_SEPARATOR.get_include_path()); if ($propelDirectory == '') { $options = array('project.dir' => PATH_CORE . 'config', 'build.properties' => $propelIni, 'propel.output.dir' => PATH_CORE); } else { $options = array('project.dir' => $propelDirectory . 'config', 'build.properties' => $propelIni, 'propel.output.dir' => $propelDirectory); } pakePhingTask::call_phing($task, array($task_name), PATH_THIRDPARTY . 'propel-generator/build.xml', $options); chdir(PATH_CORE); }