views:

43

answers:

0

Hi Guys,

I'm having a bit of a problem with Classloader added to Doctrine 2 project. I have simple directory structure like this:

  • config (bootstrap file)
  • html (docroot with templates/images/js etc)
  • php
  • Entities (doctrine 2 entities)
  • Responses (some transport objects)
  • Services (processing api and business logic - like session beans in java)

Each of the php subdirectories belongs to its own namespace (same as the name of directory).
I want to use aforementioned classloader to load these three different packages, so my bootstrap looks like this:

$classLoader = new \Doctrine\Common\ClassLoader('Doctrine', $lib );
$classLoader->register();

$responsesCL = new \Doctrine\Common\ClassLoader('Responses', __DIR__.'/../php');
$responsesCL->register();

$entitiesCL = new \Doctrine\Common\ClassLoader('Entities', __DIR__.'/../php');
$entitiesCL->register();

$servicesCL = new \Doctrine\Common\ClassLoader('Services', __DIR__.'/../php');
$servicesCL->register();

Bold DIR is actually __ DIR __ php constant.

Now, I am referring in my services package to entities and this is where the problem starts, for some reason I get errors due to file not found problem, for example:

Failed opening required '/var/www/projects/PlatformManagement/config/../php/Services/Entities/User.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/pear/Doctrine/Common/ClassLoader.php on line 148

Somehow, there is extra 'Services' in the path, and obviously it's not valid path. I am a bit puzzled why that extra directory there? I tripple checked all namespaces, calls, and they are ok.

I need another pair of eyes to have look, I'm assuming I'm missing something obvious here, but can't spot it :|

Oh, this is latest Doctrine 2 Beta (4) and php 5.3.3 on fedora if that's of any help.

Thanks, Greg