I have strange problem or maybe I'm doing something wrong. I've create my own module. My .info file looks like this:
...
files[] = DdFactory.inc
files[] = ArticleManager.inc
...
In ArticleManager.inc
I have class ArticleManager (no namespace). Than I would like to use DFactory (namespace Dd) class in ArticleManager.
Here is the beginning of DFactory.inc:
<?php
namespace Dd;
class Factory
{
...
In ArticleManger I have:
$ob = new \Dd\Factory();
And error:
Fatal error: Class 'Dd\Factory' not found
I can make it work in two ways. Or I have to remove namespaces than $ob = new Factory();
or I have to add include 'DFactory.inc'
at top of ArticleManager.inc
Could somebody tells me how to run it with namespaces and without the include? I'm using drupal 7.