#1654: generate-migrations-models - Making models_path optional
-----------------------------------+----------------------------------------
Reporter: deefour | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: Unknown
Component: Tasks | Version: 1.1-DEV
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
Hello-
I'm using:
* PHP 5.2.6
* Doctrine 1.1
It would be useful to make the models_path parameter for the
Doctrine_Task_GenerateMigrationsModels task optional;
Currently:
{{{
class Doctrine_Task_GenerateMigrationsModels extends Doctrine_Task
{
public $description = 'Generate migration classes for an
existing set of models',
$requiredArguments = array('migrations_path' => 'Specify
the path to your migration classes folder.',
'yaml_schema_path' => 'Specify
the path to your yaml schema files folder.'),
$optionalArguments = array('models_path' => 'Specify
the path to your doctrine models folder.');
// ...
}}}
Proposed:
{{{
class Doctrine_Task_GenerateMigrationsModels extends Doctrine_Task
{
public $description = 'Generate migration classes for an
existing set of models',
$requiredArguments = array('migrations_path' => 'Specify
the path to your migration classes folder.',
'yaml_schema_path' => 'Specify
the path to your yaml schema files folder.'),
$optionalArguments = array('models_path' => 'Specify
the path to your doctrine models folder.');
// ...
}}}
I have my models split into more than one directory, and as such I do this
prior to calling the Doctrine_Cli::run() in my CLI script
{{{
Doctrine::loadModels(array(CORE_PATH .'/php/model/',
APPLICATION_PATH .'/php/model/'));
}}}
Then I can execute the task only passing the Yaml schema directory and the
migrations destination directory to be used.
{{{
./doctrine generate-migrations-models _config/migrations _config/schemas
}}}
Manually loading my models prior to running the task makes specifying the
models_path parameter unnecessary. As previously mentioned, it is
necessary for me to pre-load the models since they are coming from more
than 1 directory.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1654>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---