Wednesday, August 7, 2013

PHP namespace error

PHP namespace error

everyone.
I have a problem with a PHP API library which is supposed to work. I am
using the codeigniter framework.
I am trying to use the PHPEVECentral library from my eve_market_model. As
you can see the library is composed of several files using namespaces. To
use the library, i have just include the main file PHPEVECentral.
Here http://s21.postimg.org/byz3udi8n/arbo.png, you can find a screenshot
of the arborescence folders.
namespace PHPEveCentral;
class PHPEveCentral
{
...
public function MarketStat($typeid = array())
{
return new \PHPEveCentral\Requests\MarketStat($typeid);
}
}
So, when i call PHPEveCentral->MarketStat() function, I get a php error :
Class 'PHPEveCentral\Requests\MarketStat' not found in
C:\wamp\www\Eve-board\application\libraries\PHPEveCentral\PHPEveCentral.php
on line 68
When I include the PHPEveCentral\Requests\MarketStat.php file, there is
not this error anymore but then i have an other error for an other file,
so i have to include it too and so on.
Do I have to manually include each file of the library ? I hope there is
an other way because it's a bit boring ...
Thanks you for your help.

No comments:

Post a Comment