Re: conf problem
Manuel Holtgrewe <[email protected]>
| Newsgroups | gmane.comp.lib.binarycloud.devel |
|---|---|
| Message-ID | <[email protected]> |
Jean-Christophe Michel schrieb:
> Hi,
>
> I'm faced to a conf pb that neither current nor new Conf design can solve.
> For the SimpleEntity vortex package, I need a place to store a map
> entity-base-class-name => path to class. What for?
Uhm, I think you should have different "class identifiers" for different
classes - even if the derived ones from the same base class. Otherwise
you cannot use different "item" classes - can you?
> For instance, I have in vortex/store an entity called Item.php.
> I want to extend it in my own app, but keep everything else from
> vortex/store. As the Item class is included and instanciated in many
> places, I cannot extend it without copying the whole vortex/store dir
> and modifying all files, simply to change the include_once line and set
> my extended class path.
>
> The solution I think to is this one:
> * have a map 'base class name' => path in conf
> * use include_entity(), defined in SimpleEntity
> that uses this map to load the right class.
>
> For instance for my item, with this in conf:
> item => app/myapp/MyItem.php
> include_entity('item') would include my extended class.
>
> The problem is that I need that different packages using SimpleEntity
> place their conf in the same path:
> vortex/store should have a conf SimpleEntity containing
> 'item' => vortex/store/entities/Item.php
> placed in simpleentity domain
> (conf path being simpleentity/class_path/item)
> and in my app I need to overide this value with
> 'item' => app/myapp/MyItemp.php
> with the same conf path :/
I'd say this is not a problem in Conf but rather in your SimpleEntity's
design. You cannot use multiple item classes (see above) and that alone
will complicate everything.
Or did I misunderstand you?
Manuel