1
votes

I'm trying to doctrine:generate-migrations-diff, symfony it seems to be ignored files in dirs lib\model\doctirne\PLUGINNAME — and creates migretion that deletes tables of plugins.

I'm trying to execute doctrine:build --all-classes — gererates files (forms and filters) in wrong place where it should — lib\filter\doctrine and lib\form\doctrine — but not where it should — lib\filter\doctrine\PLUGINNAME (there are files of plugins (it is ignored)).

I'm trying, for exemple, edit schema.yml of MODELNAME in plugin and generate models — models are not generating, no changes, but should be edited file BaseMODELNAME.class.php in lib\model\doctrine\PLUGINNAME directory

Moreover, not all plugins such behavior can be traced. For sfDoctrineGuardPlugin (and almost all of my plugins) everything is OK. Any changes to the scheme (in the plugin scheme) will be reflected in the expected files.

But for plugins sfGuardUserLoginHistory and PBillingPlugin (my plugin) everything goes as I described above.

I dont know where problem is. On linux all is OK.

2

2 Answers

1
votes

The problem was in my multiple app project:

I have five applications in my project:

  • api
  • backend
  • frontend
  • billing
  • other

And api application has its own configuation of enabled plugins:

class apiConfiguration extends sfApplicationConfiguration
{
  public function setup()
  {
    parent::setup();


    $this->plugins = array();
    $this->pluginPaths = array();

    $this->enablePlugins(array(
        'sfDoctrinePlugin',
        'sfDoctrineGuardPlugin',
        //'PAPIClientPlugin', //needed?
    ));

  }

  public function configure()
  {
  }
}

Why is api? It is alphabetically first in file list. And api configuration will do overwrite of others settings so symfony will think that he is has only two enabled plugins (sfDoctrinePlugin and sfDoctrineGuardPlugin) but not others and will generate models and stuff in global folders (as described in question above).

1
votes

Same problem under Linux.

Here's a way of workaround:

specify the application parameter in you symfony command line, for example:

./symfony doctrine:generate-migrations-diff --application="YOUR_APP_NAME"
./symfony doctrine:build --model --application="YOUR_APP_NAME"

YOUR_APP_NAME should be your main application, ie. backend or some such...

This trick works for me.