[PHP-DEV] __call for the namespaces
This idea spawned from playing with ext/rpc and the ability to declare class types on the fly Since zend_namespaces is really _zend_class_entry I think it would be cool to implement __call at the namespace level. namespace java { function __call($classname) { // this will be called every time a new java::$classname() is called // and $classname isn't defined eval( class $classname { } ); // and it can return the new class return new $classname(); } } This doesn't seem like it would be too hard to implement and it will allow me to do stuff like... ? $j = new java::java.util.Stack(); // $j could be of ns java:util and class Stack $s = new soap::myObject(http://server/some.wsdl;); // $s could be the namespace defined in the wsdl and of class myObject ? ps: ? namespace test { class test1 { function doSomething() { eval( class test2 { } ); } } } $test1 = new test::test1(); $test1-doSomething(); ? results in... bFatal error/b: Internal Zend error - Missing class information for in b c:\php\php5\Release_TSDbg\name.php(7) : eval()'d code/b on line b2/bbr / - Brad __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] RPC Extension
I was just playing with the RPC extension. Don't you think that the rpc layer should pass along TSRMLS_CC to all of the callbacks? rpc_call(rpc_string, void *, zval *, int, zval *** TSRMLS_CC); - Brad __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] RPC Extension
Other issues: 1) Passing This to callbacks Also I think we should pass getThis() to the handlers too rpc_call(zval *this, rpc_string, void *, zval *, int, zval *** TSRMLS_DC); 2) Return object types I see that the rpc layer is actually trying to register a new zend class for every new Com(someclass); and someclass will actually be a class... now how does that work for return values. $j = new Java(java.util.Vector); // now $j will be of type 'Vector' $j-add(string); $e = $j-elements(); /* now this returns type 'Enumeration' but since it wasn't called new Java() */ how do you register 'Enumeration' so it will be created like Vector was. A similar thing is exceptions.. Do we want to auto register exceptions.. you could so something like this try { $j = new Java(java.util.Stack); $j-pop(); } catch(java:util:EmptyStackException $e) { $e-printStackTrace(); } 3) Namespaces RPC should probally auto-register the class with a namespace too. rpc_name(rpc_string hash, rpc_string *name, rpc_string *ns, void *data, int type); so in the case of java.util.Vector we could register Vector in the java:util namespace. 4) Segfault RPC was segfaulting in rpc_objects_new() I changed this part... zend_ts_hash_init(intern-function_table, 0, NULL, NULL, TRUE); /* intern-function_table.reader = 0; intern-function_table.mx_reader = tsrm_mutex_alloc(); intern-function_table.mx_writer = tsrm_mutex_alloc();*/ 5) Possible Feature From what i understand too you can do stuff like this... $c1 = new com('test'); $c2 = new test(); $j1 = new java('java.util.Stack'); $j2 = new java:util:Stack(); Right (if we implemented the namespace thing)? now what i find interesting if we can come up with a way to get rid of the inital $j1 = new java('java.util.Stack'); and skip right to doing this $j2 = new java:util:Stack(); I don't know if thats possible.. maybe with some of the autoload() ideas, or even better having the rpc layer set a namespace that it 'listens to' and every time a new (defined ns)::Class() is called then it would call the extensions ctor and try to register the class ex.. $j = new com:some_com_class(); // where the com extension registerd for the com ns or $j = new php_java:java:utils::Vector(); // and the java ext registered php_java well anyways it would be pretty cool. . . . If you couldn't tell im trying to convert ext/java to ext/rpc/java. I got the functions down, im still learning what ext/rpc is actually doing. But i'll really need the zend *this; to go forward just from the way the old ext/java works. - Brad --- Brad LaFountain [EMAIL PROTECTED] wrote: I was just playing with the RPC extension. Don't you think that the rpc layer should pass along TSRMLS_CC to all of the callbacks? rpc_call(rpc_string, void *, zval *, int, zval *** TSRMLS_CC); - Brad __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] iterating objects with interfaces
This IS pretty cool stuff. Just a comment about the namespace, as i see more of these things added as time goes on. since you are already adding the 'spl' namespace why are you prefixing the classes with the namespace still? This is the whole point of using namespaces. I feel it should be spl::foreach spl::forward spl::key btw. what does 'spl' stand for? - Brad --- Andrei Zmievski [EMAIL PROTECTED] wrote: Very cool. :) On Sun, 09 Mar 2003, Marcus Börger wrote: Hi, i've just done the first step for a new extension which shall make use of interfaces newly implemented in ZE2. currently the extension implements the namespace spl and the interfaces spl_foreach, spl_forward and spl_key. A class that implements these can be used in a foreach() call. This work without even modifying the engine, i simply hook on the necessary calls. References: The documentation of the interfaces and their usage: http://marcus-boerger.de/php/ext/spl/spl.phps The extension code: http://marcus-boerger.de/php/ext/spl/spl-20030309.tar.bz2 And a testfile to demonstrate it works (beside shutdown): http://marcus-boerger.de/php/ext/spl/tests/foreach.phpt Of corse i am curious about other meanings :-) Otherwise i wouldn`t have posted here, would i? regards marcus -- -- Marcus Börger - Looking for all sorts of freelance work - just ask... Did i help you? Consider a gift: http://www.amazon.de/exec/obidos/wishlist/ho722v0rg1u0 -- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -Andrei http://www.gravitonic.com/ * I don't mind going nowhere as long as it's an interesting path. * -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] bug in zend_API.c (with patch)
Why can't you just simply name your classes all lowercase. All of the extensions currently do this and it works fine. - Brad --- Eric Lambart [EMAIL PROTECTED] wrote: Hello. After a short bout of hair-pulling, I have discovered the source (in the Zend engine) of a recent problem, and have fixed it. BACKGROUND: As I have mentioned previously on this list, I am developing a complex PHP extension, which among many other things creates its own PHP classes, and when these classes are instantiated, I manually call the class constructor (as one must) from my C code. I am creating the extension from existing C++ and Java versions of the same system, so I am trying to maintain things as much as possible, including names (including capitalization) of classes and functions (although I am prefixing them all with eo_ to avoid potential conflicts with functions and classes from other PHP extensions). Thus, I have classes such as eo_list, eo_table and eo_NVList. THE SYMPTOM: I had no trouble instantiating and calling the constructors for the first two classes, but when I tried to do it for eo_NVList, call_user_function_ex() was returning FAILURE, which I discovered can occur for one of seven reasons. I tracked down the problem to a failure of zend_hash_find() to lookup the function. Using zend_hash_display() I was able to verify that the eo_NVList constructor was indeed contained in the function table for the eo_NVList class. THE PROBLEM: call_user_function_ex() is converting the requested function name to lower case (at zend_execute_API.c:463) before performing the zend_hash_find(), but zend_register_functions() (in zend_API.c) does NOT convert the function names to lower case before storing them in the function table--so call_user_function_ex() was searching for a function called eo_nvlist and could never find eo_NVList! Class lookups worked fine of course, because object_init_ex() takes a pointer to the class entry rather than a name. Additionally, zend_register_internal_class() (also in zend_API.c) converts all class names to lower case, and execute() (in zend_execute.c) does the same when looking up a class to instantiate it from a script. I haven't looked into script-driven function registration and execution, but presumably case-insensitivity is properly supported there, or I'm sure you would have heard of it long ago! MY SOLUTION: I present the following little patch for your approval. I apologize that it is done against 4.3.1 rather than the latest CVS but I do not have time to deal with CVS at this time, as my project is already behind schedule and of course I need to work with a stable engine. If zend_API.c has changed since the 4.3.1 release, it should be trivial to change these few lines of code (yes, I'm sure they all say that!). =) I didn't find any patch submission guidlines in a quick web search; I'm afraid you'll have to change the file/pathnames in the first lines. If you don't want to deal with that, point me to the guidelines and I will resubmit the patch. For now I will get back to work. Respectfully, Eric Lambart --- Zend/OLD_zend_API.c Wed Oct 9 07:17:52 2002 +++ Zend/zend_API.c Fri Mar 7 13:10:38 2003 @@ -1039,6 +1039,12 @@ internal_function-type = ZEND_INTERNAL_FUNCTION; while (ptr-fname) { +/* store all function names in lower case so they will always be found by + * call_user_function_ex() */ +size_t fname_len = strlen(ptr-fname); +char *lowercase_name = zend_strndup(ptr-fname, fname_len); +zend_str_tolower(lowercase_name, fname_len); + internal_function-handler = ptr-handler; internal_function-arg_types = ptr-func_arg_types; internal_function-function_name = ptr-fname; @@ -1047,7 +1053,7 @@ zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); return FAILURE; } - if (zend_hash_add(target_function_table, ptr-fname, strlen(ptr-fname)+1, function, sizeof(zend_function), NULL) == FAILURE) { + if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, function, sizeof(zend_function), NULL) == FAILURE) { unload=1; break; } -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [SOAP] PEAR / Soap Problem
Well the PEAR::Soap is defintly more stable and has more features and supports more of the soap spec, where PECL/soap is written in C and is faster. There are some people using PECL/soap in production but it defintly still is still in a unstable mode. So its purely up to your needs. - Brad --- Steve Johnson [EMAIL PROTECTED] wrote: Cool, thanks for clearing that up. Would anyone here recommend one over the other? I've obviously only used the PEAR::Soap library. Thanks On Wed, 2003-02-12 at 10:21, Brad LaFountain wrote: Well, there are in fact TWO different soap libaries in soap that you both are referring to PEAR::Soap and a soap in pecl, he was referring to the PECL one not the PEAR::Soap, i know this is confusing... one is writtin in php where the other is written as a php extension in c. - brad --- Steve Johnson [EMAIL PROTECTED] wrote: First, I don't know of a module(compiled object file), although there may be? As far as I know you only have to include the PEAR/php module like so: include(SOAP/Client.php); And the sample file in my source shows something more like this: $wsdl = new SOAP_WSDL(http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl;); $soapclient = $wsdl-getProxy(); -Luck On Wed, 2003-02-12 at 04:50, Bruns Jan wrote: Hi all, I have got a question regarding your Pear / SOAP Package. After installing Pear and the Soap package I am not able to execute the following PHP script: //simple example to check soap extension client is working.. dl('soap.so'); echo create client\n; $soapclient = new SoapObject(http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.ws dl); echo sending getquote\n; $ret = $soapclient-getQuote(ibm); print_r($ret); echo done; The problem is that 'soap.so' is not found at all on the system. The following message comes up: Warning: Unable to load dynamic library '/usr/lib/php4/soap.so' - /usr/lib/php4/soap.so: cannot open shared object file: No such file or directory in /var/www/html/test.php on line 11 Where is soap.so distributed? Have you got any suggestions? I am using Rad Hat 7.3, and the Soap 0.7.1 package. Any Help Would be appreciated! Thanks, Jan Bruns -- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- You can get my public key at http://steve.webninja.com or search for KeyID 0x0F737450 at www.keyserver.net ATTACHMENT part 2 application/pgp-signature name=signature.asc __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- You can get my public key at http://steve.webninja.com or search for KeyID 0x0F737450 at www.keyserver.net ATTACHMENT part 2 application/pgp-signature name=signature.asc __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [SOAP] PEAR / Soap Problem
sorry, ignore this, wrong list --- Brad LaFountain [EMAIL PROTECTED] wrote: Well the PEAR::Soap is defintly more stable and has more features and supports more of the soap spec, where PECL/soap is written in C and is faster. There are some people using PECL/soap in production but it defintly still is still in a unstable mode. So its purely up to your needs. - Brad __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZE2 , static variables and friends
Check your syntax I don't know how many times people have asked a question like this and they mess up the $'s class test { static $foo = ''; } class test2 { var $how = 3; } $bar = new test2; test::$foo = $bar; echo How ? .test::$foo-how; where you had echo How ? .test::$foo-$how; now what php is trying to do here, is derefrence the local variable $how which has no value and then get the property of $foo with the value of nothing if you said $how = 'how'; then did echo How ? .test::$foo-$how; then you would get the correct output. Get it? - Brad --- Mickael BAILLY [EMAIL PROTECTED] wrote: Why can't I do this: -- class test { static $foo = ''; } class test2 { var $how = 3; } $bar = new test2; test::$foo = $bar; echo How ? .test::$foo-$bar; -- output gives me 'How ? ' Is it a PHP/ZE2 bug? If not, how to do that right ? -- NetClub'ment votre Mickael BAILLY http://www.netclub.fr/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP in 2003 (leading to PHP 5)
3. Bundle PHP-Soap (and stop the bleeding of PHP users) I know I've been saying for a while now that I'm going to start working on this again but I have yet to do it. I do plan to work on this again. I would like to see it bundled with php5 but it defintly needs some work. If its possible I would like to get a general timeline for a cycle of php5 so I can know if I can get it to a release level before then or if I need help. I know there are other issues with it too... like bundling libxml2 but they can all be worked out. as you can notice I stripped out all the rest of the email ;) - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] T_PAAMAYIM_NEKUDOTAYIM
--- Bertrand Mansion [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote : I guess I am going to have to write stupid code such as: switch ($param1) { case 'parser1': return parser1::method(); case 'parser2': return parser2::method(); } call_user_func(array($param1, 'method')); No. Undefined variable this in $param1. Get it ? No. The code you displayed (in the switch block) is 100% identical to the code Derick offered (except for the fact that Derick's example will handle any class name while yours is limited). $classname::method() === call_user_func(array($classname,'method')); No. $classname::method() is illegal and is in no case === to call_user_func(array($classname,'method')) as you state it. Class foo { function bar() { echo $this-param; } } Class MyObject { var $param; function MyObject($param) { $this-param = $param; foo::bar(); } } $obj = new MyObject('out of this'); will print 'from MyObject'. This SHOULDN'T print 'out of this', This seems like a bug, and you SHOULDN'T depend on this functionality. The scope of $this inside class foo method bar, Should be to foo::bar NOT MyObject::MyObject. Which if my memory serves me right $this inside a static method will just be the string of the current class? While, Class MyObject { var $option; function MyObject($option) { $this-option = $option; call_user_func(array('foo', 'bar')); } } will return 'Undefined variable: this'... This should be the way that both examples function. $this is a refrence to the current object. inside a static method like foo::bar() there is no $this defined because its static. - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] T_PAAMAYIM_NEKUDOTAYIM
--- Bertrand Mansion [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote : --- Bertrand Mansion [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote?: $classname::method() === call_user_func(array($classname,'method')); No. $classname::method() is illegal and is in no case === to call_user_func(array($classname,'method')) as you state it. Class foo { function bar() { echo $this-param; } } Class MyObject { var $param; function MyObject($param) { $this-param = $param; foo::bar(); } } $obj = new MyObject('out of this'); will print 'from MyObject'. This SHOULDN'T print 'out of this', This seems like a bug, and you SHOULDN'T depend on this functionality. The scope of $this inside class foo method bar, Should be to foo::bar NOT MyObject::MyObject. Which if my memory serves me right $this inside a static method will just be the string of the current class? Hi Brad, Are you sure about that ? The manual states that this is the normal behaviour which I find very handy and useful in many cases. I see a lot of possibilities with this feature, for instance a way to develop some kind of plug-ins for existing classes without having to extend them. Where in the manual do you see this? This can probably lead to some dangerous code but this goes far beyond my knowledge. besides dangerous code if you find yourself doing this, you probally aren't designing it correct. Your creating a static method of a class to access local properties of another class thru the use of $this. If you want a way to access member variables from a class in a static method, pass the object refrence into the method. Class foo { function bar($obj) { echo $obj-param; /* $this should referr to the foo refrence, not another class refrence */ } } Class MyObject { var $param; function MyObject($param) { $this-param = $param; foo::bar($this); } } - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FR: echo line
Do you realize how ugly that is? What benifit would that have over something way more readable like: ?php for(..) { echo \ttd\n; } ? -Brad --- Jari Vuoksenranta [EMAIL PROTECTED] wrote: I have a feature request: I'd like to have '#' comment like macro which would expand _ foo to ? foo\n?php. Has this been requested before? If so, why it wasn't implented? e.g. ?php for(..) { _ td } ? would echo \ttd\n to page. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: persistent java virtual machine under PHP
--- Akos Maroy [EMAIL PROTECTED] wrote: Ivan Ristic wrote: I do not think that is possible, unless PHP engine itself is contained within a single process (and runs multithreaded). Which it isn't (under Apache 1.x , at least). I'm not familiar in general with the PHP engine, so my questions may be quite stupid. Anyway: How is a persistent database connection handled then? e.g. in the mysql module? looking at the mysql module source code, it seems that there is a list called persistent_list, used in such a manner: zend_hash_find(EG(persistent_list), hashed_details, hashed_details_length+1, (void **) le would this provide some persistnece? If yes, how to use it exaclty? (I couldn't make it work myself.) It seems to me that libphp_java.so is unloaded every once in a while. For example, global static variable defined in the module get re-initialized every once in a while. Is this so? Are you sure its getting unloaded or is it starting up in another httpd? - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] pecl extensions
--- Alan Knowles [EMAIL PROTECTED] wrote: Brad LaFountain wrote: I know I'm going to piss people off by asking this but how do I create a new pecl package? I think I want going to put php_opengl in there. See if gets anymore use. upload it to pear/PECL/opengl.. (You should have karma for that already) you nead a pear account re: the web site for uploading releases. http://pear.php.net/?devme= and then refresh the page. I think you have to apply for an account on the pear page - (If it messes up cause you've already got a CVS account just report it here and somebody will fix it:) after that just set up a package.xml file as per the other PECL folders and do pear package then upload the resulting file-rev.tar.gz Thanks i'll try that soon. P.S. Hows the SOAP going :) Well after formatting my computer I finally have my dev envrionment back up. I started to get back to it. I havn't put that much time into it. Don't worry I won't let it die, unless it already is dead :). - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] pecl extensions
--- John Coggeshall [EMAIL PROTECTED] wrote: Brad: I'm going to take a real stab in the dark here and say that you know Shane Caraveo. I was at PHPCon with him presenting in October and I was talking about an idea I had to implement opengl in PHP... He said that someone by the name of Brad (at least, that's what I recall) was working on a extension and I should get in touch with him... Well, needless to say I forgot until just now... Yeah I know that shady guy Shane. What is the status of this extension? Is it experimental, stable, etc? Just curious... Well, it's defintly experimental. There are bindings for opengl and glut. You can run some sample apps that use the glut api. Its pretty cool. Me and Marcus were working on off screen redndering with OSMesa. That would allow you to render a scene without needing to display it somewhere, caputre the content and spit it out as an image. That worked pretty decent, it worked on windows but i had issues with it running under linux. It could reneder a sceen and spit out a png. I remember Andrei told me that there were issues using the api with gtk-opengl but im sure they could be addressed. - Brad John -Original Message- From: Brad LaFountain [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 8:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] pecl extensions I know I'm going to piss people off by asking this but how do I create a new pecl package? I think I want going to put php_opengl in there. See if gets anymore use. - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] pecl extensions
--- John Coggeshall [EMAIL PROTECTED] wrote: Yeah I know that shady guy Shane. Heh. He is shady, isn't he? ;) Well, it's defintly experimental. There are bindings for opengl and glut. You can run some sample apps that use the glut api. Its pretty cool. Me and Marcus were working on off screen redndering with OSMesa. That would allow you to render a scene without needing to display it somewhere, caputre the content and spit it out as an image. That worked pretty decent, it worked on windows but i had issues with it running under linux. It could reneder a sceen and spit out a png. I remember Andrei told me that there were issues using the api with gtk-opengl but im sure they could be addressed. My thoughts on it were exactly where you are going with it. However, why do you need OSMesa in order to do off-screen renderings? It would seem to me you should be able to render directly to a backbuffer and copy the bitmap into a GD buffer... Or am I missing something? Well from my understanding, that just doesn't work, this backbuffer that you are talking about IS OSMesa. Again I'm no opengl guru but thats why OSMesa was created is for this type of rendering. Maybe OSMesa is just used for offscreen HARDWARE rendering, If you can find some docs/info how to do this maybe I can look into it. I do have a working sample of osmesa working. if you goto sf.net/projects/phpopengl there is a link that says phpopeng/osmesa in action, that link is broken cause i havn't paid for my dynamic ip account recently. if you wanna see it work ill give you my ip when i get home. - Brad John -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] pecl extensions
I know I'm going to piss people off by asking this but how do I create a new pecl package? I think I want going to put php_opengl in there. See if gets anymore use. - Brad __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP and Java
--- Marc Richards [EMAIL PROTECTED] wrote: Hi, I am looking for any info or documentation on using PHP in a servlet environment. I read what I could find on php.net, and found a couple things using google, but not enough to answer my questions. If someone could tell me where to look that would be great. I am very interested in seing PHP more tightly integrated with J2EE as I think that it would add the reliabilty and scalability of the J2EE platform to the ease of use of PHP, and allow a smooth transition for the existing PHP user base, who need to do things with Java. These are the type of questions I have right now: 1) Is this a pure Java version of PHP? No. And why would there be ;) 2) What functionality is available? (only core functions? Some extention libraries) There are 2 things you can do with ext/java 1) create instances of java objects thru the php's java class, You should have access of all the methods available for that object ex. $java = new Java(java.util.Hashtable); $java-put(Key, Value); echo $java-toString(); 2) php will run as a servlet engine, meaning you can run php scripts inside Tomcat. This is done all thru native methods. 3) How does it all work? (pass thru mechanism? are pages compiled as classes?) Pages are not compiled as classes they still exists as php scripts. 4) Does this make it eiasier to access Java servlets or EJBs? Does it increse performance? Well not sure exactly what you mean by accessing java servlets, You can access a java servlet by simply file(http://someserver.com/servlet/SomeJava.jsp?param=go;); That would make the servelet execute but I might not know what you mean by access. I guess if you wanted to you could use the Java() class to create an instance of a servlet class and invoke its methods directly. Accessing a EJB from a php script should be fine, (this is purely theory never tried it or even fully thought it thru). If you take the steps that you would to create a refrence of an EJB from java and replicate it using ext/java it should work. Here is a quick example from OpenEJB HelloWorld example http://openejb.sourceforge.net/hello-world.html ? $p = new Java(java.utils.Properties); //The JNDI properties you set depend //on which server you are using. $p-put(java.naming.factory.initial, org.openejb.client.JNDIContext); $p-put(java.naming.provide.url, 127.0.0.1:4201); $p-put(java.naming.security.principal, myuser); $p-put(java.naming.security.credentials, mypass); //Now use those properties to create //a JNDI InitialContext with the server. $ctx = new Java(javax.naming.InitialContext, $p ); //Lookup the bean using it's deployment id $obj = $ctx-lookup(/Hello); //Be good and use RMI remote object narrowing //as required by the EJB specification. //** This may not work with ext/java extension *** $pro = new Java(javax.rmi.PortableRemoteObject); $helloHome = new Java(HelloHome); $ejbHome = $pro-narrow( $obj, $helloHome-class); //** This may not work with ext/java extension *** //Use the HelloHome to create a HelloObject $ejbObject = $ejbHome-create(); //The part we've all been wainting for... $message = $ejbObject-sayHello(); //A drum roll please. echo $message; ? So except for the static access to class from helloHome It should work. Maybe if I get borred some time i'll try it. 5) Who is responsible for development of this extension? Sam Ruby was the orig developer. I've played with it. I don't think anyone has done any new development in awhile. 6) When do you expect a non experimental version will be available When more intrest becomes of it and someone wants to claim any new development. - Brad __ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] short_open_tag
It would be very bad for php if short tags were disabled. I 100% agree with andi. There are ways of dealing with xml and php without pissing off the WHOLE php user world. I don't even use long tags EVER, nor will I want to start. - Brad --- Andi Gutmans [EMAIL PROTECTED] wrote: At 03:33 PM 10/22/2002 +1000, Terence Kearns wrote: Agreed. If short tags were disabled in v5, then there would be no such need for a hack like this. They won't be disabled. They won't be disabled. They won't be disabled. They won't be disabled. They won't be disabled. They won't be disabled. They won't be disabled. They won't be disabled. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] trying to understand zvals
PHP_FUNCTION(ref_assign) { zval *bar, *foo; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, zz, bar, foo) == FAILURE) { return; } ZVAL_ADDREF(foo); *bar = *foo; bar-is_ref = TRUE; bar-refcount = 1; } this works, but i don't know if its the best way to do it. - Brad --- Tim Daly, Jr. [EMAIL PROTECTED] wrote: I'm trying to do some extension programming, and I'm pretty confused by the whole zval thing. In particular, references are a little mysterious. If I have $foo = zonk; $bar = $foo; in PHP, what actually happens? Specifically, if I wanted a function that did such a reference assignment: $foo = zonk; $bar = baz; ref_assign($bar, $foo); // $bar = $foo; what has to happen in ref_assign? Thanks, Tim -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] default properties (in c)
Ok, I don't think default_properties is what you are looking for. default_properties store the information about defined variables and their default value. Like this: class MyClass { var $test = mytest; } at compile time MyClass class_entry will have test = mytest in its default properties. Where as: $t = new MyClass(); $t-other_test = my other test; at runtime other_test = my other test will be stored in zend_object.properties. So from your example I beleieve you are just trying to do the second case. So if this is true then. void define_a_class() { /* make a class with two properties, one of which is an array */ zval *obj_inst; zval *array; INIT_CLASS_ENTRY(tmp_class_entry, class_name, class_name_functions); class_name_class_entry = zend_register_internal_class(tmp_class_entry); MAKE_STD_ZVAL(obj_inst); object_init_ex(obj_inst, tmp_class_entry); add_property_null(obj_inst, prop_name); // defined in zend_API.h MAKE_STD_ZVAL(array); array_init(array); add_next_index_string(array, foo, 1); add_property_zval(obj_inst, prop_name1, array); // defined in zend_API.h } - brad --- Derick Rethans [EMAIL PROTECTED] wrote: On 8 Oct 2002, Tim Daly, Jr. wrote: Brad LaFountain [EMAIL PROTECTED] writes: What engine are you working with 1 or 2? -brad I imagine PHP3 == engine 1, and PHP4 == engine 2? PHP 3 is engine 0.5, PHP 4 is engine 1 and PHP 5 will be engine 2 :) So you're most likely using engine 1. Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] default properties (in c)
What engine are you working with 1 or 2? -brad --- Tim Daly, Jr. [EMAIL PROTECTED] wrote: Hi everybody. I'm working on an extension that creates classes, and I want to add class variables to the classes. It looks like, internally, class variables are stored in the zend_class_entry.default_properties hash. Manipulating this hash has the effect desired, however I seem to have misunderstood the memory management issues somehow; the code below causes leaks and crashes. Is there an official way to add class variables to a class from C? Is there anything obviously wrong with the code below? Thanks!! -Tim static zend_class_entry *class_name_class_entry; static zend_class_entry tmp_class_entry; int add_default_property_null(zend_class_entry *class_entry, const char *name) { zval *property; int ret; MAKE_STD_ZVAL(property); ZVAL_NULL(property); return zend_hash_update(class_entry-default_properties, name, strlen(name)+1, (void *)property, sizeof(zval *), NULL); } int add_default_property_zval(zend_class_entry *class_entry, const char *name, zval **value) { zval *aval; MAKE_STD_ZVAL(aval); *aval = **value; zval_add_ref(aval); zval_copy_ctor(aval); return zend_hash_update(class_entry-default_properties, name, strlen(name)+1, (void *)aval, sizeof(zval *), NULL); } void define_a_class() { /* make a class with two properties, one of which is an array */ zval *wrapper; zval *array; INIT_CLASS_ENTRY(tmp_class_entry, class_name, class_name_functions); class_name_class_entry = zend_register_internal_class(tmp_class_entry); add_default_property_null(class_name_class_entry, prop_name); MAKE_STD_ZVAL(array); array_init(array); add_next_index_string(array, foo, 1); add_default_property_zval(class_name_class_entry, prop_name1, array); } -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Calling an external C function under Unix
You could write a wrapper extension around your c libary. - brad --- Anna Sotnichenko [EMAIL PROTECTED] wrote: Hello All! I want to transfer a PHP script with minimum changes from IIS under Win2000 to Unix. My ISAPI PHP script calls some external C-functions through PHP W32api extension. Is there a way to call external C-function from PHP-script under UNIX? Thanks in advance. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] destructor in domxml not freeing all memory, any clues?
I don't think this is the problem but when using libxml i found i need to call xmlCleanupParser(); after I parse a file. - brad --- Christian Stocker [EMAIL PROTECTED] wrote: Hi I just watched my apache and simply doing domxml_new_doc(1.0); eats memory on the httpd process, which is not released after script end. not much, but constantly... the destructor code for a DomDocument Object looks the following: static void php_free_xml_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) { xmlDoc *doc = (xmlDoc *) rsrc-ptr; if (doc) { node_list_wrapper_dtor(doc-children); node_wrapper_dtor((xmlNodePtr) doc); xmlFreeDoc(doc); } } there are no children, so node_list_wrapper_dtor does nothing here. node_wrapper_dtor is (shortened to the relevant stuff): * static inline void node_wrapper_dtor(xmlNodePtr node) { zval *wrapper; wrapper = dom_object_get_data(node); if (wrapper != NULL ) { zval_ptr_dtor(wrapper); } } * Anyone any idea, what I have to release additionally to avoid this memory leak? I'm not (yet) that much of an expert in ZE :) TIA chregu -- christian stocker | bitflux GmbH | schöneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [EMAIL PROTECTED] | gnupg-keyid 0x5CE1DECB -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] array_diff not working with last element different
When using array diff, if the last element and only the last element is different it won't be returned as a difference. ? $ar = array(b = 1, blah = 1); $a1 = array(b = 2, blah = 2); var_dump(array_diff($ar, $a1)); ? array(2) { [b]= int(1) [blah]= int(1) } ? $ar = array(b = 1, blah = 1); $a1 = array(b = 1, blah = 2); var_dump(array_diff($ar, $a1)); ? array(0) { } I can't look at this right now maybe I can later or tomarrow. - Brad __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] array_diff not working with last element different
Well I tried to use them like that, So I guess there is a little need. I wrote a simple php function to do the same thing. I would volunteer but I have alot of stuff going on. Maybe if I get borred sometime soon. - brad --- Stig Venaas [EMAIL PROTECTED] wrote: On Tue, Aug 27, 2002 at 05:04:41PM +0300, Andrey Hristov wrote: so, is there need of array_adiff()? Right, it should then work on ordered pairs, right? Only remove (key, value) pair from 1st array if it exists in any of the others? Same goes for array_intersect... I'm not sure if there is that much of a need, but if there is one could either have new associative ones, or flags to the existing ones. But first we should see if there is a real need, then we need to see if someone will implent it. Stig -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Interfaces in PHP
--- Tim Converse [EMAIL PROTECTED] wrote: --- Brad LaFountain [EMAIL PROTECTED] wrote: 2) Interfaces as they exist in java don't really give you much in a stripting language but if you insist on having something like that you can curently do it with the zend1. class temperature { function __construct($value) {} function toCelcius() {} function toFarenheight() {} } just use that class and extend away Brad --- Not the same thing at all, as I'm sure you know. You usually want interfaces in addition to whatever (single) inheritance structure you already have. Well the zend1 example I gave was a workaround. But that is why I said if the deligation gets worked out in zend2 then you could acually do similar stuff. BTW I do use some stuff like this in some of my classes. I'll create a function with no implementation and any extending class can override that method and use its functionality (usally for event like stuff), so I don't have to call method_exists() before trying to call the method. - Brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PATCH: debug_backtrace() function for 4.3-dev/ZE1
--- Zeev Suraski [EMAIL PROTECTED] wrote: At 07:55 20/08/2002, Brad LaFountain wrote: You as a Zend owner who's business could be very propitable for Zend2 success or you as a php developer Brad, This is CLEARLY as PHP developers. We happen to have quite a bit of experience in getting the userbase to convert from one version to another - with PHP 3 and PHP 4. Most of the developers today were not involved with PHP around the time this happened (not all, of course). I said numerous times - having two major versions out there is a support nightmare we managed to avoid by succeeding to move the userbase from one version to another in a relatively short timeframe. Ok this experience you are talking about is converting php3 = php4 correct? Well how many people are were using php3 at that time? Siginifntly less? The conversion from php3 to php4 offered a more stable faster scripting language all around with more extensions more webserver support builtin session support etc etc. The conversion from 3 to 4 was a really obvious one. Ok now php is installed on how many million servers? It doesn't matter how many features you offer php4 isn't going to go away. Its like saying that apache 1.3 is going to go away. So we are stuck with the 2 major versions with or without debug_backtrace. Now keeping debug_backtrace outta zend1 may cohearse a few people to move to zend2 but how many more people could benifit from it in zend1. The ammount of time arugment till zend2 is released should have some berring if debug_backtrace being included in zend1. Besides whos to say that adding debug_backtrace now to 4.3 won't steer more people to php instead of other envrionments. We still need a carrot for people to convert to php ingeneral not just convering our current userbase to zend2. I really see what you and andi are saying here but I feel (I could be wrong) that the debug_backtrace won't keep zend1 around any longer than it will already be. Me personally I won't upgrade my servers running zend1. I'll probally only install zend2 on a differenet installation or on new servers. Holding back stuff like this is extremly frustrating to me and many others. - Brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PATCH: debug_backtrace() function for 4.3-dev/ZE1
First of all I wanna just say that I'm just stating my opnion. You seem to be getting angry. Im not trying to say your wrong and I'm right. Please don't take it like that. --- Zeev Suraski [EMAIL PROTECTED] wrote: At 17:21 20/08/2002, Brad LaFountain wrote: Ok this experience you are talking about is converting php3 = php4 correct? Both PHP/FI 2 = PHP 3 and PHP 3 = PHP 4 Well how many people are were using php3 at that time? Siginifntly less? The conversion from php3 to php4 offered a more stable faster scripting language all around with more extensions more webserver support builtin session support etc etc. The conversion from 3 to 4 was a really obvious one. No Brad, it wasn't. PHP 3 was already in use by over a million web sites when 4 came out. That's an insanely large number. Please, you weren't around back then, trust me when I tell you it wasn't easy at all to make this conversion happen. Just convincing the developer community to put the focus on the 4 CVS took months. The fact that we sent out a clear message that new features (and this IS a new feature) were going to be included in 4, and 4 only, later helped to get the developer community to upgrade. Ok now php is installed on how many million servers? Comparing apples and apples, we're talking about approximately 6 million I think. Significantly larger, but same order of magnitude. It doesn't matter how many features you offer php4 isn't going to go away. The same could be said about PHP 3. Do you have any idea what a large number *1 million domains* is? Hell, how about Windows 95, or NT4, which were all over the place. Who uses them anymore? I know pepole who use 95 and NT, hell we still have alot of them in my office and you know MS is still supporting them. Its like saying that apache 1.3 is going to go away. No, it's not. Let's compare apples and apples. If Apache 1.4 came out, then there are good chances that Apache 1.3 would have died, in the same way 1.2 is effectively dead, even though it was on millions and millions of servers. 2.0 is a rewrite with SERIOUS changes and issues, and it's highly debatable whether the gain from it is worth the price. See my previous post regarding this comparison... Well zend2 also has some serious changes and it introduces some bc issues. Maybe not major ones but it does introduce some. Besides whos to say that adding debug_backtrace now to 4.3 won't steer more people to php instead of other envrionments. I'm willing to be the first person to say this if no one beats me to it... Such a featurelet steering people to choose one technology/platform over the other? In one case ive heard someone didn't choose php becuase it doesn't support MI. Now ive heard this from a not very smart programmer but that was the decision. I know that thats absoulty obsurde but something like php doesn't support backtraces may or maynot lean someone twards php. I konw this isn't the majority but maybe a handfull. We still need a carrot for people to convert to php ingeneral not just convering our current userbase to zend2. I really see what you and andi are saying here but I feel (I could be wrong) that the debug_backtrace won't keep zend1 around any longer than it will already be. Me personally I won't upgrade my servers running zend1. I'll probally only install zend2 on a differenet installation or on new servers. Holding back stuff like this is extremly frustrating to me and many others. You won't upgrade even in a year's time, or even 1.5 year's time, when all new features, and at some point, security fixes, are available for it? That is my point, Brad, exactly. We barely have enough manpower to maintain one version, you seriously think we can maintain two? Every carrot to encourage migration, even if it's a minicarrot, should be used. By the way, if you really don't intend to upgrade to take advantage of new features and fixes, I'm willing to bet that these boxes are static boxes with legacy apps that won't include active development. As the feature in question is debugging/development related, I can't see how it will be useful in that setup. They would be semi-static boxes im sure there will be features and fixes that would be done on them and debug_backtrace would help in that effort. Obvisouly we all have our own opnion I wanted to state mine not get in a big argument about this. I do see your point, as a zend2 advocate, and im sure you see mine too, as a php user who wants debug_backtrace. So what to do, do you just call the shots or do we have an offical vote? - brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PATCH: debug_backtrace() function for 4.3-dev/ZE1
--- Zeev Suraski [EMAIL PROTECTED] wrote: At 19:35 20/08/2002, Rasmus Lerdorf wrote: We should not be talking about carrots here, and Thies is not saying screw you to you. He wants to help PHP users today. That almost sounds like a Microsoft tagline :) Come on, you know what he meant. If Andi didn't implement this efficient approach (which was not obvious, as the years that passed without it can prove), there are at least good chances that Thies wouldn't have the option of 'helping PHP users today' (the thing about algorithms is that you can't really say whether one is simple to come up with or not unless you came up with it). Andi feels that considering that it's his code, using it disregarding his objection is a slap in the face. Not a serious one, not something he'll remember forever, but still, a slap in the face. I don't see it as a slap in the face it should be considered a compliment that it was written well enough to be backported. We have a feature that doesn't destabilize anything or slow anything down as far as I can tell, and would be very useful to a whole bunch of users today. If that single point is not more important than anything else, then we are getting completely offtrack here. I disagree. Exactly the same could be said about sessions in the PHP 4 days, and a host of other features. We have to keep the roadmap in mind, and not only think about today, but also about tomorrow. (to clarify, I personally gave up on this particular issue and am fed up with it, but as I said, if this thread at least helped to prevent other stuff from being backported and got people to realize that shifting priorities is right around the corner, then maybe it was worth it). ( I did get this outta this thread. ) Well I hope Thies will commit it. Im outta this thread. - Brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Interfaces in PHP
--- Alan Knowles [EMAIL PROTECTED] wrote: From my reading of delegation, it's really overloading, worded slightly differently.. - but not that related to interfaces... In the example below, which is a php'ized version of a C# demo, the advantages of using interfaces (as far as I know) are primarly useful for COM or CORBA, where it would be possible to generate all the components for a CORBA/COM/.NET, or even java binding by reading the interfaces. A .NET binding would effectively define all the available interfaces and classes, with strong typing!, and then when called (from C# or .NET) invoke a C call to call_user_function, to run php exectuter (probably the best way to implement a .NET server in php, - compiling a loosely typed language into .NET bytecodes, from reading about python,perl etcs. experience is not the way to go..) Other than being nice for documentation, in pure PHP, I cant really see them being much use... Interesting subject anyway.. Regards Alan called from C# PHP_Celcius c = new PHP_Celcius(12.9); system.out(c.toFarenheight().toString()); Interface temperature { function __construct(float $value); float function toCelcius(); float function toFarenheight(); } There really are two different things here.. 1) Type Hints meaning you can define the types of variables This has been discussed before it hasn't been turned down or implemented. 2) Interfaces as they exist in java don't really give you much in a stripting language but if you insist on having something like that you can curently do it with the zend1. class temperature { function __construct($value) {} function toCelcius() {} function toFarenheight() {} } just use that class and extend away but this does bring up an intresting thing... To really implement interfaces when/if delegation is implemented would be easy. 1) create a interface keyword : which is easy 2) in that state allow only function (name)(params)(semi) : i believe this is easy 3) internally compile them as normal functions with no implemntation or see if an e_notice can be thrown. : pretty sure this is easy as well Im not saying that we should but it doesn't seem to be very hard at all. I think it exists as neat vs usefull issues. - Brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Data Hiding Implementation in PHP Classes
That .txt only talks about private members. Zend2 also implements protected data members. - brad --- Sander Roobol [EMAIL PROTECTED] wrote: The Zend Engine 2 implements this. See http://www.php.net/ZEND_CHANGES.txt Sander On Fri, Aug 16, 2002 at 03:13:57AM -0500, Ben Dischinger wrote: Hello, My question is if there is anyone working on an implementation of data hiding in php? IE Public, private, and protected data types within php classes. I can not find anywhere mentioning this besides very few websites that say it is on the TODO list. The research that I'm doing involves dynamically programming php from the internet collectively with many users, of which some would have restricted access rights to specific objects. All objects would have certain data that I would need to be of type private, ie owner id, permission mode, etc... in order for the object security model to be safe. Without data hiding any user using this system could simply type $Current_User-UID=0 which would then change the owner of this object, which happens to be a user to 0, or god. There may be a different way to implement this that I'm not seeing, but any model that I come up with in php I can circumvent by some simular means. I may need to implement a servlet in java that keeps track of currently logged in users and objects in memory, but this would be more overhead than wanted. If data hiding was implemented in PHP I would be very excited. If there is not already someone working on it, perhaps I will roll up my sleeves and get my elbows dirty. Thank you so much for reading. Ben Dischinger NDSU Computer Science -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] objects as string and arrays as string
I want to throw together a quick hack so that objects can implement a __as_string() method that will get called when the string is used in a string contex. Instead of append Object. $s = (string)$object; or $s .= $object; also the same things with arrays that will do something similar to $s = implode( , $array); $s = (string)$array; $s = $array . \n; Before anyone jumps on this and says no way cause it easy to implemnt your own __to_string() and call it when you want it or what is wrong with implode( , $array). Think of exactly how usefull is appending the word Array or Object. Thoughts? - brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] objects as string and arrays as string
I went back and read the lists about why people don't like __to_string() or __string_value() method. the arguments were the differences in when convert_to_string vs zend_make_printable_zval were called differently. I believe andi isn't against it but wants it implemented good and zeev was all for it. I think it should be implemented, Like I said before its not that creating your own stringify and calling it is being lazy. Sometimes when debugging you don't necesarrly know what Object you are printing out.. say because of nested objects. The issues that were brought up were it would't be consisitant becuase of echo $obj; or $p = (string)$obj; I think that everytime it should be used in the context of a string the method should be called. Not when you use var_dump. var_dump means you want to dump the contents of the variable (object in this case). You don't want to convert it to a string. $p = (string)$obj; // will call method $p .= $obj; // will call method var_dump($obj); // wont call method $p = $obj . \n; // will call method $p = $obj\n; // will call method The other consern was recursive nature that could be introduced. As mentioned in the other posts you could either require to return a string or try and handle the recursion (maybe like var_dump currently does it). -brad --- Brad LaFountain [EMAIL PROTECTED] wrote: I want to throw together a quick hack so that objects can implement a __as_string() method that will get called when the string is used in a string contex. Instead of append Object. $s = (string)$object; or $s .= $object; also the same things with arrays that will do something similar to $s = implode( , $array); $s = (string)$array; $s = $array . \n; Before anyone jumps on this and says no way cause it easy to implemnt your own __to_string() and call it when you want it or what is wrong with implode( , $array). Think of exactly how usefull is appending the word Array or Object. Thoughts? - brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP extension initialisation
--- Tom Oram [EMAIL PROTECTED] wrote: Hi, Can someone please answer my question? When running a PHP extension when PHP is running as an apache module on linux it's module init function (PHP_MINIT_FUNCTION) gets called twice, once before apache forks then once after, is there any way of finding out which init you are in. I can't keep a global variable because it get losted in between init calls, and environment vars/file locks/shared mem/semephores are not options. Are you on Windows IIS? I believe someone recently just asked about that same thing. There was a valid explination for it. One other quicky, is there a way to find out inside the extension if it is being run from with an apache module or its it a standalone executable (or running under a different webserver as my module can only ever run with apache)? I believe you could #include SAPI.h if(!strcmp(sapi_module.name, cgi) || strcmp(sapi_module.name, cli)) { printf(compiled as a command line executable); } Thanks for your time, Tom -- *** Tom Oram SCL Computer Services URL http://www.scl.co.uk/ *** -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Method memory handling from an instanced object
--- Dan Hardiker [EMAIL PROTECTED] wrote: Hi All, If I was to code something like: ?php class Example { var $abc = false; function Demo($param) { // etc // return $param; } } $ex1 = new Example; $ex2 = new Example; ? There are now 2 variables, both with a copy of the object Example in them. Now, I would expect the variables in the objects to be duplicated (eg: the memory space for $ex1-abc to be separate from $ex2-abc). However, is the method definition the same? Yes the method is only compiled once. Altho when you extend an object the opcodes will get copied. (opcodes being compiled php code) Is the method definition and contents duplicated each instancing? (eg: if I have 100,000 instances of an object with a print() method - would that method be copied to each object - or would the reference the same memory space). Again only compiled once. If the method is shared, then would a static variable in a method be shared across the entire class - or would it still reference to that object instance's variable memory space? Static varibles by definition (in all languages) are across all instances of an object. If the method is not shared, could this cause an issue with a class that has a lot of methods being instanced lots of time and taking up lots of memory? Not an issue. -brad __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
This isn't always ideal. I would rather see the threads as a function not a separate file. Forcing threads to a file would be pretty limited. -brad --- Andi Gutmans [EMAIL PROTECTED] wrote: I still think that if you're going to implement such a thread extension it shouldn't try and copy it's parents data-structures. It'd be very slow and prone to errors. I think giving a filename as the starting point of the thread would be the best solution. It'd mean that the thread is pretty much a completely new request. It would also mean much leaner threads as you could create .php files with only the logic the thread requires. Andi At 02:30 PM 8/3/2002 -0700, Shane Caraveo wrote: I've cleaned things up a bit, removed code from tsrm and added it to a new file, and commited to pecl. This way those interested can start playing with and developing the module. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] HANDLE_BLOCK_INTERRUPTIONS
Thanks.. I figured it out after looking at all the places where it was being used. The biggest use was when you are changing link'd lists or arrays. So i assumed it did something to that affect. - brad --- Thies C. Arntzen [EMAIL PROTECTED] wrote: On Thu, Aug 01, 2002 at 10:10:10AM -0700, Brad LaFountain wrote: HANDLE_BLOCK_INTERRUPTIONS(); HANDLE_UNBLOCK_INTERRUPTIONS(); what exactly does these do? this is an apache thingie. you can tell apache that you don't want to be killed during certain operations. i doubt very mucht that it really helps;-) look in the apache sapi module. tc __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Odd array problems
Should be fixed. I swear there better not be anything else wrong with that code chage :) I know alot more how the engine handles arrays now :) - brad --- Dan Kalowsky [EMAIL PROTECTED] wrote: Correction an update from a few mins ago results in the same output as Chuck's original. On Fri, 2 Aug 2002, Chuck Hagenbuch wrote: With latest CVS (HEAD branch, checked out 10 or so minutes ago), the following script: ?php error_reporting(E_ALL); $text = Before delim.br /\n--br /\nAfter delim; $parts = preg_split('|(\n--\s*(br /)?\n)|', $text, 2, PREG_SPLIT_DELIM_CAPTURE); $text = array_shift($parts); if (count($parts)) { echo 'pre /'; var_dump($parts); $text .= $parts[0]; $text .= $parts[2]; } ? Gives me this output: array(3) { [0]= string(10) -- [1]= string(6) [2]= string(11) After delim } Notice: Undefined offset: 0 in /var/www/array.php on line 10 Notice: Undefined offset: 2 in /var/www/array.php on line 11 But the var_dump() clearly shows that there _are_ elements 0 and 2 in the array. What am I missing, or is something still off with the array code? -chuck -- hello, I'm a giant cheese, and I'm here to give you a therapeutic massage --- Dan Kalowsky A little less conversation, http://www.deadmime.org/~dank a little more action. [EMAIL PROTECTED] - A Little Less Conversation, [EMAIL PROTECTED] Elvis Presley -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] array commits broke something
Sorry.. i miss read your comment... you are correct I just fixed it commiting in a few min. - brad --- Brad LaFountain [EMAIL PROTECTED] wrote: That was my fault. I did apply a patch that will fix that late last nite. Just get the current CVS and it should work. PS. array_pop/array_shift is tuns faster now :) - brad --- Jani Taskinen [EMAIL PROTECTED] wrote: Have you updated to the very latest? I'm unable to reproduce this.. Can you give some simple example script? (maybe I understood you wrong..) --Jani -- On Thu, 1 Aug 2002, Jan Schneider wrote: Hi, the recent changes in the array code broke something. array_pop() doesn't decrease the key counter. Let's say your have an array('one', 'two', 'three') and run array_pop() on it, then push another value so that you now have array('one', 'two', 'four') the key of the last value will be 3, not 2 as it should be. Jan. -- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] HANDLE_BLOCK_INTERRUPTIONS
HANDLE_BLOCK_INTERRUPTIONS(); HANDLE_UNBLOCK_INTERRUPTIONS(); what exactly does these do? - brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
This is interesting Shane and I started talking about php threads at OSCON. But baiscally your soulition won't work. I can't remember the specfic reason. I think i tried the same thing along time ago. If it were that simple it probally would have been done already :). For threading php you will need to have each php thread have a seprate interperter. So then you would need some way to share variables between php interperters ($_SHARED[] possibly). The $_SHARED (or equiv) would need read/write locks around the access to the variable. Shane and a few other hashed some ideas at the confrence and with stealing some ideas from perl we came up with a decent soulition. You might want to get ahold of him and see what he is going to do with it. -brad --- Alan Knowles [EMAIL PROTECTED] wrote: Im looking at adding threading to php, (for the cgi/cli stuff).. The story so far: I've created an extension which diverts all zend_execute calls into the extension - phpthreads_execute. this function is a copy of zend_execute with a few modifications - to copy restore things like EG(active_symbol_table); - to malloc lock and unlock the execute loop and release on each opcode. I've started testing the phpthreads_create($callback); - it appears to work ok, execept it segfaults on completion.. - trying to reduce refcounts somewhere. The fireup code looks something like this.. void phpthreads_create(void *ptr) { zval myretval; zval *callback = (zval *) ptr; if (!call_user_function( EG(function_table), NULL, callback, myretval, 0, NULL TSRMLS_CC )) { zend_error(E_ERROR, Problem Starting thread with callback); } pthread_exit(NULL); } /* {{{ proto string phpthreads_thread(string function) Return a string to confirm that the module is compiled in */ PHP_FUNCTION(phpthreads_create) { zval *callback; pthread_t thread; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, callback) == FAILURE) { return; } pthread_create( thread, NULL, (void *) phpthreads_create, (void*) callback); RETURN_TRUE; } and the backtrace of the simple threaded test looks like this.. 0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at /usr/src/php/php4/Zend/zend_execute_API.c:275 275 (*zval_ptr)-refcount--; (gdb) bt #0 0x08128f08 in _zval_ptr_dtor (zval_ptr=0x81b5ce8) at /usr/src/php/php4/Zend/zend_execute_API.c:275 #1 0x424ceba2 in ?? () #2 0x424c7c92 in ?? () #3 0x08130588 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/php/php4/Zend/zend.c:810 #4 0x08110abd in php_execute_script (primary_file=0x40006c71) at /usr/src/php/php4/main/main.c:1398 #5 0x08110138 in php_module_shutdown () at /usr/src/php/php4/main/main.c:1058 #6 0x2e325f43 in ?? () does anyone want to suggest what might be missing - is it worth putting this into pecl - and does someone what to lend a hand?? regards alan -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Session variables
--- Pierre-Alain Joye [EMAIL PROTECTED] wrote: On Wed, 31 Jul 2002 16:53:59 +0200 Diana Castillo [EMAIL PROTECTED] wrote: Hi, with ASP I use session variables to keep a variable alive between one page and another. What is the comparable way to do it with php? Take a look at http://www.vl-srm.net/ You are suggesting using srm for session handling? Thats a little mis-guided. php's built in session handling would do the job. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] phpthreads - hints anyone...
Shane, I was in the Parrot session at OSCON and parrot is going to implement threads in the exact same way. One interp per thread with sharing memory. - brad --- Shane Caraveo [EMAIL PROTECTED] wrote: Alan Knowles wrote: Im looking at adding threading to php, (for the cgi/cli stuff).. The story so far: I've created an extension which diverts all zend_execute calls into the extension - phpthreads_execute. this function is a copy of zend_execute with a few modifications - to copy restore things like EG(active_symbol_table); - to malloc lock and unlock the execute loop and release on each opcode. Ouch. While it's an interesting way to deal with the issue, I think this will be way too slow, and maintenance will be hard (keeping up with changes in the real zend_execute, and zend engine in general). As in a couple other responses, the way this needs to be implemented has been hashed out, largely based on how the same problem is solved in Perl (there is a remarkable amount of simularity between PHP and Perl at some levels). If you're interested, lets talk. Shane -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] array_pop and array_shift (#16063, #16068)
Along with fixing this bugs (16063 and 16068) I signifintly increased the preformance of array_pop and array_shift. Here are some times on a 1.2ghz athlon. ? $t = array_fill(0, $size, test); for($i = 0;$i $size;$i++) array_pop($t); ? Before: $size = 2000; //1.633s $size = 4000; //8.942s $size = 6000; //24.005s $size = 1; //1m13.986s After: $size = 2000; //0.050s $size = 4000; //0.060s $size = 6000; //0.081s $size = 1; //0.090s I still would like to see the functions array_unshift, array_splice and array_pad looked into to increase preformance too. I thought i had karma but it seems i don't. So can someone ither give me the karma or patch it themselves. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com Index: ext/standard/array.c === RCS file: /repository/php4/ext/standard/array.c,v retrieving revision 1.172 diff -u -r1.172 array.c --- ext/standard/array.c8 Jul 2002 07:33:22 - 1.172 +++ ext/standard/array.c30 Jul 2002 07:10:45 - -1661,8 +1661,9 static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) { zval **stack, /* Input stack */ - **val; /* Value to be popped */ - HashTable *new_hash; /* New stack */ + **val; /* Value to be popped */ + char *key = NULL; + int key_len; /* Get the arguments and do error-checking */ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, stack) == FAILURE) { -1689,10 +1690,8 INIT_PZVAL(return_value); /* Delete the first or last value */ - new_hash = php_splice(Z_ARRVAL_PP(stack), (off_the_end) ? -1 : 0, 1, NULL, 0, NULL); - zend_hash_destroy(Z_ARRVAL_PP(stack)); - efree(Z_ARRVAL_PP(stack)); - Z_ARRVAL_PP(stack) = new_hash; + zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), key, key_len, key_len, 0, +NULL); + zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, key_len, (key) ? +HASH_DEL_KEY : HASH_DEL_INDEX); } /* }}} */ -1747,7 +1746,8 } /* Use splice to insert the elements at the beginning. Destroy old - hashtable and replace it with new one */ + hashtable and replace it with new one */ + zend_hash_insert new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, args[1], argc-1, NULL); zend_hash_destroy(Z_ARRVAL_P(stack)); efree(Z_ARRVAL_P(stack)); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] array_pop and array_shift (#16063, #16068)
Wrong patch file.. re-attaching. --- Brad LaFountain [EMAIL PROTECTED] wrote: Along with fixing this bugs (16063 and 16068) I signifintly increased the preformance of array_pop and array_shift. Here are some times on a 1.2ghz athlon. ? $t = array_fill(0, $size, test); for($i = 0;$i $size;$i++) array_pop($t); ? Before: $size = 2000; //1.633s $size = 4000; //8.942s $size = 6000; //24.005s $size = 1; //1m13.986s After: $size = 2000; //0.050s $size = 4000; //0.060s $size = 6000; //0.081s $size = 1; //0.090s I still would like to see the functions array_unshift, array_splice and array_pad looked into to increase preformance too. I thought i had karma but it seems i don't. So can someone ither give me the karma or patch it themselves. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com Index: ext/standard/array.c === RCS file: /repository/php4/ext/standard/array.c,v retrieving revision 1.172 diff -u -r1.172 array.c --- ext/standard/array.c 8 Jul 2002 07:33:22 - 1.172 +++ ext/standard/array.c 30 Jul 2002 07:10:45 - @@ -1661,8 +1661,9 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) { zval **stack, /* Input stack */ -**val; /* Value to be popped */ - HashTable *new_hash; /* New stack */ +**val; /* Value to be popped */ + char *key = NULL; + int key_len; /* Get the arguments and do error-checking */ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, stack) == FAILURE) { @@ -1689,10 +1690,8 @@ INIT_PZVAL(return_value); /* Delete the first or last value */ - new_hash = php_splice(Z_ARRVAL_PP(stack), (off_the_end) ? -1 : 0, 1, NULL, 0, NULL); - zend_hash_destroy(Z_ARRVAL_PP(stack)); - efree(Z_ARRVAL_PP(stack)); - Z_ARRVAL_PP(stack) = new_hash; + zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), key, key_len, key_len, 0, NULL); + zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, key_len, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX); } /* }}} */ @@ -1747,7 +1746,8 @@ } /* Use splice to insert the elements at the beginning. Destroy old -hashtable and replace it with new one */ +hashtable and replace it with new one */ + zend_hash_insert new_hash = php_splice(Z_ARRVAL_P(stack), 0, 0, args[1], argc-1, NULL); zend_hash_destroy(Z_ARRVAL_P(stack)); efree(Z_ARRVAL_P(stack)); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com Index: ext/standard/array.c === RCS file: /repository/php4/ext/standard/array.c,v retrieving revision 1.172 diff -u -r1.172 array.c --- ext/standard/array.c8 Jul 2002 07:33:22 - 1.172 +++ ext/standard/array.c30 Jul 2002 07:13:34 - @@ -1661,8 +1661,9 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) { zval **stack, /* Input stack */ - **val; /* Value to be popped */ - HashTable *new_hash; /* New stack */ + **val; /* Value to be popped */ + char *key = NULL; + int key_len; /* Get the arguments and do error-checking */ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, stack) == FAILURE) { @@ -1689,10 +1690,8 @@ INIT_PZVAL(return_value); /* Delete the first or last value */ - new_hash = php_splice(Z_ARRVAL_PP(stack), (off_the_end) ? -1 : 0, 1, NULL, 0, NULL); - zend_hash_destroy(Z_ARRVAL_PP(stack)); - efree(Z_ARRVAL_PP(stack)); - Z_ARRVAL_PP(stack) = new_hash; + zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), key, key_len, key_len, 0, +NULL); + zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, key_len, (key) ? +HASH_DEL_KEY : HASH_DEL_INDEX); } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] array_pop and array_shift (#16063, #16068)
Hmm... I tried it and it said i didn't have karma. I'll try again tonite. - brad --- Rasmus Lerdorf [EMAIL PROTECTED] wrote: You have full karma to fix this. What makes you think you don't? On Tue, 30 Jul 2002, Brad LaFountain wrote: Along with fixing this bugs (16063 and 16068) I signifintly increased the preformance of array_pop and array_shift. Here are some times on a 1.2ghz athlon. ? $t = array_fill(0, $size, test); for($i = 0;$i $size;$i++) array_pop($t); ? Before: $size = 2000; //1.633s $size = 4000; //8.942s $size = 6000; //24.005s $size = 1; //1m13.986s After: $size = 2000; //0.050s $size = 4000; //0.060s $size = 6000; //0.081s $size = 1; //0.090s I still would like to see the functions array_unshift, array_splice and array_pad looked into to increase preformance too. I thought i had karma but it seems i don't. So can someone ither give me the karma or patch it themselves. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php_strip_tags and bug 7472
Ok that makes a little more sence. But instead of re-inventing the parser how about we do something with the builtin parser. I'll try to hack up something. - brad --- Rasmus Lerdorf [EMAIL PROTECTED] wrote: Yeah, I wrote that code. I'm a little fuzzy on the original thinking, but think about something like this: abc foo ?echo ?; duh()? def bar This should, and does, strip down to: abc def If you got rid of the quote parsing, how do you know not to end the php tag at the ? inside the quotes? Of course, I don't see any single-quote handling in there, so it isn't completely implemented. The bracket counting, along with the quote counting is only done in the PHP state, and yes, I agree, it doesn't make a whole lot of sense the way that is written. Basically, right now if you have a malformed PHP tag in a string that doesn't close a function call: abc ?foo(bar ? def Will strip down to just abc I am sure that seemed logical at some point. -Rasmus On Mon, 29 Jul 2002, Brad LaFountain wrote: Is any developer familiar with php_strip_tags? I was looking into but 7472 and php_strip_tags seems like its keeping track of 's and changing the state according to 's. From what I can tell the state machine shouldn't need to worry about 's, but I might be missing something obvious tho. Commenting out the case '' fixes the bugs reported by 7427. I don't want to commit it if it will break anything else. Additionally it also keeps track of ('s and )'s. Is this needed as well? http://bugs.php.net/bug.php?id=7472 - brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] array_pop and array_shift (#16063, #16068)
$ cvs commit ext/standard/array.c cvs [server aborted]: commit requires write access to the repository cvs commit: saving log message in /tmp/cvs61090800.1 - brad --- Brad LaFountain [EMAIL PROTECTED] wrote: Hmm... I tried it and it said i didn't have karma. I'll try again tonite. - brad --- Rasmus Lerdorf [EMAIL PROTECTED] wrote: You have full karma to fix this. What makes you think you don't? On Tue, 30 Jul 2002, Brad LaFountain wrote: Along with fixing this bugs (16063 and 16068) I signifintly increased the preformance of array_pop and array_shift. Here are some times on a 1.2ghz athlon. ? $t = array_fill(0, $size, test); for($i = 0;$i $size;$i++) array_pop($t); ? Before: $size = 2000; //1.633s $size = 4000; //8.942s $size = 6000; //24.005s $size = 1; //1m13.986s After: $size = 2000; //0.050s $size = 4000; //0.060s $size = 6000; //0.081s $size = 1; //0.090s I still would like to see the functions array_unshift, array_splice and array_pad looked into to increase preformance too. I thought i had karma but it seems i don't. So can someone ither give me the karma or patch it themselves. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PATCH] array_pop and array_shift (#16063, #16068)
Sorry that was it... i swear i checked it out as rodif_bl.. -brad --- Rasmus Lerdorf [EMAIL PROTECTED] wrote: And are you sure you have that tree checked out using the rodif_bl account? Because you are in the ACL file. See CVS/Root in your checked out tree. -Rasmus On Tue, 30 Jul 2002, Brad LaFountain wrote: $ cvs commit ext/standard/array.c cvs [server aborted]: commit requires write access to the repository cvs commit: saving log message in /tmp/cvs61090800.1 - brad --- Brad LaFountain [EMAIL PROTECTED] wrote: Hmm... I tried it and it said i didn't have karma. I'll try again tonite. - brad --- Rasmus Lerdorf [EMAIL PROTECTED] wrote: You have full karma to fix this. What makes you think you don't? On Tue, 30 Jul 2002, Brad LaFountain wrote: Along with fixing this bugs (16063 and 16068) I signifintly increased the preformance of array_pop and array_shift. Here are some times on a 1.2ghz athlon. ? $t = array_fill(0, $size, test); for($i = 0;$i $size;$i++) array_pop($t); ? Before: $size = 2000; //1.633s $size = 4000; //8.942s $size = 6000; //24.005s $size = 1; //1m13.986s After: $size = 2000; //0.050s $size = 4000; //0.060s $size = 6000; //0.081s $size = 1; //0.090s I still would like to see the functions array_unshift, array_splice and array_pad looked into to increase preformance too. I thought i had karma but it seems i don't. So can someone ither give me the karma or patch it themselves. -brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Bus error on CVS Head
I get the same thing on Windows in debug mode. -brad --- Dan Kalowsky [EMAIL PROTECTED] wrote: Hi, Building PHP and running a test script with the CGI or CLI on my MacOSX machine results in a a Bus Error upon script completion. I have made a fresh checkout, built clean (with a cvsclean and buildconf), yet the problem continues. Find a backtrace below, and the error. Any suggestions/ideas are welcome to be heard. ./configure --enable-debug --without-mysql --with-imap=/Users/dank/Development/imap-2001a Script (but it's really any script): ?php if (!is_dir(/tmp/reports)) mkdir(/tmp/reports, 0777); if (touch(/tmp/reports/test.txt)) { print file modification time has been updated \n; } else { print could not modify time \n; } $fp = fopen(/tmp/reports/test.txt, w); fwrite($fp, some stuff\n); fclose($fp); print end of script \n; ? backtrace: Program received signal EXC_BAD_ACCESS, Could not access memory. 0x0017dba4 in _zval_dtor (zvalue=0x664f78, __zend_filename=0x2015f4 /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c, __zend_lineno=277) at /Users/dank/Development/php4-cvs/Zend/zend_variables.c:43 43 CHECK_ZVAL_STRING_REL(zvalue); (gdb) bt #0 0x0017dba4 in _zval_dtor (zvalue=0x664f78, __zend_filename=0x2015f4 /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c, __zend_lineno=277) at /Users/dank/Development/php4-cvs/Zend/zend_variables.c:43 #1 0x001704dc in _zval_ptr_dtor (zval_ptr=0x667d84, __zend_filename=0x2019f0 /Users/dank/Development/php4-cvs/Zend/zend_variables.c, __zend_lineno=158) at /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:277 #2 0x0017e0bc in _zval_ptr_dtor_wrapper (zval_ptr=0x667d84) at /Users/dank/Development/php4-cvs/Zend/zend_variables.c:158 #3 0x001881dc in zend_hash_destroy (ht=0x667cc8) at /Users/dank/Development/php4-cvs/Zend/zend_hash.c:543 #4 0x0017dc5c in _zval_dtor (zvalue=0x667c88, __zend_filename=0x2015f4 /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c, __zend_lineno=277) at /Users/dank/Development/php4-cvs/Zend/zend_variables.c:51 #5 0x001704dc in _zval_ptr_dtor (zval_ptr=0x667de4, __zend_filename=0x2019f0 /Users/dank/Development/php4-cvs/Zend/zend_variables.c, __zend_lineno=158) at /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:277 #6 0x0017e0bc in _zval_ptr_dtor_wrapper (zval_ptr=0x667de4) at /Users/dank/Development/php4-cvs/Zend/zend_variables.c:158 #7 0x001881dc in zend_hash_destroy (ht=0x290004) at /Users/dank/Development/php4-cvs/Zend/zend_hash.c:543 #8 0x0016ffa8 in shutdown_executor () at /Users/dank/Development/php4-cvs/Zend/zend_execute_API.c:173 #9 0x0017f6d8 in zend_deactivate () at /Users/dank/Development/php4-cvs/Zend/zend.c:596 #10 0x00139e38 in php_request_shutdown (dummy=0x0) at /Users/dank/Development/php4-cvs/main/main.c:788 #11 0x0019f8e8 in main (argc=2, argv=0xb9fc) at /Users/dank/Development/php4-cvs/sapi/cgi/cgi_main.c:1100 #12 0x244c in _start () #13 0x227c in start () (gdb) --- Dan Kalowsky A little less conversation, http://www.deadmime.org/~dank a little more action. [EMAIL PROTECTED] - A Little Less Conversation, [EMAIL PROTECTED] Elvis Presley -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php_strip_tags and bug 7472
Is any developer familiar with php_strip_tags? I was looking into but 7472 and php_strip_tags seems like its keeping track of 's and changing the state according to 's. From what I can tell the state machine shouldn't need to worry about 's, but I might be missing something obvious tho. Commenting out the case '' fixes the bugs reported by 7427. I don't want to commit it if it will break anything else. Additionally it also keeps track of ('s and )'s. Is this needed as well? http://bugs.php.net/bug.php?id=7472 - brad __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Going on vacation
Thats not allowed andi! :) - Brad --- Andi Gutmans [EMAIL PROTECTED] wrote: Hey, I'm going on a four day computer-less vacation starting tomorrow morning so I won't be reading my Email. If you guys send patches for the Engine 2 or other queries please give me some time to reply when I get back. I'll look them over ASAP. Thanks, Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [Zend Engine 2] RE: [PHP-DEV] REPOST: Class Autoloading [PATCH]
- will never work for sub-classes so don't even ask! Andi, This doesn't need to be an issue. The way that I use sub-classes is I ALWAYS include_once(subclass.php); at the top of each superclass file. I know everyone doesn't code the same way but maybe you can have that as a suggestion to people who use __autoload. Foo.php class Foo{} Bar.php class Bar{} MyFoo.php include_once(Foo.php); class MyFoo extends Foo{} MyBar.php include_once(Bar.php); class MyBar extends Bar{} auto_test.php ? function __autoload($name) { include_once($name.php); } $f = new MyFoo(); $b = new MyBar(); ? - brad At 11:27 PM 6/11/2002 +0100, Ivan Ristic wrote: Okay, I guess I can live with it :) Andi Is there anyone else who would like to comment on the patch? http://www.webkreator.com/download/class_autoload.patch Or can we have it committed? -- Ivan Ristic, [EMAIL PROTECTED] [ Weblog on PHP, Software development, Intranets, and Knowledge Management: http://www.webkreator.com ] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] widestring variable possible in php?
By widestring do you mean a multi byte string? if yes take a look at the mbstring module. else don't know what you mean by widestring -brad --- Derek Aschenbrenner [EMAIL PROTECTED] wrote: I am trying to assign a widestring to a variable in php? Is it possible to create a widestring variable? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Case Sensitivity is inconsitent inside Objects
--- phpsurf [EMAIL PROTECTED] wrote: Hi I really don't want to wake up once again the endless thread about CS ! My point here, is just that I have a problem dealing dynamically with attributes and methods inside an object. The problem is that the function 'get_class_vars' returns the attributes in a case sensitive way, whereas 'get_class_methods' returns all the methods in lower case ! Well since member variables are CS and methods are not then to me these functions act the way they should. Im pretty sure that there is no way to change the functionality in ZE1 cause when functions get compiled they get converted to LC. I think andy is doing something with the ability to get the case of a function but im not positive if this will fit here. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Custom Extensions and Super Globals
I believe you are looking for zend_register_auto_global(); - Brad --- Brian Moon [EMAIL PROTECTED] wrote: I was just thinking about some of our code on dealnews.com and thought it would be cool if we could write our own extension that would, among other things, make a couple of widely used variables on out site super globals like $_SERVER, etc. A) Can this be done. B) If so, can anybody give me a push in the right direction to making it happen? Thanks, Brian Moon dealnews.com Phorum.org -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] phpopengl
A while ago I made php-opengl. The extension lets you create ither interactive opengl programs (with the help of glut) or what I was working using OSMesa is to allow php to create 3d images Off Screen (OS). This can be used for a bunch of things. (3d graphs, generation of 3d text), (i got it to work on windows but it was screwing up some colors on linux). It currently is up on sourceforge http://phpopengl.sourceforge.net/. I don't do any current development on it. I've been focusing on php-soap. Are there any developers out there interested in moving it to pecl and creating some documentation? Someone recently asked me how to install it so this is why im bringing it up now. - brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Instantiating Objects ?
There is no transpartent way of creating a c++ object from php. What you can do is create a php extension that will proxy the calls to your c++ object. Once you do that you can pass anything into your c++ class (querystring). take a look at ext/* in the souce distribution. - brad --- Kevin Caporaso [EMAIL PROTECTED] wrote: Is it possible to instantiate an object from one of my c++ shared libraries (goo.so) and then call methods on that object? How efficient is PHP's way of doing it? (if possible) Also, can I pass things like the querystring and form data into that instantiated object? Thanks for any response! $Kevin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [Zend Engine 2] RE: [PHP-DEV] REPOST: Class Autoloading [PATCH]
I dissagree with that... I would like the option to say where my classes are. If i want multiple classes in one file then i can. function myAutoLoader($className) { if (!class_exists($className)) { include(all_of_my_classes.php); } } Making a classpath and ClassName.php files will make php horibly look like java. One of the reasons java does this is cause you can't have 2 public classes in one file. We shouldn't force php developers to use one class per file just to use the auto-loading feature. - brad --- Andi Gutmans [EMAIL PROTECTED] wrote: I'd prefer not having a handler for autoloader. I'd prefer having the Engine look for ClassName.php in the default include_path and if it doesn't exist die... (i.e. not call any user-definable PHP function). Andi At 11:33 AM 6/10/2002 +0200, phpsurf wrote: this patch would be really great ! I can remember it has been discussed a lot on the ZE2 mailing list about the 'import' feature. some people (and I was) would have apreciated another name because this name was already used in many PHP frameworks to implement a function that loads classes. As far as I followed this thread, the agreement was that the import keyword can be used fine for namespaces if a autoload statement was patched to the engine ... so everyone would be happy ! :) I guess your patch gives some function like this one : set_classautoload_handler(myAutoLoader); and then, one can implement a function like this: myAutoLoader($className) { if (!class_exists($className)) { include(class/.str_replace(_, /, $className)..php); } } I'm sure many programmers would apreciate such a feature. Especially as it whould have no BC issue at all ! -Original Message- From: Ivan Ristic [mailto:[EMAIL PROTECTED]] Sent: dimanche 9 juin 2002 22:46 To: Zeev Suraski Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] REPOST: Class Autoloading [PATCH] I believe this has been discussed in the past and not ack'd, please read the php-dev archives... I tried and I tried but I couldn't find a discussion on anything similar on the mailing list. The code I sent is *already* in use, and has been in use for some time now. Take a look at this message from November 2001: http://marc.theaimsgroup.com/?l=php-devm=100687224711738w=2 I didn't introduce anything new, so if it was OK then it should be OK now. Also, the code cannot affect the people that are not using the feature so I do not think that there will be any kind of impact on the existing user base. This feature makes it possible to have one class per file and not to worry about inclusion at all. It becomes especially useful when used together with products such as Zend Accelerator, where files are cached (and you do not have to worry about a large number of small files). -- Ivan Ristic, [EMAIL PROTECTED] [ Weblog on PHP, Software development, Intranets, and Knowledge Management: http://www.webkreator.com ] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Memory Leaks /w nested classes
I use parent members all the time.. w/zend1 - Brad --- Markus Fischer [EMAIL PROTECTED] wrote: Hi, that's a limitation of the Zend Engine. It does not support circular references (at least this is would Zeev told me last time :) - Markus On Mon, Jun 10, 2002 at 10:25:38PM +0200, Andre Christ wrote : working with php's oop implementation I got some memory leaks. The behaviour can be reproduced with the following script: ?php class CBar { var $Parent; } class CSuper { function CSuper() { $this-Bar = new CBar(); $this-Bar-Parent = $this; } } $Super = new CSuper(); ? php 4.2.1 --enable-debug zend_hash.c(260) : Freeing 0x0821000C (39 bytes), script=/home/ach/usr/htdocs/devel/oop.php Last leak repeated 1 time ./zend_execute.c(470) : Freeing 0x0820FFAC (44 bytes), script=/home/ach/usr/htdocs/devel/oop.php zend_variables.c(126) : Actual location (location was relayed) ./zend_execute.c(467) : Freeing 0x0820FF6C (12 bytes), script=/home/ach/usr/htdocs/devel/oop.php zend_API.c(596) : Freeing 0x0820FE54 (44 bytes), script=/home/ach/usr/htdocs/devel/oop.php zend_API.c(584) : Actual location (location was relayed) zend_hash.c(176) : Freeing 0x0820FB34 (32 bytes), script=/home/ach/usr/htdocs/devel/oop.php Last leak repeated 1 time ./zend_execute.c(1948) : Freeing 0x0820F844 (12 bytes), script=/home/ach/usr/htdocs/devel/oop.php Is there anything wrong with the code or is it a bug in php / Zend ? -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Memory Leaks /w nested classes
--- Andre Christ [EMAIL PROTECTED] wrote: Hi Brad, Brad Lafountain [EMAIL PROTECTED] wrote I use parent members all the time.. w/zend1 well, that's what I wanted to do until I discovered these entrys in my log file when php is compiled --enable-debug. Do you have these mem leaks as well ? Well acually the code is on a live server... i can't enable-debug. Greets, André -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [Zend Engine 2] PHP in the future
--- Dan Hardiker [EMAIL PROTECTED] wrote: Am Donnerstag, 6. Juni 2002 19:59 schrieb Dan Hardiker: I sit in many PHP channels (IRC), and observe many class-based PHP networks (php-classes.org is one I monitor closely) and can say definatly that the majority of PHP users want *more* OO capabilities in PHP. [..] So when users ask for more OO in PHP, they usually want Java and Java capabilities for the price of their current PHP site, and a migration path towards this. Since there is no such thing, they end up trying to turn PHP into Java. I disagree *very* strongly with this statement. When people ask for more OO they want more OO! Its like saying that if people wanted VC++ to be more OOed then they would just be wanting Delphi... which is just untrue. The masses are asking for more flexability and expanded capabilities - not to turn PHP into anything its not already. PHP is a partially OOed language currently, extending it into other OO areas (public/private/protected methods variables) is not altering the language structure, aim or purpose. What the masses are *not* asking for is for PHP to do things the java way. That has never been suggested or hinted at... anyone wanting this can go use Java. I dont want to use java for my current projects - there is JSP but it doesnt fit for the majority of the projects I do (right tool for the right job). Giving PHP extra OOP capabilities would extend what I can do with PHP and where I can use it. This isnt about cost of using PHP over Java its about the right tool for the right job to complete at the right speed. Ex-friggin-actly, i couldn't agree with this more. - brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] oo != php
--- Preston L. Bannister [EMAIL PROTECTED] wrote: From: Ilker Cetinkaya [mailto:[EMAIL PROTECTED]] [snip] but after getting known of the ze2 features, I personally saw PHP finally growing out of that PHP, language for kiddies-image. IMHO PHP is a real good language for its target purpose, but it has potential to be much better. PHP is a nicely done scripting language. Scripting languages tend to be easier to get into, easier to make changes with, and do a good job of gluing disparate components together. Java is a compiled language. Good for building complex tightly knit applications at the higher end of the performance spectrum. For tasks that could be done with a scripting language, the implementation cost is usually higher in Java. C++ is a lower level compiled language. Good for getting every last bit of performance possible out of the hardware. Also good for complex tightly knit applications - but at an even higher development cost. Think of each as a different tool in your toolbox. You choose the tool to fit the job at hand. A screwdriver is not a kiddie hammer. Each is well suited for different kinds of tasks. To extend the metaphor - think of an all-in-one tool - a combination of hammer and screwdriver, say. In trying to combine the two tools meant for different purposes you end up with something that is neither a particularly good hammer, or a particularly good screwdriver. So the focus on improving PHP in the role as a scripting language (not trying to make PHP into Java or C++) makes a great deal of sense. OO IS OO... JUST BECAUSE JAVA IS OO DOESN'T MEAN WE ARE SUGGESTING MAKING JAVA AGAIN. WE ARE SUGGESTING MORE OO FEATURES. Please Pleas Please realize the difference. Im sick of people associating oo features as java features! Making php more like java would be suggesting making a public static void main(String args[]) in a class, and that gets run when a class with that name is loaded. Now this is stuff specfic to java! Not MI or public/private members these features have been around way before java was ever thought of!!! - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Zend Engine expert wanted!!!!
If this is your problem maybe a offical soultion to the problem should be thought. Like in your extension you can define a priority for loading and unloading your extension in the ini. Kinda like init.d. Has there been any discussion about this topic before. - brad --- Brian France [EMAIL PROTECTED] wrote: Zend Engine unloading extension in the wrong order! (Re-post due to no response) I have been tracking down a core dump with my php extension when it is unloading some of its shared libraries. I have shared extension that is link against libexpat and will load fine if it is the only on in the php.ini. If I then load xml.so extension then my extension it works fine, but if it is my extension then xml.so it crashes while xml.so is unloading libexapt. What I have found is the Zend Engine is unloading extension in the same order it loaded them. load: foo_bar.so load: xml.so unload: foo_bar.so unload: xml.so I believe this is wrong and think it should be in reverse order. load: foo_bar.so load: xml.so unload: xml.so unload: foo_bar.so There are two ways to fix this problem. One is to push the modules to the head of the hash, but looking at the zend_hash_add function I decided to go with the second. Second way is to destroy them in reverse order. I created a zend_hash_reverse_destroy and call that instead of zend_hash_destroy. There may be a better way to do this, but this is the quick fix for me. I have included a patch below, should I submit a bug report as well? Thanks, Brian diff -rc php-4.2.1/Zend/zend.c *** php-4.2.1/Zend/zend.c Tue Feb 26 10:59:25 2002 --- php-4.2.1/Zend/zend.c Thu Jun 6 11:32:57 2002 *** *** 487,493 zend_destroy_rsrc_list(EG(persistent_list) TSRMLS_CC); #endif zend_destroy_rsrc_list_dtors(); ! zend_hash_destroy(module_registry); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); free(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); --- 487,493 zend_destroy_rsrc_list(EG(persistent_list) TSRMLS_CC); #endif zend_destroy_rsrc_list_dtors(); ! zend_hash_reverse_destroy(module_registry); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); free(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); diff -rc php-4.2.1/Zend/zend_hash.c *** php-4.2.1/Zend/zend_hash.c Mon Apr 22 23:53:26 2002 --- php-4.2.1/Zend/zend_hash.c Thu Jun 6 11:32:57 2002 *** *** 550,555 --- 550,579 SET_INCONSISTENT(HT_DESTROYED); } + ZEND_API void zend_hash_reverse_destroy(HashTable *ht) + { + Bucket *p, *q; + + IS_CONSISTENT(ht); + + SET_INCONSISTENT(HT_IS_DESTROYING); + + p = ht-pListTail; + while (p != NULL) { + q = p; + p = p-pLast; + if (ht-pDestructor) { + ht-pDestructor(q-pData); + } + if (!q-pDataPtr q-pData) { + pefree(q-pData, ht-persistent); + } + pefree(q, ht-persistent); + } + pefree(ht-arBuckets, ht-persistent); + + SET_INCONSISTENT(HT_DESTROYED); + } ZEND_API void zend_hash_clean(HashTable *ht) { -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Fwd: REJECTED: 5.1.0.14.2.20020607225328.03df2740@127.0.0.1
I got it too.. - brad --- Andi Gutmans [EMAIL PROTECTED] wrote: Any idea why I got this when posting to php-dev? Andi Delivered-To: [EMAIL PROTECTED] Sender: [EMAIL PROTECTED] (reject) Date: Thu, 06 Jun 2002 08:50:05 -0700 X-Autogenerated: Reply To: Andi Gutmans [EMAIL PROTECTED] From: [EMAIL PROTECTED] Subject: REJECTED: [EMAIL PROTECTED] X-Autogenerated: UNSOLICITED ELECTRONIC COMMUNICATION Sender: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Original-Message-ID: [EMAIL PROTECTED] Original-Sender: Andi Gutmans [EMAIL PROTECTED] Original-Subject: Re: [PHP-DEV] Zend Engine expert wanted Original-Date: Fri, 07 Jun 2002 22:53:42 +0300 SERVICE of LEGAL NOTICE: Pursuant to California Law (cref. California Business Professions Code §§ 17538.4, 17538.45 (2001)), the message referenced herein, uniquely identified by the following Internet messaging headers: { Original-Message-ID: [EMAIL PROTECTED] Original-Sender: Andi Gutmans [EMAIL PROTECTED] Original-Subject: Re: [PHP-DEV] Zend Engine expert wanted Original-Date: Fri, 07 Jun 2002 22:53:42 +0300 } has been categorized as either Unsolicited Bulk E-mail (UBE), or Unsolicited Commercial E-Mail (UCE). Your server is one of those included in the headers of the message, and thus has been deemed an offending server used in the delivery of this message. California Law establishes Civil Right of Action against violators: In addition to any other action available under law, any electronic mail service provider whose policy on unsolicited electronic mail advertisements is violated as provided in this section may bring a civil action to recover the actual monetary loss suffered by that provider by reason of that violation, or liquidated damages of fifty dollars ($50) for each electronic mail message initiated or delivered in violation of this section, up to a maximum of twenty-five thousand dollars ($25,000) per day, whichever amount is greater. Your cooperation, as outlined below, is REQUIRED by California Law. To avoid being cited as an accomplice in this matter, PRESENCE-GROUP.COM requires you to take immediate and appropriate actions to stop the problem in the future. You are to notify us within three (3) days of those actions. Our experience shows that all legitimate Internet providers take immediate action. If your server is an offending server in the *origination* of this message, PRESENCE-GROUP.COM demands that you provide us with the name, mailing address and other contact information of the originator of this message. If you furnish PRESENCE-GROUP.COM with this information, PRESENCE-GROUP.COM will release you from liability in this incident. Merely telling us you have cancelled or deleted the account is *not* adequate to satisfy the PRESENCE-GROUP.COM policy. If your server is an offending server in the *relay* of this message, PRESENCE-GROUP.COM demands that you take measures to stop the open relay from your insecure mailserver. If you do not furnish PRESENCE-GROUP.COM with the information we have requested, or provide us only with auto-responder or form messages, PRESENCE-GROUP.COM will consider how often your server is involved with UBE/UCE. We may then: 1. Block access to from your server. 2. Deem you to be a co-conspirator in the delivery of UBE/UCE messages. 3. Hold you liable for fees damages. There is no need for you to send your appropriate use policy to us; As stated by law, it is our policy that governs. In order to provide required response to this notice, or if you believe you have received this notice in error, please forward your communication to: [EMAIL PROTECTED], with the words SPAM EXCEPTION exactly included in the message Subject: header. Further, you may choose to notify your intended recipient by an additional, alternate method requesting that they address this matter with the PRESENCE-GROUP.COM mail server administrator. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PHP in the future
Ok I know this email has been posted again and again. But lets look at this objectivly. PHP was designed for the web. It's perfect in alot of ways for that market. Maybe we can shift the focus of php from the web to application development. Again i know this has been discussed and been shot down for different reasons. But how about this. PHP For Applications.. pretty much use the same code base. But we introduce stuff like typed variables, Case Sensivive, Greater OO support private methods, interfaces, operator overloading. I know changing these things for what php is aim'd for now doesn't make much sence but obviously people like php alot and want to see it be used for far greater things than just web development. Introducing a new distrubiton wont have any BC issues cause it's new. Introducing a new distrubiton will be confusing for some people. Please don't reply to this email saying Use Java... Because php is different than java and always will be even with these new features. PHP can be a soulition for serious application developers with some changes. The code base for it is already there. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [Zend Engine 2] PHP in the future
--- Zeev Suraski [EMAIL PROTECTED] wrote: At 07:01 PM 6/6/2002, brad lafountain wrote: Please don't reply to this email saying Use Java... Because php is different than java and always will be even with these new features. Brad, I beg you, there's nothing anybody can say on this list that would lead this to closure. Nothing. I believe that adding the things you mentioned does indeed turn PHP into Java, just a messy Java, Java which is worse at being Java than the real one is, and torn apart when compared against it. Why do you think it would be messy. Many others feel the same way. You don't think that way, and I respect it, and there are also others who feel the same way too. If you, or others, want to take PHP into that direction - non-web-centric, more complicated language - it's your right, and you can do it outside the scope of PHP (or fork). I believe it's a bad thing for PHP (both having these patches in general and forking), but you don't necessarily share this belief. I do believe that making a fork or patches for php is a bad thing. It would lead into a big mess. But at the same time i believe more strongly that cs is a good thing, types are a good thing and stronger oo support is a good thing. To me these are more important. There's one thing that is clear to me - there's no way to 'find a solution', because we don't, at all, agree about the existence of the problem. If you believe these features belong in PHP and that it should import all (or most) of Java's features, we (and many others) have a fundamental gap in our perception of what PHP should be, and how it can stay competitive. This is exactly true. I really feel that php/zend engine could be a alot more than you must think it can be. The thing is the stuff that I/many people have in mind won't harm php as it is, its just that some people don't want these new features. Types: ? string $var; int $int; $var = 123; // var will be a string $int = $var; // int will be a int $var2 = $var; // will be string NOTE: var2 wasn't declared $var2 = $int; // will be int // this is almost like a auto conversion... nothing more nothing less $ret = doSomething($var2, $var2); function doSomething(string $str, int $int) { } ? OO Support: interface thread { function run(); } class MyClass implements thread { function run() { yeahRight(); } function setSomething(string $test) { $this-something = $test; } opperator +(MyClass $class) { $this-something = $class-something; } opperator +(MyOtherClass $class) { $this-something = $class-otherSomething; } } class MyOtherClass extends MyClass { } MI: Someone posted a good mi example i don't recall where it may be class Person { function hello() { } } class OtherPerson { function hello() { } } class MulitPersonalites extends Person, otherPerson { var $currPerson; function MulitPersonalites() { parent::Person(Jake); parent::OtherPerson(Miles); } function Person::hello() { return super() . from multi; } function hello() { if($this-currPerson == Jake) $this-Person::hello(); else $this-OtherPerson::hello(); } } what ever the syntax should be don't forget about the public private Multi threading: I know this is a huge change but.. again i think it is a good thing. Case Sensitive: I know the reasons for and against this and i agree with both of them. But I would rather see CS. For the most part the only argument against these is do we need it and it will make things slower. Maybe somepeople do maybe somepeople don't but if someone thinks they need it then probally others do too, how much slower will some of these changes make the engine? Maybe not much at all. True these kinda things will make the languge more complicated and some people don't think that php should get complicated but I do, I think that making these kinda changes can only make php better. Again the point of this email isn't to change authors/founders minds its just my point of view. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [Zend Engine 2] PHP in the future
--- Zeev Suraski [EMAIL PROTECTED] wrote: At 08:26 PM 6/6/2002, brad lafountain wrote: --- Zeev Suraski [EMAIL PROTECTED] wrote: At 07:01 PM 6/6/2002, brad lafountain wrote: Please don't reply to this email saying Use Java... Because php is different than java and always will be even with these new features. Brad, I beg you, there's nothing anybody can say on this list that would lead this to closure. Nothing. I believe that adding the things you mentioned does indeed turn PHP into Java, just a messy Java, Java which is worse at being Java than the real one is, and torn apart when compared against it. Why do you think it would be messy. See Kristian's letters to php-dev. I really don't want to get into it at this point, mental exhaustion :) I do believe that making a fork or patches for php is a bad thing. It would lead into a big mess. But at the same time i believe more strongly that cs is a good thing, types are a good thing and stronger oo support is a good thing. To me these are more important. I don't think I can add anything about CS that I haven't already said. Adding type hints is something that we have talked about in the past, and haven't ruled out - we need to think much more about the implications. This is good to hear. I was totally against types, then i started thinking that it would acually be eaiser to use. But i wouldn't want to loose the floating types too. I believe the OO level we have in ZE2 is the upper limit of what a scripting language should have. There's no doubt in my mind that going beyond that is going to complicate the language beyond what our average users want. Average user.. maybe this is true.. but if you want to target more advance developers then you need to go the extra step and do some of the stuff. There's one thing that is clear to me - there's no way to 'find a solution', because we don't, at all, agree about the existence of the problem. If you believe these features belong in PHP and that it should import all (or most) of Java's features, we (and many others) have a fundamental gap in our perception of what PHP should be, and how it can stay competitive. This is exactly true. I really feel that php/zend engine could be a alot more than you must think it can be. No, it's not a matter of me settling for little, and you thinking we can do much better. Not at all. While I don't think we can become a better Java than Java, this is not the reason I'm so much against going down this path. If that was it, I would have said 'let's give it a try, what's the worse that can happen?' But that's not the case. I believe that by going down that route we're going to ruin PHP where it is already established as one of the most popular web platforms out there, and that's a price I'm not willing to pay. But you have one market.. Why not go for another.. You aren't going to loose the market that you have. I don't think people will stop using php for the web just because it has more options. For the most part the only argument against these is do we need it and it will make things slower. Maybe somepeople do maybe somepeople don't but if someone thinks they need it then probally others do too, how much slower will some of these changes make the engine? Maybe not much at all. True these kinda things will make the languge more complicated and some people don't think that php should get complicated but I do, I think that making these kinda changes can only make php better. FWIW, I think that performance only plays a second role in such decisions. It can indeed rule out certain features if they really slow things down without giving a significant benefit, but generally, functionality is more important than performance (good functionality does not necessarily mean more features but a good, usable platform, even if it means less features). For me, the key questions are Does that belong in the language?, i.e., would adding this feature to PHP make it a stronger/more popular/easier to use web platform than it already is, and Is it worth the price (if any)?. Why settle for just web platform. It has the potental to be any platform. So here is the question again. Does adding (some feature) to php make it a stronger/more popular/eaiser to use development platform than it already is. Does adding (more oo features) to php make it a stronger/more popular/eaiser to use development language? Yes. Does adding (types) to php make it a stronger/more popular/eaiser to use development language? Yes. ( i think this is true for the web-centric php too) Does adding (CS) to php make it a stronger/more popular/eaiser to use development language? Yes/Maybe. For the CS argument, my gut feeling was 'yes' for the first question (a long time ago) but when I tried to quantify it, it occurred to me
Re: [PHP-DEV] Re: [Zend Engine 2] PHP in the future
Andi, Before you go ahead with this I would like to discuss it some more too. I'm wondering if we can fully support MI but i don't want to start this conversation now. btw: i like the contains better than aggergates. - brad --- Andi Gutmans [EMAIL PROTECTED] wrote: A couple of months ago it was agreed on how to get multiple inheritance like behavior in a way which could work with PHP. I just haven't had time to implement it yet. The talk was about aggregation of instances of classes with auto-proxy. So you'd do something like: class foo extends bar contains barbara, foobar { } $obj = new foo(); $obj-method(); /* would check foo and if method doesn't exist will auto-proxy to objects barbara and foobar in that order whatever matches first.*/ You could access the specific object by $obj-classname or $obj-barbara. Try and find it in the archives. Andi At 06:59 PM 6/6/2002 +0100, Dan Hardiker wrote: I believe the OO level we have in ZE2 is the upper limit of what a scripting language should have. There's no doubt in my mind that going beyond that is going to complicate the language beyond what our average users want. I would have to disagree to this statement extremly. It would not complicate the language as those not interested would just ignore the new options and go along as normal. (i.e. all methods and variables being public by default) I sit in many PHP channels (IRC), and observe many class-based PHP networks (php-classes.org is one I monitor closely) and can say definatly that the majority of PHP users want *more* OO capabilities in PHP. Interfaces provide a simple framework for expansive web scripts, which currently can only be botched with extends... and multiple inheritance would help my current PHP (web-based) project. If these features are too complex for you to understand - ignore them! In my opinion the demand is certainly there, if a subset of people dont want to use it - we're not asking them to. What the masses are calling for (and they obviously are with the frequency of this kind of post appearing) is the option to decide. Although Im no expert on the PHP source code and the underlying ZE - is it really that complex to please everyone and give a choice? [for those concerned about the proposed stuff having performance impacts - then make it a configure option... --with-more-oop (or whatever)] -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] New extension
What is RDF? - brad --- Garland foster [EMAIL PROTECTED] wrote: Hi all, I just finished a php extension for repat an RDF parser in C coded by Jason Diammond, with this extension we are able to parse RDF files (in any syntactical representation) from PHP and process the RDF statements as we want. Web based RDF management systems written in PHP are possible now using this extension. The extension is based on repat and repat is based on expat so I used the expat parser that the xml extension uses. The extension defines some constants (RDF_SUBJECT_TYPE_LITERAL, RDF_SUBJECT_TYPE_URI, etc) and the following functions: parser=rdf_parser_create() rdf_parser_destroy(parser) rdf_set_statement_handler(statement_handler_name) rdf_set_element_handler(start_element_handler_name, end_element_handler_name) rdf_set_character_data_handler(character_data_handler_name) rdf_parse(parser,data,is_final) And these functions for convenience: rdf_dump_document(document_uri) rdf_parse_document(parser,document_uri) I think PECL will be suggested as the way to go for this extension so I need instructions to know what to do from now, maybe someone to contact? Are there templates to write the extension documentation? Another thing that I really need is a volunteer to compile the extension under windows and produce the proper .dll to be added to windows distros of php. I promise it is a smooth extension that won't cause problems, and I'd really like to test it under windows. Regards, Garland. __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP's vision
--- Edin Kadribasic [EMAIL PROTECTED] wrote: And doesn't ZE2 address almost all of those OO related things? It does. Personally, I'm missing two things in Zend Engine 2.0: interfaces and private methods. Both are not really critical, as they don't aim at solving technical problems, but social ones during the design process. PHP != Java. :) I'm bother by the fact that you guys keep on saying Php isn't Java so don't use lets not use private methods or interfaces. Java is Object Oriented. Java didn't invent private methods, private members and all the other goodies that go along with OO development. Now good OO design is the best way to get good code re-use out of your time developing. Adding stuff that will help you design better objects like private methods will only make php stronger and more accecptable as a OO soultion. Now as far as where php is going. I feel php should do everything it can to get a more crediable name in other soulitions besides webbased. It definly is tagged as a web scripting language and it should thats what it was built around. But we know that php is way more than that we devlop it. PHP is a strong fast scripting language and should we should start trying to get people to understand this point. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP's vision
--- [EMAIL PROTECTED] wrote: On Mon, 3 Jun 2002, brad lafountain wrote: I'm bother by the fact that you guys keep on saying Php isn't Java so don't use lets not use private methods or interfaces. Java is Object Oriented. Java didn't invent private methods, private members and all the other goodies that go along with OO development. Now good OO design is the best way to get good code re-use out of your time developing. Adding stuff that will help you design better objects like private methods will only make php stronger and more accecptable as a OO soultion. PHP isn't an OO solution, PHP is a just a tool for a problem. If you think that solving webscripting problems with OO 'solutions' is the 'only' way to do it then you should use Java as a tool. And you can use a procedural aproach for webscripting too, or an OO aproach implemented in a procedural language. I wasn't saying that OO is the only way to solve the problem. To me OO soultion is not only cleaner/eaiser to read but it makes a libary eaiser to use. I'm not talking about just webscripting. Having better OO support will allow libary designers to be able to create more re-useable Objects for scripting or application server or gui components. It's kinda frustrating to me, I like php alot and php defintly has the potentional to be used for a wide virity of soultions. Then you guys are going back and forth saying that OO design has a minimanl affect on the community and that OO is clutter. Responses like if you want good OO support use Java? What is that. Why do you say these things. The php/zend engine is pretty damn strong why are you guys looking at it so narrowly. I honistly would like to see php become a more popular soulition than Java in every siuation. Enterprise, websites, or a eye doctor for an internal applicaiton. And i can be. When people at work ask me how long would it take do to x. I first think how long it would take me to do in php. Php is my first tool of choice. Php isn't java but i think it can be way better than java too. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] libxml bundling
Ok, I think we are split in two about what to do here. Ill try and list the different ideas that have been proposed. 1) don't include at all pros: No need to worry about auto install or filesize. cons: Forces people to install themselves. 2) trim down libxml and put in cvs pros: Build outta the box. Makes php to build without having to download extra libaries for highly used extension like domxml. Since domxml requires a newer version of libxml than most people have it requires them to go an install it before buiding php. cons: People feel that maintaing this would be too much of a hassle. Conserns about file size of the php package. 3) figure out some method to auto download config/install pros: No extra filesize for php source. No matinance for php developers. cons: Someone needs to build this (semi complex). Reliant on other servers being up/ asseable from clients machines (ie have internet connection from the machinge its being installed from) 4) Try and automate the sliming down of libxml and incorp it in the make dist. pros: Still have outta the box but it doesn't live in our cvs. cons: Someone needs to build this (relitivly simple). Still have the filesize issue. Do we vote? - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] libxml bundling
First off trimming down means. removing documentation. removing install help. NOT removing any code at all! Why do you feel that bundling is such a burdon and how does it requires more testing. If libxml release a new release and it is decited to upgrade then simply upgrade. I don't understand why you think its such a burdon. It looks like they are releasing a version once a month. I don't really think a hour of a developers time a month is much of a burdon. Besides the fact that i don't think we need to upgrade everytime libxml upgrades. If we bundle the newest one right now php and all of it's xmlbased extensions will work fine. if a new one gets released... so if we (php group) feels that its worth the upgrade then go we do it. Otherwise if an end users feels it is in his best intrest to get the newest version the by all means he can. Im not saying that we need to force a version on them but give them a hand if they don't have any installed. But one thing that I didn't think of that andy pointed out is. The ability for php/zend's core or extensions to use xml. (ie config files for new extensions that are separate from php.ini) Xml is so widley used everywhere. You want proof that xml is widly used??? Are you serious? What kinda comapany do you work for? We pretty much use xml and xml based techonlogies in 90% of our projects. And talk about objective points? Your points don't seem more objective than mine. - Brad --- Dan Kalowsky [EMAIL PROTECTED] wrote: Let's please try to keep the points objective. 1) don't include at all pros: No need to worry about auto install or filesize. cons: Forces people to install themselves. Is this really a valid con? This is the standard method of adding functionality to ANY programming language. It's not forcing anyone to do anything. If the end user decides that they would like to have XML capability, they will take the steps required to install such services. As of this moment that includes downloading and installing the libxml services. 2) trim down libxml and put in cvs pros: Build outta the box. Makes php to build without having to download extra libaries for highly used extension like domxml. Since domxml requires a newer version of libxml than most people have it requires them to go an install it before buiding php. Unless you have hard numbers, I'd really appriciate you not stating domxml is a highly used extension. Stating opinion as fact isn't going to help here. cons: People feel that maintaing this would be too much of a hassle. Conserns about file size of the php package. Please keep these points to an objective point, and not a rhetoric with emotion. Con(s): - Requires maintaining code integrity across new versions of libxml - libxml is a moving target - Will require double the effort to provide a 0% increase in output. - Trimmed libxml is not a full libxml, leading to possible end user confusion. - Adds a new point requiring multi-platform release testing. 3) figure out some method to auto download config/install pros: No extra filesize for php source. No matinance for php developers. This point would be more valid for the requires minimal interaction with PHP developers (i.e. hosted site changes location, path, or filename). cons: Someone needs to build this (semi complex). Reliant on other servers being up/ asseable from clients machines (ie have internet connection from the machinge its being installed from) Is this last really a con? It's the same problem across the debian apt-get, the BSD ports collection, and even for getting PHP itself. Which I believe is the more common way for people building PHP than actual tarballs. Although this is only conjecture with no real proof, so take that with a grain of salt. But these methods also check local library versions and will automatically get/update the library if necessary on a per flavor basis. 4) Try and automate the sliming down of libxml and incorp it in the make dist. pros: Still have outta the box but it doesn't live in our cvs. cons: Someone needs to build this (relitivly simple). Still have the filesize issue. Please do not dismiss the trying to hit a moving target as simplisitic. It's not. Having worked with moving targets in the past I can assure you, it is not a fun task. It gets exhausting very quickly. Con(s): - No way to automatically ensure new functionality validity - Will still require developer intervention (albiet less) - Will require multiple OS testing - Will not be valid if libxml is re-written/re-architectured - No way to tell if automated merges have selected the proper option (i.e. bug fix in PHP version and not in official distro). But you did forget at least one other option: 5) Provide a better form of documentation for the end users describing versions with
Re: [PHP-DEV] bundling libxml2 / bundling locations
--- [EMAIL PROTECTED] wrote: On Thu, 30 May 2002, Andi Gutmans wrote: I think that XML is a core technology and giving plugplay access to our users is important. Having bundled the MySQL library made it easier for people to get started with MySQL. Does that mean I think every library should be bundled with PHP? No, I don't. But if libxml2 is a moving target and it's hard to stay in sync then it certainly sounds beneficial to take away this headache from our users. It also means that other XML based extensions could use it by default. Of course it also depends how big it is. If we can strip it down a lot I'd be a +1. If it'd add 1 MB to our .tar.gz I would be against. THe normal source distribution is almost 2 MB... The 2M size has alot of stuff that we wouldn't need. Im sure we can get it down to under 500K. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] bundling libxml2 / bundling locations
--- Stig S. Bakken [EMAIL PROTECTED] wrote: On Thu, 2002-05-30 at 18:08, [EMAIL PROTECTED] wrote: On Thu, 30 May 2002, brad lafountain wrote: The 2M size has alot of stuff that we wouldn't need. Im sure we can get it down to under 500K. I still think 500kb is too much for something the most ppl already have installed. Having a too old version installed doesn't help much in this case. :-) If Brad is able to trim down libxml2 to a reasonable size, I'm +1 Got it a little under 800k Just the c source alone was 500k. There are a few source files with 1 lines. I still would like to see it bundled. I do understand that libxml2 is being developed regulary but since domxml does require a semi-new version of libxml2 that most people don't have. I don't know when 2.4.14 was released but the date on the file server is 2/8/2002. Thats pretty recent. I don't/didn't have that version installed on my system. Pretty much every project that i work on uses some kinda xml processing I don't know if thats true for a majority of people or not but I definlty rely on it alot. If we bundle 2.4.14 we can change domxml's config script to detect the version on the system if its greater than 2.4.14 then it can link against that version if it isn't then it will use the bundled version. As far as upgrading the version that is bundled. How often or if ever do we need to. If changes in domxml require a newer version of libxml2 then thats when we can upgrade the bundled lib otherwise we wouldn't need to. From my understanding libxml2 is faster than expat? and all the things like ext/xml and ext/xmlrpc can be converted to libxml2? Since we do bundle expat i don't see the big problem with bundling libxml2. So the only down side I see is the filesize of php? I don't see that as too much of a problem but thats just my opnion too. I personally will take responsiblity for bundling and upgrading it. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] bundling
This was brought up before. Instead of bundling libaries in php4/ext/mysql/libmysql they could be put in php4/bundled/libmysql This will help other extensions use bundled libaries. maybe if mod_mysql for session handling is created then it can link against the bundled mysql lib. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] bundling libxml2 / bundling locations
--- Dan Kalowsky [EMAIL PROTECTED] wrote: On Thu, 30 May 2002, brad lafountain wrote: I personally will take responsiblity for bundling and upgrading it. Brad, Nothing personal (so please don't take it that way), but in my opinion this isn't a good enough assurance. Historically you will see people come and people go with Open Source development, and while you have a lot of free time to do this now, N months from now will you? Free Time? Who says i have that? Months from now I honistly can't say what i'll be doing. For all I know i could get hit by a car. I don't plan on ditching my contributions anytime soon. But I don't see my contributions a factor in deciding if we should bundle libxml. We are only talking about a few cvs commands here! We aren't talking about a huge effort. As Rasmus stated earlier the reason the MySQL stuff is bundled is due to an assurance from the MySQL developers to keep it updated. They know their code inside and out. I'm not familiar with what you do or don't know, or what development you're active in either. Unless you were/are an active developer on the libxml code, the ability to introduce bugs completely dependent to the PHP bundle is increased considerably due to bad merges. I don't see bad merges a problem here. It's not like I would be applying patches or getting the latest and greates from libxml's cvs. Peridocially someone would just need to update the source files from the 'newest' release. But as I explained before besides bug fixes and speed increases you wouldn't get much from keeping totally up to date with the bundled libxml. And again.. its not like we are forcing the version on the user nor making it an inconvenionce for them if they already have libxml installed. I really see little to no advantage to this bundling yet. Only increasingly more reasons not to do this. I really dont see this. I don't know how much developement other people do but use xml/xml techiologies on a daily basis. I see this is the trend of many developers but I obvisouly cant speak for them. The ability to build outta the box is also what many system admins what to see, maybe not the hacker ones but the ones who just get the job done. I also know alot of managers that will pay for software just cuase it runs outta the box. No needing to depend on other software is installed. So with thoes two statements it makes total sence to go thru the process of bundling something as important as libxml. Ok we bundle gd... gd is very usefull for many sites/applications but common don't you feel that xml is a little bit more important than gd? The only downside here is the filesize of the source dist and a few developers already commented that it's not that big of a deal. Seriously we bundle expat why wouldn't we bundle libxml. It's way more usefull than expat. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] domxml changes
I was talking before about making changes to domxml. The changes involved allowing users to create nodes without having a domdocument. $node = new DomElement(myNewElement); $node-set_content(stuff); echo $node-dump_node(); it also allows you to create a document in the same way $node = new DomDocument(xmlfoo/xml); echo $node-dump_mem(); Why I decided to do this is because have have an internal (to my extension) xml doc tree that i want userland code to be able to create a node and pass it into a function then my extension will attach it to my xml doc tree. The patch also lets extension developers create domnodes from the c level with php_domobject_new(); here is a small sample xmlNodePtr node; node = xmlNewNode(null, mynode); return_value = php_domobject_new(node, found, NULL); This would create a new php dom node and return it to userland for further processing. It also removes some duplicate code in xmldocfile. It also moves DOMXML_API_VERSION to php_domxml.h. Compiled and tested on windows and linux. There wasn't any objections before when I proposed it so im committing now. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] domxml changes
Forgot to attach the diff for people who are interested. - brad --- brad lafountain [EMAIL PROTECTED] wrote: I was talking before about making changes to domxml. The changes involved allowing users to create nodes without having a domdocument. $node = new DomElement(myNewElement); $node-set_content(stuff); echo $node-dump_node(); it also allows you to create a document in the same way $node = new DomDocument(xmlfoo/xml); echo $node-dump_mem(); Why I decided to do this is because have have an internal (to my extension) xml doc tree that i want userland code to be able to create a node and pass it into a function then my extension will attach it to my xml doc tree. The patch also lets extension developers create domnodes from the c level with php_domobject_new(); here is a small sample xmlNodePtr node; node = xmlNewNode(null, mynode); return_value = php_domobject_new(node, found, NULL); This would create a new php dom node and return it to userland for further processing. It also removes some duplicate code in xmldocfile. It also moves DOMXML_API_VERSION to php_domxml.h. Compiled and tested on windows and linux. There wasn't any objections before when I proposed it so im committing now. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com Index: php_domxml.c === RCS file: /repository/php4/ext/domxml/php_domxml.c,v retrieving revision 1.159 diff -u -r1.159 php_domxml.c --- php_domxml.c19 May 2002 00:02:05 - 1.159 +++ php_domxml.c31 May 2002 05:39:19 - @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_domxml.c,v 1.159 2002/05/19 00:02:05 sniper Exp $ */ +/* $Id: php_domxml.c,v 1.118.2.8 2002/05/03 15:16:14 chregu Exp $ */ /* TODO * - Support Notation Nodes @@ -34,14 +34,12 @@ #include ext/standard/info.h #define PHP_XPATH 1 #define PHP_XPTR 2 -/* DOMXML API_VERSION, please bump it up, if you change anything in the API -therefore it's easier for the script-programmers to check, what's working how - Can be checked with phpversion(domxml); -*/ -#define DOMXML_API_VERSION 20020516 /* General macros used by domxml */ -#define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = php_domobject_new(obj, ret TSRMLS_CC))) { \ + +#define DOMXML_IS_TYPE(zval, ce) (zval +Z_TYPE_P(zval) == IS_OBJECT Z_OBJCE_P(zval)-refcount == ce-refcount) + +#define DOMXML_DOMOBJ_NEW(zval, obj, ret) if (NULL == (zval = +php_domobject_new(obj, ret, zval TSRMLS_CC))) { \ php_error(E_WARNING, %s(): cannot create required DOM object, \ get_active_function_name(TSRMLS_C)); \ RETURN_FALSE; \ @@ -203,9 +201,9 @@ PHP_FE(html_doc, NULL) PHP_FE(html_doc_file, NULL) #endif - PHP_FE(domxml_xmltree, NULL) - PHP_FALIAS(xmltree, domxml_xmltree, NULL) - PHP_FE(domxml_substitute_entities_default, NULL) + PHP_FE(domxml_xmltree, + NULL) + PHP_FALIAS(xmltree, domxml_xmltree, NULL) + PHP_FE(domxml_substitute_entities_default, + NULL) PHP_FE(domxml_doc_document_element, NULL) PHP_FE(domxml_doc_add_root, NULL) PHP_FE(domxml_doc_set_root, NULL) @@ -226,7 +224,7 @@ PHP_FE
Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [RESENT] [PATCH] Allow constants / expressions to be passed by reference]
I have ran into this limitation too or something like foo(); or foo($bar); function foo($bar = null) { } --- Andi Gutmans [EMAIL PROTECTED] wrote: I don't see any reason to allow passing non-variables by reference. It is semantically incorrect. Andi At 09:40 29/05/2002 +0200, Stig S. Bakken wrote: If this patch doesn't break anything, and it doesn't give us any difficulties with ZE2 or major design issues, I'm +1. - Stig On Tue, 2002-05-28 at 21:12, Jason T. Greene wrote: Due to this patch being sent during the msession discussion, it has not been noticed, so I am resending. -Jason From: Jason Greene [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: [PHP-DEV] [PATCH] Allow constants / expressions to be passed by reference Date: 25 May 2002 02:18:52 -0500 Problem --- There are some scenarios where a function requires the ability to modify parameters that may also be optional. Optional parameters work well, except in the scenario where all of the pass by reference parameters can be optional. ex the socket_select() function. Since select is argument-result, all three arrays that are taken as input must be passed by reference, yet any can be excluded. So for example if you were calling socket_select with a read socket array, a write socket array, yet no exception array (quite common), you are currently forced to do something like the following: $wfds = array($sock1, $sock2); $rfds = array($sock3, $sock4); $null = NULL; socket_select($rfds, $wfds, $null); I have ran into this problem before several times while developing in user space. (Especially when passing around semi-complex data structures) Proposed Solution -- Allow all expressions to be passed by reference. This will allow something like the following function normalize($element_tree, $node_mapping, $max_depth){ //Code } normalize($my_tree, NULL, 25000); Patch -- I have attached a patch against ZE2 that accomplishes this. Thanks, -Jason Index: zend_compile.c === RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.285 diff -u -r1.285 zend_compile.c --- zend_compile.c23 Apr 2002 18:06:53 - 1.285 +++ zend_compile.c25 May 2002 06:45:21 - @@ -1271,7 +1271,7 @@ op = ZEND_SEND_REF; break; default: - zend_error(E_COMPILE_ERROR, Only variables can be passed by reference); + op = ZEND_SEND_VAR; break; } } Index: zend_execute.c === RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.341 diff -u -r1.341 zend_execute.c --- zend_execute.c8 May 2002 18:43:19 - 1.341 +++ zend_execute.c25 May 2002 06:45:25 - @@ -2292,10 +2292,6 @@ NEXT_OPCODE(); } case ZEND_SEND_VAL: - if (EX(opline)-extended_value==ZEND_DO_FCALL_BY_NAME - ARG_SHOULD_BE_SENT_BY_REF(EX(opline)-op2.u.opline_num, EX(fbc), EX(fbc)-common.arg_types)) { - zend_error(E_ERROR, Cannot pass parameter %d by reference, EX(opline)-op2.u.opline_num); - } { zval *valptr; zval *value; @@ -2329,7 +2325,8 @@ zend_ptr_stack_push(EG(argument_stack), varptr); NEXT_OPCODE(); } - zend_error(E_ERROR, Only variables can be passed by reference); + /* Should only occur with an uninitialized variable */ + goto send_by_var; } NEXT_OPCODE(); case ZEND_SEND_VAR: -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!?
[PHP-DEV] bundling libxml2 / bundling locations
Hello all, It was mentioned before about bundling libxml2 with php with expat or instead of expat. Where do we stand with this? I emailed the developer asking permission to bundle it if we choose to do it (no response yet). Also I remember reading on here before someone suggested putting bundled libaries in a common place so many extensions can use the bundled software. Is this something we want to persue too? php4/bundled/libxml2 php4/bundled/mysql php4/bundled/gd you get the point.. This will be usefull if i am writing an extension that maybe does database replication (just a stupid sample) and i want to create nice graphics for my stastics i can just write some gd code and link against the bundled libary. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] bundling libxml2 / bundling locations
Ok, But take ext/domxml it requires a newerversion of libxml2. I didn't have it installed on my machine when i installed php. If we bundle say a specfic version of libxml2 that domxml depends on, then it won't matter how fast pased the development is, ext/domxml won't use it. We can obvisouly peridocially upgrade the version that is bundled and you can have an override if you want to use a different version that is installed on a system. As xml gets more and more popular i feel that domxml will be more and more popular. Build outta the box - Brad --- Christian Stocker [EMAIL PROTECTED] wrote: On Wed, 29 May 2002, brad lafountain wrote: Hello all, It was mentioned before about bundling libxml2 with php with expat or instead of expat. Where do we stand with this? I emailed the developer asking permission to bundle it if we choose to do it (no response yet). öhm, libxml2 is a relatively huge project with a fast developement cycle.. I don't see the point in bundling that with php. It's actively maintained (not as for example gd), we don't need any patches to get it running and it comes with most (all?) distros (not installed by default everywhere, but it's available). And installation from source is also no pain at all... chregu -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Fwd: Re: libxml2 - php
--- Daniel Veillard [EMAIL PROTECTED] wrote: Date: Wed, 29 May 2002 23:28:11 +0200 From: Daniel Veillard [EMAIL PROTECTED] To: brad lafountain [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: libxml2 - php Reply-to: [EMAIL PROTECTED] On Wed, May 29, 2002 at 10:35:44AM -0700, brad lafountain wrote: Hello, I'm a developer for php. We were recently talking about bundling libxml2 with the php distribution. I'm not to sure about the licensing issues involved here but I figured I'd just ask you and get your permission. Let me know your thoughts/concerns. libxml2 is licenced under the MIT Licence, I honnestly don't think bundling would be a problem at that level. However on a practical basis it would be better that you use the existing shared library if libxml2 is already installed on the system rather than always including it in the PHP module/binary. Others Apache modules may use libxml2 too and sharing the same instance can make a big change. for maintainance too ! Daniel -- Daniel Veillard | Red Hat Network http://redhat.com/products/network/ [EMAIL PROTECTED] | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] bundling libxml2 / bundling locations
My point of view is domxml does require a newish version of libxml2. It't not going to hurt if we bundle that version with php. The configure script can even detect a version that is installed on the system. If its greater than the packaged one then it can use that one instead alsogive the user to overide the bundled libxml2 --enable-domxml=/path/to/new/xml. I really don't see any ill effects with bundling. We bundle for the people don't regulary upgrade software and we allow auto config/overriding for people that do. Why do you think that .net will do so good (becides m$ forcing it on us). They run one installer and bingo everything works. People will say its easy to setup. - Brad --- Markus Fischer [EMAIL PROTECTED] wrote: On Thu, May 30, 2002 at 08:12:27AM +0900, Yasuo Ohgaki wrote : Brad Lafountain wrote: Ok, But take ext/domxml it requires a newerversion of libxml2. I didn't have it installed on my machine when i installed php. If we bundle say a specfic version of libxml2 that domxml depends on, then it won't matter how fast pased the development is, ext/domxml won't use it. We can obvisouly peridocially upgrade the version that is bundled and you can have an override if you want to use a different version that is installed on a system. As xml gets more and more popular i feel that domxml will be more and more popular. Build outta the box +1 for libxml2 bundle. This already discussed, isn't this? -1 It's very actively developed. What is the reason of shared libraries if we don't use it?! GD is a completely different story. I even think it's not necessary to bundle libmysqlclient because it's really installed everywhere where mysql is available. - Markus -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc Wishlist: http://guru.josefine.at/~mfischer/wishlist __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] karma - group at php dot net
Ive mailed group at php dot net a few times. I keep on getting a failed notice response back. Who should I mail for karma. - Brad __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP-SOAP features
--- [EMAIL PROTECTED] wrote: On Thu, 23 May 2002, brad lafountain wrote: Ok, I know not too many people are familure with my extension so I am going to go over some stuff that it does do and stuff it doesn't. The plans i have for this extension are more than just a simple soap/rpc function calls. I want to build a frame work that people can deploy existing php objects as SoapObject. Making php a very fast soap application server having exactly the same functionality as SRM but allowing non php clients access the objects. In addition to making php-soap a soap application server i have plans have the frame work be able to handle a cluster of soap application servers. Then why not help us integrate a SOAP communication layer in SRM? Saves the work of building that app server, plus we already are working on this and also designing a framework for clusterlike applications. Well i hope that phpsoap can get to a point where you can intergrate my extension with SRM. But as far as SRM instead of php soap application server. I don't think that would work as good. phpsoap doesn't require a deamon running. And the clustering stuff that im working on isn't phpsoap centric is phpsession specific so its a more generic clustering soulition. People can use it for clustering php servers with out SRM or phpsoap. - Brad __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL
Ok here I am I do already have some email lists up for my extension. [EMAIL PROTECTED] [EMAIL PROTECTED] I've been doing ALOT of work with my extension. And i currently do use it live at work. We have a java interface talking to SoapObjects on the server. This is extremly powerfull cause it take advantage of php seralization and php sessions to persist php-soap objects. So basicall you have a php-soap application server that can commiuncate with any client. Run a php object in any language that supports soap. here are some snipplits that explain what im doing ? $client = new SoapObject(http://serverendpoint.com/somescript.php;, urn:Test); $client-setData(someData); echo $client-getData(); $client-destroy(); ? ? $server = new SoapServer(urn:Test); $server-setClass(myClass); $server-setPersistence(SOAP_PERSISTENCE_SESSION); $server-handle(); class myClass { var $data; function setData($data) { $this-data = $data; } function getData() { return $this-data; } function destroy() { session_destroy(); } } ? now with the above example you can see how you can have persitiant php objects running on a remote server. I use this type of functionality in my java gui. All of my database objects are writtin in php they do the data extract. Then the java gui can fetch the data. Now if i don't like java i can create php-gtk appliation use php-soap and i don't need to re-write my database objects or MFC or VB etc etc. And now you can give this gui application to customers and have them run it... and if you ever want to change your underlaying db structure or any business logic you don't need to release a new application you can control it thru your phpsoapobjects. Since the perstited object is using php-session handling you can control where the objects go. So i take it a step further i use msession to handle my objects. Now i can have a cluster of php-soap application servers each soap call method call can run on a different server or if you want pure speed you can set up your session handling to use mod_mm but you don't have the whole clustering part. My extension is very young. it still needs alot of work but it also includes alot of functionality. the website is http://phpsoaptoolkit.sourceforge.net/ - Brad --- Dietrich Ayala [EMAIL PROTECTED] wrote: i'm under contract. i'd definitely contribute as much as possible on the list though :) i think these are excellent steps for PHP in this area. i get an amazing amount of NuSOAP-related email every day from developers who (for whatever reason) think that SOAP is the shiznit, and are creating all kinds of crazy web services. Most are trying to talk to other SOAP toolkits (mostly .NET Apache). suggestions: 1. interop is key. get an endpoint up for brad's extension, and register it w/ soapbuilders list. 2. implement solid document-oriented messaging support (doc/lit) into brad's extension. dietrich -Original Message- From: Shane Caraveo [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 23, 2002 11:04 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL I would be happy to lead the effort on the soap front. I've spoken a bit with Brad about combining our efforts but got sidetracked over the last couple weeks so haven't followed up on that. I'm also not sure whether Deitrich is tied to NuSphere with his work, it'd be nice if we could get him to work on this also (I'm sure he's lurking here ;). There have been a couple others contacting me about working on the soap stuff as well. Shane Rasmus Lerdorf wrote: pear/SOAP seems to work pretty well. There are few people out there that know more about SOAP than Shane and I am quite comfortable having him spearheading this effort. We can easily set up a php-soap mailing list if enough people are interested. -Rasmus On Thu, 23 May 2002, Lukas Smith wrote: Yeah, I keep seeing PHP SOAP and XMLRPC being announce packages everywhere. But incompatible API's will not benefit PHP much and the efforts are simply redundant. I think it would make sense to create such a mailinglist. As I am still fairly busy with working on a merge of Metabase and PEAR DB called MDB (blatant plug :-) ) I can't spend as much time as I would wish on this topic. For now I will try to order the feedback I get and put together a little static page with the content. Basically I will take every package I find and list it there and put any comments people send regarding that package underneath. Best regards, Lukas Smith [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!?
RE: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL
One reason is xmlrpc doesn't have everything that goes along with soap. meaning WSDL UDDI WebServiceSecurity. and as far as i understand that xmlrpc doesn't work on windows. and with some benchmarks phpsoap so far was 3 times as fast as xmlrpc. - Brad --- Stig S. Bakken [EMAIL PROTECTED] wrote: PHP already has SOAP support bundled in the xmlrpc extension, which is built upon the xmlrpc-epi library that we bundle. Why can't people improve that instead of re-inventing more wheels in all shapes and sizes? When we bundle a library, we should use it. - Stig On Thu, 2002-05-23 at 17:52, Andi Gutmans wrote: I think it's important to have a main stream soap implementation bundled with PHP and not a zillion different implementations floating around. If there is enough interest we could setup a Soap mailing list where interested people could cooperate possibly basing the official PHP Soap implementation on existing work, for example, Brad's work. As I personally don't have the knowledge nor the time I'm just making the suggestion :) It's up to people who are interested in this topic to move it forward. I think it would be extremely beneficial to PHP. Andi At 17:52 23/05/2002 +0200, phpsurf wrote: hi brad lafountain is working on a Soap extension which is not far from being stable. he made a good use of WSDL ... you should have look to http://phpsoaptoolkit.sourceforge.net/phpsoap/ -Original Message- From: Markus Wolff [mailto:[EMAIL PROTECTED]] Sent: jeudi 23 mai 2002 15:29 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL Am Thu, 23 May 2002 14:57:45 +0200 schrieb Lukas Smith [EMAIL PROTECTED]: What is the current status in terms of SOAP, XMLRPC and WSDL in php? How mature are the solutions? When will they be ready for primetime? Does anyone already use them in production (that can be used to show off how great the support is) or are there any other prominent examples? (I know the pear installer uses XMLRPC and Sebastian did something with Googles Webservices) We´ve been trying to make a PEAR::SOAP webservice talk to a VB.NET SOAP client. It does work very well when you stick to passing most primitive datatypes around: Strings, Integers, Floats, Booleans ... It stops being fun when you´re trying more complex structures like resultsets from SQL-Queries. Those could be represented and passed via SOAP as two-dimensional arrays, and in theory you could either use a loosely typed two-dimensional array or an array of struct to represent that data in the VB.NET client - but we did not yet manage to make the client recognize and deserialize the SOAP data from the PHP script. I have not the slightest idea where to start looking. I´ve read tons of articles on SOAP and WSDL, but all in all, the quality of documentation on this topic sucks. PEAR::SOAP itself is as good as undocumented (at least the server part) and the documentation for .NET webservices mostly talks about connecting an ASP.NET webservice to a C# or VB.NET client. When it comes to making SOAP calls to a client/server on another software platform, or even if you just want to use SOAP-RPC encoding instead of the default Document/Literal encoding that .NET does, the documentation is very uncomplete. Thing is, you _have_ to use SOAP-RPC encoding because PEAR::SOAP does not yet support Document/Literal (in fact, Microsoft seem to be the only ones who use this encoding method by default or even fully support it). I guess when it comes to maturity, all available implementations in any language still have a long way to go. Regards, Markus -- *21st Media*| Consulting, Konzeption, Produktion für die Bereiche: Markus Wolff| Internet, Intranet, eCommerce, Content Management, Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming http://21st.de | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL
Well my extension i was going for a solid implmentation of soap that could run out of the box. With many features and tightly intergrated with zend and other extensions like domxml and php-streams. I think my extension has some value here. I would like to see my soap be the soap implementation that you speak of. Again, I have cvs accounts and a php look-a-like website all hosted on sourceforge.net. I don't mind converting everything to php cvs and php site. When i first started working on this extension, the list didn't seem to interested so i went of on my own and built a website and put it up on sourceforge. More people are obvisouly interested now maybe i can put this in the right place. - Brad --- Andi Gutmans [EMAIL PROTECTED] wrote: Then go for soap, that's fine too. The most important thing is that we manage to get good SOAP support into PHP which will work out of the box and can be documented officially in the manual. Andi At 14:08 23/05/2002 -0700, Rasmus Lerdorf wrote: I really don't like the term Web Services. SOAP is an RPC mechanism and has nothing to do with the web despite what M$ would like to have you think. -Rasmus On Fri, 24 May 2002, Andi Gutmans wrote: As I mentioned earlier I am a big +1 for it. Probably php-webservices@ is even better as it covers more and sounds good :) Andi At 11:05 23/05/2002 -0700, Rasmus Lerdorf wrote: So do we want a [EMAIL PROTECTED] mailing list? I can set it up if you say the word. -Rasmus On Thu, 23 May 2002, Shane Caraveo wrote: I would be happy to lead the effort on the soap front. I've spoken a bit with Brad about combining our efforts but got sidetracked over the last couple weeks so haven't followed up on that. I'm also not sure whether Deitrich is tied to NuSphere with his work, it'd be nice if we could get him to work on this also (I'm sure he's lurking here ;). There have been a couple others contacting me about working on the soap stuff as well. Shane Rasmus Lerdorf wrote: pear/SOAP seems to work pretty well. There are few people out there that know more about SOAP than Shane and I am quite comfortable having him spearheading this effort. We can easily set up a php-soap mailing list if enough people are interested. -Rasmus On Thu, 23 May 2002, Lukas Smith wrote: Yeah, I keep seeing PHP SOAP and XMLRPC being announce packages everywhere. But incompatible API's will not benefit PHP much and the efforts are simply redundant. I think it would make sense to create such a mailinglist. As I am still fairly busy with working on a merge of Metabase and PEAR DB called MDB (blatant plug :-) ) I can't spend as much time as I would wish on this topic. For now I will try to order the feedback I get and put together a little static page with the content. Basically I will take every package I find and list it there and put any comments people send regarding that package underneath. Best regards, Lukas Smith [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL
--- Stig S. Bakken [EMAIL PROTECTED] wrote: On Thu, 2002-05-23 at 23:28, brad lafountain wrote: One reason is xmlrpc doesn't have everything that goes along with soap. meaning WSDL UDDI WebServiceSecurity. WSDL can be implemented through the introspection stuff in ext/xmlrpc. It's just about describing/documenting the available interfaces, right? UDDI is just a catalog service AFAIK, so that would fit better on top of the SOAP stuff. and as far as i understand that xmlrpc doesn't work on windows. and with some benchmarks phpsoap so far was 3 times as fast as xmlrpc. Really? What XML parser are you using? libxml2... - Brad - Brad --- Stig S. Bakken [EMAIL PROTECTED] wrote: PHP already has SOAP support bundled in the xmlrpc extension, which is built upon the xmlrpc-epi library that we bundle. Why can't people improve that instead of re-inventing more wheels in all shapes and sizes? When we bundle a library, we should use it. - Stig On Thu, 2002-05-23 at 17:52, Andi Gutmans wrote: I think it's important to have a main stream soap implementation bundled with PHP and not a zillion different implementations floating around. If there is enough interest we could setup a Soap mailing list where interested people could cooperate possibly basing the official PHP Soap implementation on existing work, for example, Brad's work. As I personally don't have the knowledge nor the time I'm just making the suggestion :) It's up to people who are interested in this topic to move it forward. I think it would be extremely beneficial to PHP. Andi At 17:52 23/05/2002 +0200, phpsurf wrote: hi brad lafountain is working on a Soap extension which is not far from being stable. he made a good use of WSDL ... you should have look to http://phpsoaptoolkit.sourceforge.net/phpsoap/ -Original Message- From: Markus Wolff [mailto:[EMAIL PROTECTED]] Sent: jeudi 23 mai 2002 15:29 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL Am Thu, 23 May 2002 14:57:45 +0200 schrieb Lukas Smith [EMAIL PROTECTED]: What is the current status in terms of SOAP, XMLRPC and WSDL in php? How mature are the solutions? When will they be ready for primetime? Does anyone already use them in production (that can be used to show off how great the support is) or are there any other prominent examples? (I know the pear installer uses XMLRPC and Sebastian did something with Googles Webservices) We´ve been trying to make a PEAR::SOAP webservice talk to a VB.NET SOAP client. It does work very well when you stick to passing most primitive datatypes around: Strings, Integers, Floats, Booleans ... It stops being fun when you´re trying more complex structures like resultsets from SQL-Queries. Those could be represented and passed via SOAP as two-dimensional arrays, and in theory you could either use a loosely typed two-dimensional array or an array of struct to represent that data in the VB.NET client - but we did not yet manage to make the client recognize and deserialize the SOAP data from the PHP script. I have not the slightest idea where to start looking. I´ve read tons of articles on SOAP and WSDL, but all in all, the quality of documentation on this topic sucks. PEAR::SOAP itself is as good as undocumented (at least the server part) and the documentation for .NET webservices mostly talks about connecting an ASP.NET webservice to a C# or VB.NET client. When it comes to making SOAP calls to a client/server on another software platform, or even if you just want to use SOAP-RPC encoding instead of the default Document/Literal encoding that .NET does, the documentation is very uncomplete. Thing is, you _have_ to use SOAP-RPC encoding because PEAR::SOAP does not yet support Document/Literal (in fact, Microsoft seem to be the only ones who use this encoding method by default or even fully support it). I guess when it comes to maturity, all available implementations in any language still have a long way to go. Regards, Markus -- *21st Media*| Consulting, Konzeption, Produktion für die Bereiche: Markus Wolff| Internet, Intranet, eCommerce, Content Management, Hamburg,Germany | Softwareentwicklung, 3D-Animation, Videostreaming http://21st.de | Tel. [+49](0)40/6887949-0, Fax: [+49](0)40/6887949-1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: [PEAR-DEV] SOAP, XMLRPC and WSDL
--- Stig S. Bakken [EMAIL PROTECTED] wrote: On Fri, 2002-05-24 at 00:10, brad lafountain wrote: --- Stig S. Bakken [EMAIL PROTECTED] wrote: On Thu, 2002-05-23 at 23:28, brad lafountain wrote: One reason is xmlrpc doesn't have everything that goes along with soap. meaning WSDL UDDI WebServiceSecurity. WSDL can be implemented through the introspection stuff in ext/xmlrpc. It's just about describing/documenting the available interfaces, right? UDDI is just a catalog service AFAIK, so that would fit better on top of the SOAP stuff. and as far as i understand that xmlrpc doesn't work on windows. and with some benchmarks phpsoap so far was 3 times as fast as xmlrpc. Really? What XML parser are you using? libxml2... I'd really like stuff like this to build out of the box in PHP. Bundling expat was great because we didn't have to think about it anymore. My impression is that libxml2 is rarely installed by default (GNOME still uses 1.8 for instance). But I guess we'll have to deal with that sooner or later anyway, since libxml2 looks like the best xml library out there and more extensions want to use it. Could we bundle libxml2, or does the LGPL prevent us from doing that? I don't know about the LGPL but i would love to see it bundled. This would also help the domxml extension cause it requires a newer version than most people have. - Brad - Stig -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PHP-SOAP features
Ok, I know not too many people are familure with my extension so I am going to go over some stuff that it does do and stuff it doesn't. The plans i have for this extension are more than just a simple soap/rpc function calls. I want to build a frame work that people can deploy existing php objects as SoapObject. Making php a very fast soap application server having exactly the same functionality as SRM but allowing non php clients access the objects. In addition to making php-soap a soap application server i have plans have the frame work be able to handle a cluster of soap application servers. I currently use this exacty technology at work and it works great. I'll try to walk you thru how exactly it works and how powerfull it is. //MyClass.php ? class MyClass { function MyClass() { $this-db = connect_to_db(); } function getName() { return $this-name; } function setName($name) { $this-name = $name; } function save() { $query = update table blah; db_query($query); } function load() { $query = select * from table; $res = db_query($query); $this-name = $res['name']; } } ? So this is a normal db aware object written in php (it obviously doesn't work but you get the idea). //somescript.php ? include(MyClass.php); $person = new MyClass(); $person-load(); $person-setName(brad); $person-save(); ? Now again.. this script doesn't make much sence alone but make a gui use the object and it works good. Ok now we have our class and a php script to use it. Now we want to make MyClass a SoapObject. Using php-soap //MyClassServer.php ? include(MyClass.php); $server = new SoapServer(urn:someservice); $server-setClass(MyClass); $server-setPersistence(SOAP_PERSISTENCE_SESSION); $server-handle(); ? so one file and 5 lines of code turns MyClass into a SoapObject... all methods are exposed from MyClass and the setPersistence(SOAP_PERSISTENCE_SESSION) tells php-soap-server to use php's session handling to persist the object. Ok now we write our soap client. // MyClassClient.php ? $person = SoapObject(http://localhost/MyClassServer.php;); $person-load(); $person-setName(brad); $person-save(); ? now as you can see you use the object EXACTLY the same as a soap object as you use it a local object. Since the server was set up to persist the object each subsequent call to the same soap object sends the php session id back to the server the server will restore the session (the created object) and invoke the next method on the object. Now i wrote the client in php just for an example but any soap client can use that php object like a normal object. As long as it will pass the session id back to the server on each request. So basically you have a soap enabled php object that you can run remotely. This is a generic soultion to j2ee or SRM and a simpler, faster soultion to .net. Since php soap is using php's session handling you can totally control where the objects go. I also am currently working two different session handlers one mod_remote that allows you to grab session info from a remote php server. Kinda like msession works but a more generic way. You can configure the php session server to use mod_mm or mod_files or mod_user but still allowing a remote session server to access its session info. Another session handler will allow you to replicate session information. What this will allow you to do is cluster your phpsoap object servers replicating all session information to other servers so incase the server that the object got created on goes down or if the next request got load ballaced to a different machine the object can still be used. using thoes two together you can create a realy nice redudent clustered soap service. I will have more on that setup and how it works when i acually get done with it. Ok now here is how i use it at work (along with the clustering). We will be using java for our frontends to our databases. We are going to deploy these java applications to end users now we obvisouly don't want to open up our database up to the world let alone use JDBC!. So i created a bunch of data access objects written in php so im using native dabase calls. Soap Enabled them with php soap. Build a java gui using a soap client and there you go a database application. But the best part is if i want to create a MFC application or a VB application i don't need to rewrite my php database objects. So if we deploy our frontends to end users all we have to open up is a simple webserver on port 80. Now i currently am trying to implement alot of features in php-soap to allow script writers to override the functionality of the core engine. Here is an example. php-soap encodes hashtable with the apache namespace and that defines a hashtable to be encoded as follows. item keysome_key/key valuesome_value/value /item item keysome_key2/key valuesome_value2/value /item now i just found out that M$ decited to encode their hashtables
Re: [PHP-DEV] classes example
you can look at ext/domxml ext/COM ext/java ... this should do it zend_class_entry obj; INIT_CLASS_ENTRY(obj, class, internal_functions); zend_register_internal_class(obj); --- fabwash [EMAIL PROTECTED] wrote: sorry wasn't clear enough. I'm writing an extension and I want it to be used as a class. Fab. - Original Message - From: [EMAIL PROTECTED] To: fabwash [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 22, 2002 9:42 AM Subject: Re: [PHP-DEV] classes example Hello, this is the wrong list for user questions, you'd want the [EMAIL PROTECTED] mailinglist. Derick On Wed, 22 May 2002, fabwash wrote: Hello, what is the best example to use to write classes? The documentation is clear about functions, but not really about classes or I missed something. I need to find out how to define an object and its methods, and make them visible to the scripts. Fab. -- - Did I help you? http://www.jdimedia.nl/derick/link.php?url=giftlist Frequent ranting: http://www.jdimedia.nl/derick/ -- - PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net -- - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] multithreading
PHP isn't threadable... PHP is Thread Safe meaning you can run multiple php scripts on multiple threads for the samp process but you can't create threads inside php code. What i don't see is why you want to go from cron .. using ither php-cli or cgi.. to using threads. It seems you are just trying to run a script that you have multiple times? You can do system calls inside php shell_exec(php some_script /dev/null 21); which will allow you to call a script from a script. or you can get into unix forking.. http://www.php.net/manual/en/ref.pcntl.php - Brad --- Andrew Milne [EMAIL PROTECTED] wrote: I have a PHP script that is run hourly by cron; I would like to make this multithreading rather than configure cron to run the script more than once per hour. Is this possible using PHP? I've tried using ticks, but it doesn't appear to work - the tick function doesn't execute more than once at the same time... I'm using 4.1.2. Any help greatly appreciated! Andrew -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] karma
How would i go about getting karma for cvs commits? - Brad __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] zend_multibyte.c
What exactly does this do. Is zend going to support multbyte characters? - Brad __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Probably a simple answer...
Well i do believe that the zval string SHOULD be null termiated and have the length stored. But zend does provied this api function zend_binary_zval_strcmp(zval *, zval*); - Brad --- Robert Cummings [EMAIL PROTECTED] wrote: zval containers that are of string type don't seem to hold a null terminating character, but rather directly store the length of the string - I note this because of how the ZVAL_STRING macro works... My question then is what is the best way to compare two strings in a zval? I would imagine a macro or function would already exist, and I'm quite sure that the following simple invocation is asking for trouble: strcmp( Z_STRVAL_P( target1 ), Z_STRVAL_P( target2 ) ) == 0 Thanks for any information. Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Probably a simple answer...
--- Robert Cummings [EMAIL PROTECTED] wrote: Robert Cummings wrote: brad lafountain wrote: Well i do believe that the zval string SHOULD be null termiated and have the length stored. You would think so, but on further thought, if that were the case you wouldn't be able to store compressed data from gzip in a string because the null bytes everywhere would interfere. Also, as I said, ZVAL_STRING suggests that this is so... since when you use it to set a zval container to a string it saves the length as strlen( passedString ), rather than strlen( passedString ) + 1, also the memcpy then uses this length ^^ I just took another look at ZVAL_STRING and it uses estrndup and not memcpy... maybe I'm losing my mind :) well ZVAL_STRING should be fine for non binary strings.. but if you have binary string you can use ZVAL_STRINGL(s,l,d) - Brad Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php