Re: superglobals
| From: | Alan Knowles | Date: | Tue, 13 Apr 2004 14:59:34 +0000 |
| Subject: | Re: superglobals | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-550@lists.php.net to get a copy of this message | ||
you can use treecc in pnet (see dotgnu/portable .net) to write aspect code for PHP (I wrote the driver a while back.. AFAIK it still works)
It does unfortunatly add a generation stage to create programs.. but is quite interesting.
Regards
Alan
marcus@skysaber.com wrote:
Hey DvdmanDt, Aspect Oriented Programming (AOP) is a not-so-new paradigm for centralizing crosscutting features in an application. It is beginning to see real world use via AspectJ, a Java implementation of AOP. AOP is not really well defined. It has lots of implementations and "suggested" ways of implementing. I for one would love to see Aspects introduuced at some level to PHP, and it seems like Pecl would be the appropriate place. Aspects have thus far not been incorporated into the core of many languages (none that I know of). It has mostly been by way of extensions in the best cases, and hacks in the worst. Extensions provide namespace and the ability to add aspects, pointcuts and rules (joinpoints) to a language, and for Framework developers such as myself and Jackson, this would be huge. To have multiple functions listen to advice from aspects would be pretty huge. It would take out the consistent use of error handling and logging etc. that I have in many of my library calls in our framework (and I think other frameworks deal with the same issues). Here is a link with lots of info regarding research and implementations of Aspects in languages today. http://www.aosd.net/technology/research.php Hope you fiind it usefuul. Quoting DvDmanDT <dvdmandt@telia.com>:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comSounds better to have it compiled in, cause otherwise some ppl will for sure start using it in their scripts, and stuff wont be portable and lots of setup issues and.. .. Well.. You get the point.. Also, can someone give me a link with an explanation of what aspects are? I read about it few years ago, but I never really understood it... So anyone? -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com "Sara Golemon" <pollita@php.net> skrev i meddelandet news:20040409153101.43112.qmail@pb1.pair.com...I looked into just this thing a couple months ago and (Davey Shafik wanted to create an _APPLICATION superglobal to make supersessions that would be shared amongst all users of a particular application). Unfortunately,whatWez just stated is absolutlely the case. Any superglobals must be defined *prior* to compile time so registering superglobals from within an application (via something like superglobal_create('_FOO'); ) would not work. The best you'd be able to manage would be to create an .ini option to specify superglobals you want defined. Further, such a module could notbeloaded by dl(), but would have to be loaded in an extension directive (or compiled in staticly). php.ini: extension=php_superglobals.so superglobals.user = _FOO, _BAR, _BAZ, _APPLICATION, _ASPECT, etc.... <?php $_FOO = "Foo"; function bar() { echo $_FOO; } bar(); -Sara "Wez Furlong" <wez@thebrainroom.com> wrote in message news:052201c41e1a$da802270$8a02a8c0@tron...butas I recall, superglobals are resolved at script compile time, so a superglobal() function you can call from PHP won't be possible. You can add your own superglobals in your extension; however, since this isn't really going to meet the needs of others, it probably won't make sense to put it into PECL. (unless you have a really cool useful idea ;-) --Wez. ----- Original Message ----- From: "Robert Cummings" <robert@interjinn.com> To: "Andrey Hristov" <php@hristov.com> Cc: "Jackson Miller" <jackson@tekzen.net>; "PHP-PECL" <pecl-dev@lists.php.net>; <marcus@skysaber.com> Sent: Friday, April 09, 2004 11:00 AM Subject: Re: [PECL-DEV] superglobalspossibleOn Fri, 2004-04-09 at 05:45, Andrey Hristov wrote:question.Jackson Miller wrote:Please excuse me if this is not an appropriate forum for this(empty)The short question is: Is it possibly to create a PECL extension for PHP that adds a newsuperglobal variable? If so, then I am assuming it would betocreate a PECL extension for adding a superglobal() method. I know this question has been discussed on php-dev a few times,-- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpthosethosediscussions have resulted in no solution (and I was not part ofPECL is about special needs though, is it not? I don't see why an outcome decided by internals should affect something in PECL. Is it possible anyways to added a new super globals entry via an extension?discussions).AFAIR it was decided that adding such a function is a bad idea.