Sharedir from configuration file ignored #8

piotras opened this Issue Jun 16, 2010 · 6 comments


None yet

3 participants

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.


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

@bergie bergie reopened this Sep 7, 2011
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.

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.

piotras commented Sep 7, 2011

Ah, just checked the closing commit.
In php ini, set :
The this config should be taken into account and it's sharedir.

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?

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");


$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