Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3)
JIRA is down at the moment... I can confirm openSuse as a problem - I've been updated around the packaged versions for some time otherwise my own names gets a few squawks of protest ;). The level of compatility issues seems to indicate a problem with PHP integrating with PCRE in some distributions. Some of the problem issues still occur even if PCRE appears to be compiled with UTF-8 support (6.x at least). Ubuntu seems perfectly fine. I compiled my own Fedora PHP so I don't know about it's packaged versions. My own work. This problem isn't going to vanish anytime soon - there's very little the framework can do except shift down from Unicode against such issues. That causes another problem in how to manage the inconsistency so migrating/installing applications don't bork on the spot when using a simple accented character. It might be useful to distinguish between Alnum for ASCII/ISO and Alnum for Unicode/UTF-8 so a programmer can select which to use themselves. Regards, Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com - Original Message From: Graham Anderson [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Wednesday, June 27, 2007 11:05:16 PM Subject: Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3) On Wednesday 27 June 2007 18:38:07 Darby Felton wrote: Hi Josh, It's already filed as: http://framework.zend.com/issues/browse/ZF-1641 We can post further comments and results there for further investigation. Best regards, Darby Hiya, I can't post to JIRA at the moment so this will have to do in the meantime. From testing on my platforms ( openSUSE/SUSE-OSS 10.0, 10.1, 10.2 ), I have the following results: Up to ( but not including ) apache2-mod_php5-5.2.0-10.rpm testing against the PCRE expression in current Zend_Filter_Alnum passes. From mod_php5 version that ships with openSUSE 10.2 ( 5.2.0-10 ) to the current available in the openSUSE build service, ( 5.2.3-29.1 ), testing against the pattern fails. On openSUSE mod_php5-5.2.0-10 and greater is built against the system PCRE library and not the PHP bundled one, on opensuse 10.2 this is pcre-6.7-21. While patterns with UTF-8 options match against this system library outside of PHP; they do not, for whatever reason match when used inside of PHP. Workaround, on openSUSE 10.2 an upgrade of the system PCRE to the latest available from the openSUSE build service ( pcre-7.1-16 ) will allow pattern matching inside of PHP to function as expected. Cheers Graham Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather
Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3)
Pádraic, Please try my patched version attached. Let me know if it works, please. Best, Andries Seutens http://andries.systray.be Pádraic Brady schreef: JIRA is down at the moment... I can confirm openSuse as a problem - I've been updated around the packaged versions for some time otherwise my own names gets a few squawks of protest ;). The level of compatility issues seems to indicate a problem with PHP integrating with PCRE in some distributions. Some of the problem issues still occur even if PCRE appears to be compiled with UTF-8 support (6.x at least). Ubuntu seems perfectly fine. I compiled my own Fedora PHP so I don't know about it's packaged versions. My own work. This problem isn't going to vanish anytime soon - there's very little the framework can do except shift down from Unicode against such issues. That causes another problem in how to manage the inconsistency so migrating/installing applications don't bork on the spot when using a simple accented character. It might be useful to distinguish between Alnum for ASCII/ISO and Alnum for Unicode/UTF-8 so a programmer can select which to use themselves. Regards, Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com - Original Message From: Graham Anderson [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Wednesday, June 27, 2007 11:05:16 PM Subject: Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3) On Wednesday 27 June 2007 18:38:07 Darby Felton wrote: Hi Josh, It's already filed as: http://framework.zend.com/issues/browse/ZF-1641 We can post further comments and results there for further investigation. Best regards, Darby Hiya, I can't post to JIRA at the moment so this will have to do in the meantime. From testing on my platforms ( openSUSE/SUSE-OSS 10.0, 10.1, 10.2 ), I have the following results: Up to ( but not including ) apache2-mod_php5-5.2.0-10.rpm testing against the PCRE expression in current Zend_Filter_Alnum passes. From mod_php5 version that ships with openSUSE 10.2 ( 5.2.0-10 ) to the current available in the openSUSE build service, ( 5.2.3-29.1 ), testing against the pattern fails. On openSUSE mod_php5-5.2.0-10 and greater is built against the system PCRE library and not the PHP bundled one, on opensuse 10.2 this is pcre-6.7-21. While patterns with UTF-8 options match against this system library outside of PHP; they do not, for whatever reason match when used inside of PHP. Workaround, on openSUSE 10.2 an upgrade of the system PCRE to the latest available from the openSUSE build service ( pcre-7.1-16 ) will allow pattern matching inside of PHP to function as expected. Cheers Graham Need a vacation? Get great deals to amazing places http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--on Yahoo! Travel. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.10/875 - Release Date: 27/06/2007 21:08 -- Andries Seutens http://andries.systray.be Alnum.php Description: application/php Gecontroleerd op virussen door de JOJO Secure Gateway.
Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3)
One note with this patch of course UTF-8 supports get's dropped when PCRE isn't compiled with UTF-8 and Unicode stuff support. Best, Andries Seutens http://andries.systray.be Andries Seutens schreef: Pádraic, Please try my patched version attached. Let me know if it works, please. Best, Andries Seutens http://andries.systray.be Pádraic Brady schreef: JIRA is down at the moment... I can confirm openSuse as a problem - I've been updated around the packaged versions for some time otherwise my own names gets a few squawks of protest ;). The level of compatility issues seems to indicate a problem with PHP integrating with PCRE in some distributions. Some of the problem issues still occur even if PCRE appears to be compiled with UTF-8 support (6.x at least). Ubuntu seems perfectly fine. I compiled my own Fedora PHP so I don't know about it's packaged versions. My own work. This problem isn't going to vanish anytime soon - there's very little the framework can do except shift down from Unicode against such issues. That causes another problem in how to manage the inconsistency so migrating/installing applications don't bork on the spot when using a simple accented character. It might be useful to distinguish between Alnum for ASCII/ISO and Alnum for Unicode/UTF-8 so a programmer can select which to use themselves. Regards, Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com - Original Message From: Graham Anderson [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Wednesday, June 27, 2007 11:05:16 PM Subject: Re: [fw-general] Re: Zend_Validate_Alnum and Zend_Validate_Alpha failing(ZF1.0RC3) On Wednesday 27 June 2007 18:38:07 Darby Felton wrote: Hi Josh, It's already filed as: http://framework.zend.com/issues/browse/ZF-1641 We can post further comments and results there for further investigation. Best regards, Darby Hiya, I can't post to JIRA at the moment so this will have to do in the meantime. From testing on my platforms ( openSUSE/SUSE-OSS 10.0, 10.1, 10.2 ), I have the following results: Up to ( but not including ) apache2-mod_php5-5.2.0-10.rpm testing against the PCRE expression in current Zend_Filter_Alnum passes. From mod_php5 version that ships with openSUSE 10.2 ( 5.2.0-10 ) to the current available in the openSUSE build service, ( 5.2.3-29.1 ), testing against the pattern fails. On openSUSE mod_php5-5.2.0-10 and greater is built against the system PCRE library and not the PHP bundled one, on opensuse 10.2 this is pcre-6.7-21. While patterns with UTF-8 options match against this system library outside of PHP; they do not, for whatever reason match when used inside of PHP. Workaround, on openSUSE 10.2 an upgrade of the system PCRE to the latest available from the openSUSE build service ( pcre-7.1-16 ) will allow pattern matching inside of PHP to function as expected. Cheers Graham Need a vacation? Get great deals to amazing places http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--on Yahoo! Travel. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.10/875 - Release Date: 27/06/2007 21:08 Gecontroleerd op virussen door de JOJO Secure Gateway. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.10/875 - Release Date: 27/06/2007 21:08 -- Andries Seutens http://andries.systray.be Gecontroleerd op virussen door de JOJO Secure Gateway.
Re: [fw-general] Re: Zend_Validate_Alnum::isValid evaluating alnum strings as false
I tried this snippet on both PC weirdest things happen. See attached files In short: LPC - Local PC - slack (5.2.1) RPC - Remote PC - debian (5.1.6-0.dotdeb.2) on LPC I get warning + returned false on test. on RPC I get no warning + returned true on test. On both I get PCRE is not compiled with UTF-8 and Unicode support See attached files for output + script used. Andries Seutens wrote: Joshua (and others that are facing the same problem), Please try running the following code on the machine where the AlNum filter is failing: ?php if (!preg_match('/\pL/u', 'a')) die('PCRE is not compiled with UTF-8 and Unicode support'); You'll probably see PCRE is not compiled with UTF-8 and Unicode support ... ? Let me/us know if this isn't the case, because that would be really weird. Best, Andries Seutens http://andries.systray.be We are also having problems using Zend_Validate_Alpha and Zend_Validate_Alnum but only on our production RHEL5 server. Using xampp locally on windows XP the same code works perfectly. Prior to 1.0RC3 this worked on production as well. We are running ZF 1.0RC3. Here is the test code(similar to original post): $validator = new Zend_Validate_Alnum(); $vars = array('Alnum' = 'foobar1', 'notAlnum' = '[EMAIL PROTECTED]'); foreach ($vars as $var) { echo $validator-isValid($var) ? $var.:true\n:$var.:false\n; } RHEL5 response: foobar1:false [EMAIL PROTECTED]:false WindowsXP response: foobar1:true [EMAIL PROTECTED]:false RHEL 5 System details: ** PHP 5.1.6 (cli) (built: Apr 4 2007 11:38:24) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies yum info: *** PCRE --- pcre.x86_64 6.6-1.1 installed PHP --- php.x86_64 5.1.6-11.el5 installed php-bcmath.x86_645.1.6-11.el5 installed php-cli.x86_64 5.1.6-11.el5 installed php-common.x86_645.1.6-11.el5 installed php-dba.x86_64 5.1.6-11.el5 installed php-devel.x86_64 5.1.6-11.el5 installed php-gd.x86_645.1.6-11.el5 installed php-imap.x86_64 5.1.6-11.el5 installed php-ldap.x86_64 5.1.6-11.el5 installed php-mbstring.x86_64 5.1.6-11.el5 installed php-mysql.x86_64 5.1.6-11.el5 installed php-ncurses.x86_64 5.1.6-11.el5 installed php-odbc.x86_64 5.1.6-11.el5 installed php-pdo.x86_64 5.1.6-11.el5 installed php-pear.noarch 1:1.4.9-4 installed php-pgsql.x86_64 5.1.6-11.el5 installed php-snmp.x86_64 5.1.6-11.el5 installed php-soap.x86_64 5.1.6-11.el5 installed php-xml.x86_64 5.1.6-11.el5 installed php-xmlrpc.x86_645.1.6-11.el5 installed WindowsXP System details: ** PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies PCRE: * PCRE Library Version = 6.7 04-Jul-2006 Josh Darby Felton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Graham, I just added the potentially offending data to the unit tests for Zend_Validate_Alnum, but I have been unable to reproduce the problem on either of the two following platforms: * PHP 5.1.4, WinXP, PCRE 6.6 * PHP 5.2.1, Ubuntu, PCRE 6.7 Are you on FreeBSD by chance? Anyone else experiencing such a problem? On another note, I would highly recommend upgrading your PHP beyond 5.2.0, which introduced some problems that have since been addressed in later releases. Best regards, Darby Graham Anderson wrote: I updated against trunk and now... require_once('Zend/Validate/Alnum.php'); $validator = new Zend_Validate_Alnum(); $vars = array ( 'Alnum' = 'foobar1', 'NotAlnum' =
Re: [fw-general] Re: Zend_Validate_Alnum::isValid evaluating alnum strings as false
*Warning*: preg_replace() [function.preg-replace http://surveyor.trac.vision22.net/function.preg-replace]: Compilation failed: POSIX named classes are supported only within a class at offset 1 in *blabla/zf/Zend/Filter/Alnum.php* on line *73* Is Alnum: asdf1234 - false on both PC Andries Seutens wrote: Julian, That's good news in some way ;). I sent a patch to the mailing list about an hour ago, please try that version, and let me/us know if it works. Make note that you will not be able to filter UTF-8 strings... Best, Andries Seutens http://andries.systray.be Julian Davchev schreef: I tried this snippet on both PC weirdest things happen. See attached files In short: LPC - Local PC - slack (5.2.1) RPC - Remote PC - debian (5.1.6-0.dotdeb.2) on LPC I get warning + returned false on test. on RPC I get no warning + returned true on test. On both I get PCRE is not compiled with UTF-8 and Unicode support See attached files for output + script used. Andries Seutens wrote: Joshua (and others that are facing the same problem), Please try running the following code on the machine where the AlNum filter is failing: ?php if (!preg_match('/\pL/u', 'a')) die('PCRE is not compiled with UTF-8 and Unicode support'); You'll probably see PCRE is not compiled with UTF-8 and Unicode support ... ? Let me/us know if this isn't the case, because that would be really weird. Best, Andries Seutens http://andries.systray.be We are also having problems using Zend_Validate_Alpha and Zend_Validate_Alnum but only on our production RHEL5 server. Using xampp locally on windows XP the same code works perfectly. Prior to 1.0RC3 this worked on production as well. We are running ZF 1.0RC3. Here is the test code(similar to original post): $validator = new Zend_Validate_Alnum(); $vars = array('Alnum' = 'foobar1', 'notAlnum' = '[EMAIL PROTECTED]'); foreach ($vars as $var) { echo $validator-isValid($var) ? $var.:true\n:$var.:false\n; } RHEL5 response: foobar1:false [EMAIL PROTECTED]:false WindowsXP response: foobar1:true [EMAIL PROTECTED]:false RHEL 5 System details: ** PHP 5.1.6 (cli) (built: Apr 4 2007 11:38:24) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies yum info: *** PCRE --- pcre.x86_64 6.6-1.1 installed PHP --- php.x86_64 5.1.6-11.el5 installed php-bcmath.x86_645.1.6-11.el5 installed php-cli.x86_64 5.1.6-11.el5 installed php-common.x86_645.1.6-11.el5 installed php-dba.x86_64 5.1.6-11.el5 installed php-devel.x86_64 5.1.6-11.el5 installed php-gd.x86_645.1.6-11.el5 installed php-imap.x86_64 5.1.6-11.el5 installed php-ldap.x86_64 5.1.6-11.el5 installed php-mbstring.x86_64 5.1.6-11.el5 installed php-mysql.x86_64 5.1.6-11.el5 installed php-ncurses.x86_64 5.1.6-11.el5 installed php-odbc.x86_64 5.1.6-11.el5 installed php-pdo.x86_64 5.1.6-11.el5 installed php-pear.noarch 1:1.4.9-4 installed php-pgsql.x86_64 5.1.6-11.el5 installed php-snmp.x86_64 5.1.6-11.el5 installed php-soap.x86_64 5.1.6-11.el5 installed php-xml.x86_64 5.1.6-11.el5 installed php-xmlrpc.x86_645.1.6-11.el5 installed WindowsXP System details: ** PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies PCRE: * PCRE Library Version = 6.7 04-Jul-2006 Josh Darby Felton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Graham, I just added the potentially offending data to the unit tests for Zend_Validate_Alnum,
Re: [fw-general] Re: Zend_Validate_Alnum::isValid evaluating alnum strings as false
Updated version attached ... Hard to test like this... can i gain access to your system somehow? if so, please mail me the details in private email. Best, Andries Seutens http://andries.systray.be Julian Davchev schreef: *Warning*: preg_replace() [function.preg-replace http://surveyor.trac.vision22.net/function.preg-replace]: Compilation failed: POSIX named classes are supported only within a class at offset 1 in *blabla/zf/Zend/Filter/Alnum.php* on line *73* Is Alnum: asdf1234 - false on both PC Andries Seutens wrote: Julian, That's good news in some way ;). I sent a patch to the mailing list about an hour ago, please try that version, and let me/us know if it works. Make note that you will not be able to filter UTF-8 strings... Best, Andries Seutens http://andries.systray.be Julian Davchev schreef: I tried this snippet on both PC weirdest things happen. See attached files In short: LPC - Local PC - slack (5.2.1) RPC - Remote PC - debian (5.1.6-0.dotdeb.2) on LPC I get warning + returned false on test. on RPC I get no warning + returned true on test. On both I get PCRE is not compiled with UTF-8 and Unicode support See attached files for output + script used. Andries Seutens wrote: Joshua (and others that are facing the same problem), Please try running the following code on the machine where the AlNum filter is failing: ?php if (!preg_match('/\pL/u', 'a')) die('PCRE is not compiled with UTF-8 and Unicode support'); You'll probably see PCRE is not compiled with UTF-8 and Unicode support ... ? Let me/us know if this isn't the case, because that would be really weird. Best, Andries Seutens http://andries.systray.be We are also having problems using Zend_Validate_Alpha and Zend_Validate_Alnum but only on our production RHEL5 server. Using xampp locally on windows XP the same code works perfectly. Prior to 1.0RC3 this worked on production as well. We are running ZF 1.0RC3. Here is the test code(similar to original post): $validator = new Zend_Validate_Alnum(); $vars = array('Alnum' = 'foobar1', 'notAlnum' = '[EMAIL PROTECTED]'); foreach ($vars as $var) { echo $validator-isValid($var) ? $var.:true\n:$var.:false\n; } RHEL5 response: foobar1:false [EMAIL PROTECTED]:false WindowsXP response: foobar1:true [EMAIL PROTECTED]:false RHEL 5 System details: ** PHP 5.1.6 (cli) (built: Apr 4 2007 11:38:24) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies yum info: *** PCRE --- pcre.x86_64 6.6-1.1 installed PHP --- php.x86_64 5.1.6-11.el5 installed php-bcmath.x86_645.1.6-11.el5 installed php-cli.x86_64 5.1.6-11.el5 installed php-common.x86_645.1.6-11.el5 installed php-dba.x86_64 5.1.6-11.el5 installed php-devel.x86_64 5.1.6-11.el5 installed php-gd.x86_645.1.6-11.el5 installed php-imap.x86_64 5.1.6-11.el5 installed php-ldap.x86_64 5.1.6-11.el5 installed php-mbstring.x86_64 5.1.6-11.el5 installed php-mysql.x86_64 5.1.6-11.el5 installed php-ncurses.x86_64 5.1.6-11.el5 installed php-odbc.x86_64 5.1.6-11.el5 installed php-pdo.x86_64 5.1.6-11.el5 installed php-pear.noarch 1:1.4.9-4 installed php-pgsql.x86_64 5.1.6-11.el5 installed php-snmp.x86_64 5.1.6-11.el5 installed php-soap.x86_64 5.1.6-11.el5 installed php-xml.x86_64 5.1.6-11.el5 installed php-xmlrpc.x86_645.1.6-11.el5 installed WindowsXP System details: ** PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies PCRE: * PCRE Library Version = 6.7 04-Jul-2006 Josh Darby Felton [EMAIL PROTECTED] wrote in message
[fw-general] Zend_Acl custom assertions
Hello, i just want to know if there's a good solution to get the request-object within the assert method? I think there are several situations where the request object is required to determine if the client has access to the requested resource. i.e. ?php class Project_Acl_Assert_ForumPostEdit implements Zend_Acl_Assert_Interface { public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null) { // get the request object // get the requested post $posts = new ForumPosts(); $post = $posts-find($req-_getParam(id))-current(); // compare author with authenticated client return Zend_Auth::getInstance()-getIdentity()-id == $post-author_id; } } ? with kind regards, Daniel
[fw-general] Zend Event/Subscription Component?
Hi, Are there any plans to introduce an event/subscription component in ZF? Whereby somehow an object could register a subscription to a particular event in another object, and then when that occurs the object can trigger an event, and the event/subscription registry notify all of the subscribers? That was probably a bad description, but I hope you know what I mean. Thanks, Jack -- View this message in context: http://www.nabble.com/Zend-Event-Subscription-Component--tf3993696s16154.html#a11340782 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend Event/Subscription Component?
You mean an observer? :) I believe there's already one in SPL in 5.2 so I don't think ZF needs one specifically. Hi, Are there any plans to introduce an event/subscription component in ZF? Whereby somehow an object could register a subscription to a particular event in another object, and then when that occurs the object can trigger an event, and the event/subscription registry notify all of the subscribers? That was probably a bad description, but I hope you know what I mean. Thanks, Jack -- View this message in context: http://www.nabble.com/Zend-Event-Subscription-Component--tf3993696s16154.html#a11340782 Sent from the Zend Framework mailing list archive at Nabble.com. -- Simon Mundy | Director | PEPTOLAB 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
Re: [fw-general] Zend Event/Subscription Component?
Yes I do :) , will have to check out the SPL one, thanks! -- Jack
[fw-general] Calling actions from PHP-CLI
Hi I have an Action which I want to run from a cronjob. Which is the best way to go? Calling the URL with curl or something like that? Or use the PHP-CLI? I don't know how to call the action with PHP-CLI. Any suggestions? Thanks -- Xavier Vidal Piera Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] 610.68.41.78
Re: [fw-general] Routing issues
-- Nathan Bell [EMAIL PROTECTED] wrote (on Wednesday, 27 June 2007, 04:22 PM -0700): We're seeing issues with RC3 (RC2 and RC1 work as expected): http://example.com/controller/action routes to indexController - indexAction http://example.com/index.php/controller/action routes properly to controllerController - actionAction What has changed in RC3 that could cause this? Tried stripping our bootstrap file to the bare minimum, still having issues. [ .htaccess ] RewriteEngine on RewriteRule !\.(js|ico|GIF|JPG|gif|jpg|png|css|swf)$ index.php I notice at least two others have posted similiar issues here. Anyone able to fix it? I haven't observed any issues, personally, on sites I'm developing using latest SVN. I didn't do any changes to either the router or dispatcher between RC2 and RC3 (other than to make sure a missing exception class was included in the dispatcher), though I know Martel fixed at least one issue in the router for this release. Could you give some example code -- your bootstrap and directory layout -- so I can try and reproduce the issue? -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Re: Zend_Validate_Alnum::isValid evaluating alnum strings as false
Issue resolved in r5468. Andries Seutens http://andries.systray.be Andries Seutens schreef: Updated version attached ... Hard to test like this... can i gain access to your system somehow? if so, please mail me the details in private email. Best, Andries Seutens http://andries.systray.be Julian Davchev schreef: *Warning*: preg_replace() [function.preg-replace http://surveyor.trac.vision22.net/function.preg-replace]: Compilation failed: POSIX named classes are supported only within a class at offset 1 in *blabla/zf/Zend/Filter/Alnum.php* on line *73* Is Alnum: asdf1234 - false on both PC Andries Seutens wrote: Julian, That's good news in some way ;). I sent a patch to the mailing list about an hour ago, please try that version, and let me/us know if it works. Make note that you will not be able to filter UTF-8 strings... Best, Andries Seutens http://andries.systray.be Julian Davchev schreef: I tried this snippet on both PC weirdest things happen. See attached files In short: LPC - Local PC - slack (5.2.1) RPC - Remote PC - debian (5.1.6-0.dotdeb.2) on LPC I get warning + returned false on test. on RPC I get no warning + returned true on test. On both I get PCRE is not compiled with UTF-8 and Unicode support See attached files for output + script used. Andries Seutens wrote: Joshua (and others that are facing the same problem), Please try running the following code on the machine where the AlNum filter is failing: ?php if (!preg_match('/\pL/u', 'a')) die('PCRE is not compiled with UTF-8 and Unicode support'); You'll probably see PCRE is not compiled with UTF-8 and Unicode support ... ? Let me/us know if this isn't the case, because that would be really weird. Best, Andries Seutens http://andries.systray.be We are also having problems using Zend_Validate_Alpha and Zend_Validate_Alnum but only on our production RHEL5 server. Using xampp locally on windows XP the same code works perfectly. Prior to 1.0RC3 this worked on production as well. We are running ZF 1.0RC3. Here is the test code(similar to original post): $validator = new Zend_Validate_Alnum(); $vars = array('Alnum' = 'foobar1', 'notAlnum' = '[EMAIL PROTECTED]'); foreach ($vars as $var) { echo $validator-isValid($var) ? $var.:true\n:$var.:false\n; } RHEL5 response: foobar1:false [EMAIL PROTECTED]:false WindowsXP response: foobar1:true [EMAIL PROTECTED]:false RHEL 5 System details: ** PHP 5.1.6 (cli) (built: Apr 4 2007 11:38:24) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies yum info: *** PCRE --- pcre.x86_64 6.6-1.1 installed PHP --- php.x86_64 5.1.6-11.el5 installed php-bcmath.x86_645.1.6-11.el5 installed php-cli.x86_64 5.1.6-11.el5 installed php-common.x86_645.1.6-11.el5 installed php-dba.x86_64 5.1.6-11.el5 installed php-devel.x86_64 5.1.6-11.el5 installed php-gd.x86_645.1.6-11.el5 installed php-imap.x86_64 5.1.6-11.el5 installed php-ldap.x86_64 5.1.6-11.el5 installed php-mbstring.x86_64 5.1.6-11.el5 installed php-mysql.x86_64 5.1.6-11.el5 installed php-ncurses.x86_64 5.1.6-11.el5 installed php-odbc.x86_64 5.1.6-11.el5 installed php-pdo.x86_64 5.1.6-11.el5 installed php-pear.noarch 1:1.4.9-4 installed php-pgsql.x86_64 5.1.6-11.el5 installed php-snmp.x86_64 5.1.6-11.el5 installed php-soap.x86_64 5.1.6-11.el5 installed php-xml.x86_64 5.1.6-11.el5 installed php-xmlrpc.x86_645.1.6-11.el5 installed WindowsXP System details: ** PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies PCRE: * PCRE
Re: [fw-general] Calling actions from PHP-CLI
-- Xavier Vidal Piera [EMAIL PROTECTED] wrote (on Thursday, 28 June 2007, 01:48 PM +0200): I have an Action which I want to run from a cronjob. Which is the best way to go? Calling the URL with curl or something like that? Or use the PHP-CLI? I don't know how to call the action with PHP-CLI. There are a couple options. First, you can re-create your bootstrap, but instead of letting the front controller create the request, you'd create it yourself: ?php // .. setup bootstrap... // Setup request: // Provide the URL which you'd normally call for the action: $request = new Zend_Controller_Request_Http('http://host/controller/action'); // Use a CLI response, so that redirects won't throw exceptions: require_once 'Zend/Controller/Response/Cli.php'; $response = new Zend_Controller_Response_Cli(); // Dispatch: $front-dispatch($request, $response); The other option is to use the CLI request object, which is currently in proposal form; search on the wiki for Zend_Controller_Request_Cli. This request allows you to specify a controller and action on the command line, which would allow you to create a single CLI bootstrap and use it to call any action in your application. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend_Acl custom assertions
Hi Daniel, The request object may be fetched in a controller action method using $this-getRequest(), and controller plugins also receive the request in preDispatch(), among other methods. If your authorization code is in neither of these places, please let us know if you are still having problems getting to the request object. Sorry for the multiple mailings! Best regards, Darby Darby Felton wrote: Oops... I mean the /request/ object. :) Darby Felton wrote: Hi Daniel, Zend_Acl_Assert_Interface::assert() is not special regarding access to the response object, but you should be able to get to it pretty easily. For example, you can set the response object as a property of an instance of your assertion class, allowing assert() access to it: class MyAssert implements Zend_Acl_Assert_Interface { public function __construct($response) { $this-response = $response; } public function assert(...) { // do something with $this-response } } For information on how to fetch the response object, please see: http://framework.zend.com/manual/en/zend.controller.response.html Hope this helps! Best regards, Darby Daniel Freudenberger wrote: Hello, i just want to know if there’s a good solution to get the request-object within the assert method? I think there are several situations where the request object is required to determine if the client has access to the requested resource. i.e. ?php class Project_Acl_Assert_ForumPostEdit implements Zend_Acl_Assert_Interface { public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null) { // get the request object // get the requested post $posts = new ForumPosts(); $post = $posts-find($req-_getParam(“id“))-current(); // compare author with authenticated client return Zend_Auth::getInstance()-getIdentity()-id == $post-author_id; } } ? with kind regards, Daniel
[fw-general] Lucene termvector?
Hello, fw-general. It turned out that i need to store all positions of each term within a document - i believe this is called termvector. Is it possible to store termvectors in Zend Lucene? -- Best regards, Peter mailto:[EMAIL PROTECTED]
Re: [fw-general] Model Loading helper (Everyone likes diagrams!)
How about this? Zend_Loader::loadClass('Users', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'models'); I can almost hear the boos, but it works for a conventional modular layout. Personally I'd like to see Zend_Controller_Action provide the info so I could do this: Zend_Loader::loadClass('Users', $this-getModuleDirectory() . DIRECTORY_SEPARATOR . 'models'); No need for another helper class. No need to bloat your include_path or bloat your boostrap. Correct me if I'm wrong but I think Padraic advocates read only model access from views so not sure that this would help in that, but I'm almost excited about the big throwdown at: http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS.+Zend_Layout+Throwdown I don't get out much :) Regards, Mark Shahar Evorn wrote: I generally like the idea as long as it is kept optional. I personally like to load models by defining a model path (eg. APP_MODEL_DIR) constant in my bootstrap file, and then call Zend_Loader::loadClass('User', APP_MODEL_DIR); whenever I need to. IMHO it's clean enough and super fast, and I don't like the idea of loading an extra class and calling some methods just for loading a model class. Shahar. -- View this message in context: http://www.nabble.com/Model-Loading-helper-tf3942096s16154.html#a11345909 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Routing issues
Matthew, I believe I have found what is causing this issue. When I upgraded to RC3 I had the same issue as Nathan Bell. Also, I send the BaseUrl and the BasePath to my views and prior to RC3 they were both empty strings. Using RC3 $BaseUrl == \ and $BasePath == /index.php. After searching around a bit I found the problem in Zend_Controller_Request_Http. Line 327 and 328 (in the setRequestUri() method) were added in RC3 and they read: } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite $requestUri = $_SERVER['REDIRECT_URL']; I found that commenting out these two lines fixed the issue. My .htaccess file: RewriteEngine On # Rewrite non-multimedia to index.php RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php Hopefully this'll point someone in the right direction to solve this before the final release so I don't have to go in and comment this out every time I upgrade (Then again, if I must I suppose I can do a unset($_SERVER['REDIRECT_URL']) but I'd rather not) :-) Best Regards, Nick Howell
Re: [fw-general] Routing issues
-- Nick Howell [EMAIL PROTECTED] wrote (on Thursday, 28 June 2007, 01:47 PM -0400): I believe I have found what is causing this issue. When I upgraded to RC3 I had the same issue as Nathan Bell. Also, I send the BaseUrl and the BasePath to my views and prior to RC3 they were both empty strings. Using RC3 $BaseUrl == \ and $BasePath == /index.php. After searching around a bit I found the problem in Zend_Controller_Request_Http. Line 327 and 328 (in the setRequestUri() method) were added in RC3 and they read: } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite $requestUri = $_SERVER['REDIRECT_URL']; I found that commenting out these two lines fixed the issue. Ah, right -- those have actually been removed in recent SVN. Please test and confirm. (I created a separate HTTP request object for those needing that line.) -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Routing issues
Ah, the latest SVN works perfectly (I should've checked that! :x). Thank you much. Regards, Nick Howell
[fw-general] numRows method missing in db adapter
I am using the MySqli adapter for our xmlrpc data api. We recently decided to use the Zend_Db classes just to maintain consistency... before we were using our own custom MySqli adapter class that we wrote to support slave database servers and so on... well as I am porting the code to Zend_Db I noticed that there is my method to return a count of rows from a query... what's up with that? Am I just missing something or being we todd did? Shawn McAllister
RE: [fw-general] numRows method missing in db adapter
there is my method should have read there is NO method From: Shawn McAllister [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 3:44 PM To: fw-general@lists.zend.com Subject: [fw-general] numRows method missing in db adapter I am using the MySqli adapter for our xmlrpc data api. We recently decided to use the Zend_Db classes just to maintain consistency... before we were using our own custom MySqli adapter class that we wrote to support slave database servers and so on... well as I am porting the code to Zend_Db I noticed that there is my method to return a count of rows from a query... what's up with that? Am I just missing something or being we todd did? Shawn McAllister
Re: [fw-general] numRows method missing in db adapter
You can use $stmt-rowCount(). Arthur Shawn McAllister wrote: I am using the MySqli adapter for our xmlrpc data api. We recently decided to use the Zend_Db classes just to maintain consistency... before we were using our own custom MySqli adapter class that we wrote to support slave database servers and so on... well as I am porting the code to Zend_Db I noticed that there is my method to return a count of rows from a query... what's up with that? Am I just missing something or being we todd did? Shawn McAllister
RE: [fw-general] numRows method missing in db adapter
ok... well the docs need to reflect this... currently they say Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object. Shawn McAllister From: Arthur M. Kang [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 3:44 PM To: Shawn McAllister Cc: fw-general@lists.zend.com Subject: Re: [fw-general] numRows method missing in db adapter You can use $stmt-rowCount(). Arthur Shawn McAllister wrote: I am using the MySqli adapter for our xmlrpc data api. We recently decided to use the Zend_Db classes just to maintain consistency... before we were using our own custom MySqli adapter class that we wrote to support slave database servers and so on... well as I am porting the code to Zend_Db I noticed that there is my method to return a count of rows from a query... what's up with that? Am I just missing something or being we todd did? Shawn McAllister
Re: [fw-general] Two-Step View, subclassing controller, etc
-- Christopher Thompson [EMAIL PROTECTED] wrote (on Thursday, 28 June 2007, 12:17 PM -0700): I agree with Matthew that identifying the actual use cases that people are requesting and then showing the code that solves those use cases in the proposed systems is necessary. The issue is that there are currently two distinct approaches to the issue of how to include layout support, both of which are valid. The question, to me, is which makes more sense in the context of the existing components and leverages existing functionality best. Also, as you note, there are slightly different use cases, and I think the what of each use case needs to be better detailed, as often detailing what the desired outcome is will better inform the how of implementation. I have had discussions with Pádraic on this subject and looked at his and Ralph's code. While I think we agree on the goals, I think they are trying to solve specific problems rather than providing support in the Zend_View for solving problems. That is a big difference and has been the problem to date. Things like viewRenderer() are solutions to only a narrow set of problems Indeed, the goals of the ViewRenderer were clearly laid out in the proposal and the documentation. From the ViewRenderering documentation, the goals were: * Eliminate the need to instantiate view objects within controllers; view objects will be automatically registered with the controller. * Automatically set view script, helper, and filter paths based on the current module, and automatically associate the current module name as a class prefix for helper and filter classes. * Create a globally available view object for all dispatched controllers and actions. * Allow the developer to set default view rendering options for all controllers. * Add the ability to automatically render a view script with no intervention. * Allow the developer to create her own specifications for the view base path and for view script paths. and they do not make Zend_View more flexible -- only more confusing. The ViewRenderer is not an extension to Zend_View. It is a way of providing convention over configuration to the MVC layer -- follow a particular set of rules, and things will be done behind the scenes in a predictable way. It uses the existing functionality of Zend_View, and simply defines some rules for how to name your view scripts so that the controller can auto-render them. I'd love to hear what you find more confusing so I can either clarify things in the documentation or update the code to make things more clear. You can keep tacking things on until you get coverage, or you can go back and reimplement the internals to support BC first and then the other requested schemes. And it is important to note that the solution here is not just in Zend_View, but necessarily in the Action and Http_Response as well as they are all a related system. I don't think there's much change needed in the internals. But you're absolutely right -- there are a variety of components that need to be touched or extended to make this work. I like the idea of using View and/or Action helpers and controller plugins, as these leverage existing functionality and keep all code fully BC. Loose coupling, and all. We'll revisit the issue post-1.0. Matthew Ratzloff wrote: Ralph, you're one step ahead of me. But instead of broad dissertations on the role of Controllers, Views, and Models, what I'd like to see is concrete end-user code showing how each would work. Not just controllers, but sample views as well. Establish a use case and then show how each solution would solve it. Since Pádraic has already put up a proposal, what you might do is copy his use cases into your Layout Throwdown '07 wiki page and then translate them to how Zend_Layout works. I also would really, really like to see layout support integrated into Zend Framework as soon as possible. The difference is that if that's a 1.1 release two to four weeks down the road, that's fine. The key is releasing soon after 1.0. -Matt On Tue, June 26, 2007 9:30 am, Ralph Schindler wrote: Oh yeah! This is turning into a Bobby Flay style - Zend What do we do with layouts Throwdown! In all seriousness, it would be fruitless to respond to this here. I think we should move this to the wiki, in a QA style, left-right - left being the ZVE POV and right being the Zend_Layout POV. This will allow us to track the goals, design notes, and discussions that are taking place, and in a more structured (less FUD) fashion. http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS.+Zend_Layout+Throwdown I also think we should both develop sites on our proposed solutions so that we may better demonstrate our points, what do you think of that? -ralph Pádraic Brady wrote: Ralph, You'll have to forgive me, but I haven't read all your code yet -
[fw-general] ZF Application Variables?
Hi, Are there any plans to introduce an application variable type system in ZF? Something like this: http://www.leosingleton.com/projects/code/phpapp/ As far as I'm aware this is something PHP cant do. If this is something you would be interested in adding I would be happy to help with a proposal/coding/development. Thanks, Jack -- View this message in context: http://www.nabble.com/ZF-Application-Variables--tf3996469s16154.html#a11349949 Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] ViewRenderer inconsistency with routes and view scripts
ViewRenerer is inconsisteny with the default routes and possibly custom routes because instead of rendering 'actionName.phtml' which would be consistent with the name of the action it renders the action specified in the url. An example of this would be valid urls /foo/fooBar and /foo/foo_bar which would route to the same action in controller foo and action fooBarAction(). The problem here is with ViewRenderer, it will use the action supplied in the url for the name of the view script. So /foo/fooBar would render fooBar.phtml while /foo/foo_bar would render 'foo_bar.phtml' this is a problem because it would throw a 'cannot find view script' exception on a valid url from the router's point of view. Some may argue that this doesn't matter, but VR should be consistent with the rest of the framework. A route that is valid should be translated no matter the view script name. Suppose only intended the user to visit /foo/foobar, but the user visits /foo/foo_bar then they would get a 'view script' not found exception (usually caught by the errorController) but the point is that the action was dispatched, so VR should render the view. If you still don't understand what I just said (I know, it's confusing), but the problem is VR translates whatever was provided by ':action' in the spec as the view script to render. The solution I believe is that VR should stick to a solid naming convention for view scripts either by actionName.phtml or something. -- View this message in context: http://www.nabble.com/ViewRenderer-inconsistency-with-routes-and-view-scripts-tf3996483s16154.html#a11349989 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] ZF Application Variables?
I don't think so, there really isn't a need for it with all the current features... Registry etc... Another reason is it looks like bad practice to me. -- View this message in context: http://www.nabble.com/ZF-Application-Variables--tf3996469s16154.html#a11350087 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] ViewRenderer inconsistency with routes and view scripts
There is an inconsistency here, and I am getting to the root of the problem. PotatoBob wrote: ViewRenerer is inconsisteny with the default routes and possibly custom routes because instead of rendering 'actionName.phtml' which would be consistent with the name of the action it renders the action specified in the url. Technically, ViewRenderer maintains a convention of dash-seperated script names (for the action). Personally, I used to use under_score, but since have switched to the dashed-name convention as it is ultimately cleaner, and agrees with other conventions outside of file names itself (google urls, and css naming conventions). An example of this would be valid urls /foo/fooBar and /foo/foo_bar which would route to the same action in controller foo and action fooBarAction(). The problem here is with ViewRenderer, it will use the action supplied in the url for the name of the view script. So /foo/fooBar would render fooBar.phtml while /foo/foo_bar would render 'foo_bar.phtml' this is a problem because it would throw a 'cannot find view script' exception on a valid url from the router's point of view. There is a bug here.. basically if an action can be dispatched, then there should be only one logical name for a view script based on whatever convention is enforced at the ViewRenderer layer. Some may argue that this doesn't matter, but VR should be consistent with the rest of the framework. A route that is valid should be translated no matter the view script name. Routes are apples, View/Controller integration is oranges. I can define routes that having nothing to do with action names in the url.. actionName.phtml or something. Personally, I am not a fan of camelCase file names. I do like under_score, but dashed-names for me has emerged as a favorite for a number of reasons. -ralph
RE: [fw-general] ZF Application Variables?
Instead of accessing superglobals in your view, it would probably be better to pass to the View a Model object which has methods to do these kinds of actions. In general I think it is a good practice for a View to treat data as read-only and not alter values or invoke side-effects. But there's nothing preventing you from writing a Model class with methods that have side-effects, and calling those methods from within a View script. Application variables solution: ?php echo $_APP['visitor_count']++; ? MVC solution: ?php echo $this-model-getVisitorCount(); $this-model-incrementVisitorCount(); ? Regards, Bill Karwin -Original Message- From: Jack Sleight [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 1:00 PM To: fw-general@lists.zend.com Subject: [fw-general] ZF Application Variables? Hi, Are there any plans to introduce an application variable type system in ZF? Something like this: http://www.leosingleton.com/projects/code/phpapp/ As far as I'm aware this is something PHP cant do. If this is something you would be interested in adding I would be happy to help with a proposal/coding/development. Thanks, Jack -- View this message in context: http://www.nabble.com/ZF-Application-Variables--tf3996469s1615 4.html#a11349949 Sent from the Zend Framework mailing list archive at Nabble.com.
RE: [fw-general] numRows method missing in db adapter
SQL databases do not report the number of rows that are expected to be returned by a query. The information is simply not available until after the client has fetched the rows. All client libraries that offer a method numRows() (or a method with similar functionality) work by first fetching all the rows until the result set is complete, and then doing a count() on the resulting array of rows. For example read this text from: http://dev.mysql.com/doc/refman/5.0/en/mysql-num-rows.html The use of mysql_num_rows() depends on whether you use mysql_store_result() or mysql_use_result() to return the result set. If you use mysql_store_result(), mysql_num_rows() may be called immediately. If you use mysql_use_result(), mysql_num_rows() does not return the correct value until all the rows in the result set have been retrieved. So you can do this in Zend Framework in the following way: $result = $db-fetchAll( $select ); echo count($result); Regards, Bill Karwin From: Shawn McAllister [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 12:51 PM To: fw-general@lists.zend.com Subject: RE: [fw-general] numRows method missing in db adapter ok... well the docs need to reflect this... currently they say Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object. Shawn McAllister From: Arthur M. Kang [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 3:44 PM To: Shawn McAllister Cc: fw-general@lists.zend.com Subject: Re: [fw-general] numRows method missing in db adapter You can use $stmt-rowCount(). Arthur Shawn McAllister wrote: I am using the MySqli adapter for our xmlrpc data api. We recently decided to use the Zend_Db classes just to maintain consistency... before we were using our own custom MySqli adapter class that we wrote to support slave database servers and so on... well as I am porting the code to Zend_Db I noticed that there is my method to return a count of rows from a query... what's up with that? Am I just missing something or being we todd did? Shawn McAllister
Re: [fw-general] ViewRenderer inconsistency with routes and view scripts
-- Ralph Schindler [EMAIL PROTECTED] wrote (on Thursday, 28 June 2007, 03:10 PM -0500): There is an inconsistency here, and I am getting to the root of the problem. PotatoBob wrote: An example of this would be valid urls /foo/fooBar and /foo/foo_bar which would route to the same action in controller foo and action fooBarAction(). The problem here is with ViewRenderer, it will use the action supplied in the url for the name of the view script. So /foo/fooBar would render fooBar.phtml while /foo/foo_bar would render 'foo_bar.phtml' this is a problem because it would throw a 'cannot find view script' exception on a valid url from the router's point of view. There is a bug here.. basically if an action can be dispatched, then there should be only one logical name for a view script based on whatever convention is enforced at the ViewRenderer layer. I think I know already what the bug is, and should be able to fix it pretty easily. Please create a JIRA issue detailing the above so I can resolve it. Thanks! -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Working with Paths
Hello, I'm not currently using Zend Framework although I'm observing it's evolution waiting for the final release and studying its applicability into my projects. One thing that poped into my mind lately is how I should deal with paths within Zend Framework. Is there any built in solution for this? For this I mean a way to reference the application base directory and define other key directories to be used in the code instead of writing the path everytime. I'm used to create constants to define paths. What about Zend Framework? What about modules that have they own javascript and css files for instance? How should I organize them? Thank you, Luiz
Re: [fw-general] Working with Paths
[EMAIL PROTECTED] wrote: Hello, I'm not currently using Zend Framework although I'm observing it's evolution waiting for the final release and studying its applicability into my projects. One thing that poped into my mind lately is how I should deal with paths within Zend Framework. Is there any built in solution for this? For this I mean a way to reference the application base directory and define other key directories to be used in the code instead of writing the path everytime. I'm used to create constants to define paths. What about Zend Framework? What about modules that have they own javascript and css files for instance? How should I organize them? Thank you, Luiz I think you should take a look at the Zend_Config component. It would definitely serve your needs. http://framework.zend.com/manual/en/zend.config.html Cheers Shaun
[fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
Re: [fw-general] Modular System with submodules
unbelievable that noone ever needed a modularsystem with more than one subsection. Or is it just to easy that I do not see the solution? Daniel Tangermann schrieb: I finally have a working modular system together with smarty and maintemplates. My file-structure is: /application /modules /foo1 /controllers IndexController.php /foo2 /controllers IndexController.php /views /scripts /foo1 footemplate1.tpl /foo2 footemplate2.tpl maintemplate.tpl I know that in every module there should be a views folder for the subtemplates, but this will not work for me together with the smarty + maintemplate solution, but this is ok for me right now. I set up the module-dir in the bootstrap with: $controller-addModuleDirectory('./application/modules'). Working fine for now, but what do I have to do to have some of the modules having seperate modules like /application /modules /submodule1 /foo1 /controllers /foo2 /controllers /modulewithoutsubs /controllers Maybe you can give me a hint. Daniel
Re: [fw-general] Modular System with submodules
Hi Daniel, why don't you just use multiple controllers instead of submodules with one index controller each? Or do I miss something? Greetz, Sascha Daniel Tangermann schrieb: unbelievable that noone ever needed a modularsystem with more than one subsection. Or is it just to easy that I do not see the solution? Daniel Tangermann schrieb: I finally have a working modular system together with smarty and maintemplates. My file-structure is: /application /modules /foo1 /controllers IndexController.php /foo2 /controllers IndexController.php /views /scripts /foo1 footemplate1.tpl /foo2 footemplate2.tpl maintemplate.tpl I know that in every module there should be a views folder for the subtemplates, but this will not work for me together with the smarty + maintemplate solution, but this is ok for me right now. I set up the module-dir in the bootstrap with: $controller-addModuleDirectory('./application/modules'). Working fine for now, but what do I have to do to have some of the modules having seperate modules like /application /modules /submodule1 /foo1 /controllers /foo2 /controllers /modulewithoutsubs /controllers Maybe you can give me a hint. Daniel
Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
Congratulations :-) Bill Karwin wrote: Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
Re: [fw-general] ZF Application Variables?
Hmmm, well, the fact that it is a global in the example I gave isn't actually relevant to the concept I was trying to suggest. What I meant by Application Variables is variables that not only persist over multiple requests (session variables) but also persist across all sessions. They could be used to store a particular object that all users/sessions could access, for example a list of users currently logged into a chat room application. Its basically a storage mechanism for data/variables that all users of the website/application have access to, like a database, but without the database. From the article I posted: Application variables in ASP work very similar to the $_SESSION variable in PHP. However, unlike the $_SESSION variable, application variables are not specific to an individual user; they persist across every user of every page on the web site. PotatoBob wrote: I don't think so, there really isn't a need for it with all the current features... Registry etc... Another reason is it looks like bad practice to me to add any more global variables. -- View this message in context: http://www.nabble.com/ZF-Application-Variables--tf3996469s16154.html#a11351770 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] ZF Application Variables?
Sorry, I just ready Bills post and what he suggested makes what I was proposing possible anyway. PotatoBob wrote: I don't think so, there really isn't a need for it with all the current features... Registry etc... Another reason is it looks like bad practice to me to add any more global variables. -- View this message in context: http://www.nabble.com/ZF-Application-Variables--tf3996469s16154.html#a11351888 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] ZF Application Variables?
Application variables add a significant amount of scaling problems. But they're not exactly a database either. There's a lot of ways to do IPC in PHP; .. the SRM for one, or transient storage like memcache can also store app variables without needing a persistent storage mechanism like a database. K - Original Message - From: Bill Karwin To: fw-general@lists.zend.com Sent: Thursday, June 28, 2007 4:56 PM Subject: RE: [fw-general] ZF Application Variables? They call that a database. Bill From: Jack Sleight [mailto:[EMAIL PROTECTED] From the article I posted: Application variables in ASP work very similar to the $_SESSION variable in PHP. However, unlike the $_SESSION variable, application variables are not specific to an individual user; they persist across every user of every page on the web site.
Re: [fw-general] Two-Step View, subclassing controller, etc
Matthew Weier O'Phinney wrote: -- Christopher Thompson [EMAIL PROTECTED] wrote The issue is that there are currently two distinct approaches to the issue of how to include layout support, both of which are valid. The question, to me, is which makes more sense in the context of the existing components and leverages existing functionality best. Also, as you note, there are slightly different use cases, and I think the what of each use case needs to be better detailed, as often detailing what the desired outcome is will better inform the how of implementation. I don't think there are just two, but more like 4-5. However, I think that they are all a subsets of a more general scheme that they could be implemented on top of. Indeed, the goals of the ViewRenderer were clearly laid out in the proposal and the documentation. From the ViewRenderering documentation, the goals were: I don't question the need for a non-MVC shortcut to render pages, but I think internally is was don't as a tacked on feature rather than building on a generic core. I'd love to hear what you find more confusing so I can either clarify things in the documentation or update the code to make things more clear. I understand it, but I have poured over the code and written frameworks, so I am not the target audience. Every time I hear the explanations of how this stuff works on the lists I have to shake my head. There are lots of settings; dispatchLoopShutdown() gets bandied about as if it is a normal/obvious solution; different schemes are needed to achieve similar things; Controller and View responsibilities are scattered about. Rendering has evolved from the original not-very-clear system to a fairly obscure one -- and it still does not really support hierarchical Views which is the gold standard. We'll revisit the issue post-1.0. I think define the use cases, from implicit rendering, through simple/single View, to Two-Step, to hierarchical, and see what solution solves them all in the simplest, cleanest, most flexible fashion.
Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
Hip hip hooraaay! On 6/29/07, Nick Mohr [EMAIL PROTECTED] wrote: Congratulations :-) Bill Karwin wrote: Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
It is exciting even if the Zend_Coding_Made_So_Easy_I_Cant_Believe_Its_Not_Butter class will have to wait until version 1.1. Has there been any news on that one? For me, the MVC code is the single most toughest thing to grip on. I find the general library so damn easy it's a delight. Perhaps the MVC will in fact going to become the jewel in the crown for ZF in time with careful maturation. I love the importance given to decoupling and the release that this gives me from that lock in feeling experienced on so many otherwise worthy frameworks elsewhere. As I experience it, ZF is truly a library first that almost magically forms an elegant framework by innate design. Surely the big trick to the MVC should be conventions? You want flexibility? It's there. You want to see MVC intelligence, follow the conventions and it will do the heavy lifting for you. I think the growth in default conventions within the MVC is crucial to keeping it user friendly for noobs like me. I'm particularly lookiing forward to the View side to developing more and a universal Zend Framework Official Demo steadily refocusing on best practices and real world concerns. Thank you for ZF. I'm still a noob but hope to contirbute. Regards, Mark Maynereid On Friday 29 June 2007 01:18, Dylan Arnold wrote: Hip hip hooraaay! On 6/29/07, Nick Mohr [EMAIL PROTECTED] wrote: Congratulations :-) Bill Karwin wrote: Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
*CONGRATS*!! I'm couldn't afford to be a code contributor to the framework but just pointed out a few bugs and suggested some enhancements. It's great to see the framework come a long way and to be invoved in its evolvution as it matured into 1.0.0 induces a sentimental attachment to it. Yes, it's a high-quality framework with decoupled components and does the heavy-lifting. A great design and a great job from you all and keep up the good work... Zend Framework is a - *magic*! And, it rocks!! Regards, Shekar Reddy On 6/28/07, Dylan Arnold [EMAIL PROTECTED] wrote: Hip hip hooraaay! On 6/29/07, Nick Mohr [EMAIL PROTECTED] wrote: Congratulations :-) Bill Karwin wrote: Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
Gratz, the feature request for next releases is: less typing ^^ On 29/06/07, Bill Karwin [EMAIL PROTECTED] wrote: Hi all, We are planning to call a code-freeze tomorrow, Friday 6/29 at 4:00pm PDT (midnight GMT). This release will be tagged 1.0.0. Please click on C:\Windows\Media\tada.wav now. :-) Thanks to the efforts of dozens of developers for many months, we are here. This isn't the end of the game for Zend Framework, but it is the beginning of a new phase of development and maturity. After I update the downloads for this release tomorrow evening, I'll email out to ask you to download it and try it. We know there are still 47 open bugs in Zend Framework (all other open issues are feature requests, etc.) but there are none severe enough to delay the release. They will be fixed in 1.0.1 or subsequent releases. Regards, Bill Karwin
RE: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA
LOL! We decided to rename that class Zend_DoWhatIMean. Actually, it's Zend_DoWhatIMean_Abstract. Users are encouraged to extend the class to... you know... do what they mean. Bill -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 8:01 PM To: fw-general@lists.zend.com Subject: Re: [fw-general] Code Freeze for ZF 1.0.0 RC4 / GA It is exciting even if the Zend_Coding_Made_So_Easy_I_Cant_Believe_Its_Not_Butter class will have to wait until version 1.1. Has there been any news on that one?
[fw-general] YOU KNOW WHAT TIME IT IS?!?!?!
Wiki down time, thats right kids, Java's own personal gift to the zend framework. Can someone put paddles on the server and jumpstart the tomcats heart?
Re: [fw-general] Modular System with submodules
We are doing something very close from what you call submodules by using static path. Make routes like this in routes.ini routes.submodule1.route = submodule1/:module/:controller/:action/* routes.submodule2.route = submodule2/:module/:controller/:action/* Then in bootstrap, with frontcontroller, you add all module dirs // For regulars modules path $frontController-addModuleDirectory('controllers/modules'); For 'submodules' path $frontController-addModuleDirectory('controllers/submodule1'); $frontController-addModuleDirectory('controllers/submodule2'); Daniel Tangermann a écrit : unbelievable that noone ever needed a modularsystem with more than one subsection. Or is it just to easy that I do not see the solution? Daniel Tangermann schrieb: I finally have a working modular system together with smarty and maintemplates. My file-structure is: /application /modules /foo1 /controllers IndexController.php /foo2 /controllers IndexController.php /views /scripts /foo1 footemplate1.tpl /foo2 footemplate2.tpl maintemplate.tpl I know that in every module there should be a views folder for the subtemplates, but this will not work for me together with the smarty + maintemplate solution, but this is ok for me right now. I set up the module-dir in the bootstrap with: $controller-addModuleDirectory('./application/modules'). Working fine for now, but what do I have to do to have some of the modules having seperate modules like /application /modules /submodule1 /foo1 /controllers /foo2 /controllers /modulewithoutsubs /controllers Maybe you can give me a hint. Daniel -- - Sorry, This disclamer is auto added by my company's FW - Si vous n'etes pas destinataires de ce message, merci d'avertir l'expediteur de l'erreur de distribution et de le detruire immediatement. Ce message contient des informations confidentielles ou appartenant a La Francaise des Jeux. Il est etabli a l'intention exclusive de ses destinataires. Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) de ce message ou des informations qu'il contient, doit etre prealablement autorisee. Tout message electronique est susceptible d'alteration et son integrite ne peut etre assuree. La Francaise des Jeux decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie. If you are not the intended recipient of this e-mail, please notify the sender of the wrong delivery and delete it immediately from your system. This e-mail contains confidential information or information belonging to La Francaise des Jeux and is intended solely for the addressees. The unauthorised disclosure, use, dissemination or copying (either whole or partial) of this e-mail, or any information it contains, is prohibited. E-mails are susceptible to alteration and their integrity cannot be guaranteed. La Francaise des Jeux shall not be liable for this e-mail if modified or falsified.