Re: [fw-general] ZF 1.9.3 and phpunit 3.4.0 zf_tool problem
Hi, I have applied Raphael's patch from #ZF-7894 and the PHPUnit error in fact is not showing anymore. However now, no providers are recognized: m...@groovy:~$ zf show version An Error Has Occurred Action 'show' is not a valid action. Zend Framework Command Line Console Tool v1.9.3 And Ladislav, what is the bug id for PHPUnit? Cheers, Marcello Raphael Stolt-2 wrote: Hi Benjamin, Can you provide some tips on how to catch if PHPUnit 3.4.0 is twice in the include_path and on how to remove it it this is the case? As I had the same problem and after reverting to one release before PHPUnit 3.4.0 the problem was gone. Cheers, Raphael 2009/9/22 Benjamin Eberlei kont...@beberlei.de do you have phpunit on your include path twice? On Tue, 22 Sep 2009 18:06:15 +0200, Ladislav Prskavec ladis...@prskavec.net wrote: If run zf tool: zf version Fatal error: Cannot redeclare class phpunit_framework_testsuite_dataprovider in /usr/local/zend/share/pear/PEAR/PHPUnit/Framework/TestSuite/DataProvider.php on line 64 Using Ubuntu 9.04 with Zend Server CE 4.0.5 (php 5.2.10, tested zf 1.9.2 and 1.9.3 ) Ladislav -- View this message in context: http://www.nabble.com/ZF-1.9.3-and-phpunit-3.4.0--zf_tool-problem-tp25562792p25776304.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] findDependentRowset Class not found in file
Hi Henry, Seems to me you have a problem with autoloading. How are you including the models path in the bootstrap? HenryG wrote: Hi all, I hope this is a really easy one. I've just started using findDependentRowset() but I get the following exception when trying to use it. If I call $programmes = $centre1-findDependentRowset('DbTable_Programme'); this happens: Message: File DbTable/Programme.php does not exist or class DbTable_Programme was not found in the file. My application structure is: -application --controllers --models ---DbTable (containing Programme.php with class DbTable_Programme) I can't figure out why it can't find the file or class as they both exist. Any suggestions? Many thanks, Henry -- View this message in context: http://www.nabble.com/findDependentRowset-Class-not-found-in-file-tp21994497p21995021.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] findDependentRowset Class not found in file
You are right, it's simple fix. Just make sure you add your models path to your include_path: set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . DIRECTORY_SEPARATOR . 'models'); Should do the trick. HenryG wrote: Thanks for the quick reply, It's pretty much as per the GuestBook application, index.php sets up the include path and Zend_Loader. The boot strap looks like this: defined('APPLICATION_PATH') or define('APPLICATION_PATH', dirname(__FILE__)); $frontController = Zend_Controller_Front::getInstance(); $frontController-setControllerDirectory(APPLICATION_PATH . '/controllers'); I can't see the models path set anywhere, I assume this is set to the default location somewhere. It must be something easy causing this but I just can't seem to find out what! Marcello Duarte wrote: Hi Henry, Seems to me you have a problem with autoloading. How are you including the models path in the bootstrap? HenryG wrote: Hi all, I hope this is a really easy one. I've just started using findDependentRowset() but I get the following exception when trying to use it. If I call $programmes = $centre1-findDependentRowset('DbTable_Programme'); this happens: Message: File DbTable/Programme.php does not exist or class DbTable_Programme was not found in the file. My application structure is: -application --controllers --models ---DbTable (containing Programme.php with class DbTable_Programme) I can't figure out why it can't find the file or class as they both exist. Any suggestions? Many thanks, Henry -- View this message in context: http://www.nabble.com/findDependentRowset-Class-not-found-in-file-tp21994497p21995468.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Db_Select Order By
Hi, why are you trying to order by a statement instead of a field? What are you trying to accomplish. Do you want to order by the status? display only the tuples with status as new? order by status, but having new first and the others following? It's not clear what you are trying to do. Please give more information. AZEL wrote: hi, but $select-where('b.status = ?', 'new')-order('b.status ASC'); and $select-order(b.status = 'new'); has 2 differnt results. $select-order(b.status = 'new'); sort by status where is equal to 'new' at first. On Wed, Oct 8, 2008 at 3:33 PM, Tom Graham [EMAIL PROTECTED] wrote: Hi, Try something like: $select-where('b.status = ?', 'new')-order('b.status ASC'); On 8 Oct 2008, at 13:22, Elvin Şiriyev wrote: hi, i can't use order by like that: $select-order(b.status = 'new'); Error Message : *Fatal error*: Uncaught exception 'Zend_Db_Statement_Mysqli_Exception' with message 'Mysqli prepare error: Unknown column 'b.status = 'new'' in 'order clause'' in ... Thanks for helps, -- Elvin Şiriyev -- Elvin Şiriyev -- View this message in context: http://www.nabble.com/Zend_Db_Select-Order-By-tp19877596p19898299.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Catching catched exceptions
There's no cheap way of catching a exception alread catched. I'd suggest you looked into changing you catch block. Let the external components deal with the exception. While you don't have you code ready to deal with the exception, a mid-term fix could be throwing another Exception from catch. try { $result = $dbconn-query(SELECT * FROM TABLE); } catch (Exception $e) { throw new My_Db_Exception; } In your exception constructor deal with the exception as you are thinking of. Will that work for you? Mauricio Cuenca wrote: Hello Marcelo, It's basically something like this: try { $result = $dbconn-query(SELECT * FROM TABLE); } catch (Exception $e) { echo Something is wrong...; exit(); } I could modify the catch part and do some redirection or something similar, but the code has many SQL calls like this. I don't want to change each one manually. Marcello Duarte wrote: What code is in your catch statement? Mauricio Cuenca wrote: Hello, I have an application that started small and now its big. The problem is that each database transaction has a try/catch statement. Now I want to capture all those exceptions and send them to the error controller to display friendly error messages to users in the production environment. Is there a way to force the Error Controller to catch this already catched exceptions without modifying each sql try/catch block in the code? Thanks! -- View this message in context: http://www.nabble.com/Catching-catched-exceptions-tp19874696p19876265.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Catching catched exceptions
What code is in your catch statement? Mauricio Cuenca wrote: Hello, I have an application that started small and now its big. The problem is that each database transaction has a try/catch statement. Now I want to capture all those exceptions and send them to the error controller to display friendly error messages to users in the production environment. Is there a way to force the Error Controller to catch this already catched exceptions without modifying each sql try/catch block in the code? Thanks! -- View this message in context: http://www.nabble.com/Catching-catched-exceptions-tp19874696p19875672.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Catching catched exceptions
I wouldn't renounce using try/catch altogether. They are important for object's messaging. They are not merely errors handlers. Exceptions are themselves objects sending a message when a rule is broken. Construct you try/catch hierarchy so that it is extensible. That is, don't catch unless you are at a level of your application to decide logically/graphically wise how to handle the exception. Mauricio Cuenca wrote: What I conclude about this is that is better for my future application to not have try/catch blocks any at all. Just have the main one in the bootstrap and let it do the job. Am I right or not catching individual exceptions is not a good approach? -- View this message in context: http://www.nabble.com/Catching-catched-exceptions-tp19874696p19877880.html Sent from the Zend Framework mailing list archive at Nabble.com.