NYCPHP Meetup

NYPHP.org

[nycphp-talk] Namespaces

Rob Marscher rmarscher at beaffinitive.com
Tue Jan 22 12:05:44 EST 2008


On Jan 20, 2008, at 7:40 AM, leam wrote:
> How does the require in:
>
> 	require 'MyProject/Db/Connection.php';
>
> from http://www.php.net/manual/en/language.namespaces.using.php
> know that it's a namespace and not a filepath?

Hi Leam,

It still is a path.  It's including the file MyProject/Db/ 
Connection.php... but at the top of that file that gets included is  
this:

<?php
namespace MyProject::DB;

...


See http://www.php.net/manual/en/language.namespaces.definition.php --  
that page shows the contents of MyProject/Db/Connection.php





More information about the talk mailing list