Re: [fw-general] Re: PHPUnit taking forever?
From my experience, Windows is really slow for PHPUnit. I think that's NTFS' fault. I cant run any tests for the framework on Windows, too slow (anyway I dont use that system anymore), lasts hours for the whole framework testing. Try to run the exact same tests on *nix systems with ext or other FS and give us your results. Julien On Sat, May 29, 2010 at 9:53 PM, Fudgz phpunit.8.fu...@spamgourmet.comwrote: It depends of your project's structure I guess ... Well I am not an expert, but as my tests on this behavior ran, when you put whitelist directory suffix=.php../application//directory every single file in the application folder will be parsed, the .svn files, the .random_extension files, etc, even if you've excluded them in a exclude afterwards In fact, you shouldn't even need to exclude directory suffix=.phtml../application//directory since you asked to allow only .php files on your whitelist But are you saying your unittesting is slow only with these filters ? You don't seem to include any lib (unless your libs are in your application folder) But basically, I recommand you to whitelist only folders you really want to test E.g. whitelist directory suffix=.php../application/models/directory directory suffix=.php../application/modules/frontend/directory directory suffix=.php../application/modules/backend/directory etc. Then if you have a ../application/my_bullshit_and_stuff directory, it won't even be parsed by phpunit -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/PHPUnit-taking-forever-tp2133459p2235870.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Http TCP Connection management
I'm absolutly not a network master, but cant SNMP just do that ? It seems to have been designed to monitor Layer 7 protocols, but perhaps it could just connect to the system TCP stack and provide some informations from it ? Anyway I'm sure such a service exists somewhere, let's find it ! Julien.P On Fri, Nov 27, 2009 at 8:57 AM, Rick1125 rick1...@gmail.com wrote: maybe you can look into /proc/net/tcp for some information Long_Horn wrote: I would very much appreciate any help on this matter. Thanks all. JBrumwell wrote: Hi, I have an application that is used to connect ot a service once a week for a 1 hour session. This session has many requirements, one of which is that we only have one open tcp connection at a time. Out of the 30 or so sessions we've completed we've had 3 sessions where there were multiple tcp connections open during the 1 hour. I am wondering if there is a failsafe method to determine if there is an open tcp connection to a given host. I have considered using executing netstat and parsing the result until the connection is closed, but I wasn't sure if there was something built into the zend_http that would allow for this check without doing that. I would love to hear some suggestions if possible. As for why multiple connections are opened I'm not sure as the code has not changed and only happends sparactically. I've tried the following: unset the client and adapter object explicitly call the adapters close function after the clients request function the last time I did both unset and close the adapter Due to this we have been suspended from the sessions for 1 month and we need to ensure that never happends again. I'm not sure if this may be a fault in Windows either and not a problem with the coding. any help is appreciated All the best, Jason -- View this message in context: http://n4.nabble.com/Zend-Http-TCP-Connection-management-tp663757p788565.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] PHP5.2.11 corrects spl_autoload_functions
Just a note to say that PHP5.2.11 corrects the spl_autoload_functions() bug that Zend_Loader_Autoloader tries to emulate. ( http://www.php.net/ChangeLog-5.php) Patch should have been merged to 5.3 branch. Cheers Julien.P
Re: [fw-general] Minimizing Zend Framework
According to its author, it just looks for dependencies and builds a package Julien.P 2008/12/24 MrMastermind ma...@alting-multimedia.nl Thanks Julien for the link. Is that doing something special? Or is it just creating a package of the selected files/folders? Marco doctorrock wrote: You should go on the unofficial http://epic.codeutopia.net/pack/library/1.7 Julien.P 2008/12/24 MrMastermind ma...@alting-multimedia.nl Hi, It might not be wise to do, but is it possible to install only part of the library, like the Zend_Db and Zend_Amf if you only need those? Maybe some generic stuff is needed as well. But since we are doing a lot of Flash only projects using AMF, I thought we could reduce the copying of the library by taking out unneeded files and folders. So, would it be possible? Has anyone done it? And how would one approach this? Thanks, Marco -- View this message in context: http://www.nabble.com/Minimizing-Zend-Framework-tp21156476p21156476.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Minimizing-Zend-Framework-tp21156476p21156813.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How the heck do you go into production mode?
Personnaly, I use some kind of Apache setEnv + php's $_SERVER to push my app in prod mode. Julien.P 2008/11/19 Terre Porter [EMAIL PROTECTED] This would depend on the programmer and the style he/she used. For example, I used the zend studio MVC bootstrap/initializer style in my project. You might have something like this in the bootstrap.php in you app dir. Could also be in the index.php in the web root, if not using a bootstrap file. $frontController-registerPlugin(new Initializer('development')); All I have to do is change development to production, and I'm out of dev mode. But I'd look in the initializer file to make sure, to see if it has to be something specific. Sorry to say, but you'll just have to track it down. I'd start looking at the index.php and any configs that are loaded. It would be in the beginning of the application. Terre -Original Message- From: MrEMan [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 11:50 AM To: fw-general@lists.zend.com Subject: [fw-general] How the heck do you go into production mode? I've been developing a Zend app for awhile now. It's a project I adopted from a previous contractor and I am not the one responsible for deploying it. I've recently encountered a production bug and really need to run the app in production mode locally to figure this out. How do I run my Zend Framework app in production? It must be obvious, because it doesn't seem to be documented _anywhere_. Thanks -- View this message in context: http://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp2058403 1p20584031.htmlhttp://www.nabble.com/How-the-heck-do-you-go-into-production-mode--tp20584031p20584031.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Db_Table_Rowset seek() question
You can use a LimitIterator to make it starts where you want ;-) Julien.P 2008/11/7 Jason Austin [EMAIL PROTECTED] Thanks for the code. After further investigation, it appears that the issue is not with Zend_Db_Table_Rowset, but with the SPL SeekableIterator class, and how PHP handles iterators and foreach loops. The foreach loop executes a rewind() before beginning, therefore resetting our pointer to 0. It would seem to make sense for SeekableIterator to be able to move the pointer, then the foreach loops start where the pointer is telling it to. Zend_Db_Table_Rowset could handle this on its own, but it seems that would be the entire point of implementing SeekableIterator as opposed to Iterator. IE: // in Zend_Db_Table_Rowset_Abstract protected $_seek = false; public function seek($position) { // do all the stuff seek does $this-_seek = true; } public function rewind() { if (!$this-_seek) { $this-_pointer = 0; } $this-_seek = false; return $this; } That code isn't great, but doing something like this could get around PHP's rewind at the beginning of foreach loops, but it seems kinda hack-ish to me. Thoughts? Cameron wrote: I built something like this as a paginator for when you're on your item view. What I did was build a simple class that implements the SPL Iterator and Countable classes, just like the internal Zend_Paginator, but just uses an array as its internal guts. Then I simply grabbed all the id fields from my table and passed it as an array through to my paginator class' constructor, and then called the setCurrentItem method to correctly position the pointer in array. I have no idea if something like this helps you at all, but it seemed a pretty clean way of solving my particular problem, which was getting a next and previous button on my record display. Here's the class anyway, if it helps. class ItemPaginator implements Countable, Iterator { protected $collection; protected $count; protected $pointer_position; public function __construct( $collection ) { $this-collection = $collection; $this-count = sizeof($this-collection); } public function count() { return $this-count; } public function key() { return $this-pointer_position; } public function current() { return $this-collection[$this-pointer_position]; } public function next() {$this-pointer_position++; } public function rewind() { $this-pointer_position = 0; } public function valid() { return strlen( $this-collection ) $this-pointer_position; }public function getNextItem() { if ($this-pointer_position $this-count) { return $this-collection[$this-pointer_position + 1]; } return false; } public function getPrevItem() { if ($this-pointer_position 0 ) { return $this-collection[$this-pointer_position - 1]; } return false; } public function getFirstItem() { if ($this-pointer_position 0 ) { return $this-collection[0]; } return false; } public function getLastItem() { if ($this-pointer_position $this-count ) { return $this-collection[$this-count - 1]; // -1 for the array offset } return false; } public function setCurrentItem($item) { $key = array_search($item, $this-collection); if (FALSE !== $key) { $this-pointer_position = $key; return true; } return false; } } Sorry if this is really terrible code that I should be implementing completely differently, the SPL is all a bit new to me :) On Fri, Nov 7, 2008 at 1:17 AM, Jason Austin [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: I have a need to paginate some simple results, which I need the count of the entire rowset, and then rows from a particular offset. I don't really want to execute 2 queries, so I was thinking of using the seek() method of my result set to put the pointer to the required offset, however when I loop through the results it starts over at the beginning of the result set: ?php $rows = $model-fetchAll($where, $order); $rows-seek($page * $resultsPerPage); echo $rows-current()-id // echoes correct seek() offset ID foreach ($rows as $r) { // starts over at the beginning of the rowset // add to result set } ? Is this the expected behavior or am I missing something totally obvious? This is with version 1.6.1. http://1.6.1. Should I just do 2 queries (a query to get the required rows, then a count query without qualifier)? Thanks! Jason --Jason Austin Senior Solutions Implementation Engineer NC State University - Office of Information Technology http://webapps.ncsu.edu 919.513-4372 -- Jason
Re: [fw-general] Z C E - ZF e xa m
By the way, I created a ZFCE group on LinkedIn. For those who are certified, you can request a join, it's here : http://www.linkedin.com/groups?gid=870067 Julien.P 2008/9/19 Aldemar Bernal [EMAIL PROTECTED] Hi Zenders, Now that the e xa m is out, are you planning any kind of discount coupon for those who are suscribed to this list or at least to those that have contributed proposals to the framework? (:rolling eyes) =D Best, Aldemar
Re: [fw-general] Establishing naming conventions for Zend Framework 2.0
+1, I accepts those exposed ideas : - Why migrate from 1.x branch when it works ? Just keep 2.x branch for new projects - Even on big (tested ?:-) ) apps, such a suggested refactoring (Zend classes, some {not so much} methods) won't be that hard and long (if wanted) - 2.0 seems to be the good point for a change in API - After some time passes, the 1.x branch will get forgotten anyway - if one of the ZF points is to be 'simple' , well that would be welcome (frequent doc looks are nothing else that waste of time, think about PHP...) - Sooner it comes, better it is : ZF is growing days after days, such a change, if accepted, must be taken the soonest. Julien.P 2008/5/20 Eric Marden [EMAIL PROTECTED]: I think having a phase of things being depreciated is the best approach to minimize conflicts and the need to rewrite code just to upgrade the core. I've seen other projects take this approach and over time nobody is using the old style, and has fully adopted the new approach. Anything jarring, even under the guise of a 'major point release' is not good practice in my honest opinion, and is kind of a turn off. -- Eric Marden -- *From:* Bradley Holt [mailto:[EMAIL PROTECTED] *Sent:* Tuesday, May 20, 2008 12:26 PM *To:* Matthew Ratzloff *Cc:* fw-general@lists.zend.com *Subject:* Re: [fw-general] Establishing naming conventions for Zend Framework 2.0 +1 As others have said, and I agree, it's OK to break backwards compatibility in a major version release (with one caveat that I'll outline below). Refactoring my web applications to use the new class names shouldn't be that difficult. Someone suggested a compatibility layer that is marked as deprecated. I think this is a good idea but should be should either be done in a 1.x release (still maintains BC but informs developers stuff will be changing in the next major release) or it should be done in the 2.0 release with plans of deleting the deprecated compatibility layer in 3.0. Either way, I think the warning that something is deprecated should be made in a major version *before* the deprecated code is removed (if at all possible). On Tue, May 20, 2008 at 12:00 AM, Matthew Ratzloff [EMAIL PROTECTED] wrote: This seems like a perennial issue for me, but I'm bringing it up again because I think it's worthwhile. Since the beginning of this project, there hasn't really been much in the way of direction given on naming standards for classes in Zend Framework. This lack of consistency is what has yielded two nomenclatures for CLI components (Zend_Console vs. Zend_Controller_Response_Cli), differing terms for similar concepts (Zend_Json_Decoder vs. Zend_Mime_Decode), both nouns and verbs in equal measure (Zend_Loader but not Zend_Translator; alternately, Zend_Translate but not Zend_Load), and so on. I first brought this issue up in February 2007 and concluded, Consistency means predictability, which means being able to recall names without having to check the manual every time. It's why most people can't use PHP's date or string functions without looking at the documentation, for example. There was a lot of agreement from the community (and a couple Zenders) but no movement because the framework was preparing for 1.0. At the time I was told, There is life after 0.9.0, and so as we prepare for 2.0, I think it's the perfect time to revisit this. -Matt -- Bradley Holt [EMAIL PROTECTED]
Re: [fw-general] ZF - APC tuning
Please take one thing on consideration : when using Windows to benchmark , turn your AV and all those kind of services OFF. I ran an APC test as well on Windows ( for fun ), and with / without my AntiVirus solution == I got twice more requests per second without it !! I ran an ab with something like -n 80 -c 40 , (no DB, no session ), results were poor, but that is an OS problem , Windows is not good at all to support such PHP apps ( in fact it 'may' be, but a Windows developer platform cant give good results). With APC, I got about twice more requests served than without. I noticed as well that APC should be fined configured. 1 or 2 more MB for the memory segment can improve / degrade performance with a big factor. Conclusion : do test on Windows if you want, but dont be surprised if you have (very) poor performance results. There are several Windows services that can knock the performance, not talking about the so bad File System. (you should try to put your session data in memory such as memcache for tests as well) Cheers Julien.P 2008/4/8 James Dempster [EMAIL PROTECTED]: I also get the same kind of results on Windows, installing APC for me actually slows down the requests. My PC is dual booted so I tested the setup in Ubuntu Linux which was so amazingly fast. *Tested on: *Intel Dual Core 2.8GHz, 4GB RAM etc etc *Tested using: *ab -n 2000 http://localhost/ (No concurancy cause we're testing response speed not server load) Website tested usues the following (but not limited to) ZF components MVC including Modules, Zend_Db + Db_Table etc (metadata cached in Zend_Cache sqlite), Zend_Config_Ini, Zend_Registry, Zend_Log, Zend_Session and all classes associated with them. Some custom models. So it's a fairly good senario. There's no extra caching other than the Zend_Db_Table metadata. Windows XP Pro SP2, Apache2 mod_php = 450ms Windows XP Pro SP2, Apache2 mod_php + apc = 500ms Ubuntu Linux 7.10, Apache2 mod_php= 150ms Ubuntu Linux 7.10, Apache2 mod_php + apc = 50ms This goes to show that ZF is not at fault here. I'm not even sure if Windows is at fault as I've heard great results about the new php fast cgi + iis 6. It just seems that Apache + PHP + Windows is a bad mix (for production). -- /James On Mon, Apr 7, 2008 at 7:02 PM, Aldemar Bernal [EMAIL PROTECTED] wrote: Well, after a weekend of testing I found that: - fastcgi (using zend core fastcgi and other fastcgi) didn't give me better results than using the mod_php, I couldn't test using IIS since I don't have it =P - apc and xcache with fastcgi gave always trouble when benchmarking using ab from apache (php crashed all the times). - turning off apc.stat really boost my code, but I had to change some things (relative require_once to absolute require_once using dirname(__FILE__)) - it seems that even if apc.stat is turned off, it access the disk (well, obviously it does the first time it caches the files) because ramdisk still faster than using my files on my harddrive, it should be faster only the first time, but it's faster all the times (I checked out apc.php and I found that apc was already caching the files). - concluding, I'll use here in my dev laptop mod_php + apc with apc.filters filtering and caching only ZF files (in a ramdisk) and my customers windows servers I'll use mod_php + apc with apc.stat always off (maybe including the ramdisk thingy). Times: - fastcgi ~700ms - fastcgi + accelerator (apc or xcache) ~ 600ms - mod_php alone ~ 500ms - mod_php + apc + files in ramdisk ~ 300ms - mod_php + apc + apc.stat = 0 ~ 300ms - mod_php + apc + apc.stat = 0 + files in ramdisk ~ 110ms - mod_php + apc + apc.stat = 0 + apc.filtering (only caching ZF) + files in ramdisk (only ZF) ~ 280ms Again my setup is: - apache 2.2 (mod_php) - php 5.2.5 - apc 3.0.17-dev - zf 1.5.1 - windows xp home Still sucks, doesn't it :P btw, I couldn't any documentation about apc caching classes (maybe you were talking about user cache), the command I use to benchmark was: ab -c 5 -n 20 http://localhost/x/ (before running this command I opened twice the page in order that apc cached w/o fragmenting the files) The page I used did connect to a DB but doing nothing but a 'SET NAMES utf8' query, and disabling it didn't show any difference. Aldemar - Original Message - From: Matthew Weier O'Phinney [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Saturday, April 05, 2008 6:10 PM Subject: Re: [fw-general] ZF - APC tuning -- Aldemar Bernal [EMAIL PROTECTED] wrote (on Saturday, 05 April 2008, 02:40 PM -0500): I've been trying to make my app perform better, every request takes (according ab: apache stress tool) ~510ms, which is a lot!, over half second in every request?, so I installed and enabled APC but surprisly it performed
Re: [fw-general] Should I resolve issues on the tracker? (I'm not the component maintainer)
Personnaly when I see a trivial bug that doesnt need too much work, I take myself to resolve it by commiting a fix and marking issue as resolved. When the bug is in need of more work (aka : tests writings), I contact Zend persons, usually Matthew or Darby, to talk about it quickly. cheers, Julien.P 2008/3/24, James Dempster [EMAIL PROTECTED]: Seems very out of date. -- /James On Mon, Mar 24, 2008 at 7:23 PM, Thomas Weidner [EMAIL PROTECTED] wrote: See here: http://framework.zend.com/wiki/pages/viewpage.action?pageId=11036 Greetings Thomas Weidner, I18N Team Leader http://www.thomasweidner.com - Original Message - From: Rob Allen [EMAIL PROTECTED] To: Simone Carletti [EMAIL PROTECTED] Cc: Amr Mostafa [EMAIL PROTECTED]; Zend Framework General fw-general@lists.zend.com Sent: Monday, March 24, 2008 8:15 PM Subject: Re: [fw-general] Should I resolve issues on the tracker? (I'm not the component maintainer) On 23 Mar 2008, at 14:38, Simone Carletti wrote: However, it's always recommended that you drop a line to current component mantainer to notify him about the changes, especially the first times you are contributing, thus he will be able to provide you some additional feedback. Is there a list of current component maintainers? Regards, Rob...
Re: [fw-general] Library for writing config (INI) files to disk?
Please, visit that improvement : http://framework.zend.com/issues/browse/ZF-2849 Feel free to contact both Rob or me for making a proposal of refactoring + adding implementations (such as the save() one ) for Zend_Config. regards Julien.P 2008/3/11, Vincent [EMAIL PROTECTED]: On 3/10/08, Jan Pieper [EMAIL PROTECTED] wrote: Today i´ve created a new issue with exact the same target: http://framework.zend.com/issues/browse/ZF-2838 Well, actually, that one is a little bit different. My library will be able to *update* existing INI files. However, with the current code it is easy to add a __toString() method. -- Vincent
Re: [fw-general] Library for writing config (INI) files to disk?
Don't worry = just write tests and tests again, with use cases. I will be enought ;-) Julien.P 2008/3/11, Vincent [EMAIL PROTECTED]: On 3/11/08, Julien Pauli [EMAIL PROTECTED] wrote: Please, visit that improvement : http://framework.zend.com/issues/browse/ZF-2849 Feel free to contact both Rob or me for making a proposal of refactoring + adding implementations (such as the save() one ) for Zend_Config. Hmm... I haven't sign the CLA or anything, and in fact, don't think I'm experienced enough to be really contributing to ZF yet. I'll first make sure my class works, publish it so people can at least take a look at it, and see how it could be refactored. I'm really not confident enough yet to be making serious contributions ;-) regards Julien.P -- Vincent
Re: [fw-general] Library for writing config (INI) files to disk?
I'am :-) Julien.P 2008/3/5, Vincent [EMAIL PROTECTED]: On 3/5/08, dinok [EMAIL PROTECTED] wrote: Have a look at http://www.zfforum.de/showthread.php?t=1453 It's a german page, but you should be able to copy some source :-D Best regards Thanks. Problem with this is that the licensing is unclear and that it cannot update existing configuration files. However, I've started my own class that extends Zend_Config_Ini and adds a save() method. Is anyone interested in getting notifief once it's done? -- Vincent
Re: [fw-general] Slow performance with ZF 1.5.0PR on a live server
No prob Darby. bye Julien.Pauli 2008/2/5, Darby Felton [EMAIL PROTECTED]: Hi Julien, Julien Pauli wrote: Hi all. Darby's code to manage exception is a good deal, unfortunatly it seems to show performance issues. Are you referring to the latest SVN? I think probably not. http://framework.zend.com/fisheye/browse/~raw,r=7726/Zend_Framework/trunk/library/Zend/Loader.php I think that the issues with performance of the error handling code I had previously added have been resolved, since I removed the error handling, but if you have trouble with the latest Zend_Loader's performance, please provide us with your experience (metrics are helpful, too :) ). What do you think of that new Zend_Loader code, working with php's track_error param ? : Not a bad idea, but actually, I don't want to throw an exception when, for example, an E_WARNING occurs in user code. Unless I'm decidedly wrong about this (it's happened before ;) ), I think it's best to let PHP handle such events in the normal PHP way, which is how the current implementation operates. Thank you kindly for your support! :) Best regards, Darby ?php //.. /** * Try finding for the plain filename in the include_path. */ if(ini_get('track_errors') == 0){ ini_set('track_errors',1); } if ($once) { @include_once $filename; } else { @include $filename; } /** * If searching in directories, reset include_path */ if ($incPath) { set_include_path($incPath); } if (isset($php_errormsg)){ throw new Zend_Loader_Exception($php_errormsg); } return true; // .. ? cheers Julien.Pauli 2008/2/1, Darby Felton [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Ralf Eggert wrote: As to your performance problems, I suspect that you could be having trouble with Zend_Loader. Please see the following JIRA issue if you also suspect the same could be true: http://framework.zend.com/issues/browse/ZF-2463 But could this problem really result in a quadruplication of the run time for almost all pages? I rather thought that amendments to other components like Zend_Db or Zend_Controller might have caused the performance decrease. I probably should not guess any further. :) I'll recommend to use profiling to determine the cause(s) of your performance degradation. :) I just happened to be aware (having made the changes myself) of a not-so-fast Zend_Loader implementation pursuant to: http://framework.zend.com/issues/browse/ZF-2463 This implementation made it into 1.5.0 PR before I could change it, but the latest SVN version of it does not have the error handling functions about which I was concerned. Instead, errors in included files will simply be handled in the normal PHP way. :) Finally, I would recommend that Zend_Loader be eschewed, in favor of using require_once, whenever possible. If there are any framework components using Zend_Loader, where require_once would work nicely instead, please let us know about it. This is not so easy to accomplish since my whole application relies on Zend_Loader. All classes I use should be loaded by Zend_Loader and I don't really get the point of a Zend_Loader class if it is not recommended to use it Okay, so in this case, it's not reasonably possible for you not to use Zend_Loader. That's fine. I was really more concerned about the version that came with 1.5.0 PR than the version from 1.0.3 or the version that will be in 1.5.0 RC1. Best regards, Darby
Re: [fw-general] Slow performance with ZF 1.5.0PR on a live server
Hi all. Darby's code to manage exception is a good deal, unfortunatly it seems to show performance issues. What do you think of that new Zend_Loader code, working with php's track_error param ? : ?php //.. /** * Try finding for the plain filename in the include_path. */ if(ini_get('track_errors') == 0){ ini_set('track_errors',1); } if ($once) { @include_once $filename; } else { @include $filename; } /** * If searching in directories, reset include_path */ if ($incPath) { set_include_path($incPath); } if (isset($php_errormsg)){ throw new Zend_Loader_Exception($php_errormsg); } return true; // .. ? cheers Julien.Pauli 2008/2/1, Darby Felton [EMAIL PROTECTED]: Ralf Eggert wrote: As to your performance problems, I suspect that you could be having trouble with Zend_Loader. Please see the following JIRA issue if you also suspect the same could be true: http://framework.zend.com/issues/browse/ZF-2463 But could this problem really result in a quadruplication of the run time for almost all pages? I rather thought that amendments to other components like Zend_Db or Zend_Controller might have caused the performance decrease. I probably should not guess any further. :) I'll recommend to use profiling to determine the cause(s) of your performance degradation. :) I just happened to be aware (having made the changes myself) of a not-so-fast Zend_Loader implementation pursuant to: http://framework.zend.com/issues/browse/ZF-2463 This implementation made it into 1.5.0 PR before I could change it, but the latest SVN version of it does not have the error handling functions about which I was concerned. Instead, errors in included files will simply be handled in the normal PHP way. :) Finally, I would recommend that Zend_Loader be eschewed, in favor of using require_once, whenever possible. If there are any framework components using Zend_Loader, where require_once would work nicely instead, please let us know about it. This is not so easy to accomplish since my whole application relies on Zend_Loader. All classes I use should be loaded by Zend_Loader and I don't really get the point of a Zend_Loader class if it is not recommended to use it Okay, so in this case, it's not reasonably possible for you not to use Zend_Loader. That's fine. I was really more concerned about the version that came with 1.5.0 PR than the version from 1.0.3 or the version that will be in 1.5.0 RC1. Best regards, Darby
Re: [fw-general] Re: *** PROBABLY SPAM *** RE: [fw-general] Zend_Session::start() and remember me
session_set_cookie_params() must be called before session_start() as session_start() will send the cookie headers; To demonstrate that behavior, just run this : ?php session_set_cookie_params(3600); session_start(); var_dump(headers_list()); You should see that the header contains a set-cookie HTTP header, specifying the cookie lifetime. Note as well that if the browser doesn't accept the cookie, then PHP will try to send the session cookie at each request. 2007/12/7, Steven Brown [EMAIL PROTECTED]: After login the details are as follows: array(5) { [lifetime]= int(604800) [path]= string(1) / [domain]= string(0) [secure]= bool(false) [httponly]= bool(false) } After redirect they are as follows: array(5) { [lifetime]= int(0) [path]= string(1) / [domain]= string(0) [secure]= bool(false) [httponly]= bool(false) } Notice I had to turn off the redirect to get the first result. Note my remember me line is: Zend_Session::rememberMe(60 * 60 * 24 * 7); // Remember me for 7 days This is 604800. Cheers, Steven -Original Message- From: Laurent Melmoux [mailto:[EMAIL PROTECTED] Sent: Friday, 7 December 2007 8:24 PM To: Steven Brown Cc: 'Darby Felton'; 'Zend Framework General' Subject: [fw-general] Re: *** PROBABLY SPAM *** RE: [fw-general] Zend_Session::start() and remember me Do var_dump(session_get_cookie_params()) at the end of your bootstrap If you have : 'lifetime' = int 1209600 then it is working. If I call Zend_Session::rememberMe() in my authController I have 'lifetime' = int 0 which mean the cookie will die when the browser get closed. Steven Brown a écrit : Yes it definitely works, I login (ticking remember me), close the browser, open the browser again and it remembers me. I thought I had to set remember me before starting the session however I found someone else had done the same as I have, and on testing it works. I wonder is the cookie set only when needed, or is the remember me cookie set on the next request, which may be caused by my redirect? -Original Message- From: Laurent Melmoux [mailto:[EMAIL PROTECTED] Sent: Friday, 7 December 2007 5:35 PM To: Steven Brown Cc: 'Darby Felton'; 'Zend Framework General' Subject: Re: [fw-general] Zend_Session::start() and remember me Are you sure it is working? Zend_Session::rememberMe() is calling Zend_Session::rememberUntil() which is calling the php function session_set_cookie_params () (http://php.net/session_set_cookie_params) . This function configures the cookie use by the session. As Darby said it should be called before session_start() to work. Finally here is how I solve this issue: *In my AuthController, after a successful authentification :* // Set a cookie to notify the bootstrap how long the session cookie should last $duration = $this-_form-rememberme ? 1209600 : 0; setcookie(Zend_Auth_RememberMe, $duration, time()+6000, '/'); *In my bootstrap:* // Session include 'Zend/Session.php'; if(isset($_COOKIE[Zend_Auth_RememberMe])){ Zend_Session::rememberUntil($_COOKIE[Zend_Auth_RememberMe]); unset($_COOKIE[Zend_Auth_RememberMe]); } Zend_Session::start(); Regards, -- Laurent Melmoux - [EMAIL PROTECTED] Annecy - France
Re: [fw-general] FrontController improvement : preventing infinite dispatch loop
I wanted to open one, but I prefered asking here before. Sure, the QA and/or tests should detect that. But we all know what damages can cause an infinite dispatch loop, and we can never be 100% sure, with some kind of very complex applications, that nothing like this would happen, even with lots of tests. As said : if that idea is to be re-asked in the future, I think we could think about a (quiet simple) frontcontroller patch. Thanks all Julien.P 2007/11/30, Matthew Weier O'Phinney [EMAIL PROTECTED]: -- Julien Pauli [EMAIL PROTECTED] wrote (on Friday, 30 November 2007, 04:23 PM +0100): I'm wondering why there is not actually any FrontController system to prevent infinite dispatching loops. Some of you massivelly use _forward or other tricks like that, but a loop limitation should be set into FC as we all know that it is easy to get an infinite dispatch() loop (specially while manipulating multiple plugins or action helpers ). Why not set a private static property in FC called (for example) maxDispatchLoopBeforeExit ? This, with accessors (getter setter) and a default value to figure out (I think 10 should be a reasonable average). In the dispatch loop, FC just increments an internal variable, and at the end of the loop, checks its value with its static 'flag'. If over : it should then break the dispatch loop throwing (or response appending) an exception ( ' infinite dispatch loop presumed' , something like that ). Is that a good idea ? Maybe someone has already thought about that ? Hopefully, you're either unit testing your application and/or have a QA process in place to catch this kind of situation before you deploy. However, I think what you're suggesting is pretty easy to implement as a postDispatch() plugin: class DetectInfiniteRecursion extends Zend_Controller_Plugin_Abstract { public $_counter = 1; public $_maxLoop = 100; public function postDispatch(Zend_Controller_Request_Abstract $request) { if (!$request-isDispatched()) { ++$this-_counter; if ($this-_counter $this-_maxLoop) { throw new Exception('Maximum dispatch loop count reached'); } } } } If others feel this would be useful, please open a feature improvement issue in the issue tracker. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] FrontController improvement : preventing infinite dispatch loop
Hi everybody. I'm wondering why there is not actually any FrontController system to prevent infinite dispatching loops. Some of you massivelly use _forward or other tricks like that, but a loop limitation should be set into FC as we all know that it is easy to get an infinite dispatch() loop (specially while manipulating multiple plugins or action helpers ). Why not set a private static property in FC called (for example) maxDispatchLoopBeforeExit ? This, with accessors (getter setter) and a default value to figure out (I think 10 should be a reasonable average). In the dispatch loop, FC just increments an internal variable, and at the end of the loop, checks its value with its static 'flag'. If over : it should then break the dispatch loop throwing (or response appending) an exception ( ' infinite dispatch loop presumed' , something like that ). Is that a good idea ? Maybe someone has already thought about that ? cheers. Julien.Pauli http://www.z-f.fr
Re: [fw-general] again about Zend_Db_Table paging
Well, I don't think so. I made some tests with a 'table reader' implementation. My article is in french, however, the code, and UML schemes are understandable. ^^ 2007/11/9, Truppe Steven [EMAIL PROTECTED]: Hi again, to use the -fetchAll() method to fetch a certain interval is working, but now i have the problem that i need to list my shop articles in categories. So i need a way to count the number of results of a -fetchAll() query without actualy doing the fetch, so i can get the number of articles inside one category to be able to use fetchAll() with $limit and $offset. Hope there is another solution than doing an sql count command... best regards, Steven Truppe
[fw-general] Zend_Db_Table $_sequence set to false AND inserting row with no PK value
Hi, In the manual it is written that if you put $_sequence to boolean false, in your ORM definition ( extending Zend_Db_Table_Abstract ), then you'll be forced to provide values for PKs while inserting a new row. However, this feature does not seem to be present actually ..? inserting blank value still proxies to Adapter and creates a DB error ( caused by a NULL to be inserted on a PK col ) that give logically a Zend_Db_Statement_Exception Thx for response. Julien.