Пример #1
0
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'));
}
Пример #2
0
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);
}