]> git.andy128k.dev Git - ipf.git/commitdiff
introduce project_root constant instead of project_path
authorAndrey Kutejko <andy128k@gmail.com>
Wed, 7 Jan 2015 18:19:28 +0000 (20:19 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Wed, 7 Jan 2015 18:19:28 +0000 (20:19 +0200)
ipf.php
ipf/command/createmigration.php
ipf/command/migrate.php
ipf/project_template.php

diff --git a/ipf.php b/ipf.php
index 2551a1571914061f75342571dc7acebf16e6c540..5c2d31586bcff1849b6b9f10bb2e560a46efa593 100644 (file)
--- a/ipf.php
+++ b/ipf.php
@@ -43,6 +43,8 @@ final class IPF
         if (php_sapi_name() === 'cli-server' && IPF::requestedFileExists())
             return false;
 
+        $project_root = dirname($project_path);
+
         self::$settings = IPF_Settings::create()
             ->apply(array(
                 'app_base'          => '',
@@ -59,10 +61,10 @@ final class IPF
                 '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);
 
@@ -101,7 +103,7 @@ final class IPF
                 $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);
index adca2d9fbe61f7e56692840c6a05ed39519fa074..e1f50c575ac8046c08353bb194ba7da7e50e408b 100644 (file)
@@ -8,7 +8,7 @@ class IPF_Command_CreateMigration
     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";
     }
 }
index ac7ddd484baa63abb4553e559103dd0ca13a4c44..ed50c45c6ce7d58906ba209ea282c2ee13cc7fd0 100644 (file)
@@ -9,7 +9,7 @@ class IPF_Command_Migrate
     {
         $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';
         }
index eaf5cecaff77b78c7a7206ea7103c40b89f40dfa..1d406bd116dcc82694756a8a7167520b4c7a9f1b 100644 (file)
@@ -6,7 +6,7 @@ final class IPF_Project_Template
     {
         $dirs = array();
 
-        $projectTemplates = IPF::get('project_path') . '/templates';
+        $projectTemplates = IPF::get('project_root') . '/project/templates';
         if (is_dir($projectTemplates))
             $dirs[] = $projectTemplates;