Re: possible namespace bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 20, 2011 at 3:49 PM, Adam Richardson wrote:
> On Thu, Jan 20, 2011 at 5:33 PM, Tommy Pham wrote:
>>
>> Hi folks,
>>
>> I thought I try implementing namesapce on one the ported apps I did a
>> while
>> back but ran into a problem. ÂFirst the code:
>>
>> //namespace org\puremvc\php\interfaces;
>>
>> interface ICommand
>> {
>> Â Âfunction execute(INotification $notification);
>> }
>> interface INotifier
>> {
>> Â Âfunction sendNotification($notificationName, $body = null, $type =
>> null);
>> }
>>
>> //--------------------------------------------------------------------------
>> ---
>> //namespace org\puremvc\php\patterns\observer;
>> //use org\puremvc\php\interfaces\INotifier;
>>
>> class Notifier implements INotifier
>> {
>> Â Âpublic function __construct() { echo __METHOD__; }
>> Â Âpublic function sendNotification($notificationName, $body = null, $type
>> = null)
>> Â Â{
>> Â Â}
>> }
>>
>> //--------------------------------------------------------------------------
>> ---
>> //namespace org\puremvc\php\patterns\command;
>> //use org\puremvc\php\interfaces\ICommand;
>> //use org\puremvc\php\interfaces\INotifier;
>> //use org\puremvc\php\patterns\observer\Notifier;
>>
>> class SimpleCommand extends Notifier implements ICommand, INotifier
>> {
>> Â Âpublic function __construct() { parent::__construct(); echo ' -> ';
>> echo __METHOD__; }
>> Â Âfunction execute(INotification $notification) { }
>> }
>
> Where's the INotification namespace? ÂIf it's in org\puremvc\php\interfaces,
> you'll have to include it, too. ÂI see you just included the whole set of
> interfaces in the top part of the example. ÂMaybe you just omitted the code,
> but that could be the problem.
> Adam
>
> --
> Nephtali:Â A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
>

Hi Adam,

The error didn't complain about that even if I use without the
namespace... possible bug? :))  Anyway, I found the problem:  \N   in

use org\puremvc\php\patterns\observer\Notifier;

I think I should submit request for change from \ to / to prevent
escaping.  and makes using of namespace more natural.

Thanks,
Tommy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux