Sharedir from configuration file ignored #8

Closed
piotras opened this Issue Jun 16, 2010 · 6 comments

Projects

None yet

3 participants

@piotras
Member
piotras commented Jun 16, 2010
  • Create configuration with self defined ShareDir=/my/path.
  • In PHP script invoke midgard_storage::create_class_storage for a class which is defined in schema dir under /my/path.

Warning is thrown because given class is not registered as PHP, and all schemas has been read from standard prefix/share directory.

Owner

init schema using share-dir from config-file (if possible). Closed by 16814d1

@bergie bergie reopened this Sep 7, 2011
Owner
bergie commented Sep 7, 2011

Seems this issue still persists. If you place schemas into a custom directory and try to set them via a ShareDir of a Midgard config file (or config object) in a php-cli, the schemas will not be found.

This is especially critical as AiP is also running under cli.

Member
piotras commented Sep 7, 2011

Did you try to sharedir via env ?

export MIDGARD_ENV_GLOBAL_SHAREDIR=/path/to/sharedir

The problem with PHP extension is fact that we must register all classes when extension is loaded which means very early before PHP comes to userland.

Member
piotras commented Sep 7, 2011

Ah, just checked the closing commit.
In php ini, set :
midgard.configuration_file="/path/to/config"
The this config should be taken into account and it's sharedir.

Owner
bergie commented Sep 8, 2011

Yes, but I wanted to reopen this so we get sharedirs working properly on dynamically loaded configurations as well. In the Hrungnir cycle making the schemas more flexible will be an important priority. In Desktop Summit you mentioned this should now be possible with more recent PHP versions?

Member
piotras commented Sep 8, 2011

Yep. I have been told there were many fixes in PHP wrt classes' memory management. But still, we have to consider couple of options:

  1. How to register classes in cli and in http server context.

Classes registered per request (in apache env) might be easily performance killer.

  1. How it should be forward compatible with PHP-GIR.

In PHP, we should start thinking differently. There will be no more

$o = new MgdSchemaClassName();

but instead:

$o = MidgardSchemaFactory::factory ("MgdSchemaClassName");

or

$o = new \GIR\Object ("MgdSchemaClassName");
@indeyets indeyets closed this in d7e7040 Sep 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment