Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-26 Thread Jessie Hernandez
Hello Weyert, "Weyert de Boer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > May I make some sort of suggestion, without having a closer look at the > internal working of PHP, the below is jsut one big day dream for me. > > My idea is to wrap namespaces by default, for e

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-26 Thread Jessie Hernandez
Yes, you are correct, 'break' should be 'return'. -- Jessie "Marcus Boerger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On a first sight i only see that 'break' should be 'return'. > > Best regards, > Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsu

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-26 Thread Jessie Hernandez
"Marcus Boerger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Weyert, > > Tuesday, July 26, 2005, 10:04:28 AM, you wrote: > > > Hello, > > > How can I use the namespaces support, in such way that I can use with my > > coding guideline? > > > interfaces -> interface.NAME.inc.p

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-26 Thread Jessie Hernandez
Hi Marcus, "Marcus Boerger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > 3) Simply pass an extra argument (or pass an array or object as the first > > argument) to __autoload containing the names of the imported namespaces of > > the calling file. __autoload can then use this

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-25 Thread Jessie Hernandez
Marcus Boerger wrote: > > You already have the ability to overload __autoload or provide several > userspace __autoload functions that would be called one after another > until the first succeeds. What else do you want? Besides the fact that > i am still convinced that we should find a way to pas

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-25 Thread Jessie Hernandez
Alex Kiesel wrote: > Hi Jessie, > > first, while your patch applied cleanly (except zend_vm_opcodes.h, which > is generated) the build broke with: > bison -y -p zend -v -d > /mnt/home/alex/cvs/php-namespaces/Zend/zend_language_parser.y -o > Zend/zend_language_parser.c > conflicts: 5 shift/reduce

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-21 Thread Jessie Hernandez
Hello Marcus, In my case at work, my include_path only has three directories: . (current directory), the PEAR path, and the directory where my company's classes are stored. In this case, the namespace import will only have to search in three directories, which is not bad. The class_path would only

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-20 Thread Jessie Hernandez
;ll have to duplicate the code I have for >> ZEND_IMPORT_CLASS in another function). > > In that case you should provide a function apart the import opcode > handler. Since zend_vm_gen.h might create multiple handlers out of it this > is anyway perhaps a good idea. This function ca

Re: [PHP-DEV] [PATCH] Namespace Patch, Alpha 3

2005-07-20 Thread Jessie Hernandez
"Marcus Boerger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Please don't add new ini settings here, living with include_path should be > enough, wouldn't it? > Do we want the import behavior to apply to the existing include path? To me, it seems nice to have the include_path and

[PHP-DEV] Re: YANP (Yet Another Namespace Proposal)

2005-07-17 Thread Jessie Hernandez
'm tired now ;-)). BTW, I tried to do a "cvs add" to add my test files, but of course, it failed with an "cvs add requires write access to repository" error. Hence, I had to zip up the files separately. How can I add new files locally so that cvs diff picks them up

Re: [PHP-DEV] Interesting zend_executor_globals Find...

2005-07-12 Thread Jessie Hernandez
and you are very likely to > end up with a segfault. > > -Andrei > > > On Jul 11, 2005, at 9:36 PM, Jessie Hernandez wrote: > > > > > Does anyone know why this happens? > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] Interesting zend_executor_globals Find...

2005-07-11 Thread Jessie Hernandez
RESOURCES]; 4) make clean (or simply delete all the *.o and *.lo files under Zend/) and compile PHP again. All executed scripts work as usual, and no segfault is produced. Does anyone know why this happens? Regards, Jessie Hernandez -- PHP Internals - PHP Runtime Development Mailing List T

Re: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-11 Thread Jessie Hernandez
The attached patch includes variable class name support (test file has also been updated). To clarify for the benefit of others, this means that the code below will work. Note that imports are still done on "file-level" scope, even at runtime, so you can only create objects using variable import cl

Re: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-10 Thread Jessie Hernandez
Stanislav, Correct, in fact, I began to work on this yesterday. My approach will be to translate whatever's possible at compile-time, as I'm doing now, and saving the import alias info for what's needed at runtime, such as in the case of variable class names. This hashtable will also be needed for

RE: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-08 Thread Jessie Hernandez
David, You are right, classes that don't use self might break, although there might be a solution for this: when a class declaration is started, immediately "import" the class. This will fix the problem, but I don't really think it's necessary. After all, if you're using an new feature as namespac

[PHP-DEV] Re: YANP (Yet Another Namespace Proposal)

2005-07-08 Thread Jessie Hernandez
For previewing purposes, I have attached a patch of what I have so far so that others can look at it and try it out. I have also attached two PHP files for testing (_testns.php is the script that should be run after the patch is applied. This script includes a class from class3.php to demonstrate t

Re: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-07 Thread Jessie Hernandez
Could you elaborate on this? Let's say we have the following situation: - a.php does a full namespace import of "my_namespace". - The /my_namespace directory has two files (classes), class1.php and class2.php. - a.php has the following code: - After a.php is first run, a new file, class3.php, is

Re: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-07 Thread Jessie Hernandez
I'm still debating whether importing all symbols from a namespace is a good idea or not (I sometimes use Java at work, and I never import a full package myself, and this is not recommended anyways). But, if it were to be implemented, then below is how I would approach it. The following would be req

Re: [PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-07 Thread Jessie Hernandez
Actually, this will work! In the "class_name_reference" rule, the "zend_do_fetch_class" function is called. Inside this function, class_name is a znode, and what is assigned to the opcode is "opline->op2 = *class_name". This function is changed to check the import hashtable, and if a match is found

[PHP-DEV] YANP (Yet Another Namespace Proposal)

2005-07-06 Thread Jessie Hernandez
the above approach, in order to see if I should continue making these changes or not. If there is enough demand, I will post the patches of what I have so far, even though it's not complete. Regards, Jessie Hernandez -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

<    1   2