Re: [fw-general] Help with ajaxContext helper

2010-03-24 Thread Саша Стаменковић
I thinks second requirement is there, but XMLHttpRequest is not. Otherwise, it would always fail. Regards, Saša Stamenković On Wed, Mar 24, 2010 at 6:15 PM, Jurian Sluiman wrote: > On Tuesday 23 Mar 2010 20:15:03 Саша Стаменковић wrote: > > Interesting. Is there a way to solve it on one place.

[fw-general] Help With Zend_Currency Throwing Exception

2010-03-24 Thread Arthur M. Kang
I'm trying to set a locale and have use that information throughout my site for languages, currency, and dates. I would assume this is pretty standard. The problem occurs when setting a locale without a region and then trying to instantiate a Zend_Currency object using that locale. Zend_Date

[fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
Sorry ignore the last part of the last response with the calling of ->run(). The Zend Application is not setup in that file, rather it is setup in the ControllerTestCase class that extends the Zend testing classes. -- View this message in context: http://n4.nabble.com/Unit-Testing-with-Zend-Tes

[fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
I think there is some confusion with my use of the word Bootstrap. When I mean bootstrap I am talking about the class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { } That was not getting run until I manually called $application->bootstrap(); and the bootstrap object was not being inj

Re: [fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread A.J. Brown
Routes should be tested independently of everything else. You should be testing your controllers and actions. Routes are just smoke and mirrors. I personally run a seperate bootstrap file for my automated tests. It's essentially the same as index.php, but without the ->run() call on the bootstra

Re: [fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Giorgio Sironi
On Wed, Mar 24, 2010 at 6:32 PM, Joseph Crawford wrote: > > Jake, > > I am not intentionally stopping Zend_Application from loading the bootstrap. > > As you mentioned I do have a bootstrap.php file that is the same as your > TestHelper.php it's my index.php from the app except it does not call >

[fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
Jake, I am not intentionally stopping Zend_Application from loading the bootstrap. As you mentioned I do have a bootstrap.php file that is the same as your TestHelper.php it's my index.php from the app except it does not call ->bootstrap()->run(); Thanks, Joseph Crawford -- View this message

Re: [fw-general] Re: FrontController plugin and controllers

2010-03-24 Thread Jurian Sluiman
On Wednesday 24 Mar 2010 18:24:00 asagala wrote: > What do you mean by this "To avoid DRY the code inside the method could be > replaced with an action helper. " > > Do you mean implement my frontcontroller logic as an action helper and call > the action helper in preDispatch function on the contr

Re: [fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Jake McGraw
On Wed, Mar 24, 2010 at 1:09 PM, Joseph Crawford wrote: > > Jake, > > Will I also have to move my Bootstrap.php file into the /tests/application/ > directory or will it know where to find it? No, just establish where your application.ini file is relative to your tests. I typically have a TestHelp

Re: [fw-general] FrontController plugin and controllers

2010-03-24 Thread A.J. Brown
The way you're doing it is probably the best. The only other alternative I can think of is to have another plugin at routeShutdown() which only registers the plugin for select controllers. That seems to be a more convoluted solution than to just have your plugin's code determine if it should do a

[fw-general] Re: FrontController plugin and controllers

2010-03-24 Thread asagala
What do you mean by this "To avoid DRY the code inside the method could be replaced with an action helper. " Do you mean implement my frontcontroller logic as an action helper and call the action helper in preDispatch function on the controllers I need it? -- View this message in context: http:

Re: [fw-general] Help with ajaxContext helper

2010-03-24 Thread Jurian Sluiman
On Tuesday 23 Mar 2010 20:15:03 Саша Стаменковић wrote: > Interesting. Is there a way to solve it on one place. What is enough for me > is to prevent logging errors in error controller. > So custom exception thrown from controller plugin is fine...if ajax action > is called without ajax. > > Regar

[fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
Jake, Will I also have to move my Bootstrap.php file into the /tests/application/ directory or will it know where to find it? Thanks, Joseph Crawford -- View this message in context: http://n4.nabble.com/Unit-Testing-with-Zend-Test-tp1680861p1680875.html Sent from the Zend Framework mailing li

[fw-general] Re: Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
Jake, is there a reason you have to do it manually in the tests but not in the actual application? Thanks, Joseph Crawford -- View this message in context: http://n4.nabble.com/Unit-Testing-with-Zend-Test-tp1680861p1680873.html Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] FrontController plugin and controllers

2010-03-24 Thread Jurian Sluiman
On Wednesday 24 Mar 2010 17:27:06 asagala wrote: > I currently have a FrontController plugin that extends > Zend-Controller_Plugin_Abstract. The preDispatch function is implemented in > it. Everything works except for one thing. How can I prevent the > preDispatch function to be applied to certain

Re: [fw-general] Unit Testing with Zend_Test

2010-03-24 Thread Jake McGraw
Joseph: Within an instance of Zend_Test_PHPUnit_ControllerTestCase: ... public function appBootstrap() { $this->application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $this->application->bootstrap(); $this->getFrontController

[fw-general] Unit Testing with Zend_Test

2010-03-24 Thread Joseph Crawford
Hello Everyone, I have been working with Unit Testing in a ZF Application over the last few days and I have hit a problem. What I am wondering is if my application/Bootstrap.php file will be executed when testing. The reason I am asking is because I will want all of my custom routes to resolve

[fw-general] FrontController plugin and controllers

2010-03-24 Thread asagala
I currently have a FrontController plugin that extends Zend-Controller_Plugin_Abstract. The preDispatch function is implemented in it. Everything works except for one thing. How can I prevent the preDispatch function to be applied to certain controllers? The only way I have right noew is to use $t

[fw-general] getext and array adapters

2010-03-24 Thread jpadron
Hi, I'm using getext in order to translate the whole 1.10 Zend application including forms through a controller plugin. Everything is working fine, the translate resource is saved in the registry using default name convention but, now, I'm working on the server side validation (after js validatio

Re: [fw-general] Re: Default router still goes ahead of custom

2010-03-24 Thread Hector Virgen
Glad I could help :) The LIFO rule only applies when routing a request, but not when assembling URLs. When assembling a URL, either through Zend_Navigation or the "url" view helper, the route will be set to the currently matched route unless you specify otherwise. -- Hector On Wed, Mar 24, 2010

Re: [fw-general] Help with ajaxContext helper

2010-03-24 Thread Hector Virgen
Keep in mind that the AjaxContext helper needs two conditions to be satisfied in order for it to kick in: 1. The header "X_REQUESTED_WITH" must be "XMLHttpRequest" (automatic with Prototype and jQuery) and 2. The correct "format" parameter must be specified in the request, It's that sec

[fw-general] Re: How to convert different local float format to standard float format, using zend?

2010-03-24 Thread nisanth
//Are both values strings? no, its local format floating point numbers //And what is your system's locale? in my browser (opera),the local is 'English (IN) [en-IN]' What do you set within the registry? //Are you "hardcoding" en_IN or are you relying on the no //system/browser/autoset

[fw-general] RE: Zend_Db really slow

2010-03-24 Thread David Muir
Where is the database located in relation to the web server? My guess is that it's slow because the database server is not on the same network as the web server. Cheers, David -- View this message in context: http://n4.nabble.com/Zend-Db-really-slow-tp1680359p1680428.html Sent from the Zend Fra

Re: [fw-general] Zend_Db really slow

2010-03-24 Thread Matthew Weier O'Phinney
-- Sergio Rinaudo wrote (on Wednesday, 24 March 2010, 12:51 PM +0100): > thank you for reply, answering to your questions > > . Did you run the sql directly from command line or via a db client? > > This is an example query in the bootstrap > $db->query("SET NAMES 'utf8'"); > but also all the ot

[fw-general] Re: Default router still goes ahead of custom

2010-03-24 Thread zeliboba
Hector, thank you very much! I chosed another way of routes declaration. In bootstrap.php. So, I added also key 'route' = 'default' in pages array in navigation declaration, and it works now. I am sorry to bother you again. But as I remember in manual about routes the order of routes execution

RE: [fw-general] Zend_Db really slow

2010-03-24 Thread Sergio Rinaudo
Hi, thank you for reply, answering to your questions . Did you run the sql directly from command line or via a db client? This is an example query in the bootstrap $db->query("SET NAMES 'utf8'"); but also all the other queries are slow and make not difference if they are inside a controller o

Re: [fw-general] Zend_Db really slow

2010-03-24 Thread till
On Wed, Mar 24, 2010 at 12:01 PM, scs wrote: > Hi, > Could you write the sql sentence here? > How do you determine that the sql is slow and takes 6-8seconds? > Profiler is active? > Then, > . Did you run the sql directly from command line or via a db client? > . How many records are there in the m

Re: [fw-general] Zend_Db really slow

2010-03-24 Thread scs
Hi, Could you write the sql sentence here? How do you determine that the sql is slow and takes 6-8seconds? Profiler is active? Then, . Did you run the sql directly from command line or via a db client? . How many records are there in the main table? . Are there any index fields defined? . Any joine

[fw-general] Zend_Db really slow

2010-03-24 Thread Sergio Rinaudo
Hi everybody, I've started a new application project using Zend Framework, unfortunatelly I am experiencing a really slow database query ( 6~8 sec for very simple queries ). I'm not mantaining the server, the only thing I know that is unix. Any advice in what should I have to look or configur

[fw-general] Re: Problem in getting week number of sundays , in zend

2010-03-24 Thread linodavis
So, how can we get the week number of a particular day? for '21-03-2010' it is 12 for '22-03-2010' it is 12 for '2003-2010' it is 11 like that Iam using the code $date = new Zend_Date('22-03-2010', null, Zend_Registry::get('Zend_Locale')); echo $date->get(Zend_Date::WEEK); //output 12, cor

Re: [fw-general] Re: Problem in getting week number of sundays , in zend

2010-03-24 Thread Alayn Gortazar
El mié, 24-03-2010 a las 01:27 -0800, linodavis escribió: > So no solution for getting the exact week number , according to each user's > local ? > > if yes, can you pleas suggest it You can get the week related info of the locale with: $locale = new Zend_Locale('en_IN'); $weekList = Zend_Lo

[fw-general] Re: Problem in getting week number of sundays , in zend

2010-03-24 Thread linodavis
So no solution for getting the exact week number , according to each user's local ? if yes, can you pleas suggest it -- View this message in context: http://n4.nabble.com/Problem-in-getting-week-number-of-sundays-in-zend-tp1680149p1680271.html Sent from the Zend Framework mailing list archi

Re: [fw-general] Problem in getting week number of sundays , in zend

2010-03-24 Thread Alayn Gortazar
Hi, I suppose the "problem" is the week is calculated with PHP's date 'W' format. Which uses the ISO-8601 standard with Monday as the first day of the week. http://php.net/manual/en/function.date.php El mar, 23-03-2010 a las 23:42 -0800, linodavis escribió: > I want to get the week number of a p

[fw-general] Problem in getting week number of sundays , in zend

2010-03-24 Thread linodavis
I want to get the week number of a particular date , using Zend_Date My local is setted as English(IN) [en_IN], in Opera browser I am using the following code $date = new Zend_Date('22 Mar, 2010', null, Zend_Registry::get('Zend_Locale')); echo $date->get(Zend_Date::WEEK); //output 12, c