Google Groups Home
Help | Sign in
sf1.1, config handlers, autoloading, and plugins
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Ian P. Christian  
View profile
 More options Mar 18, 7:29 am
From: "Ian P. Christian" <poo...@pookey.co.uk>
Date: Tue, 18 Mar 2008 11:29:20 +0000
Local: Tues, Mar 18 2008 7:29 am
Subject: sf1.1, config handlers, autoloading, and plugins
Hi all!

Doctrine has config handlers defined as follows:

# cat plugins/sfDoctrinePlugin/config/config_handlers.yml
config/doctrine.yml:
   class:    sfDoctrineConfigHandler

config/schemas.yml:
   class:    sfDoctrineSchemasConfigHandler

When a sf1.1 project starts up, the lib/projectConfiguration file
registers sfCoreAutoload, which handles the base autoloading required
for bootstrapping.  However...

in ./lib/vendor/symfony/lib/config/sfApplicationConfiguration.class.php,
  we have this:

  97   public function initConfiguration()
  98   {
..
107     // required core classes for the framework
108     if (!sfConfig::get('sf_debug') && !sfConfig::get('sf_test'))
109     {
110       $configCache->import('config/core_compile.yml', false);
111     }
112
113     sfAutoload::getInstance()->register();

This causes this:

  Fatal error: Class 'sfDoctrineConfigHandler' not found in
/var/www/localhost/cache/frontend/prod/config/config_config_handlers.yml.ph p
on line 29

This file contains:

29 $this->handlers['config/doctrine.yml'] = new sfDoctrineConfigHandler();
30 $this->handlers['config/schemas.yml'] = new
sfDoctrineSchemasConfigHandler();

Now, the problem this is failing, is because the real autoloader isn't
started till line 113 in the aplicationConfiguration  class show above,
but the file is being imported at line 110.

For now, I've  got around this issue by manually including these classes
in my project config class, but that's no real fix :)

Any ideas?

--

Ian P. Christian ~ http://pookey.co.uk


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabien POTENCIER  
View profile
 More options Mar 18, 7:43 am
From: Fabien POTENCIER <fabien.potenc...@symfony-project.com>
Date: Tue, 18 Mar 2008 12:43:27 +0100
Local: Tues, Mar 18 2008 7:43 am
Subject: Re: [symfony-devs] sf1.1, config handlers, autoloading, and plugins

Ian P. Christian wrote:
> Hi all!

> Doctrine has config handlers defined as follows:

> # cat plugins/sfDoctrinePlugin/config/config_handlers.yml
> config/doctrine.yml:
>    class:    sfDoctrineConfigHandler

> config/schemas.yml:
>    class:    sfDoctrineSchemasConfigHandler

You can specify a file in config_handlers.yml like this:

config/schemas.yml:
   file:
%SF_LIB_DIR%/doctrine/.../sfDoctrineSchemasConfigHandler.class.php
   class:  sfDoctrineSchemasConfigHandler

Fabien


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabien POTENCIER  
View profile
 More options Mar 18, 7:46 am
From: Fabien POTENCIER <fabien.potenc...@symfony-project.com>
Date: Tue, 18 Mar 2008 12:46:09 +0100
Local: Tues, Mar 18 2008 7:46 am
Subject: Re: [symfony-devs] Re: sf1.1, config handlers, autoloading, and plugins

Or, if you don't want to hardcode the path, perhaps we can add a new
shortcut to able to do something like this:

config/schemas.yml:
    file:
%SF_CURRENT_DIR%/../lib/sfDoctrineSchemasConfigHandler.class.php
    class:  sfDoctrineSchemasConfigHandler

I'm not sure about the name...

What do you think?

Fabien


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian P. Christian  
View profile
 More options Mar 18, 8:23 am
From: "Ian P. Christian" <poo...@pookey.co.uk>
Date: Tue, 18 Mar 2008 12:23:43 +0000
Local: Tues, Mar 18 2008 8:23 am
Subject: Re: [symfony-devs] Re: sf1.1, config handlers, autoloading, and plugins

Fabien POTENCIER wrote:
> Or, if you don't want to hardcode the path, perhaps we can add a new
> shortcut to able to do something like this:

> config/schemas.yml:
>     file:
> %SF_CURRENT_DIR%/../lib/sfDoctrineSchemasConfigHandler.class.php
>     class:  sfDoctrineSchemasConfigHandler

> I'm not sure about the name...

> What do you think?

That's certainly a good idea... but yes, not sure about the name.

This will of course allow plugins to be renamed locally without any
changes, for whatever odd reason someone might want to do it.... ;)

'current' dir does seem wrong...  'this' dir doesn't seem much better
though.  Maybe 'relative' makes some sense.

Adding file: to my config_hamders.yml causes a really really odd error:

sfParseException: Configuration file
"/var/www/localhost/lib/vendor/symfony/lib/config/config/config_handlers.ym l"
specifies category "category" with missing class key. in
/var/www/localhost/lib/vendor/symfony/lib/config/sfRootConfigHandler.class. php
on line 63

I'm busy trying to figure that out at the moment, but if you have any
bright ideas, I'm all ears :)

--

Ian P. Christian ~ http://pookey.co.uk


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabien POTENCIER  
View profile
 More options Mar 18, 8:33 am
From: Fabien POTENCIER <fabien.potenc...@symfony-project.com>
Date: Tue, 18 Mar 2008 13:33:38 +0100
Local: Tues, Mar 18 2008 8:33 am
Subject: Re: [symfony-devs] Re: sf1.1, config handlers, autoloading, and plugins
You have to specify the file AND the class. If ou've done so, you might
have a YAML problem.

Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.com | aide-de-camp.org
Tél: +33 1 40 99 80 80


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian P. Christian  
View profile
 More options Mar 18, 8:50 am
From: "Ian P. Christian" <poo...@pookey.co.uk>
Date: Tue, 18 Mar 2008 12:50:29 +0000
Local: Tues, Mar 18 2008 8:50 am
Subject: Re: [symfony-devs] Re: sf1.1, config handlers, autoloading, and plugins

Fabien POTENCIER wrote:
> You have to specify the file AND the class. If ou've done so, you might
> have a YAML problem.

Fixed in r7946

--

Ian P. Christian ~ http://pookey.co.uk


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google