Permalink
Browse files

Made base changes to use sf_propel_path and sf_phing_path and separate

vendor dir prom plugin dir
  • Loading branch information...
1 parent d2372a0 commit afc6175f85b917fbb7e33546e4445349d547822b @lucasaba lucasaba committed Aug 19, 2011
@@ -16,15 +16,23 @@ class sfPropelORMPluginConfiguration extends sfPluginConfiguration
public function initialize()
{
sfConfig::set('sf_orm', 'propel');
+ sfConfig::set('sf_phing_path', sfConfig::get('sf_lib_dir', '../../../lib').'/vendor/phing');
+ sfConfig::set('sf_propel_path', sfConfig::get('sf_lib_dir', '../../../lib').'/vendor/propel');
+ //This one because propel includes phing/.....php
+ sfConfig::set('sf_vendor_path', sfConfig::get('sf_lib_dir', '../../../lib').'/vendor');
+
+
if (!sfConfig::get('sf_admin_module_web_dir'))
{
sfConfig::set('sf_admin_module_web_dir', '/sfPropelORMPlugin');
}
sfToolkit::addIncludePath(array(
sfConfig::get('sf_root_dir'),
- sfConfig::get('sf_phing_path', realpath(dirname(__FILE__).'/../lib/vendor/phing/classes')),
- sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__).'/../lib/vendor/propel/runtime/lib')),
+ sfConfig::get('sf_phing_path'),
+ sfConfig::get('sf_propel_runtime_path', sfConfig::get('sf_propel_path').'/runtime/lib'),
+ sfConfig::get('sf_propel_path'),
+ sfConfig::get('sf_vendor_path')
));
require_once 'Propel.php';
@@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/
-require_once dirname(__FILE__) . '/../vendor/propel/generator/lib/util/PropelPHPParser.php';
+require_once 'generator/lib/util/PropelPHPParser.php';
/**
* Internationalizes Propel models.
@@ -237,7 +237,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
// Call phing targets
sfToolkit::addIncludePath(array(
sfConfig::get('sf_symfony_lib_dir'),
- sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__).'/../vendor/propel/generator/lib')),
+ sfConfig::get('sf_propel_generator_path', sfConfig::get('sf_symfony_lib_dir').'/vendor/propel/generator/lib'),
));
$args = array();
@@ -255,7 +255,7 @@ protected function callPhing($taskName, $checkSchema, $properties = array())
// Build file
$args[] = '-f';
- $args[] = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'propel/generator'.DIRECTORY_SEPARATOR.'build.xml');
+ $args[] = realpath(sfConfig::get('sf_propel_path').DIRECTORY_SEPARATOR.'generator'.DIRECTORY_SEPARATOR.'build.xml');
// Logger
if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT)))
@@ -381,7 +381,7 @@ protected function getPlatform($databaseManager, $connection)
{
$params = $this->getConnection($databaseManager, $connection);
$platformClass = ucfirst($params['adapter']) . 'Platform';
- include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/platform/' . $platformClass . '.php';
+ include_once sfConfig::get('sf_propel_path') . '/generator/lib/platform/' . $platformClass . '.php';
$platform = new $platformClass();
$platform->setGeneratorConfig($this->getGeneratorConfig());
return $platform;
@@ -391,7 +391,7 @@ protected function getParser($databaseManager, $connection, $con)
{
$params = $this->getConnection($databaseManager, $connection);
$parserClass = ucfirst($params['adapter']) . 'SchemaParser';
- include_once dirname(__FILE__) . '/../vendor/propel/generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
+ include_once sfConfig::get('sf_propel_path') . '/generator/lib/reverse/' . $params['adapter'] . '/' . $parserClass . '.php';
$parser = new $parserClass();
$parser->setConnection($con);
$parser->setGeneratorConfig($this->getGeneratorConfig());
@@ -9,11 +9,11 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/AppData.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/builder/util/XmlToAppData.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/platform/DefaultPlatform.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/model/diff/PropelDatabaseComparator.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
+require_once('generator/lib/model/AppData.php');
+require_once('generator/lib/builder/util/XmlToAppData.php');
+require_once('generator/lib/platform/DefaultPlatform.php');
+require_once('generator/lib/model/diff/PropelDatabaseComparator.php');
+require_once('generator/lib/util/PropelMigrationManager.php');
/**
* Create classes for the current model.
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
+require_once('generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migration down
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
+require_once('generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migrations up
@@ -9,7 +9,7 @@
*/
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
+require_once('generator/lib/util/PropelMigrationManager.php');
/**
* Executes the next migration up
@@ -8,9 +8,6 @@
* file that was distributed with this source code.
*/
-//require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
-//require_once(dirname(__FILE__).'/../vendor/propel/generator/lib/util/PropelMigrationManager.php');
-
/**
* Checks the migrations to run
*
View
@@ -18,4 +18,5 @@
$_test_dir = realpath(dirname(__FILE__).'/..');
-sfToolkit::addIncludePath(realpath(dirname(__FILE__).'/../../lib/vendor'));
+sfToolkit::addIncludePath(rdirname(__FILE__).'/../../../../lib/vendor');
+sfToolkit::addIncludePath(sfConfig::get('sf_vendor_path'));

0 comments on commit afc6175

Please sign in to comment.