[fw-general] Action view helper ajaxcontext

2009-01-05 Thread sinkingfish
Hi, I'm displaying a list of contacts on a page, when a contact is added I fetch the new list using Ajax, my action is set in the init() of the controller as an ajax action. public function init() { $contextSwitch = $this-_helper-getHelper('AjaxContext');

Re: [fw-general] ZF Memory usage

2009-01-05 Thread mothmenace
Hi Till, I totally get you that every app is doing something different. However afaik, there is little info available online about how much memory sites/apps actually use. I'd love to see a chart or something, going from html holding page to video cruncher. When I moved my site to MT and

Re: [fw-general] PHP version requirement

2009-01-05 Thread Matthew Ratzloff
Litka's RPMs are fine; I've relied on them for almost two years now. Honestly, PHP 5.1.6 came out two and a half years ago. Red Hat may backport the security fixes, but look at the bug fixes in this change log from 5.1.6 to 5.2.8: http://www.php.net/ChangeLog-5.php -Matt On Mon, Jan 5, 2009 at

Re: [fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread Edward Haber
I use a custom validator for this functionality. Add it to the validation chain in the form model: $confirmPassword = new Zend_Form_Element_Password(password_confirm); $confirmPassword-setLabel('Confirm Password') -setDescription('Please re-enter your

Re: [fw-general] Zend_Tool sub forum?

2009-01-05 Thread Ralph Schindler
After a lot of tweaking, I got http://devzone.zend.com/article/3811-Using-Zend_Tool-to-start-up-your-ZF-Proje c Using Zend_Tool to start up your ZF-Project to work, but in http://framework.zend.com/wiki/display/ZFDEV/Zend_Tool+-+Todo+2008-10-01?showC hildren=true#children Zend_Tool

[fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread webPragmatist
Is it possible to pass the POST variable(s) once instead of twice when using the identical validator? What I have is a method in a model that checks a param which is passed when the form is generated in the controller. Then the controller (if the request is post) runs isValid($_POST). This

[fw-general] Subquery Generation

2009-01-05 Thread Saeven
Hi, The following snippet of code is what I intuitively would have thought would solve the requirement of subqueries: $query = Engine::$DB-select(); $query-from( array( 'L' = 'sales_opportunities' ), array( L.*, assigned_to_name =

Re: [fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread PHPScriptor
I never used the identical validator before but my first thought was that it should be something like this: $password = self::createElement('text', 'newpassword'); -setRequired(true) -setLabel('Password'); $password1 = self::createElement('text',

Re: [fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread webPragmatist
Thanks! This works great... Quick question, I couldn't find it in the manual... a) is it required to set addPrefixPath() b) if so how can I set it globally? Edward Haber wrote: I use a custom validator for this functionality. Add it to the validation chain in the form model:

Re: [fw-general] ZF Memory usage

2009-01-05 Thread Pádraic Brady
Bear in mind Wordpress has several aggressive caching plugins. Are these activated and configured? They too could certainly reduce memory usage on average. ;) Paddy Sent from my iPhone On 5 Jan 2009, at 15:07, mothmenace ultranib...@gmail.com wrote: Hi Till, I totally get you that every

Re: [fw-general] Subquery Generation

2009-01-05 Thread Ralph Schindler
I think what you are looking for is to be able to use Zend_Db_Expr() inside of the from method of the select object. Effectively, it would be: $query-from( array('L' = 'sales_opportunity'), array('L.*', 'assigned_to_name' = new Zend_Db_Expr($DB-select()-...) ) ... That

Re: [fw-general] ZF Memory usage

2009-01-05 Thread till
On Mon, Jan 5, 2009 at 12:08 PM, mothmenace ultranib...@gmail.com wrote: I just got round to testing some other web apps memory use against my Zend App that I mentioned before. I'm using memory_get_usage(true) to test before and after php script, although also have Xdebug installed. My

[fw-general] validator break chain on success

2009-01-05 Thread Patrick Lorber
Hi all, I have a form that collects billing and shipping information. I want to be able to control whether or not the shipping information is required based on a same as shipping checkbox element. I have written a validator using the $context array to check whether or not this checkbox is

Re: [fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread Edward Haber
I set it in my form class. I don't know if there's a global way to set it, but i wouldn't doubt it. You could also use a base form class like so: class MF_Form { public function __construct($options = null) { parent::__construct($options);

Re: [fw-general] ZF Memory usage

2009-01-05 Thread mothmenace
I just got round to testing some other web apps memory use against my Zend App that I mentioned before. I'm using memory_get_usage(true) to test before and after php script, although also have Xdebug installed. My Zend app uses 5-6.5mb without APC, and 2mb with. I just tested a default

Re: [fw-general] Zend_Form / Identical Validator and comparing form fields

2009-01-05 Thread Edward Haber
Sorry should have been : class MF_Form extends Zend_Form { Thx, EH

Re: [fw-general] Question about DB calls in models and efficiency

2009-01-05 Thread Ralph Schindler
This is a matter of taste more than anything else. To my knowledge, neither example is more performant than another. Think of it like this, you are either calling a method on the object in the global scope ($select-...), or you are calling a method on the object returned from the previous method

Re: [fw-general] PHP version requirement

2009-01-05 Thread ardx
Matthew Weier O'Phinney-3 wrote: -- ardx ovg...@rogers.com wrote (on Sunday, 04 January 2009, 06:34 PM -0800): Till Klampaeckel-2 wrote: Zend_File seems to lead the list, but only with 5.2.1, not 5.2.4. And if anyone cares, here are the version requirements per component (tests

Re: [fw-general] Question about DB calls in models and efficiency

2009-01-05 Thread Matthew Weier O'Phinney
-- Robert Castley robert.cast...@macro4.com wrote (on Monday, 05 January 2009, 09:47 AM -): Out of the two following examples which is the most efficient code i.e. which offers the best performance? Example 1: $sql = $this-select() -from($this-_name) -order('timestamp', 'DESC');

Re: [fw-general] ZF Memory usage

2009-01-05 Thread mothmenace
Yep Wordpress has some really nice caching plugins. The 10.75mb was without them. But I was only using WP as a 'control' to compare against, as WP is so popular and I'm assuming well written. I'm pretty suspicious if my 2mb Zend app was ever to blame for the memory problems now. Media Temple DV

Re: [fw-general] PHP version requirement

2009-01-05 Thread Matthew Weier O'Phinney
-- ardx ovg...@rogers.com wrote (on Sunday, 04 January 2009, 06:34 PM -0800): Till Klampaeckel-2 wrote: Zend_File seems to lead the list, but only with 5.2.1, not 5.2.4. And if anyone cares, here are the version requirements per component (tests not included): ... Zend_Date:

[fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread sprynmr
I'm still learning more about the javascript integration through the jquery xtra shipped with 1.7, but when I look at all the hoops you have to jump through to do some basic things with javascript in the Zend way... I just get the feeling its more trouble than its worth. The jquery plugin

[fw-general] Question about DB calls in models and efficiency

2009-01-05 Thread Robert Castley
Hi, Out of the two following examples which is the most efficient code i.e. which offers the best performance? Example 1: $sql = $this-select() -from($this-_name) -order('timestamp', 'DESC'); Example 2: $sql = $this-select(); $sql-from($this-_name); $sql-order('timestamp', 'DESC');

Re: [fw-general] validator break chain on success

2009-01-05 Thread PHPScriptor
What you could do is just test that one element and if succes (or not succes depends on what you want) continue. Something like this: $form = new MyForm(); if ($this-_request-isPost()) { $test = $form-getElement('Elementname')-isValid($this-_request-getPost('Elementname')); if($test ==

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Matthew Weier O'Phinney
-- sprynmr robert.sp...@hivelive.com wrote (on Monday, 05 January 2009, 12:32 PM -0800): I'm still learning more about the javascript integration through the jquery xtra shipped with 1.7, but when I look at all the hoops you have to jump through to do some basic things with javascript in the

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Josh Team
I may be totally wrong when saying this.. but the ZF integration benefits with *any js framework* are minimal at best, especially when factoring in the overhead required (as you mentioned before) and the double training that would require on robust apps. Don't get me wrong, I am a -huge- fan of

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread sprynmr
Thanks Matt, I think I'm coming to pretty much the same conclusion you have, although I think I might favor keeping my form validation in a separate jquery plugin for great flexibility. Definitely going to leverage the JS integration as far as the scaffolding goes and building the script tags

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Benjamin Eberlei
Hello Robert, Hello Josh, thanks for the comments on jQuery. I do see the point in your criticism and share it a bit. Personally I think when the jQuery integration plays best is when you are using it for prototyping, admin areas and scaffolding generation. If you want to use the jQuery or

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Karol Grecki
I didn't bother with any JS integration and I never mix JavaScript with PHP. I have a view helper to load required .js files and another to trigger onload events. All event handlers are attached in js using jQuery and no code is ever generated. I think it's just simpler, cleaner and doesn't limit

[fw-general] Project Structure / Public directory

2009-01-05 Thread Alan Wagstaff
Hi all, In most of the ZF tutorials I have read (ZF Quickstart, Rob's one, ZF Book), they all recommend setting your Apache's webroot to your /zfapp/public/ directory for security reasons. I can understand the logic, putting the application / library directory outside of the webroot is a good

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Matthew Ratzloff
A quick note to everyone who may be confused: he's replying to an e-mail I sent him off-list. (Didn't want to spam a link to my blog yet again.) -Matt On Mon, Jan 5, 2009 at 2:09 PM, sprynmr robert.sp...@hivelive.com wrote: Thanks Matt, I think I'm coming to pretty much the same conclusion

RE: [fw-general] Project Structure / Public directory

2009-01-05 Thread Vincent de Lau
The only 'framework' file in public in you index.php which loads your bootstrap. You could move it up a level and adjust the include paths accordingly. I've done this as well, since I'm running some sites on Plesk systems where we don't have write access to the level containing the webroot.

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread sprynmr
Hey Benjamin, I haven't thought it through 100% yet, but essentially I'm thinking along the lines of dynamically including javascript based on naming conventions (pairing with the similarly named view script). I'm also thinking of doing the same sort of thing when including various classes that

Re: [fw-general] Project Structure / Public directory

2009-01-05 Thread Pádraic Brady
One possible solution is setting a .htaccess file for the other root directories setting the deny from all directive to forbid access. Pádraic Brady http://blog.astrumfutura.com http://www.survivethedeepend.com OpenID Europe Foundation Irish Representative

Re: [fw-general] Zend_Tool sub forum?

2009-01-05 Thread Graham Anderson
On Sunday 04 January 2009 18:28:04 Matthew Weier O'Phinney wrote: Originally, the Y! group was invite only, to keep the discussions targetted. Later, it was to ensure that Zend_Tool discussions could be found easily -- we're not sure if we'll do an additional list for just Zend_Tool in the

Re: [fw-general] Is javascript framework integration into ZF really that beneficial?

2009-01-05 Thread Marko Korhonen
Hi, I made following solution without thinking it much =( 1. I have module based filesystem for my application 2. I added the javascripts folder to my module folder 3. In my base controller, I check if the current action has js file 4. If there is a file, I add new js file to view component. eg