[PHP-DEV] static module in HEAD doesn't compile
Hello, since a recent cvs update apache stops compiling here: === src/modules/php4 gcc -c -I../../os/unix -I../../include -DLINUX=22 -I/usr/include/db1 -DNO_DL_NEEDED `../../apaci` -DLINUX=22 -I/usr/include/db1 -I -I/dat/dev/php/php-4.3.0dev -I/dat/dev/php/php-4.3.0dev/sapi -I/dat/dev/php/php-4.3.0dev/sapi/apache -I/dat/dev/php/php-4.3.0dev/main -I/dat/dev/php/php-4.3.0dev/Zend -I/dat/dev/php/php-4.3.0dev/TSRM mod_php4.c In file included from /dat/dev/php/php-4.3.0dev/sapi/apache/php_apache_http.h:9, from mod_php4.c:22: /dat/dev/php/php-4.3.0dev/main/php_regex.h:12:31: regex/regex_extra.h: No such file or directory /dat/dev/php/php-4.3.0dev/main/php_regex.h:13:25: regex/regex.h: No such file or directory /dat/dev/php/php-4.3.0dev/main/php_regex.h:17:31: regex/regex_extra.h: No such file or directory In file included from /dat/dev/php/php-4.3.0dev/main/php_variables.h:25, from /dat/dev/php/php-4.3.0dev/sapi/apache/php_apache_http.h:29, from mod_php4.c:22: /dat/dev/php/php-4.3.0dev/main/php.h:305:29: main/php_output.h: No such file or directory In file included from mod_php4.c:22: /dat/dev/php/php-4.3.0dev/sapi/apache/php_apache_http.h:32:39: ext/standard/php_standard.h: No such file or directory make[4]: *** [mod_php4.o] Error 1 make[3]: *** [all] Error 1 make[2]: *** [subdirs] Error 1 make[2]: Leaving directory `/dat/dev/php/apache_1.3.23/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/dat/dev/php/apache_1.3.23' make: *** [build] Error 2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Addition to session-module (patch included)
On Thu, Apr 25, 2002 at 06:59:21PM +0200, Harald Radi wrote: On Thu, Apr 25, 2002 at 03:04:36PM +0200, Harald Radi wrote: sounds very useful, go ahead ;) would you mind extending it that session_set_userdata(array(thies = 1, harald = 2, knorp = 100)) would be possible ? nope - that would make the url_scanner slower. but you can always ancode as much data as you want into the one userdata var. can you explain me why this affects the url_scanner ? i'm a liar;-) no, if architected smart it would make no real difference. but - do we really want it? session-data belongs into the session. this new function just allows you to identify different browser-windows within the same session (if used right). i really see no point in extending it -but- wait we could of course add a real API to the trans-sid module that allows for url_rewriter_add('bal' , 'hallo'); url_rewriter_add('SID' , session_id()); etc etc.. so you could run you session in hidden vars on the page - and the security nightmare starts again (ppls will use that to store stuff in hidden vars that _belong_ in the sesseon). on the other hand i think it might be useful to run the session using a cookie and still be able to add things (like comments? tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Persistent overloaded class registration problem,
-Original Message- From: Andi Gutmans [mailto:[EMAIL PROTECTED]] Sent: 25 April 2002 23:14 To: Sam Liddicott; Sam Liddicott; 'Rasmus Lerdorf' Cc: 'PHP Developers Mailing List' Subject: Re: [PHP-DEV] Persistent overloaded class registration problem, At 11:11 24/04/2002 +0100, Sam Liddicott wrote: My overloaded classes are now registered in MINIT with: INIT_OVERLOADED_CLASS_ENTRY() zend_register_internal_class() ..zend_register_list_destructors_ex And all seems mostly fine; except the second time apache serves a request, one of the classes (!!) has been de-registered! As shown by get_declared_classes() in the script. I'm not sure what's happening there. Did you grep the directories under ext/ for examples of how to use zend_register_internal_class()? Yes, most of it I copied from java/java.c however it turned out to be another pointer fault (HashPosition * instead of HashPosition) which was clobbering zend memory, so it works fine now. Thanks v.much Sam -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Proposal! Destructor notification
Some know I'm working to improve swig-php to make module generation easy and satisfying. The final hurdle remains in handling and generating callbacks from the module to PHP. Or rather from the library the module wraps to PHP. This requires some kind of callback wrapper that can convert from a flat function pointer the library expects to a complete object-method (or just function) reference that call_user_function expects. This problem is solved but it requires some per-callback-function allocation to hold this extra data. The new problem is that swig can't tell when the scope of the callback closes (when no more callbacks will occur) and when it can free this structure, so for longer lived scripts which make new objects often to handle callbacks we allocate and do not free ever more and more structures. If a module could request notification when all/specific objects are destroyed it would be able to free these structures when the object dies and thus avoid long term memory leaks. Are PHP developers willing to provide a mechanism where more than one module can request notification when objects generally, or specific objects are destroyed? Sam -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: recode configure checks broken
On 26/04/02, Jani Taskinen [EMAIL PROTECTED] wrote: Yes, I'm blind. :) So you have recode 3.5...just update to 3.6 and it works. That configure error message just needs tuning. Yeah, but it worked fine for me before you changed configure! I don't want to update my recode installation :-) --Wez. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Another addition to session-module ... while were on topic
Your work around is how Im doing things at the moment (very annoying picking up and dropping sessions). PHP's limitation currently is that it can only handle one session at a time, and as thus, only one set of session variables. What Im hoping for is (at some point) there to be a multiple session handler allowing me to do something like: session_start($session_id, $handler); where $session_id is the session ID I want to use and $handler a string to be used in conjuntion with a new global variable (like $_*, possibly cakked $_SESSION). Given the following code (with $PHPSESSID containing the individual user session): session_start(global, main); session_start($PHPSESSID, user); if ($_SESSION[user][status]-loggedin === true) session_start(loggedin, authed); FYI: status is a session_registered object done on the $PHPSESSID session, and the user element before is from the session_start above it. Explained further below. This would give me access to 3 session simultaniously: $_SESSIONS[main][*] would be all the global session settings $_SESSIONS[user][*] would be all the individual session settings $_SESSIONS[authed][*] would be all the group loggedin session settings The benifits of this are (incase they arent obvious) * global could be access from all the user interactions (providing a working base for pages of any calibre to interact / leave tracking data). * user could be used as sessions are right now. This fundamentally would tie in the other sessions (as shown above for the loggedin session). * authed is only accessed by people who are logged in (as set in the user session) From a developer point of view (especially when creating multi-user and multi-tiered websites) this would be a god send and dramatically increase PHP's ability to handle sessions. The equivelent code in PHP is currently very messy and Im hoping if it was adopted into the session module itself it would be significantly faster than its PHP counterpart. Comments, Thoughts and Conceptions are more than welcome. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd Yeah it was disscuessed that the session modules could define and handle $_APP so that would be globals for all sessions. a work around would be to do something like this $oldsession_id = sessoin_id(); session_id(1); session_start(); $var = $_SESSION['var']; session_desetroy(); session_id($oldsesion_id); session_start(); echo $var . $_SESSION['local_var']; (i didn't run this code might not work logicall it does tho) it would be much cleaner to do session_start(); echo $_APP['var'] . $_SESSION['local_var']; and allowing the session modules to handle the $_APP (files/mm/msession) variable. but you bring up a good point.. globals per 'mode'. not just 'loggged_in' but.. you could have many 'modes' that you would want globaly scoped data assoicated with them. but you could do something like this too... $_APP['logged_in'] = array(some, global, data); So i guess what im saying... if $_APP global was added then it would also solve your other 'scope'. - Brad --- Dan Hardiker [EMAIL PROTECTED] wrote: While were talking about session advancement... has anyone ever thought of adding shared sesssions? Consider the following scenario: I have 3 sets of variables: 1. Global Scoped - Variables accessed and altered by anyone entering my site. EG: a currently online array which stores the a list of active users 2. Logged in Scoped - Variables accessed by *anyone* logged in. EG: if you cache the database stuff in a session then if one user updates the cache the often you want all the logged in users to see that change without having to requery the db 3. Individual Scope - Variables specific to this user (eg: whats my name, my last ip, when did I last do anything meaningful). Being able to split those scopes up into separate variables would be great and being able to do something along the lines of: $session-global = array of global variables $session-loggedin = 2nd scope $session-personal = personal variables and then have the session module manage those 3 sessions individually. In short - it would be cool if a script could (easily) have access to a multitude of sessions and keep them segregated. -- 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! Games - play chess, backgammon, pool and more http://games.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
RE: [PHP-DEV] lt;?= and lt;%= both work, why not lt;?php=
Could there not be a php.ini switch put in? - like there is for asp-style tags? This could even be defaulted to 0 so that people who write sloppy code (and/org might confuse ?php with ?$php) wont be affected. After reading the thread it seems that this option would be a win / win situation for both sides, as the ones that want it - get it, and the ones that dont - leave it off. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd Well, having read that thread (thank you), I tallied up the votes (where I could tell what the vote was) and it was 13 for, 3 against, 2 undecided/don't care. Of the unsure, one person voted against, then undecided, then for, the other voted don't care, then against. Of the against, one voted against purely on stylistic reasons. Why wasnt' this change implemented? It's not a feature anyone would be forced to use, it improves syntax consistency, and the feeling from that discussion was overwhelmingly for the change. - Theo -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:40 PM To: Brinkman, Theodore Cc: 'PHP Developers Mailing List' Subject: Re: [PHP-DEV] ?= and %= both work, why not ?php= On Thu, 2002-04-25 at 15:27, Brinkman, Theodore wrote: Ok. I have the feeling that I'm going to be making myself a bit unpopular here with my first post, but I mean no offense or disrespect. I'm just trying to understand something. PHP allows ?= if short tags are enabled, or %= if asp-style tags are enabled, but doesn't allow ?php=. Why? I went so far as to look into the source and as near as I can tell without getting my hands on a C compiler, changing it so that the '{opentag}=' format was equivalent to '{opentag} echo' would take a 2 line patch to one file. I submitted this change as a feature request in the bug system (#16763), and got the incredibly informative and helpful response of this was discussed to death on php-dev. it's not going to happen. 17 minutes later. I've spent the next 2 days trying to hunt down any mention of it, and having no luck because searching for ?php=, or ?php= turns up no results. So in an effort to understand why and how the decision was made to leave a feature partially implemented, I'm left with no resort except to post here and probably bring down a can of whoop-ass on myself. My appologies to anyone who is sick of this being discussed. That said. Why? - Theo One long discussion starts here: http://marc.theaimsgroup.com/?l=php-devm=100405792100833w=2 It looks like consistency was voted down because someone might misread ?php=$var to mean ?$php=$var. Which doesn't seem much worse than the age-old '=' vs. '==' screwup. Anyway, there's the thread and you should read it and decide whether this needs to get going again. :) -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- 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] FYI: Function rename
No problem. Are we going to decide before PHP5? Which came first: the chicken, or the egg? In otherwords, doubtful. Read the archives and see how often this arguement comes up. --- Dan KalowskyThe record shows, I took the blows. http://www.deadmime.org/~dankAnd did it my way. [EMAIL PROTECTED] - My Way, Frank Sinatra [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] RE: phpize writes config.m4
Sorry; wrong list, I get boths lists in the same mailbox and I just replied to a message already there. -Original Message- From: Sam Liddicott Sent: 26 April 2002 12:01 To: [EMAIL PROTECTED] Subject: phpize writes config.m4 I'm making some more changes to php-swig, where it writes out the sample config.m4 file. It's pretty complete now but it strikes me that this code should probably be part of phpize. Most modules have the same requirements for config.m4 (below). Perhaps we could have a phpize.in file where we provide the module name, required header and library files and an optional symbol to test compile each library. Does this make sense? I've already done it for swig but I think it belongs in phpize Sam 1) PHP_ARG_WITH 2) search paths for INCDIR looking for certain include files 3) search paths for LIBDIR looking for certain LIBS 4) PHP_REQUIRE_CXX, AC_CHECK_LIB(stdc++, cin) if it is a C++ module optional 5) AC_CHECK_LIB... to check the library links and a test symbol is present 6) PHP_SUBST(***_SHARED_LIBADD) AC_DEFINE(HAVE_***, 1, [ ]) AC_DEFINE_UNQUOTED(PHP_***_DIR, $***_DIR, [ ] ) for each library PHP_ADD_LIBRARY_WITH_PATH(***, $***_LIBDIR, ***_SHARED_LIBADD) for include path PHP_ADD_INCLUDE($***_INCDIR) 7) PHP_EXTENSION(***, $ext_shared) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
At 19:11 25/04/2002 -0400, Brinkman, Theodore wrote: Well, having read that thread (thank you), I tallied up the votes (where I could tell what the vote was) and it was 13 for, 3 against, 2 undecided/don't care. Of the unsure, one person voted against, then undecided, then for, the other voted don't care, then against. Of the against, one voted against purely on stylistic reasons. Why wasnt' this change implemented? It's not a feature anyone would be forced to use, it improves syntax consistency, and the feeling from that discussion was overwhelmingly for the change. Let's not get into it again. I'm sure you'll survive writing an extra 5 characters. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] lt;?= and lt;%= both work, why not lt;?php=
At 10:37 26/04/2002 +0100, Dan Hardiker wrote: Could there not be a php.ini switch put in? - like there is for asp-style tags? This could even be defaulted to 0 so that people who write sloppy code (and/org might confuse ?php with ?$php) wont be affected. After reading the thread it seems that this option would be a win / win situation for both sides, as the ones that want it - get it, and the ones that dont - leave it off. I'm sure the thread also mentions the fact that we are trying not to put language syntax things in ini switches anymore so that apps can run on all PHP installations. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Re: Addition to session-module (patch included)
can you explain me why this affects the url_scanner ? i'm a liar;-) i know ;) no, if architected smart it would make no real difference. but - do we really want it? session-data belongs into the session. this new function just allows you to identify different browser-windows within the same session (if used right). i really see no point in extending it -but- wait yes, you are right, session stuff belongs into the session but i can show you lots of examples where i can't put things into the session but have to send it via get/post. e.g. i have a multistep enrolment procedure where i generate a access-key for each form which is stored in the session _and_ in the webpage and only if they are both the same the form can be submitted. the submit-action script immediately generates a new access-key which prevents the form to be submitted twice and which allowes the next enrolment step to be performed. i also have samples where i need more than one var to be appended. we could of course add a real API to the trans-sid module that allows for url_rewriter_add('bal' , 'hallo'); url_rewriter_add('SID' , session_id()); that would be ok too. etc etc.. so you could run you session in hidden vars on the page - and the security nightmare starts again (ppls will use that to store stuff in hidden vars that _belong_ in the sesseon). ... and if people set empty root passwords their boxes will be vulnerable too ... on the other hand i think it might be useful to run the session using a cookie and still be able to add things (like like ? harald -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
Sure, and its only an extra 4 character, really. But that's not the issue at hand. The issue at hand is that the inconsistency of supporting ?= and %= but not ?php= encourages quite a few people to use the 'optional' short form tags, meaning that their code isn't portable. For each person who says ?php= $variable ? is hard to read at least one other person says they find ?php echo $variable ? harder to read. I personally find the first easier to read when it is embedded in the middle of a long line of HTML (like an input tag for example). If you don't like to use the shorthand, don't. But, if there is a call from the masses (and 13 to 3 (81.25% for) seems pretty overwhelming to me) to support consistent availability features in the syntax (even if you don't like, or wouldn't use the feature) what technical reason is there to support inconsistent availability of the feature? What possible harm comes from improving the internal consistency of the language? Why is a two-line patch that would completely remove an inconsistency so bitterly fought against? If $i++ were only supported with the short tag forms, would people actually fight adopting it in the standard tag form because 'you'll survive writing an extra 3 characters'? - Theo -Original Message- From: Andi Gutmans [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 8:38 AM To: Brinkman, Theodore; 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= At 19:11 25/04/2002 -0400, Brinkman, Theodore wrote: Well, having read that thread (thank you), I tallied up the votes (where I could tell what the vote was) and it was 13 for, 3 against, 2 undecided/don't care. Of the unsure, one person voted against, then undecided, then for, the other voted don't care, then against. Of the against, one voted against purely on stylistic reasons. Why wasnt' this change implemented? It's not a feature anyone would be forced to use, it improves syntax consistency, and the feeling from that discussion was overwhelmingly for the change. Let's not get into it again. I'm sure you'll survive writing an extra 5 characters. Andi -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Upload problem with MIME type
Hello! I've got a problem uploading files (PDF, TXT, others...). I'm building an intranet for my compagny (I work on a local network). I've already write some upload functions in PHP for others sites with success, but this time I have a strange thing : I receive the file, I can copy it, I have the size, the name, but not the MIME type! The variable _type is empty... And I can see the type directly at the beginning of the copied file! The problem seems to come from the form : the size of the received file is different than the original file... Does anybody know this problem? Can you help me? Thank's a lot! Jibs. ___ Do You Yahoo!? -- Une adresse yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
-Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: 26 April 2002 14:55 To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Sure, and its only an extra 4 character, really. But that's not the issue at hand. The issue at hand is that the inconsistency of supporting ?= and %= but not ?php= encourages quite a few people to use the 'optional' short form tags, meaning that their code isn't portable. I guy here who till recently poo-poo'd asp tags is now using them because %=$VAR;% is emminently more readable than the alternative. For each person who says ?php= $variable ? is hard to read at least one other person says they find ?php echo $variable ? harder to read. I personally find the first easier to read when it is embedded in the middle of a long line of HTML (like an input tag for example). Yep. What possible harm comes from improving the internal consistency of the language? Why is a two-line patch that would completely remove an inconsistency so bitterly fought against? To emphasise; people here are adopting bad-old short tags in order to keep readability of code. It makes it easy to see the code is passive, echoing only. Sam -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] feature request for __LINE__, __FILE__ and trigger_error
I wrote this extension a while back, but I never released it since I didn't follow coding style and it was my first forage into extension coding for PHP. It should be what your looking for though for the most part... the function of usefulness is: get_function_call_stack() which will return an array with the call stack for the current function which includes the calling file, funcion and line number. Use a print_r() on the results to get a better idea. Please don't flame me for not releasing or following coding style. Cheers, Rob. - [EMAIL PROTECTED] wrote: Addressed to: [EMAIL PROTECTED] [EMAIL PROTECTED] ** Reply to note from [EMAIL PROTECTED] Wed, 24 Apr 2002 21:06:41 +0200 (CEST) Hello Michael, I'm working (80% done) on an extension for this. It should be finished in a few days. It doesn't feature the __C*__ things yet, but I can add a function for that too. I'll keep you posted, Loud cheer!!! Thanks, I've wished for this for a long time! -- .-. | 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 | `--' ftrace.tar.gz Description: GNU Zip compressed data -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Bug #16838 Updated: PHP short_open_tags and ?xml .. ?
On Fri, Apr 26, 2002 at 03:10:08PM -, [EMAIL PROTECTED] wrote : ID: 16838 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Suspended Bug Type: Feature/Change Request Operating System: all PHP Version: 4.2.0 New Comment: people have been warned for *ages* now that short tags are *not* xml-compliant, so everybody still using them should be blamed for doing so and not benn supported in continuing using bad style ... instead of adding extra magic i'd suggest to emmit warnings for uses of '?' even if short_tags are enabled ... By all means, this is completely insane :-) Have you seriously thought about what this sentence means? This would break 99% of the scripts, but I bet you had that in mind ? :) - Markus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
Guys, this argument has been killed many times. Please stop. The reasons it won't change: 1. ?php is the SGML-compliant PI tag-style that is supposed to play nice with other technologies. ?php= would completely break that as the SGML spec (and the XML spec) says to use ?phpwhitespace so it would have to be ?php =$foo? which is even uglier and would cause a bit of trouble at the parser level. 2. The only reason for using ?php =$foo? is to save a few keystrokes. We have short_tags and asp_tags for example that reason. These are the non-compliant tag style that people have been taught are ok for local code, but shouldn't be used for distributed code. Therefore if you really do want to save keystrokes, which I am all for, use ?=$foo? or %=$foo% and you are happy. If you ever need to distribute your code, write a 30-second sed script that changes these to ?php echo $foo? for you. That way local hacks/shortcuts stay local, but the distributed code is proper and readable and people won't be wondering what the heck this = thing is. 3. The whole concept of =$var sucks. Magic tokens with no visible meaning is against the spirit of PHP. Yes, it has snuck in due to popular demand, but I see no reason to help the disease spread any further and give people precedence for then wanting stuff like ~$foo:$bar which might echo $foo if it is non-empty, $bar otherwise. A useful operation to be sure, but we don't want a language that looks like ?php~SID:new user? blah blah ?php=$user_name? It goes back to the old concept of keeping things readable. Figuring out what = and ~ do in this particular context is difficult. You can't just look them up in the index of a PHP book because first of all they are single-character common tokens, but worse, they are modal tokens. -Rasmus On Fri, 26 Apr 2002, Sam Liddicott wrote: -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: 26 April 2002 14:55 To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Sure, and its only an extra 4 character, really. But that's not the issue at hand. The issue at hand is that the inconsistency of supporting ?= and %= but not ?php= encourages quite a few people to use the 'optional' short form tags, meaning that their code isn't portable. I guy here who till recently poo-poo'd asp tags is now using them because %=$VAR;% is emminently more readable than the alternative. For each person who says ?php= $variable ? is hard to read at least one other person says they find ?php echo $variable ? harder to read. I personally find the first easier to read when it is embedded in the middle of a long line of HTML (like an input tag for example). Yep. What possible harm comes from improving the internal consistency of the language? Why is a two-line patch that would completely remove an inconsistency so bitterly fought against? To emphasise; people here are adopting bad-old short tags in order to keep readability of code. It makes it easy to see the code is passive, echoing only. Sam -- 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] sockets
I've been using it since the first API revision and it's been working fine for me. (Up to and including the latest API revision.) As far as I'm concerned, it's getting pretty close to losing the experimental tag. (Perhaps by PHP 4.3.x or so, barring any glarring problems that I've not encountered.) J Markus Fischer wrote: Hi, Simple when enough people have tested it and it reaches the consensus that it's mature enough for being called stable (api doesn't change anymore, more testers, you name it). - Markus On Thu, Apr 25, 2002 at 07:46:30PM +0200, Michael Virnstein wrote : Hi, as i could read in the manual, the socket functions are completely experimental. When do you think the API gets final and won't change anymore. Any comments on this are welcome. Michael -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] sockets
The only feature which would be useful towards this module is threading. If PHP were able to thread it could handle multiple incoming sockets and neglegate the need for IPC between child processes (where PCNTL has been used) as it could all be handled by a common parent with shared (not copied) variables. Just my 2p's worth -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd I've been using it since the first API revision and it's been working fine for me. (Up to and including the latest API revision.) As far as I'm concerned, it's getting pretty close to losing the experimental tag. (Perhaps by PHP 4.3.x or so, barring any glarring problems that I've not encountered.) J Markus Fischer wrote: Hi, Simple when enough people have tested it and it reaches the consensus that it's mature enough for being called stable (api doesn't change anymore, more testers, you name it). - Markus On Thu, Apr 25, 2002 at 07:46:30PM +0200, Michael Virnstein wrote : Hi, as i could read in the manual, the socket functions are completely experimental. When do you think the API gets final and won't change anymore. Any comments on this are welcome. Michael -- 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: Bug #16838 Updated: PHP short_open_tags and ?xml.. ?
Markus Fischer wrote: By all means, this is completely insane :-) Have you seriously thought about what this sentence means? This would break 99% of the scripts, but I bet you had that in mind ? :) no, it isn't if it is an E_NOTICE warning it would break exactly as many scripts as undefined variables or array-indices and unquoted strings break and even if it was an E_WARNING it should not harm as in production environment you turn of display_errors and in developement environments i *want* this displayed ;) -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de/ +49-711-99091-77 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] snaps.php.net
I'm not sure who runs snaps.php.net, so I'm posting to the list: . . . Even though no sane person can dispute the fact that the frantic pace of PHP3 development warrants fresh snapshot of the venerable scripting environment every three hours, many people feel that the development and especially QA efforts on the 4.2 branch would greatly benefit from snapshot availability. As 4.2 is our stable branch, its users are probably not as cutting edge as the PHP3 users, so I'm proposing a compromise: three daily builds of 4.2 and five daily builds of PHP3? Marko ;-) -- Marko Karppinen - http://homepage.mac.com/marko/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can spend a few weeks learning it just for this), so I can't go into that, but extending this to XML is a falacy, because PHP comparison syntax breaks the XML spec. I'm pretty sure that % echo $var % (valid PHP) would cause most XML parsers to choke. As for #2 there's no flaw with the logic until you assume that '?php echo ' is somehow inherently more readable than '?php= '. That's a matter of opinion either way. By the time you get to #3, however, you've resorted to dreaming up new unrequested language extensions, and references to 'magic' to support your argument. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? If you really do want some equivalent to your proposed '?php~ $foo:$bar ?', then I might suggest '?php= isset($foo)?$foo:$bar ?', which I believe would already work as '?php echo isset($foo)?$foo:$bar ?', '?= isset($foo)?$foo:$bar ?'. - Theo -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:42 AM To: Sam Liddicott Cc: Brinkman, Theodore; 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Guys, this argument has been killed many times. Please stop. The reasons it won't change: 1. ?php is the SGML-compliant PI tag-style that is supposed to play nice with other technologies. ?php= would completely break that as the SGML spec (and the XML spec) says to use ?phpwhitespace so it would have to be ?php =$foo? which is even uglier and would cause a bit of trouble at the parser level. 2. The only reason for using ?php =$foo? is to save a few keystrokes. We have short_tags and asp_tags for example that reason. These are the non-compliant tag style that people have been taught are ok for local code, but shouldn't be used for distributed code. Therefore if you really do want to save keystrokes, which I am all for, use ?=$foo? or %=$foo% and you are happy. If you ever need to distribute your code, write a 30-second sed script that changes these to ?php echo $foo? for you. That way local hacks/shortcuts stay local, but the distributed code is proper and readable and people won't be wondering what the heck this = thing is. 3. The whole concept of =$var sucks. Magic tokens with no visible meaning is against the spirit of PHP. Yes, it has snuck in due to popular demand, but I see no reason to help the disease spread any further and give people precedence for then wanting stuff like ~$foo:$bar which might echo $foo if it is non-empty, $bar otherwise. A useful operation to be sure, but we don't want a language that looks like ?php~SID:new user? blah blah ?php=$user_name? It goes back to the old concept of keeping things readable. Figuring out what = and ~ do in this particular context is difficult. You can't just look them up in the index of a PHP book because first of all they are single-character common tokens, but worse, they are modal tokens. -Rasmus On Fri, 26 Apr 2002, Sam Liddicott wrote: -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: 26 April 2002 14:55 To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Sure, and its only an extra 4 character, really. But that's not the issue at hand. The issue at hand is that the inconsistency of supporting ?= and %= but not ?php= encourages quite a few people to use the 'optional' short form tags, meaning that their code isn't portable. I guy here who till recently poo-poo'd asp tags is now using them because %=$VAR;% is emminently more readable than the alternative. For each person who says ?php= $variable ? is hard to read at least one other person says they find ?php echo $variable ? harder to read. I personally find the first easier to read when it is embedded in the middle of a long line of HTML (like an input tag for example). Yep. What possible harm comes from improving the internal consistency of the language? Why is a two-line patch that would completely remove an inconsistency so bitterly fought against? To emphasise; people here are adopting bad-old short tags in order to keep readability of code. It makes it easy to see the code is passive, echoing only. Sam -- PHP Development Mailing List
RE: [PHP-DEV] ?= and %= both work, why not ?php=
If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? I think the argument was that ?php was ment to be the standard (and therefore clean way) while ? And % is for the short hand freaks :-) Remember that one of the huge advantages of php is code readability. If you want short hand you can either use stuff like % or move over to perl. As an aside: what do you do most? Write or read/maintain code? Then think again about short hand stuff. So Rasmus's argument seems quite sound in my eyes. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:37 PM To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can spend a few weeks learning it just for this), so I can't go into that, but extending this to XML is a falacy, because PHP comparison syntax breaks the XML spec. I'm pretty sure that % echo $var % (valid PHP) would cause most XML parsers to choke. As for #2 there's no flaw with the logic until you assume that '?php echo ' is somehow inherently more readable than '?php= '. That's a matter of opinion either way. By the time you get to #3, however, you've resorted to dreaming up new unrequested language extensions, and references to 'magic' to support your argument. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. If you really do want some equivalent to your proposed '?php~ $foo:$bar ?', then I might suggest '?php= isset($foo)?$foo:$bar ?', which I believe would already work as '?php echo isset($foo)?$foo:$bar ?', '?= isset($foo)?$foo:$bar ?'. - Theo -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:42 AM To: Sam Liddicott Cc: Brinkman, Theodore; 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Guys, this argument has been killed many times. Please stop. The reasons it won't change: 1. ?php is the SGML-compliant PI tag-style that is supposed to play nice with other technologies. ?php= would completely break that as the SGML spec (and the XML spec) says to use ?phpwhitespace so it would have to be ?php =$foo? which is even uglier and would cause a bit of trouble at the parser level. 2. The only reason for using ?php =$foo? is to save a few keystrokes. We have short_tags and asp_tags for example that reason. These are the non-compliant tag style that people have been taught are ok for local code, but shouldn't be used for distributed code. Therefore if you really do want to save keystrokes, which I am all for, use ?=$foo? or %=$foo% and you are happy. If you ever need to distribute your code, write a 30-second sed script that changes these to ?php echo $foo? for you. That way local hacks/shortcuts stay local, but the distributed code is proper and readable and people won't be wondering what the heck this = thing is. 3. The whole concept of =$var sucks. Magic tokens with no visible meaning is against the spirit of PHP. Yes, it has snuck in due to popular demand, but I see no reason to help the disease spread any further and give people precedence for then wanting stuff like ~$foo:$bar which might echo $foo if it is non-empty, $bar otherwise. A useful operation to be sure, but we don't want a language that looks like ?php~SID:new user? blah blah ?php=$user_name? It goes back to the old concept of keeping things readable. Figuring out what = and ~ do in this particular context is difficult. You can't just look them up in the index of a PHP book because first of all they are single-character common tokens, but worse, they are modal tokens. -Rasmus On Fri, 26 Apr 2002, Sam Liddicott wrote: -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: 26 April 2002 14:55 To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Sure, and its only an extra 4 character, really. But that's not
Re: [PHP-DEV] sockets
There's only one thing it's missing -- the equivalent of socket_get_status(), which is not part of the extension, despite the name. If I set my socket to nonblocking, the only way to tell if it has died is to try to write to it, which isn't always a desirable thing to do :) Unless there's another way that I just don't understand. J Smith wrote: I've been using it since the first API revision and it's been working fine for me. (Up to and including the latest API revision.) As far as I'm concerned, it's getting pretty close to losing the experimental tag. (Perhaps by PHP 4.3.x or so, barring any glarring problems that I've not encountered.) J Markus Fischer wrote: Hi, Simple when enough people have tested it and it reaches the consensus that it's mature enough for being called stable (api doesn't change anymore, more testers, you name it). - Markus On Thu, Apr 25, 2002 at 07:46:30PM +0200, Michael Virnstein wrote : Hi, as i could read in the manual, the socket functions are completely experimental. When do you think the API gets final and won't change anymore. Any comments on this are welcome. Michael -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ?= and %= both work, why not ?php=
As I said. The assumption that '?php echo $var ?' is more readable than '?php= $var ?' is not universally supported. I'm not alone in finding the latter easier to read. To answer your aside, I spend alot of time writing code followed by reading and maintaining that code. I prefer the '?php' opening tag to '?' or '%', but I find '{opentag}= ' more readable than '{opentag} echo ', which means I have to either make my code harder for me to read, or I have to use tag styles which are not portable, and/or cause other issues. - Theo -Original Message- From: Lukas Smith [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? I think the argument was that ?php was ment to be the standard (and therefore clean way) while ? And % is for the short hand freaks :-) Remember that one of the huge advantages of php is code readability. If you want short hand you can either use stuff like % or move over to perl. As an aside: what do you do most? Write or read/maintain code? Then think again about short hand stuff. So Rasmus's argument seems quite sound in my eyes. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:37 PM To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can spend a few weeks learning it just for this), so I can't go into that, but extending this to XML is a falacy, because PHP comparison syntax breaks the XML spec. I'm pretty sure that % echo $var % (valid PHP) would cause most XML parsers to choke. As for #2 there's no flaw with the logic until you assume that '?php echo ' is somehow inherently more readable than '?php= '. That's a matter of opinion either way. By the time you get to #3, however, you've resorted to dreaming up new unrequested language extensions, and references to 'magic' to support your argument. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. If you really do want some equivalent to your proposed '?php~ $foo:$bar ?', then I might suggest '?php= isset($foo)?$foo:$bar ?', which I believe would already work as '?php echo isset($foo)?$foo:$bar ?', '?= isset($foo)?$foo:$bar ?'. - Theo -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:42 AM To: Sam Liddicott Cc: Brinkman, Theodore; 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Guys, this argument has been killed many times. Please stop. The reasons it won't change: 1. ?php is the SGML-compliant PI tag-style that is supposed to play nice with other technologies. ?php= would completely break that as the SGML spec (and the XML spec) says to use ?phpwhitespace so it would have to be ?php =$foo? which is even uglier and would cause a bit of trouble at the parser level. 2. The only reason for using ?php =$foo? is to save a few keystrokes. We have short_tags and asp_tags for example that reason. These are the non-compliant tag style that people have been taught are ok for local code, but shouldn't be used for distributed code. Therefore if you really do want to save keystrokes, which I am all for, use ?=$foo? or %=$foo% and you are happy. If you ever need to distribute your code, write a 30-second sed script that changes these to ?php echo $foo? for you. That way local hacks/shortcuts stay local, but the distributed code is proper and readable and people won't be wondering what the heck this = thing is. 3. The whole concept of =$var sucks. Magic tokens with no visible meaning is against the spirit of PHP. Yes, it has snuck in due to popular demand, but I see no reason to help the disease spread any further and give people precedence for then wanting stuff like ~$foo:$bar which might echo $foo if it is non-empty, $bar otherwise. A useful operation to be sure, but we
Re: [PHP-DEV] Re: Bug #16838 Updated: PHP short_open_tags and ?xml .. ?
Comparing notice for undefined variables and short tags makes no sense in my opinion. There's absolutely nothing wrong with using short tags if you have short tags turned on, and you're using for code that you don't intend to be distributed for reuse. That is not the case with using undefined variables - which may hide bugs behind them... Zeev At 19:12 26/04/2002, Hartmut Holzgraefe wrote: Markus Fischer wrote: By all means, this is completely insane :-) Have you seriously thought about what this sentence means? This would break 99% of the scripts, but I bet you had that in mind ? :) no, it isn't if it is an E_NOTICE warning it would break exactly as many scripts as undefined variables or array-indices and unquoted strings break and even if it was an E_WARNING it should not harm as in production environment you turn of display_errors and in developement environments i *want* this displayed ;) -- Hartmut Holzgraefe [EMAIL PROTECTED] http://www.six.de/ +49-711-99091-77 -- 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] ?= and %= both work, why not ?php=
Well some people find =~ quite readable. But this is all funky magic stuff that is simply not easy to read. For the newbie '{opentag} echo ' is much more clear than '{opentag}= '. Actually this syntax is simply more predicatable for anyone that does not use {opentag}= ' all day. So not only newbies, but also casual php programmers or people that spend a lot of their time also coding in other languages will be more happy with the '{opentag} echo ' variant. Do you dispute this fact? And this is what php is about. Otherwise we will venture into perl land and php will loose one of its keys to success. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:50 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= As I said. The assumption that '?php echo $var ?' is more readable than '?php= $var ?' is not universally supported. I'm not alone in finding the latter easier to read. To answer your aside, I spend alot of time writing code followed by reading and maintaining that code. I prefer the '?php' opening tag to '?' or '%', but I find '{opentag}= ' more readable than '{opentag} echo ', which means I have to either make my code harder for me to read, or I have to use tag styles which are not portable, and/or cause other issues. - Theo -Original Message- From: Lukas Smith [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? I think the argument was that ?php was ment to be the standard (and therefore clean way) while ? And % is for the short hand freaks :-) Remember that one of the huge advantages of php is code readability. If you want short hand you can either use stuff like % or move over to perl. As an aside: what do you do most? Write or read/maintain code? Then think again about short hand stuff. So Rasmus's argument seems quite sound in my eyes. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:37 PM To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can spend a few weeks learning it just for this), so I can't go into that, but extending this to XML is a falacy, because PHP comparison syntax breaks the XML spec. I'm pretty sure that % echo $var % (valid PHP) would cause most XML parsers to choke. As for #2 there's no flaw with the logic until you assume that '?php echo ' is somehow inherently more readable than '?php= '. That's a matter of opinion either way. By the time you get to #3, however, you've resorted to dreaming up new unrequested language extensions, and references to 'magic' to support your argument. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. If you really do want some equivalent to your proposed '?php~ $foo:$bar ?', then I might suggest '?php= isset($foo)?$foo:$bar ?', which I believe would already work as '?php echo isset($foo)?$foo:$bar ?', '?= isset($foo)?$foo:$bar ?'. - Theo -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:42 AM To: Sam Liddicott Cc: Brinkman, Theodore; 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Guys, this argument has been killed many times. Please stop. The reasons it won't change: 1. ?php is the SGML-compliant PI tag-style that is supposed to play nice with other technologies. ?php= would completely break that as the SGML spec (and the XML spec) says to use
RE: [PHP-DEV] ?= and %= both work, why not ?php=
I only dispute your contention so far as you imply that it is ALWAYS true. I never had any problem understanding what '%= ' meant when I learned ASP. When I was first learning PHP (after learning ASP), I saw many examples which used either short tag format with shortcut ('{opentag}= '), and never misunderstood that either. However, I did run into problems because I had been told that '?php' was preferred over '?' or '%' because either of those might not work on 'other' servers. So I tried '?php= ' having no reason to even *think* it wouldn't be supported because the format works on either of the 'non-preferred' tag styles. People who find '{opentag}= ' more difficult to read are not forced to use it, or the short tags. People who find '{opentag} echo ' more difficult to read are forced to either use it, or use non-portable tags. Not knowing where you're coming from with =~ I couldn't tell you what it means. As an aside: Why do the people against the inclusion of '?php= ' insist on writing it out their examples as '?php=$var?' when they don't insist on trying to write their preferred method '?phpecho$var?'? In the case of the previous I can at least tell what it is supposed to mean by skimming it. In the case of the latter, it's very hard to read and I suspect the parser would throw a fit. - Theo -Original Message- From: Lukas Smith [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 12:54 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Well some people find =~ quite readable. But this is all funky magic stuff that is simply not easy to read. For the newbie '{opentag} echo ' is much more clear than '{opentag}= '. Actually this syntax is simply more predicatable for anyone that does not use {opentag}= ' all day. So not only newbies, but also casual php programmers or people that spend a lot of their time also coding in other languages will be more happy with the '{opentag} echo ' variant. Do you dispute this fact? And this is what php is about. Otherwise we will venture into perl land and php will loose one of its keys to success. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:50 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= As I said. The assumption that '?php echo $var ?' is more readable than '?php= $var ?' is not universally supported. I'm not alone in finding the latter easier to read. To answer your aside, I spend alot of time writing code followed by reading and maintaining that code. I prefer the '?php' opening tag to '?' or '%', but I find '{opentag}= ' more readable than '{opentag} echo ', which means I have to either make my code harder for me to read, or I have to use tag styles which are not portable, and/or cause other issues. - Theo -Original Message- From: Lukas Smith [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? I think the argument was that ?php was ment to be the standard (and therefore clean way) while ? And % is for the short hand freaks :-) Remember that one of the huge advantages of php is code readability. If you want short hand you can either use stuff like % or move over to perl. As an aside: what do you do most? Write or read/maintain code? Then think again about short hand stuff. So Rasmus's argument seems quite sound in my eyes. Best regards, Lukas Smith [EMAIL PROTECTED] ___ DybNet Internet Solutions GbR Reuchlinstr. 10-11 Gebäude 4 1.OG Raum 6 (4.1.6) 10553 Berlin Germany Tel. : +49 30 83 22 50 00 Fax : +49 30 83 22 50 07 www.dybnet.de [EMAIL PROTECTED] ___ -Original Message- From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 6:37 PM To: 'PHP Developers Mailing List' Subject: RE: [PHP-DEV] ?= and %= both work, why not ?php= Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Ok. #1 is the first logical, technical reason I've seen against the shorthand being fully implemented (though it begs the question why it was partially implemented in the first place). I'm not to knowledgeable about SGML specifics (and I can't afford to spend $200+ for a copy of the spec so I can spend a few weeks learning it just for this), so I can't go into that, but extending this to XML is a falacy, because PHP comparison syntax breaks the XML spec. I'm pretty sure that % echo $var % (valid PHP) would cause most XML parsers to choke. Just a guess, but when you say the alphabet, do you often say it as such: a,b,d,e,c,f,g,i... ? Your argument shows you either don't know php, or don't know how to think. The whole point of the ?php tag is to allow people to embed commands in XML documents. When short tags are disabled, commands such as % echo 'HELLO'; % don't work. If you allow ?php=? syntax, it is not valid XML, which negates the point of having ?php in the first place. As for #2 there's no flaw with the logic until you assume that '?php echo ' is somehow inherently more readable than '?php= '. That's a matter of opinion either way. Perhaps if it were a computer making these assumptions, yes. But anyone with half a brain can see that ?php echo 'Hello'; ? is much easer to understand for someone with no programming experience, than: ?php='Hello'?. By the time you get to #3, however, you've resorted to dreaming up new unrequested language extensions, and references to 'magic' to support your argument. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. If, as you imply, '?=' and '%=' are such a horrible disease that their very existance is proof that '?php=' would be a syntactic travesty. Why were they allowed in the first place? If they were implemented due to popular demand, why is popular demand not sufficient for '?php='? 42 If you really do want some equivalent to your proposed '?php~ $foo:$bar ?', then I might suggest '?php= isset($foo)?$foo:$bar ?', which I believe would already work as '?php echo isset($foo)?$foo:$bar ?', '?= isset($foo)?$foo:$bar ?'. Thanks for the tip, we didn't realize that. -Sterling -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Why are short tags (? ? and % %) such a bad thing? Why does the PHP formatting (tags) matter in terms of SGML XML? Not that it matters, but personally I prefer to use the short tags ? and ? because it's less code for me to write, it fits nicely into my HTML, and I find ?= much easier to read than ?php echo. I honestly don't really care for ?php= , although I do understand the reasoning behind it and agree with the consistency argument for it. - Gabriel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
At 21:07 26/04/2002, Sterling Hughes wrote: The whole point of the ?php tag is to allow people to embed commands in XML documents. When short tags are disabled, commands such as % echo 'HELLO'; % don't work. If you allow ?php=? syntax, it is not valid XML, which negates the point of having ?php in the first place. He was wrong about the 2nd example, but I'm pretty sure about his first: ?php if ($foo $bar) ... ? Is this valid XML? [I'm not taking sides on whether ?php= should be supported or not] Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
At 20:32 26/04/2002, Gabriel Ricard wrote: Why are short tags (? ? and % %) such a bad thing? % % are bad because they're not supported on most setups. ? ? are not good enough because they're not supported on all setups, even though they're supported on most. As to why they're not supported on all - please refer to the huge threads about the subject, that date back to 1997 or 1998 :) Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Perhaps if it were a computer making these assumptions, yes. But anyone with half a brain can see that ?php echo 'Hello'; ? is much easer to understand for someone with no programming experience, than: ?php='Hello'?. Agreed, Sterling. I can't understand why this is so difficult to realize. Theo, are you just trying to impress people by saying how easy the cryptic syntax is? If so, it's not working. I, and others, would argue that '?php=' is no more 'magic' than '?php echo'. We know what it means. Seriously, Theo, this list isn't a place where everyone's ego is on the line. This is like arguing that the ternary operator in C is more intuitive than just writing the long if statement. Just because you and others know what it means is *not* a valid argument. This isn't a contest. You seem to have gotten the wrong impression. I for one am glad that PHP has remained as clean as it is. It is certainly a factor in PHP's success. Thanks for the tip, we didn't realize that. Well, Sterling, the sarcasm might have ben a bit harsh, but I must admit I laughed out loud when I read it. :) It's too bad really that ?= and %= are valid. I can guess why, but it leads to useless conversations like this. Chris -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
?php if ($foo $bar) ... ? Is this valid XML? No, this is technically invalid XML. You would have to write it as: ?php if ($foo gt; $bar) But sheez... That's just way too ugly, you can work around it and there are other examples out there of people breaking this rule. Doing ?php= is a much more flagrant violation in my opinion. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
On Fri, 26 Apr 2002, Gabriel Ricard wrote: Why are short tags (? ? and % %) such a bad thing? They aren't really bad. It's just that they are optional and if you distribute your code to run on someone else's PHP setup they may be turned off. If you have full control over your PHP setup anywhere the code you write will run, then using these tags is perfectly fine. Why does the PHP formatting (tags) matter in terms of SGML XML? It rarely does, but people worry that they may want to pass a PHP file through an XML parser or that they want to pass raw XHTML files through the PHP parser. In these cases it would matter. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
I'm pretty sure it is. It parses fine according to Xerces, at any rate. At first, I was thinking the greater than comparison would cause problems, as xsl:if elements like seeing the test written as foo gt; bar, but when you have the symbol inside of a processing instruction, it's fine. J Zeev Suraski wrote: At 21:07 26/04/2002, Sterling Hughes wrote: The whole point of the ?php tag is to allow people to embed commands in XML documents. When short tags are disabled, commands such as % echo 'HELLO'; % don't work. If you allow ?php=? syntax, it is not valid XML, which negates the point of having ?php in the first place. He was wrong about the 2nd example, but I'm pretty sure about his first: ?php if ($foo $bar) ... ? Is this valid XML? [I'm not taking sides on whether ?php= should be supported or not] Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
I'm pretty sure it is. It parses fine according to Xerces, at any rate. At first, I was thinking the greater than comparison would cause problems, as xsl:if elements like seeing the test written as foo gt; bar, but when you have the symbol inside of a processing instruction, it's fine. Are you sure? I know that this is a common thing for XML parsers to allow, but I think going strictly by the spec it is not valid. I could be wrong though, my XML spec-reading patience has long since worn off. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] odbc problems in 4.2
is this it then? How hard is it to get a hold of a version that is compiled the same way as my version 4.1.1? I'd really like to upgrade. I do have the tools I need to compile my own version but I'm not set up to do it and for the last 4 years of using PHP I haven't had to since the distributions have all worked. Thanks. Ryan -Original Message- From: Andreas Karajannis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 5:16 PM To: Dan Kalowsky Cc: Ryan Jameson (USA); [EMAIL PROTECTED] Subject: Re: [PHP-DEV] odbc problems in 4.2 Dan Kalowsky wrote: Hi Ryan, Okay did a little looking over the odbc_fetch_row code, and it should reset the result-fetched to whatever the second argument (if one is provided) is. This variable is how the ODBC result system handles where it currently is in the cache. Now the catch is that odbc_result checks this value, and if it's set to 0 re-fetches the results. This should be perfectly ok, just as if you start with a fresh resultset. Row # 0 doesn't contain data. So in otherwords the code sample you sent should work, provided that the $rs is a valid result. I'm having some local DB access/ODBC issues so I cannot test it right at the moment. I'm working on fixing that. On Wed, 24 Apr 2002, Ryan Jameson (USA) wrote: If this is easy for anyone could someone verify that: odbc_fetch_row($rs,0); ...does not reset the result set in version 4.2? From what I can tell it doesn't work at all. I want to be certain that we cannot upgrade to 4.2. If someone has another way to reset an ODBC result set I'd love to hear about it. It's done in a central core function, but is necessary in a plethora of scripts. The result set comes from the MS SQL Server driver (shhh... I tried to get them to use MySQL ... they are scared of free stuff. I'm just glad they let me use PHP). Thanks! Just to clarify: The odbc module doesn't cache or refetch resultsets. Whether you're able to reset a resultset depends on the odbc driver or driver manager you use (And how PHP was compiled, see below). If the driver doesn't support so called scrollable cursors, some Driver Managers (afaik unixODBC and the standard MS Windows DM do) provide support for this via a cusror library that caches resultsets and emulates scrolling cursors. My guess is that the PHP 4.2 you've tried was wasn't compiled with HAVE_SQL_EXTENDED_FETCH (so only the simple SQLFetch that can only move forwards gets used; the rownum parameter is ignored in this case) or that your DM wasn't configured to use it's cursor library. -Andreas -- Andreas Karajannis mediaworx berlin AG Fon (0 30) 2 75 80 - 266 Fax (0 30) 2 75 80 - 200 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
This might not matter too much now, but conforming to XML standards might matter eventually. Let's say in a year or two, somebody decides to write a PHP module for an XML/XSL processor. (Something like XSP using Apache's Cocoon.) Basically, these processors take in some XML, look for processing instructions, create some output based on what they find, pass the output through an XSL transformation and spit out some other format, like HTML. If PHP doesn't work well with XML, this is going to be a mess. (I seem to remember hearing about such a module for Cocoon, which they call producers. It would be kind of cool to have a PHP procuder, which I'd prefer over the standard Cocoon producer, Java.) J p.s. and OT -- it would be pretty cool if the XSLT extension for PHP was able to process the XML/XSL before it passed it off to the actual XSLT processor, i.e. look through the XML or XSL for PHP processing instructions encased in ?php ... ? and actually evaluate them before the transformation. That might be something cool to look into. (I use the XSLT extension quite a bit, and this would definitely be useful. For now, I eval() the XML/XSL and buffer it before sending it to the XSLT processor.) Gabriel Ricard wrote: Why are short tags (? ? and % %) such a bad thing? Why does the PHP formatting (tags) matter in terms of SGML XML? Not that it matters, but personally I prefer to use the short tags ? and ? because it's less code for me to write, it fits nicely into my HTML, and I find ?= much easier to read than ?php echo. I honestly don't really care for ?php= , although I do understand the reasoning behind it and agree with the consistency argument for it. - Gabriel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Are you positive about that? I would have assumed so, too, but it passes both the Sablotron and Xerces XML processors without so much as a warning. J Rasmus Lerdorf wrote: ?php if ($foo $bar) ... ? Is this valid XML? No, this is technically invalid XML. You would have to write it as: ?php if ($foo gt; $bar) But sheez... That's just way too ugly, you can work around it and there are other examples out there of people breaking this rule. Doing ?php= is a much more flagrant violation in my opinion. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
I hear that. Not that reading specs and standards isn't fun... J Rasmus Lerdorf wrote: I'm pretty sure it is. It parses fine according to Xerces, at any rate. At first, I was thinking the greater than comparison would cause problems, as xsl:if elements like seeing the test written as foo gt; bar, but when you have the symbol inside of a processing instruction, it's fine. Are you sure? I know that this is a common thing for XML parsers to allow, but I think going strictly by the spec it is not valid. I could be wrong though, my XML spec-reading patience has long since worn off. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Ok, cool, so as long as we don't do something stupid like add ?php= then we are XML-clean. Well, in the language anyway. People could still write ?php echo ?? I suppose. -Rasmus On Fri, 26 Apr 2002 [EMAIL PROTECTED] wrote: From: http://www.w3.org/TR/2000/REC-xml-20001006#sec-pi [16] PI ::='?' PITarget (S (Char* - (Char* '?' Char*)))? '?' [17] PITarget ::=Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) [3] S::=(#x20 | #x9 | #xD | #xA)+ [2] Char ::=#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x1-#x10] Meaning that between ?php and ? everytning is allowed but '?'. Derick On Fri, 26 Apr 2002, J Smith wrote: Are you positive about that? I would have assumed so, too, but it passes both the Sablotron and Xerces XML processors without so much as a warning. J Rasmus Lerdorf wrote: ?php if ($foo $bar) ... ? Is this valid XML? No, this is technically invalid XML. You would have to write it as: ?php if ($foo gt; $bar) But sheez... That's just way too ugly, you can work around it and there are other examples out there of people breaking this rule. Doing ?php= is a much more flagrant violation in my opinion. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php --- Did I help you? Consider a gift: http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B --- 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 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Just read that myself at w3c.org. I hate the format of their recommendations, god. It takes forever for me to find anything specific in their specs. J [EMAIL PROTECTED] wrote: From: http://www.w3.org/TR/2000/REC-xml-20001006#sec-pi [16] PI ::='?' PITarget (S (Char* - (Char* '?' Char*)))? '?' [17] PITarget ::=Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) [3] S::=(#x20 | #x9 | #xD | #xA)+ [2] Char ::=#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [[#x1-#x10] Meaning that between ?php and ? everytning is allowed but '?'. Derick On Fri, 26 Apr 2002, J Smith wrote: Are you positive about that? I would have assumed so, too, but it passes both the Sablotron and Xerces XML processors without so much as a warning. J -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Hi, From: http://www.w3.org/TR/2000/REC-xml-20001006#sec-pi [16] PI ::='?' PITarget (S (Char* - (Char* '?' Char*)))? '?' [17] PITarget ::=Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) [3] S::=(#x20 | #x9 | #xD | #xA)+ [2] Char ::=#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x1-#x10] Meaning that between ?php and ? everytning is allowed but '?'. Nice to know! Not that it matters to the ?php= discussion, because if someone doesn't want to make a valid XML document he has plenty ways of doing that... About the ?php= thing: IMHO it can be put in, because the people who don't like it just won't use it... I understand that others want to keep the language clean, which is very important too! I probably wouldn't use it, but I have nothing against it either. But: very nice to know the XML thing. Thanks! Sander. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Discourage use of short tags
I've changed basic-syntax.xml a little. The manual list short tag first, even if it recommends ?php tag. Anyway, I would like to add something like note para Use of short tag is strongly discouraged. It not only non-portable and non-XML compliant, but also a obsolete feature. /para /note There are too many hosting services that enable short tag by default. In many case, user cannot do anything.. Any comments? -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Discourage use of short tags
Please qualify this correctly. There is nothing wrong with using short-tags for code that is always going to live on servers you have full control over. Simply explain the drawbacks instead of this scare tactic. And no, it is not an obsolete feature that is going to go away. -Rasmus On Sat, 27 Apr 2002, Yasuo Ohgaki wrote: I've changed basic-syntax.xml a little. The manual list short tag first, even if it recommends ?php tag. Anyway, I would like to add something like note para Use of short tag is strongly discouraged. It not only non-portable and non-XML compliant, but also a obsolete feature. /para /note There are too many hosting services that enable short tag by default. In many case, user cannot do anything.. Any comments? -- Yasuo Ohgaki -- 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] Discourage use of short tags
While you're at it..add a note that the short tag stuff is disabled by default in php.ini-* starting from 4.3.0. --Jani On Sat, 27 Apr 2002, Yasuo Ohgaki wrote: I've changed basic-syntax.xml a little. The manual list short tag first, even if it recommends ?php tag. Anyway, I would like to add something like note para Use of short tag is strongly discouraged. It not only non-portable and non-XML compliant, but also a obsolete feature. /para /note There are too many hosting services that enable short tag by default. In many case, user cannot do anything.. Any comments? -- Yasuo Ohgaki -- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended
This is illogical. It will break reams of code out there. People who have happily written code without any intention of distributing it will now deploy new servers and not have their code work. We will get slammed with questions. Second, it is only a factor in very few cases. Very few people are going to parse their PHP code through an XML parser. The people who do so are very capable of turning off short_tags. Likewise for the people who write PHP code that they re-distribute. These are the people who know enough to use the longer tag style. Please revert. -Rasmus On Fri, 26 Apr 2002, Jani Taskinen wrote: sniperFri Apr 26 19:20:07 2002 EDT Modified files: /php4 php.ini-dist php.ini-recommended Log: Default setting for short_open_tag is better be Off. Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.123 php4/php.ini-dist:1.124 --- php4/php.ini-dist:1.123 Fri Apr 19 03:13:55 2002 +++ php4/php.ini-dist Fri Apr 26 19:20:06 2002 -68,7 +68,7 engine = On ; Allow the ? tag. Otherwise, only ?php and script tags are recognized. -short_open_tag = On +short_open_tag = Off ; Allow ASP-style % % tags. asp_tags = Off Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.76 php4/php.ini-recommended:1.77 --- php4/php.ini-recommended:1.76 Tue Apr 23 21:51:12 2002 +++ php4/php.ini-recommended Fri Apr 26 19:20:06 2002 -81,7 +81,7 engine = On ; Allow the ? tag. Otherwise, only ?php and script tags are recognized. -short_open_tag = On +short_open_tag = Off ; Allow ASP-style % % tags. asp_tags = Off -- PHP CVS 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-DEV] Re: Bug #16836 Updated: Crash of Webserver
Hi, this is getting off-topic for the bug system as it's 99% not related to PHP. Use your debian tools to verify if your binaries are right (check md5sum or whatever) for a start. See also if you can upgrade then. Whatever it is, it's most likely not related to PHP (at least, after I've written this a few times now, I also hope so ;) Anyway, good luck, - Markus On Fri, Apr 26, 2002 at 07:46:43PM -, [EMAIL PROTECTED] wrote : ID: 16836 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: MySQL related Operating System: Linux debian/woody PHP Version: 4.2.0 New Comment: Nope, has same effect :( How can I check that libdb2 is ok? Maybe some bug in that lib? BG MaC Previous Comments: [2002-04-26 14:10:31] [EMAIL PROTECTED] Does PHP 4.1.2 work any better then? [2002-04-26 09:40:59] [EMAIL PROTECTED] Dear Developers, thank you a lot for quick reply. I tried it using minimal configuration: ./configure --enable-debug --with-mysql --with-apxs=/usr/bin/apxs Apache is libthread linked. Libc is Version: 2.2.5-4 MySql lines from /etc/services: grep mysql /etc/services mysql 3306/tcp# MySQL mysql 3306/udp# MySQL I think myself that it is a lib problem, but I reinstalled all libs, made hardware check before writing this bug report :( All libs are from woody, apt installed. BR MaC [2002-04-26 09:26:56] [EMAIL PROTECTED] Please provide the full configure line of PHP. Also can you paste the relevant lines of the /etc/services file containing mysql? Btw, which version of libc are you using exactly (use dpkg -s libc6|grep Version ) ? It looks like a problem with your system libraries, not related to php or mysql at all. [2002-04-26 09:10:38] [EMAIL PROTECTED] Dear Sniper, yet PHP Apache does not crash on requesting phpinfo() but does if I try to make MySql connection. I took sources from download section at php.net (Apr.22) and the config you told me. strace tells me: open(/lib/libdb.so.3, O_RDONLY) = 5 read(5, \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300*\0..., 1024) = 1024 fstat64(5, {st_mode=S_IFREG|0644, st_size=233488, ...}) = 0 old_mmap(NULL, 236572, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) = 0x40411000 mprotect(0x4044a000, 3100, PROT_NONE) = 0 old_mmap(0x4044a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 5, 0x38000) = 0x4044a000 close(5)= 0 munmap(0x4037e000, 22601) = 0 --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ gdb shows: #0 0x in ?? () #1 0x40428682 in __db_err () from /lib/libdb.so.3 #2 0x40421e1d in db_open () from /lib/libdb.so.3 #3 0x4040cd0a in _nss_db_getprotobynumber_r () from /lib/libnss_db.so.2 #4 0x4040cefa in _nss_db_endservent () from /lib/libnss_db.so.2 #5 0x4040d181 in _nss_db_getservbyname_r () from /lib/libnss_db.so.2 #6 0x401bbac3 in getservbyname_r () from /lib/libc.so.6 #7 0x401bb971 in getservbyname () from /lib/libc.so.6 #8 0x402b87cd in mysql_once_init () at libmysql.c:1022 #9 0x402b871c in mysql_init (mysql=0x80f114c) at libmysql.c:989 #10 0x402b3fe5 in php_mysql_do_connect (ht=3, return_value=0x80f10b4, this_ptr=0x0, return_value_used=1, persistent=0) at php_mysql.c:661 #11 0x402b41ed in zif_mysql_connect (ht=3, return_value=0x80f10b4, this_ptr=0x0, return_value_used=1) at php_mysql.c:714 #12 0x4028a007 in execute (op_array=0x8102848) at ./zend_execute.c:1598 #13 0x4028a211 in execute (op_array=0x80d9a1c) at ./zend_execute.c:1638 #14 0x40297dce in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #15 0x402a5556 in php_execute_script (primary_file=0xb968) at main.c:1381 #16 0x402a114e in apache_php_module_main (r=0x80d2fc4, display_source_mode=0) at sapi_apache.c:90 #17 0x402a1c4e in send_php (r=0x80d2fc4, display_source_mode=0, filename=0x0) at mod_php4.c:575 #18 0x402a1cb2 in send_parsed_php (r=0x80d2fc4) at mod_php4.c:590 BR MaC [2002-04-25 22:07:23] [EMAIL PROTECTED] Please get fresh sources of PHP 4.2.0 and replace the configure with this: http://www.edin.dk/php/configure.gz This might be yet another side effect of the buggy autoconf 2.52 which was used to generate the configure in the distribution package.
Re: [PHP-DEV] ?= and %= both work, why not ?php=
At 20:52 26/04/2002, Rasmus Lerdorf wrote: ?php if ($foo $bar) ... ? Is this valid XML? No, this is technically invalid XML. You would have to write it as: ?php if ($foo gt; $bar) Erm, but that won't work :) But sheez... That's just way too ugly, you can work around it and there are other examples out there of people breaking this rule. Doing ?php= is a much more flagrant violation in my opinion. Look, I'm not trying to argue in favour of ?php= or anything. I'm just going back to this discussion from 5 years ago, and pointing out that I still don't quite understand why we cared about XML compliance, when a language such as PHP cannot be XML compliant no matter what :) Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
?php if ($foo gt; $bar) Erm, but that won't work :) Obviously. But sheez... That's just way too ugly, you can work around it and there are other examples out there of people breaking this rule. Doing ?php= is a much more flagrant violation in my opinion. Look, I'm not trying to argue in favour of ?php= or anything. I'm just going back to this discussion from 5 years ago, and pointing out that I still don't quite understand why we cared about XML compliance, when a language such as PHP cannot be XML compliant no matter what :) It looks like we can. I was assuming the SGML characteristics for XML and it looks like I was wrong. A '' is ok inside the ?php ? tags. -R -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Discourage use of short tags
Addressed to: Yasuo Ohgaki [EMAIL PROTECTED] [EMAIL PROTECTED] ** Reply to note from Yasuo Ohgaki [EMAIL PROTECTED] Sat, 27 Apr 2002 07:47:08 +0900 I've changed basic-syntax.xml a little. The manual list short tag first, even if it recommends ?php tag. Anyway, I would like to add something like note para Use of short tag is strongly discouraged. It not only non-portable and non-XML compliant, but also a obsolete feature. /para /note There are too many hosting services that enable short tag by default. In many case, user cannot do anything.. Any comments? -maxint! IM(ns)HO There aren't enough hosting services that support short tags! If you don't like them don't use them, but don't force me to follow your programming rules. Short tags have been available for a long time, and work just fine, thank you. I also strongly prefer ?= to ? echo. If you don't that's fine don't use them. I use them and have a large code base that uses them extensively, and don't intend to change. Please don't try to force me to change to follow your code standards when what I'm doing has been part of the language much longer than you've been around this forum. Grrr! Rick Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
At 03:18 27/04/2002, Rasmus Lerdorf wrote: It looks like we can. I was assuming the SGML characteristics for XML and it looks like I was wrong. A '' is ok inside the ?php ? tags. Ok, so that's actually useful. But it sounds odd - XML is not SGML compliant? Zeev -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
I'm pretty sure that XML is a scaled down and easier to learn/work with version of SGML Correct me if I'm wrong --Andrew On Friday 26 April 2002 07:30 pm, Zeev Suraski wrote: At 03:18 27/04/2002, Rasmus Lerdorf wrote: It looks like we can. I was assuming the SGML characteristics for XML and it looks like I was wrong. A '' is ok inside the ?php ? tags. Ok, so that's actually useful. But it sounds odd - XML is not SGML compliant? Zeev -- 35. I think we can plug just one more thing in to this outlet strip with out triping the breaker. --Top 100 things you don't want the sysadmin to say -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ?= and %= both work, why not ?php=
Yes, but I thought it was SGML compliant (as in, some sort of a subset of SGML with lots of predefined rules, but still, falls into the SGML language category). But then, I could very well be wrong about this. Zeev At 05:37 27/04/2002, Andrew Lindeman wrote: I'm pretty sure XML is a scaled down and easier to learn/work with version of SGML. Correct me if I'm wrong --Andrew On Friday 26 April 2002 07:30 pm, Zeev Suraski wrote: At 03:18 27/04/2002, Rasmus Lerdorf wrote: It looks like we can. I was assuming the SGML characteristics for XML and it looks like I was wrong. A '' is ok inside the ?php ? tags. Ok, so that's actually useful. But it sounds odd - XML is not SGML compliant? Zeev -- We all know Linux is great...it does infinite loops in 5 seconds. (Linus Torvalds about the superiority of Linux on the Amterdam Linux Symposium) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Make mysql_select_db return previous db name..
See details about this: http://bugs.php.net/?id=16495edit=1 This patch implements it..but should there be some parameter which triggers it? --Jani -- Index: php_mysql.c === RCS file: /repository/php4/ext/mysql/php_mysql.c,v retrieving revision 1.133 diff -u -r1.133 php_mysql.c --- php_mysql.c 18 Apr 2002 16:48:03 - 1.133 +++ php_mysql.c 27 Apr 2002 02:05:32 - -776,6 +776,7 zval **db, **mysql_link; int id; php_mysql_conn *mysql; + char *prev_db; switch(ZEND_NUM_ARGS()) { case 1: -801,10 +802,16 convert_to_string_ex(db); + if (mysql-conn.db) { + prev_db=estrdup(mysql-conn.db); + } else { + prev_db=estrdup(); + } + if (mysql_select_db(mysql-conn, Z_STRVAL_PP(db))!=0) { RETURN_FALSE; } else { - RETURN_TRUE; + RETURN_STRING(prev_db, 0); } } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Discourage use of short tags
note para Use of short tags is strongly discouraged. It is disabled by default from PHP 4.3.0. Short tags are not only non-portable, but also non-XML compliant. /para /note Disabling it by default has not been agreed upon. I am against changing this default. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Make mysql_select_db return previous db name..
See details about this: http://bugs.php.net/?id=16495edit=1 This patch implements it..but should there be some parameter which triggers it? Well, the problem with this is: if (mysql_select_db(foo, $dbh)) { print BAH BAM BOOM; } will fail either way -Sterling --Jani -- Index: php_mysql.c === RCS file: /repository/php4/ext/mysql/php_mysql.c,v retrieving revision 1.133 diff -u -r1.133 php_mysql.c --- php_mysql.c 18 Apr 2002 16:48:03 - 1.133 +++ php_mysql.c 27 Apr 2002 02:05:32 - -776,6 +776,7 zval **db, **mysql_link; int id; php_mysql_conn *mysql; + char *prev_db; switch(ZEND_NUM_ARGS()) { case 1: -801,10 +802,16 convert_to_string_ex(db); + if (mysql-conn.db) { + prev_db=estrdup(mysql-conn.db); + } else { + prev_db=estrdup(); + } + if (mysql_select_db(mysql-conn, Z_STRVAL_PP(db))!=0) { RETURN_FALSE; } else { - RETURN_TRUE; + RETURN_STRING(prev_db, 0); } } /* }}} */ -- 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] Discourage use of short tags
I too (given a voice) would be against changing this default. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd note para Use of short tags is strongly discouraged. It is disabled by default from PHP 4.3.0. Short tags are not only non-portable, but also non-XML compliant. /para /note Disabling it by default has not been agreed upon. I am against changing this default. -Rasmus -- 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] odbc problems in 4.2
I'm looking into these problems right now. Please be patient. A recent slew of bug reports suggests that there might be some stuff that is working for me here locally, but not for other setups.. As for getting a hold of a different version, the best I can suggest right now is A) try a snapshot from http://snaps.php.net/win32 or B) build your own (requires VC++, or some such compiler). On Fri, 26 Apr 2002, Ryan Jameson (USA) wrote: is this it then? How hard is it to get a hold of a version that is compiled the same way as my version 4.1.1? I'd really like to upgrade. I do have the tools I need to compile my own version but I'm not set up to do it and for the last 4 years of using PHP I haven't had to since the distributions have all worked. Thanks. Ryan -Original Message- From: Andreas Karajannis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 5:16 PM To: Dan Kalowsky Cc: Ryan Jameson (USA); [EMAIL PROTECTED] Subject: Re: [PHP-DEV] odbc problems in 4.2 Dan Kalowsky wrote: Hi Ryan, Okay did a little looking over the odbc_fetch_row code, and it should reset the result-fetched to whatever the second argument (if one is provided) is. This variable is how the ODBC result system handles where it currently is in the cache. Now the catch is that odbc_result checks this value, and if it's set to 0 re-fetches the results. This should be perfectly ok, just as if you start with a fresh resultset. Row # 0 doesn't contain data. So in otherwords the code sample you sent should work, provided that the $rs is a valid result. I'm having some local DB access/ODBC issues so I cannot test it right at the moment. I'm working on fixing that. On Wed, 24 Apr 2002, Ryan Jameson (USA) wrote: If this is easy for anyone could someone verify that: odbc_fetch_row($rs,0); ...does not reset the result set in version 4.2? From what I can tell it doesn't work at all. I want to be certain that we cannot upgrade to 4.2. If someone has another way to reset an ODBC result set I'd love to hear about it. It's done in a central core function, but is necessary in a plethora of scripts. The result set comes from the MS SQL Server driver (shhh... I tried to get them to use MySQL ... they are scared of free stuff. I'm just glad they let me use PHP). Thanks! Just to clarify: The odbc module doesn't cache or refetch resultsets. Whether you're able to reset a resultset depends on the odbc driver or driver manager you use (And how PHP was compiled, see below). If the driver doesn't support so called scrollable cursors, some Driver Managers (afaik unixODBC and the standard MS Windows DM do) provide support for this via a cusror library that caches resultsets and emulates scrolling cursors. My guess is that the PHP 4.2 you've tried was wasn't compiled with HAVE_SQL_EXTENDED_FETCH (so only the simple SQLFetch that can only move forwards gets used; the rownum parameter is ignored in this case) or that your DM wasn't configured to use it's cursor library. -Andreas --- Dan KalowskyThe record shows, I took the blows. http://www.deadmime.org/~dankAnd did it my way. [EMAIL PROTECTED] - My Way, Frank Sinatra [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended
Rasmus Lerdorf wrote: But what problem are you trying to solve? Me? None. I just wanted to show a possible third way. There have been a lot of changes lately that adds more obstacles for the new user. Most of the books out there and all sorts of tutorials show short-tag examples. Blame the authors, then :) -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php