From f2a7390c29e51b8dd4dc060aa9d9fb2525050a1f Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Tue, 16 Oct 2007 00:48:09 +0000 Subject: [PATCH] Fixed calls to wrong static functions and added some functionality to sandbox. --- lib/Doctrine/Facade.php | 6 +++--- sandbox/config.php.dist | 8 +++++--- sandbox/models/generated/BaseUser.class.php | 2 +- sandbox/sandbox.db | Bin 4096 -> 5120 bytes sandbox/schema/user.yml | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/Facade.php b/lib/Doctrine/Facade.php index 34a626a55..c95be73c7 100644 --- a/lib/Doctrine/Facade.php +++ b/lib/Doctrine/Facade.php @@ -169,7 +169,7 @@ class Doctrine_Facade { $directory = '/tmp/tmp_doctrine_models'; - Doctrine::generateModelsFromDb($directory); + Doctrine_Facade::generateModelsFromDb($directory); $export = new Doctrine_Export_Schema(); @@ -321,7 +321,7 @@ class Doctrine_Facade if ($delete) { - $models = Doctrine::getLoadedModels(); + $models = Doctrine_Facade::getLoadedModels(); foreach ($models as $model) { @@ -351,7 +351,7 @@ class Doctrine_Facade if ($delete) { - $models = Doctrine::getLoadedModels(); + $models = Doctrine_Facade::getLoadedModels(); foreach ($models as $model) { diff --git a/sandbox/config.php.dist b/sandbox/config.php.dist index beabb2f51..730c31381 100644 --- a/sandbox/config.php.dist +++ b/sandbox/config.php.dist @@ -38,13 +38,15 @@ define('SANDBOX_PATH', dirname(__FILE__)); define('DOCTRINE_PATH', dirname(SANDBOX_PATH) . DIRECTORY_SEPARATOR . 'lib'); define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'fixtures'); define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); -define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); +define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'migrations'); define('SQL_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql'); define('YAML_SCHEMA_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'schema'); -define('DSN', 'sqlite:/' . SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db'); +define('DB_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db'); +define('DSN', 'sqlite:' . DB_PATH); require_once(DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php'); spl_autoload_register(array('Doctrine', 'autoload')); -Doctrine_Manager::connection(DSN, 'sandbox'); \ No newline at end of file +$pdo = new PDO(DSN); +Doctrine_Manager::connection($pdo, 'sandbox'); \ No newline at end of file diff --git a/sandbox/models/generated/BaseUser.class.php b/sandbox/models/generated/BaseUser.class.php index eba00611d..a2a74df32 100644 --- a/sandbox/models/generated/BaseUser.class.php +++ b/sandbox/models/generated/BaseUser.class.php @@ -10,7 +10,7 @@ abstract class BaseUser extends Doctrine_Record { $this->setTableName('user'); $this->hasColumn('username', 'string', 255); - $this->hasColumn('contact_id', 'integer', null); + $this->hasColumn('contact_id', 'integer', 11); } public function setUp() diff --git a/sandbox/sandbox.db b/sandbox/sandbox.db index 5f4bd6848e27a8149a1019f7ec841d5287b1e48b..6f0820dba8111a68c469cf86a8c2ca25e83bbe4d 100755 GIT binary patch delta 317 zcmZorXwaA-EhxYM0n9*(5r{b^>R9qKXD~1`&0$~`W1h-1hiUc3MhzzM3RZS;QBlUm z;F83ooYd0d)FKdOom|iCC#s{6oS#>cm|PN{nWEt77vk#f8l*W{j5&w}Xrk`q9A;Hh zAcG~7gE$gC>N$jqRdm7kYbl98CFkfEngo|v8rR09L7Kn5#N>3inM z|JhkNn3!KOFn?oy2^6`@tjNv8EX@dY1S1C{vnV6TUyKktJ~1$V0xEmK%*VsX!XV8E Jv;<@}BLEoFO$7h| delta 157 zcmZqBXi%6SEy%=x3YaG9Sn>jen3=^Gn9nh1FpF&#WLd&AS&TV|C54Gyd~y!6>g1zL zHkO(OjBMhfqKvL3iAg!BC8@