if (php_sapi_name() === 'cli-server' && IPF::requestedFileExists())
return false;
+ $project_root = dirname($project_path);
+
self::$settings = IPF_Settings::create()
->apply(array(
'app_base' => '',
'admin_title' => 'IPF Administration',
))
->set('ipf_path', dirname(__FILE__))
- ->set('project_path', $project_path)
+ ->set('project_root', $project_root)
->set('document_root', $document_root)
- ->applyFile($project_path.'/settings.php')
- ->tryApplyFile($project_path.'/settings_local.php');
+ ->applyFile($project_root.'/project/settings.php')
+ ->tryApplyFile($project_root.'/project/settings_local.php');
self::checkSettings(self::$settings);
$file = '/' . strtolower(implode(DIRECTORY_SEPARATOR, $elts)).'.php';
self::include_existing(self::$settings->get('ipf_path') . $file);
- self::include_existing(self::$settings->get('project_path') . $file);
+ self::include_existing(self::$settings->get('project_root') . '/project' . $file);
if (!function_exists($function))
throw new IPF_Exception('Impossible to load the function: '.$function.' in '.$file);
public function run($args=null)
{
$m = new \PFF\Migrations\Migrations;
- $filename = $m->createMigration(IPF::get('project_path').'/db/migrations', implode('_', $args));
+ $filename = $m->createMigration(IPF::get('project_root').'/project/db/migrations', implode('_', $args));
echo "Create new migration $filename\n";
}
}
{
$project = IPF_Project::getInstance();
- $paths = array(IPF::get('project_path').'/db/migrations');
+ $paths = array(IPF::get('project_root').'/project/db/migrations');
foreach ($project->appList() as $app) {
$paths[] = $app->getPath() . 'migrations';
}
{
$dirs = array();
- $projectTemplates = IPF::get('project_path') . '/templates';
+ $projectTemplates = IPF::get('project_root') . '/project/templates';
if (is_dir($projectTemplates))
$dirs[] = $projectTemplates;