Re: [PHP-DEV] Session Patch
Walter A. Boring IV wrote: The patch provides: configure option --enable-app-session, which turns on the new functions. session_get_list() : function which returns an array of active session ids. session_get_data() : function which returns the session data array of a particular session id. session_destroy_id() : destroys a particular session. What's the purpose of this, what's the difference to msession? Ulf -- Free for Freelancing: PHP (Anwendungsentwicklung, Schulungen) Berufserfahrung, Kongressannahmen... http://www.ulf-wendel.de -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Overloading Tags with PHP functions
Kristian Köhntopp wrote: The following code is slow and very ad-hoc. Still, I'd like you to have a look at it and think about it - I'll gather reviews and opinions and probably turn it into C at some later time. Your suggestions hits my needs to almost 100%. People say that I tend to copy your ideas. This is not true actually. About a year ago you started to work with XML/XSLT. I also looked at XML/XSLT that days, bought a couple of books and decided not to use XSLT. XSLT - nice, but The first time I read about XSLT in depth I was missing some callbacks during the transformation process to perform certain actions. For example I needed a phpcode / container to be translated into a highlight_string() function call and - in certain cases an eval(). Using XSLT to do this I would have had to do the following: XML - XSLT - PHP - HTML Really complicated. Guess I want this to be translated: phpcode eval=true title=print example php $foo = 1; print Silly example, usually I put 20+ lines here; ? /phpcode Using XSLT my first step would be producing: ?php ob_start(); $foo = 1; print Silly example, usually I put 20+ lines here; ob_end(); $content = ob_get_content(); $content = highlight_source($content); $content = preg_replace(#f0f0f0, #d0d0d0, $content); print $content; ? or maybe: ?php phpcode(...); ? In the next step I would be executing this PHP script to generate an HTML output. If you've ever written XSL containing if-else (xsl:choose/xsl:when) and recursive template calls you know how much it hurts to write the required XSL file. If not, here's a simple example turning XML into PHP using XSLT: http://www.ulf-wendel.de/projekte/menu/xmlmenu.php [sorry, german] (http://www.ulf-wendel.de/projekte/menu/menu3.xsl) As you can see this is a lot of almost unreadable stuff to do the job. I decided not to use XSLT, but I used XML + preg_match()/callbacks + regular HTML templates. Adding content to my homepage is really easy. All I have to do was to fill out this XML fragment. homepage title.../title keyords.../keywords content XHTML goes here /content /homepage My framework adds all I need: menu, ... So, tell me about the advantage of using XSLT for HTML generation? I can't use my favourite HTML editor, generating HTML can't be done in one step. In my case XSL was no more but overhead. Not powerful enough to serve my needs. Why the hell do I want XML and custom tags? Rasmus might shake his head asking what's my point? Rasmus, the man that can't be seen without wireless LAN and a notebook, started to add functions to HTML many years ago. He wrote: html head titleJoke of the day, ?php print date(Y-m-d, time()); ?/title ... Maybe the syntax was slightly different, but that's roughly how it looked like. Using templates we've turned this into: html head titleJoke of the day, {TODAY}/title ... [IT, PHPLib, ...] or: html head titleJoke of the day, {$today}/title [customized Smarty] What we've done is wrapping a new syntax around PHP, hiding ?php today(); ?. The usual argument to use templates is the separation of design and logics. But these days we put lots of logic back into our templates using Smarty (or XSL). Anyway. Generally speaking we do no more but change the syntax of PHP. Having callback functions associated with customs xml-tags is just another version of the same game: html head titleJoke of the day, today/title ... Why should one go this way? XML is just cool: - XML is a world-wide accepted standard for information interchange - XML structures our content - XML is ease to learn - XML can be transformed (into CSV, XML, ...) using XSLT - XML documents can be validated (well-formed, DTD, Schema) - XML is plain text which can be understood by every computer in this world. These are only a _few_ arguments for XML. Having IT[X], PHPLib, Smarty - whatever - templates I can't use XSLT to transform it into CSV file to be processed by a database. But I can use XML for this. Having an XML content files I can switch from PHP to Java without many hurts. For eample I could use (properitary) Xalan XSL extensions to emulate my PHP callbacks. Using XY-PHP-Template-Engine I would have to write a parser before I can concentrate on the main issue. More important: pixeldunker have no difficulties learning new tags. Most of them know XHTML. It's easy for them to understand what's going on here: menu url=/contact type=tree / gtext label=send / Not only the webmonkey likes this syntax. Look at my first example: Do you preferr: phpcode /phpcode Or do you want to type this: ?php phpcode( wow escaping all double slashes ... puuh ); ? I like the first one: it's to simple. Smarty: new, old ideas Some customers are requesting full-fledged templates without PHP. No problem with Smarty: if, else, functions, variables, ... But this is not why I like Smarty. Smarty
Re: [PHP-DEV] Overloading Tags with PHP functions
Markus Fischer wrote: On Wed, Jan 16, 2002 at 12:07:17AM +0100, Ulf Wendel wrote : Who's gonna implement it ;) You. I doubt this, btw. here's something related: http://www.php-tools.de/index.php?file=patTemplateOverview.xml My plans for the near future do not include this. I'm gonna focus on another related topic to be presented on the next php conference. Meanwhile I might maintain my existing projects. Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Website: seach result order
Hi! I recently looked for bcmath informations using http://www.php.net/bcmath and I got http://www.php.net/search.php?show=nosourcepattern=bcmath : 1.polish docs 2.polish docs 3.english docs 4.-6. russian docs I doubt that more php.net visitors can understand polish but english. Is there a way to restrict the seach results to a certain language when I use the regular seach page http://www.php.net/search.php ? Thanks! Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] ext/msession: inconsistent function names?
Hi, ext/msession seems to be in an early stage. Can we still change function names? There're some inconsistencies in my eyes: msession_get_array() msession_set_array() vs. msession_setdata() (requested: msession_set_data()) msession_getdata() (requested: msession_get_data()) Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Sessions: garbage collection run
Hi, being not a php source code guru I need some help on understanding the source. Why does the session module run the garbage collection from the PHP_RINIT_FUNCTION() means from php_session_start()? Does the user notice a delay caused by PHP_RSHUTDOWN_FUNCTION()? If not what's the reason not placing the GC there. Thanks in advice, Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: Sessions: garbage collection run
Yasuo Ohgaki wrote: Ulf Wendel wrote: Hi, being not a php source code guru I need some help on understanding the source. Why does the session module run the garbage collection from the PHP_RINIT_FUNCTION() means from php_session_start()? Does the user notice a delay caused by PHP_RSHUTDOWN_FUNCTION()? If not what's the reason not placing the GC there. I think Sascha wants to delete garbages before reading data and I can understand the reasons. I asked Sascha on IRC #php.de and his answer was Good question. It might have todo with the lifetime of PS(mod_data). If so, it's clear. If not, there's no reason on running GC at a time where the user definetly notices the (often negliable) delay. But well, there's a lot of if's and I just wanna know. Someone with detailed knowledge of the internals should be able to answer my questions: - is a PHP_RSHUTDOWN_FUNCTION() delay visible to the user? - what about the lifetime of PS(mod_data), can one still access it from within the PHP_RSHUTDOWN_FUNCTION()? Anyway, with user defined handlers, you can gc at shutdown w/o changing PHP C source. Create empty gc function and use If it's possible to run GC on shutdown there's no reason to delay the delivery of php script result by running GC on session start. Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] [NEW EXTENSTION]: templates
Alexander Wagner wrote: Björn Schotte wrote: - anything else? you tell me Feature set from PHPLIB's Template class. IT[X]-Style interface for blocks. Hmm, I know about someone that implemented IT[X] in C. Well not 100% IT[X] but 95% of it. Maybe some fine day when we both have lot's of time IT[X] will become a simple wrapper on yet another template extension... Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [PEAR-DEV] PHPDoc Development Status
Stig S. Bakken wrote: [EMAIL PROTECTED] wrote: phpdoc itself or just this extension ? Just this extension. Hurry up and apply for a CVS account at http://php.net/cvs-php.php :-) Ok, now that everybody commented on it, let me add my 2 Cents. I never stopped beliving in the importance of PHPDoc and I never ever wanted to give up my engagement entirely. I and Jan passed the half-the-way extension to quite some companies that asked for bugfixes and/or and update. Some one them offered help with the development but actually never supplied any. Up to now there's just one serious contact to a company willing to help. This was indeed a frustrating situation which gained almost 8 months. And that's why I put my focus on other projects: no Open-Source without contributions. Anyway, finally I got some cool feedback from you these days. Now that we're about to get a stable extension - thanks to Ol [EMAIL PROTECTED] and again to Jan [EMAIL PROTECTED] - I'll try to find some time to write a 1.0 version. More credits go to Kristian [EMAIL PROTECTED] who came up with the highlight_source() idea. I can't promise anything on the timeframe, but belive me, I'm still intrested in it. Please do not blow up the extension, keep it simple and smart/stupid. Let it output it's very own, simple XML files: no HTML, no Docbook or anything else. Any transformation of the basic output belongs to the userspace as comment parsing and documentation information inheritance does. Once we have a stable extension people will start to write lot's of documentation tools. Some chaos will come up and we'll need a discussion on the development lists on what features some kind of standard documentation generation should implement; quite similar to PEAR coding rules. Let me end with some Q/A's. Q: Will you write docs on your documentation tool? A: I'm currently updating my websites, some of them contain tutorials which I plan to expand. Yes, PHPDoc will be discussed as well. Q: When will there be 1.0 of PHPDoc - any roadmap? A: Can't tell you - but I'm very much interested in working on it. Those intrested getting involved in the development can ask question on the existing code on PEAR-DEV. Please, no PM. Q: Any chance to get a GUI? A: Yes, definetly. I never went into this business as I was looking for a tool to handle the expected mass of user interfaces, mostlysimple forms. Now, that I have a tool to handle lot's of forms... Q: What about DocBook? A: I don't have the neccessary knowledge for this, but I know some guys that actually have it. Means, I've send some pizza's and beer crates to send to them and make them feel guilty to help us ;). Help is very much appreciated. Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] PHPDoc Future
James Moore wrote: Q: What about DocBook? A: I don't have the neccessary knowledge for this, but I know some guys that actually have it. Means, I've send some pizza's and beer crates to send to them and make them feel guilty to help us ;). Help is very much appreciated. What needs doing on this front?? Uff, you're almost too fast. There're two explanations for this: you're looking for some beer or you don't have a job that occupies you... No, beside kidding: it's hard to give a precise answer to this. To be honest I don't know which way would be best. Let's try some kind of reverse engeneering. PEAR needs a documentation tool, that's able to generate a basic framework (or a final document) to be used with the documentation system on php.net . This, and the whish to use the existing tools to generate PDF etc. based on DocBook, means that eigther the documentation tool needs to output DocBook directly or the XML output of the doc tool has to be transformed using XSLT. I expect this situation to become quite familiar. Some company is looking for a documentation tool. They start searching for it and they will find about a hundred scripts using ext/phpdoc. The developer resonsible to select a tool checks two or three of them and decides that none of them fits the needs of the company. He asks the project manager for three days to write the 101st customized tool. Of course this tool must be capable to generate DocBook. Well, he's a XML novice and doesn't know anything about DocBook which is quite complex. Means he has no chance to create DocBook on it's own. But he might have the knowledge to integrate a DocBook conversation plug-in. So what I suggest is having a DocBook conversation plug-in that consists of some basic XSLT function calls and - most important - XSL files. This way we get: 1.) C: ext/phpdoc = simple XML (doc comments unparsed) 2.) PHP: standard_doctool = generates standard_intermediate XML = might generate template based HTML = might generate template based PDF 3.) PHP: standard_docbook_conv = generates DocBook = generates HTML = generates PDF I the standard_docbook_conv tool is well documented it should be possible to alter the XSL files that can handle the XML output of the standard_doctool - even for a novice. What does this mean for you? We'll have to start a discussion on what the standard_doctool should look like. This determines it's XML output format. And this is the base for your standard_docbook_conv tool. If you want me, I can try to write some kind of whitepaper draft what a PHPDoc tool should look like. It would take me about 10 days to do so. This paper could be discussed on the dev-lists or we start discussing right the way. Ulf -- NetUSE AG Dr.-Hell-Straße Fon: +49 431 386 436 00 http://www.netuse.de/ D-24107 Kiel Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Re: [PEAR-DEV] PHPDoc Future
Alexander Merz wrote: 1.) C: ext/phpdoc = simple XML (doc comments unparsed) 2.) PHP: standard_doctool = generates standard_intermediate XML What would be the different between this two types of XML? And how compatible will the xml-output to the existing xml-output? Certain features should not be implemented in C as this complicates the extension and makes it very hard to write customized documentation tools: - information inveritance PHPDoc: a derived class inherits the documentation of a parent class - doc comment parsing any userside documentation tool: parse it on your own and you'll be able to implement customized tags - ... Example (just to show off): ext/phpdoc: doccomment First line - short description used for overviews Second, third and so on for detailed explanations @abstract There's no abstract in PHP, PHPDoc supports the concept. Does every other doc tool want to do so as well @private there's no private in PHP @netusehints that must not be included in the public docs for the customer /doccomment your doc tool: function actract=true private=true description sdescFirst line - .../sdesc Second, third and so on for detailed explanations /description abstract Should my doctool support, should it use an attribute or a tag? /abstract netuse I'm leaving this company, my new company might preferr lt;secret_docgt; . /netuse /function Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Memory consumption / usage
Hi, is there a way to monitor the memory usage of a php script and especially the size of it's variables? We've some trouble with a script eating up lots of memory (100M) although we make heavy use of unset() :(. I know the leak could be almost everywhere and we should start a classical debugging but, ... beside this I'm generally intrested in some kind of C like sizeof() (ok, this name is occupied). Any chance to get it? Ulf -- NetUSE AG Dr.-Hell-Straße Fon: +49 431 386 436 00 http://www.netuse.de/ D-24107 Kiel Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Memory consumption / usage
Joerg Behrens wrote: is there a way to monitor the memory usage of a php script and especially the size of it's variables? Thies added a patch long time ago to log the memory usage of a php script into the apache log files. Well, I'm using a set of scripts to monitor the systemload and the size of http processes. I knew that there's such a Thies (?) but it's not exactly what I would like to know. I'm more intrested in some kind of dump_sizeof($GLOBALS). Ulf -- NetUSE AG Dr.-Hell-Straße Fon: +49 431 386 436 00 http://www.netuse.de/ D-24107 Kiel Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Patch to ext/pdf/
Kristian Koehntopp schrieb: Access denied: Insufficient Karma (kk|php4/ext/pdf) cvs server: Pre-commit check failed cvs [server aborted]: correct above errors first! So patch this yourself. Tanks to Sascha who gave me some more Karma. Committed. Ulf -- NetUSE AG Dr.-Hell-Straße Fon: +49 431 386 436 00 http://www.netuse.de/ D-24107 Kiel Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug or undocumented feature: static?
Hi, I stepped into something yesterday I would call an undocumented feature or a bug, don't know if I should make a bug report. Here's the snippet: function bar() { static $j = 0; print ++$j; } class foo { function foo() { static $i = 0; print ++$i; } function bar() { static $j = 0; print ++$j; } } $obj1 = new foo(); = prints 1 $obj2 = new foo(); = prints 2 $obj1-bar(); = prints 1 $obj2-bar(); = prints 2 bar(); = prints 1 Looks like the static variable is not bound to the member functions of my objects. I expected that member functions from different objects of the same type do not share static variables, so that the output would be 1. Ulf -- NetUSE AG Dr.-Hell-Straße Fon: +49 431 386 436 00 http://www.netuse.de/ D-24107 Kiel Fax: +49 431 386 435 99 PHP lernen? Noch sind Schulungsplätze frei: http://www.netuse.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Classes function names
Zeev Suraski schrieb: The other, is a more fundamental change, and it is to change PHP to be case dependant. PHP 4.0 follows the standard set by PHP/FI 2.0 (or earlier), and maintains case sensitivity for variable names, but not function names or class names. IMHO, there's very little reason for this inconsistency, and PHP would have been better off with full case sensitivity across class names, function names and variable names. It would also improve performance fairly significantly. I'd appreciate the change to break with the mixed case sensitivity and case insesitivity. I'm just a little afraid, that it might break existing code, although I'm sure one will write a tool to convert source files. Ulf -- PHP lernen? Noch sind Schulungsplätze frei: http://www.netuse.de/ Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel Tel: +49 431 386 436 00, Fax: +49 431 386 435 99 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Re: [PHP-PEAR] Merging PHPLIB into PEAR
Chuck Hagenbuch wrote: If the DB layer is changing, then there are going to be backwards compatibility problems anyway, and they might end up being more subtle and hard to find. Why not provide scripts to convert users' code to use the new names? Why assume that the API is going to be the same, anyway? In my eyes most of the PHPLib code will get rewritten. For a private project I would have touched lots of the PHPLib code (auth, perm, menu, some widget stuff) anyway during the next months. While doing this I can "pearify" the code. As there's a huge user base that relies on the PHPLib, we have to provide wrapper classes for the initial release so that we do not break compatibility. Don't know where to place these wrapper classes, maybe in the PHPLib CVS. We'll see, don't haste. Ulf -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]