Development

#2791 ([FIX] Allow the admin generator to work when sf_lib_dir contains sub-folders)

You must first sign up to be able to contribute.

Ticket #2791 (closed defect: wontfix)

Opened 8 months ago

Last modified 1 month ago

[FIX] Allow the admin generator to work when sf_lib_dir contains sub-folders

Reported by: ericbartels Assigned to: fabien
Priority: major Milestone:
Component: generator Version: 1.0.10
Keywords: model, dir, separate Cc:
Qualification: Design decision

Description

I separated the class-files in my model into different folders (lib/model and lib/tecdoc). If I use the admin generator for a class inside lib/tecdoc it fails.

The class cannot be found, because the getModelDirs of the sfLoader-class does not give me the tecdoc subfolder. And thats why loadMapBuilderClasses in sfPropelCrudGenerator fails.

An easy solution would be to allow a configuration setting to let the user define the directories which are evaluated by the generator class.

// Check if there are extended directories set and add them to the array
// of directories the `sfFinder` will look later on
if (is_array (sfConfig::get ('sf_lib_dir_extend')))
{
  $dirs = array_merge ($dirs, sfConfig::get ('sf_lib_dir_extend'));
}

So I define this setting in my backend settings.yml like

lib_dir_extend: [%SF_LIB_DIR%/tecdoc]

Now everything works as expected.

Change History

04/05/08 19:48:10 changed by FabianLange

  • qualification changed from Unreviewed to Design decision.

08/06/08 11:17:50 changed by hartym

  • status changed from new to closed.
  • resolution set to wontfix.

This is a new feature, that cannot be included in sf 1.0

In sf1.1 and newer, you can override getModelDirs() method in your project configuration class, and so it's no more an issue.