I've since run into further problems and realize after looking into it
further that your solution seems best. Symfony should be ORM agnostic
if it's going to support more than one ORM. Symfony started by
supporting only propel and now plans to completely support doctrine in
1.1. Although in most applications it makes no sense to support
multiple ORM's we should have the ability to run multiple to make the
conversion. Furthermore, as our plugin community is becoming divided
support for a truely ORM agnostic framework would allow developers to
use plugins based on either ORM in the same project.

At this point I'd just like to know the direction of symfony. Is there
a plan to support multiple ORM's in the future or will we continue
down divided roads?




On May 24, 12:22 pm, chtito <[EMAIL PROTECTED]> wrote:
> A great deal of problems are due to the location of the propel schema
> (and model) files.
>
> I have designed Doctrine from the beginning so that it would be
> possible to have both Doctrine and propel (or other ORMs) running.
> (This is why everything that is Doctrine related (schema and model
> classes) are in a "doctrine" folder.) To achieve this it would in
> principle just require very small changes which were described in this
> ticket <http://trac.symfony-project.com/trac/ticket/1054>.
>
> Fabien refused to make those changes at that time. Now those changes
> are harder to make because they break BC. They are however necessary
> for symfony to be truly ORM independent.
>
> I don't believe that tinkering the existing propel task to avoid the
> doctrine folders is the right solution. IMO the right solution is to
> move the propel files in a propel folder everywhere, just as
> sfDoctrine does.
>
> == Olivier
>
> On May 24, 6:13 pm, Jon Todd <[EMAIL PROTECTED]> wrote:
>
> > Here is my code to allow the propel-build-model task to ignore
> > doctrine schema files if the --ignore-doctrine arg is given:
>
> > It passes args to   _propel_convert_yml_schema(false, 'generated-',
> > $args) and then uses this logic to ignore doctrine schema files:
>
> > if(in_array('--ignore-doctrine',$args) && !
> > (substr(dirname($schema),strrpos(dirname($schema),'/')) == '/
> > doctrine'))
>
> > This basically says any schema file who's parent directory is called '/
> > doctrine' should be ignored.
>
> > function _propel_convert_yml_schema($check_schema = true, $prefix =
> > '', $args = array())
> > {
> >   $finder = pakeFinder::type('file')->name('*schema.yml');
> >   $dirs = array('config');
> >   if ($pluginDirs = glob(sfConfig::get('sf_root_dir').'/plugins/*/
> > config'))
> >   {
> >     $dirs = array_merge($dirs, $pluginDirs);
> >   }
> >   $schemas = $finder->in($dirs);
> >   if ($check_schema && !count($schemas))
> >   {
> >     throw new Exception('You must create a schema.yml file.');
> >   }
>
> >   $db_schema = new sfPropelDatabaseSchema();
> >   foreach ($schemas as $schema)
> >   {
> >     // ignore doctrine schemas
> >     if(in_array('--ignore-doctrine',$args) && !
> > (substr(dirname($schema),strrpos(dirname($schema),'/')) == '/
> > doctrine'))
> >     {
>
> >       $db_schema->loadYAML($schema);
>
> >       pake_echo_action('schema', 'converting "'.$schema.'"'.' to
> > XML');
>
> >       $localprefix = $prefix;
>
> >       // change prefix for plugins
> >       if (preg_match('#plugins[/\\\\]([^/\\\\]+)[/\\\\]#', $schema,
> > $match))
> >       {
> >         $localprefix = $prefix.$match[1].'-';
> >       }
>
> >       // save converted xml files in original directories
> >       $xml_file_name = str_replace('.yml', '.xml', basename($schema));
>
> >       $file = str_replace(basename($schema), $localprefix.
> > $xml_file_name,  $schema);
> >       pake_echo_action('schema', 'putting '.$file);
> >       file_put_contents($file, $db_schema->asXML());
> >     }
> >   }}
>
> > function run_propel_build_model($task, $args)
> > {
> >   _propel_convert_yml_schema(false, 'generated-',$args);
> >   _propel_copy_xml_schema_from_plugins('generated-');
> >   _call_phing($task, 'om');
> >   $finder = pakeFinder::type('file')->name('generated-*schema.xml');
> >   pake_remove($finder, array('config', 'plugins'));
>
> > }
>
> > These functions are in the following path on my machine:
> > /usr/share/pear/data/symfony/tasks/sfPakePropel.php


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to