Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1
You missed one thing... You can have empty-byte files: BUT: When there is no translation available at all, so if there is not a single translation, you will get an error setting the language. WHEN you set another locale with setLocale it checks if the language exists by testing if there is anything to translate at all. Setting a language without having a translation is not possible. So you can have multiple translation files and some of them are empty files... but minimum one single translation must be available. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Thomas Weidner [EMAIL PROTECTED] Cc: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 11:04 PM Subject: Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi Thomas, Thanks for the reply. I thought I made myself clear. Here is the simplest code that can cause the problem require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); $tr = new Zend_Translate('csv', 'en_US.txt', 'en_US'); $tr-setLocale('en_US'); If en_US.txt exists but has zero bytes I get Zend_Translate_Exception: Language (en_US) has to be added before it can be used If I add a single like test;test everything goes fine. In this example I only have one language so the setLocale should be unnecessary but in my real app I have more than two so when the user chooses one I use the setLocale. About the #zftalk how can I access this ? (off-list if found appropriate). I don't access IRC in more than a decade :) Thanks. On Mon, Aug 4, 2008 at 12:58 PM, Thomas Weidner [EMAIL PROTECTED] wrote: When there would be a problem when adding the file you would get an exception. Why do you not simply debug your code ? Look which files are added, look which locale was found, look what's requested to be translated. All needed methods and functionallities are available. Just call them and you will see what's going wrong. To note: Without any data, and believe me... it works here but not there is not enough data for reproduction, there is no way to help you. You could just go to #zftalk... there are always people online who can help you. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 5:27 PM Subject: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi, Before opening a bug I'd like to know if this is an expected behavior change. Until 1.5.2 I could have an empty (zero bytes) file used with Zend_Translate ('csv', $path, $locale). Now with 1.5.3 and 1.6RC1 I can't . it does not complain when I create the object, it does not complain when I use addTranslation, but aborts with 'locale X must be added before it is used' when I call the setLocale(X). Thanks.
[fw-general] Zend_Form and generating fields
I`d like to generate a form which lists products and provides one field for each product. Seems to be easy, so I do sth like: http://paste2.org/p/55571 Unfortunately it is slow! For 10 products it takes 0.6 sec. to generate. Is there a better (more efficient) method to build such forms via Zend_Form? The same I noticed when tried to create a select element which contained many options (i.e. list of countries). Without ajax (autocomplete) it takes ages to generate and seems to be useless in this case. Shame. I wonder if Zend_Form can be used when it comes to generate a lot of inputs/options in select or I`m forced to create it by hand? -- View this message in context: http://www.nabble.com/Zend_Form-and-generating-fields-tp18826312p18826312.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Json + Image Stream
Hi there I am need to upload an image to the server (from a j2me midlet). I have attemted uploading a byte stream but the Zend_Json_Server_Request is throwing an error. Can json handle byte streams? If not, what other format could I upload the in? Thank-you, Paola -- View this message in context: http://www.nabble.com/Json-%2B-Image-Stream-tp18827597p18827597.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] How are you using Zend_Pdf?
Willie Alberty wrote: Kevin and I are about ready to introduce the comprehensive Zend_Pdf updates I described last week for community review and early testing. I am working on shoring up the documentation now and could use some feedback: In what ways are you are currently using Zend_Pdf? I create complex reports from scratch. I have page decorators and classes for building tables and paragraphs. Most of it uses basic -draw methods, but in some cases I calculate text positioning for aligning, line wrapping etc. using methods available in styles and fonts classes. Karol -- View this message in context: http://www.nabble.com/How-are-you-using-Zend_Pdf--tp18767550p18828816.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] documentation typo
I came across one or two typos in the documentation that I thought I'd pass along. In Example 10.73 of Zend_Db_Table, shouldn't bugs be capitalized? I'm new to ZF. But, all of the other Class names are capitalized. In 12.1. Introduction of Zend_Dojo, helpers is spelled helpres.
Re: [fw-general] Zend_Form and generating fields
-- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 01:00 AM -0700): I`d like to generate a form which lists products and provides one field for each product. Seems to be easy, so I do sth like: http://paste2.org/p/55571 Unfortunately it is slow! For 10 products it takes 0.6 sec. to generate. Is there a better (more efficient) method to build such forms via Zend_Form? The same I noticed when tried to create a select element which contained many options (i.e. list of countries). Without ajax (autocomplete) it takes ages to generate and seems to be useless in this case. Shame. I wonder if Zend_Form can be used when it comes to generate a lot of inputs/options in select or I`m forced to create it by hand? Have you considered caching? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] Json + Image Stream
Hi Paola, can't you use an HTTP POST upload for this? There is a component called Zend_File_Transfer in the incubator that will nicely handle HTTP uploads for you on the server side. It should also be included in RC2, IIRC. Best regards, Tobias 2008/8/5 Paolav [EMAIL PROTECTED] Hi there I am need to upload an image to the server (from a j2me midlet). I have attemted uploading a byte stream but the Zend_Json_Server_Request is throwing an error. Can json handle byte streams? If not, what other format could I upload the in? Thank-you, Paola -- View this message in context: http://www.nabble.com/Json-%2B-Image-Stream-tp18827597p18827597.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend Form and addError
Hi, Adding an error on an element 'multiCheckbox' does not work : $droitModel = new Droit(); $tabDroits = $droitModel-getDroitsModule($this-initData-module); $droits = $this-createElement('multiCheckbox', 'droits'); $droits-setMultiOptions($tabDroits) -setLabel($this-_translateController-_('type_droits')) -setValue($this-initData-droits) -setDecorators($this-_elementDecorators) -setRequired(true); $droits-addError('test'); Error : Notice: Array to string conversion in /usr/share/php/Zend/Form/Element.php on line 2063. Zend_Form_Element ligne 2063 : $messages[$key] = str_replace('%value%', $value, $message); $value is a array in the case of an element with a multiOptions. Cordialement, Samuel verdier Directeur technique [EMAIL PROTECTED]
Re: [fw-general] Zend Form and addError
-- Samuel Verdier [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 02:31 PM +0200): Adding an error on an element 'multiCheckbox' does not work : $droitModel = new Droit(); $tabDroits = $droitModel-getDroitsModule($this-initData-module); $droits = $this-createElement('multiCheckbox', 'droits'); $droits-setMultiOptions($tabDroits) -setLabel($this-_translateController-_('type_droits')) -setValue($this-initData-droits) -setDecorators($this-_elementDecorators) -setRequired(true); $droits-addError('test'); Error : Notice: Array to string conversion in /usr/share/php/Zend/Form/Element.php on line 2063. Zend_Form_Element ligne 2063 : $messages[$key] = str_replace('%value%', $value, $message); $value is a array in the case of an element with a multiOptions. Nice catch -- I've added an issue in the tracker for this: http://framework.zend.com/issues/browse/ZF-3852 -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] Zend_Form and generating fields
Yes but caching doesn`t answer the question why this operation is so slow. Matthew Weier O'Phinney-3 wrote: -- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 01:00 AM -0700): I`d like to generate a form which lists products and provides one field for each product. Seems to be easy, so I do sth like: http://paste2.org/p/55571 Unfortunately it is slow! For 10 products it takes 0.6 sec. to generate. Is there a better (more efficient) method to build such forms via Zend_Form? The same I noticed when tried to create a select element which contained many options (i.e. list of countries). Without ajax (autocomplete) it takes ages to generate and seems to be useless in this case. Shame. I wonder if Zend_Form can be used when it comes to generate a lot of inputs/options in select or I`m forced to create it by hand? Have you considered caching? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/Zend_Form-and-generating-fields-tp18826312p18830980.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Form and generating fields
-- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 06:20 AM -0700): Yes but caching doesn`t answer the question why this operation is so slow. You're right, it doesn't. We're planning on doing a performance audit for 1.7, and this is one area I've already marked (others have noted similiar issues with Multi elements that have large sets). Please file an issue for this, and indicate: * What operating system you're using * What version of PHP you're using * Whether or not you're using an opcode cache (you should!) * The size of the data set you're looping over * What benchmarks you may have run This will help us better understand the problem set so that we can have accurate profiling -- which will hopefully lead to some optimizations. Matthew Weier O'Phinney-3 wrote: -- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 01:00 AM -0700): I`d like to generate a form which lists products and provides one field for each product. Seems to be easy, so I do sth like: http://paste2.org/p/55571 Unfortunately it is slow! For 10 products it takes 0.6 sec. to generate. Is there a better (more efficient) method to build such forms via Zend_Form? The same I noticed when tried to create a select element which contained many options (i.e. list of countries). Without ajax (autocomplete) it takes ages to generate and seems to be useless in this case. Shame. I wonder if Zend_Form can be used when it comes to generate a lot of inputs/options in select or I`m forced to create it by hand? Have you considered caching? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/Zend_Form-and-generating-fields-tp18826312p18830980.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
[fw-general] zend form adderror and isvalid
Hi, In use addError('test'); And : $form-isValid($formData); retour true. Is this normal? So I do : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } Cordialement, Samuel verdier - Directeur technique [EMAIL PROTECTED]
RE: [fw-general] zend form adderror and isvalid
and when I do this : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } if there are errors added by addError() the others errors from validator form-isValid($formData) are not displayed Cordialement, Samuel verdier Directeur technique [EMAIL PROTECTED] -Message d'origine- De : Samuel Verdier [mailto:[EMAIL PROTECTED] Envoyé : mardi 5 août 2008 15:43 À : fw-general@lists.zend.com Objet : [fw-general] zend form adderror and isvalid Hi, In use addError('test'); And : $form-isValid($formData); retour true. Is this normal? So I do : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } Cordialement, Samuel verdier - Directeur technique [EMAIL PROTECTED]
RE: [fw-general] zend form adderror and isvalid
I found the same problem but no answer : http://www.nabble.com/Zend-Form-isValid%28%29---custom-errors-td18729453.htm l#a18729453 I found the same problem Cordialement, Samuel verdier Directeur technique [EMAIL PROTECTED] -Message d'origine- De : Samuel Verdier [mailto:[EMAIL PROTECTED] Envoyé : mardi 5 août 2008 15:47 À : fw-general@lists.zend.com Objet : RE: [fw-general] zend form adderror and isvalid and when I do this : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } if there are errors added by addError() the others errors from validator form-isValid($formData) are not displayed Cordialement, Samuel verdier Directeur technique [EMAIL PROTECTED] -Message d'origine- De : Samuel Verdier [mailto:[EMAIL PROTECTED] Envoyé : mardi 5 août 2008 15:43 À : fw-general@lists.zend.com Objet : [fw-general] zend form adderror and isvalid Hi, In use addError('test'); And : $form-isValid($formData); retour true. Is this normal? So I do : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } Cordialement, Samuel verdier - Directeur technique [EMAIL PROTECTED]
Re: [fw-general] Zend_Form and generating fields
It`s great to hear that performance audit is planning. I`ll definitely share everything I`ve noticed and benchmarked. Thanks for info Matthew. Matthew Weier O'Phinney-3 wrote: -- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 06:20 AM -0700): Yes but caching doesn`t answer the question why this operation is so slow. You're right, it doesn't. We're planning on doing a performance audit for 1.7, and this is one area I've already marked (others have noted similiar issues with Multi elements that have large sets). Please file an issue for this, and indicate: * What operating system you're using * What version of PHP you're using * Whether or not you're using an opcode cache (you should!) * The size of the data set you're looping over * What benchmarks you may have run This will help us better understand the problem set so that we can have accurate profiling -- which will hopefully lead to some optimizations. Matthew Weier O'Phinney-3 wrote: -- Michał Zieliński [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 01:00 AM -0700): I`d like to generate a form which lists products and provides one field for each product. Seems to be easy, so I do sth like: http://paste2.org/p/55571 Unfortunately it is slow! For 10 products it takes 0.6 sec. to generate. Is there a better (more efficient) method to build such forms via Zend_Form? The same I noticed when tried to create a select element which contained many options (i.e. list of countries). Without ajax (autocomplete) it takes ages to generate and seems to be useless in this case. Shame. I wonder if Zend_Form can be used when it comes to generate a lot of inputs/options in select or I`m forced to create it by hand? Have you considered caching? -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/Zend_Form-and-generating-fields-tp18826312p18830980.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/ -- View this message in context: http://www.nabble.com/Zend_Form-and-generating-fields-tp18826312p18831763.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] zend form adderror and isvalid
-- Samuel Verdier [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 03:43 PM +0200): In use addError('test'); And : $form-isValid($formData); retour true. Is this normal? Yes. The use case for addError() is to add an error message to the element or form. isValid() is for validating the various form elements. Adding an error message is not indicative of the actual validations performed. So I do : if (count($form-getMessages()) == 0 $form-isValid($formData)) { echo 'OK'; } -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
[fw-general] Zend_Date Problems
Hi! I new here, and not speak english very well. So, I have some problems using Zend_Date, i don't know but year 2038 is not valid, i think some related to timestamp limit or locate, or I not using Zend_Date correct way. CODE: //date_default_timezone_set ( 'America/New_York' ); //$locale = new Zend_Locale( 'en_US' ); date_default_timezone_set ( 'America/Sao_Paulo' ); $locale = new Zend_Locale( 'pt_BR' ); function isValidDate( $value, $locale ) { if ( Zend_Date::isDate( $value, 'MM-dd-', $locale ) ) echo $value: Is Valid br/; else echo $value: Is NOT Valid br/; } isValidDate( '01-01-2008', $locale ); // Return 01-01-2008: Is Valid isValidDate( '01-01-2020', $locale ); // Return 01-01-2020: Is Valid isValidDate( '01-01-2037', $locale ); // Return 01-01-2037: Is Valid isValidDate( '01-01-2038', $locale ); // Return 01-01-2038: Is NOT Valid isValidDate( '01-01-2039', $locale ); // Return 01-01-2039: Is Valid isValidDate( '01-01-3000', $locale ); // Return 01-01-3000: Is Valid isValidDate( '01-01-0001', $locale ); // Return 01-01-0001: Is Valid --- When I change locale and time zone to en_US:America/New_York, year 2038 become valid, I make tests changing format 'MM-dd-' to my reginal format 'dd-MM-', or switching 'y' to 'Y', and still get problem. Another thing I want know, is there some option to make Zend_Date not 'try' detect time zone from date string, this generate some warnings because of @. I use error_handler to get errors, and when my application go to production, normaly I set display_errors off, and send errors by email. CODE: $zDate = new Zend_Date('01.01.2008', 'dd.MM.', 'en_US'); print $zDate-getIso(); // //[Warning]Zend\Date\DateObject.php:1016 timezone_open(): Unknown or bad timezone (2009) //[Cause] if ([EMAIL PROTECTED]($zone)) { // --- I think, if format not specify timezone, this shoud not verify it. Thanks. -- Haroldo Mitsumi Murata [K33]
Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1
Hi Thomas, Thanks for the clarification. This has changed since 1.5.2 so if it is not already mentioned somewhere I think that it should be in the release notes. It did break my apps :( thanks that it is a simple correction and that the unit tests spotted... Regards. On Tue, Aug 5, 2008 at 2:13 AM, Thomas Weidner [EMAIL PROTECTED] wrote: You missed one thing... You can have empty-byte files: BUT: When there is no translation available at all, so if there is not a single translation, you will get an error setting the language. WHEN you set another locale with setLocale it checks if the language exists by testing if there is anything to translate at all. Setting a language without having a translation is not possible. So you can have multiple translation files and some of them are empty files... but minimum one single translation must be available. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com
Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1
Hi Thomas, Is it possible to change the error message to reflect this, or create a new exception that tests for this particular case? The current error message doesn't really point to this being the cause of the error. -Matt On Mon, Aug 4, 2008 at 11:13 PM, Thomas Weidner [EMAIL PROTECTED]wrote: You missed one thing... You can have empty-byte files: BUT: When there is no translation available at all, so if there is not a single translation, you will get an error setting the language. WHEN you set another locale with setLocale it checks if the language exists by testing if there is anything to translate at all. Setting a language without having a translation is not possible. So you can have multiple translation files and some of them are empty files... but minimum one single translation must be available. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Thomas Weidner [EMAIL PROTECTED] Cc: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 11:04 PM Subject: Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi Thomas, Thanks for the reply. I thought I made myself clear. Here is the simplest code that can cause the problem require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); $tr = new Zend_Translate('csv', 'en_US.txt', 'en_US'); $tr-setLocale('en_US'); If en_US.txt exists but has zero bytes I get Zend_Translate_Exception: Language (en_US) has to be added before it can be used If I add a single like test;test everything goes fine. In this example I only have one language so the setLocale should be unnecessary but in my real app I have more than two so when the user chooses one I use the setLocale. About the #zftalk how can I access this ? (off-list if found appropriate). I don't access IRC in more than a decade :) Thanks. On Mon, Aug 4, 2008 at 12:58 PM, Thomas Weidner [EMAIL PROTECTED] wrote: When there would be a problem when adding the file you would get an exception. Why do you not simply debug your code ? Look which files are added, look which locale was found, look what's requested to be translated. All needed methods and functionallities are available. Just call them and you will see what's going wrong. To note: Without any data, and believe me... it works here but not there is not enough data for reproduction, there is no way to help you. You could just go to #zftalk... there are always people online who can help you. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 5:27 PM Subject: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi, Before opening a bug I'd like to know if this is an expected behavior change. Until 1.5.2 I could have an empty (zero bytes) file used with Zend_Translate ('csv', $path, $locale). Now with 1.5.3 and 1.6RC1 I can't . it does not complain when I create the object, it does not complain when I use addTranslation, but aborts with 'locale X must be added before it is used' when I call the setLocale(X). Thanks.
[fw-general] Zend_Db not inserting UTF-8?
I'm trying to insert a name into our database using the following call: $db-insert( 'MBR_GEN', $data, 'EML' ); $data includes the column names to value. One column is 'FIRST_NM' and the value is: Josué However, when I insert it into our database, it inserts as: Josu¿¿ I've even did a var_dump() of $data and it shows fine there. It's only when I insert. I manually altered the data in the table, and it's fine. So...our DB seems to support it. Any clue as to why Zend_Db is altering the value? --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/
Re: [fw-general] Zend_Db not inserting UTF-8?
Which database are you using? MySQL, PostgreSQL, Oracle...? Have you tried to specify the client encoding in database connection setup? In MySQLi and PDO_MySQL will be $db-query('SET NAMES UTF8'); if you're inserting data with a web form, the page encoding is utf-8? On Tue, Aug 5, 2008 at 18:07, Philip G [EMAIL PROTECTED] wrote: I'm trying to insert a name into our database using the following call: $db-insert( 'MBR_GEN', $data, 'EML' ); $data includes the column names to value. One column is 'FIRST_NM' and the value is: Josué However, when I insert it into our database, it inserts as: Josu¿¿ I've even did a var_dump() of $data and it shows fine there. It's only when I insert. I manually altered the data in the table, and it's fine. So...our DB seems to support it. Any clue as to why Zend_Db is altering the value? --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ -- Xavier Vidal Piera Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] [EMAIL PROTECTED] http://web.xaviervidal.net 610.68.41.78
[fw-general] Zend_Cache with 'Class' frontend - problem with __construct($a, $b)
Hi all, I'm trying to cache the entire class using Zend_Cache_Frontend_Class. My class instantiation code looks like (yes, $a and $b have to go into the constructor): $_myClass = new myClass($a, $b); After reading ZF manual, I came up with the following code: $frontendOptions = array( 'cached_entity' = new myClass($a, $b) ); $backendOptions = array('cache_dir' = realpath(C:/tmp)); $cache = Zend_Cache::factory('Class', 'File', $frontendOptions, $backendOptions); Now, the problem is, how do I use this $cache to retrieve cached instantiated object? Of course, $cache-__construct($a, $b) fails (it also looks stupid - I already passed $a and $b in). What to do? Any ideas? Thanks, Temuri -- View this message in context: http://www.nabble.com/Zend_Cache-with-%27Class%27-frontend---problem-with-__construct%28%24a%2C-%24b%29-tp18834887p18834887.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Cache with 'Class' frontend - problem with __construct($a, $b)
I use the Registry for this. So in your bootstrap: Zend_Registry::set('cache', Zend_Cache::factory( ... )); then in your action or wherever: Zend_Registry::get('cache')-save($var, 'var'); Zend_Registry::get('cache')-load('var') Hope this helps! On Tue, Aug 5, 2008 at 11:32 AM, temuri [EMAIL PROTECTED] wrote: Hi all, I'm trying to cache the entire class using Zend_Cache_Frontend_Class. My class instantiation code looks like (yes, $a and $b have to go into the constructor): $_myClass = new myClass($a, $b); After reading ZF manual, I came up with the following code: $frontendOptions = array( 'cached_entity' = new myClass($a, $b) ); $backendOptions = array('cache_dir' = realpath(C:/tmp)); $cache = Zend_Cache::factory('Class', 'File', $frontendOptions, $backendOptions); Now, the problem is, how do I use this $cache to retrieve cached instantiated object? Of course, $cache-__construct($a, $b) fails (it also looks stupid - I already passed $a and $b in). What to do? Any ideas? Thanks, Temuri -- View this message in context: http://www.nabble.com/Zend_Cache-with-%27Class%27-frontend---problem-with-__construct%28%24a%2C-%24b%29-tp18834887p18834887.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend_Paginate how to integrate?
Hallo, I'm a bit confused, how to integrate Zend_Paginate into my app framework. In order to use the DbSelect adapter, I need a select object, which is in my model. In order to display the page numbers I need the view object which I have in the controller. In the docu I can't find any examples. The use case in the proposal has this excample: $db = new Zend_Db_Adapter_Pdo_Sqlite(array( 'dbname' = 'example.sqlite' )); $sampleData = $db-select()-from('example'); // this is an array result set, not a select object... $paginator = Zend_Paginator::factory($sampleData); ..some configuration... $this-view-pages = $paginator; In reality I have this: $data = $mymodel-getObjectData($someConditions) $this-view-data = $data; Should I instantiate the paginator in the model and have then: $data = $mymodel-getObjectData($someConditions) $this-view-data = $data;# $paginator = $mymodel-getPaginator(); $paginator-setView($this-view) $this-view-pages = $paginator; The confiuraten of the paginator I would like to provide in the bootstrap process simelary as in ZYM. I would like to integrate Zend_Paginate as an configurable feature, which my model base class should be aware of. My model class provides a list function wich list data objects based on a passed condition, using Zend_Db_Table_Select. Thank you for your advice Axel -- View this message in context: http://www.nabble.com/Zend_Paginate-how-to-integrate--tp18835208p18835208.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Cache with 'Class' frontend - problem with __construct($a, $b)
Hi, thanks for the response. Not sure this is exactly what I had in mind. ZF manual contains the following example: ---8 class test { public function foobar2($param1, $param2) {...} } $frontendOptions = array( 'cached_entity' = new test() // An instance of the class ); $cache = Zend_Cache::factory(...); # The cached call $res = $cache-foobar2('1', '2'); ---8 This is all fine and dandy when you're interested in any method other than a constructor. However, I am trying to cache the class that's instantiated based on *mandatory* constructor parameters, and it may not have any other methods: $_myClass = new myClass($a, b); So, I figured it should say: $frontendOptions = array( 'cached_entity' = new myClass($a, b) // An instance of the class ); $cache = Zend_Cache::factory('Class', 'File', $frontendOptions, $backendOptions); The problem is, how should I use $cache to fetch cached instance of $myClass? Temuri Josh Team wrote: I use the Registry for this. So in your bootstrap: Zend_Registry::set('cache', Zend_Cache::factory( ... )); then in your action or wherever: Zend_Registry::get('cache')-save($var, 'var'); Zend_Registry::get('cache')-load('var') Hope this helps! -- View this message in context: http://www.nabble.com/Zend_Cache-with-%27Class%27-frontend---problem-with-__construct%28%24a%2C-%24b%29-tp18834887p18835410.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Date Problems
I think, if format not specify timezone, this shoud not verify it. This is not true. A date/timestamp always include a timezone EXCEPT you specify UTC or GMT as timezone. If you dont specify one, it will detect it automatically. When you have problems please try always with the latest available release. When this does not help, please add a issue to jira adding description, and reproducable code so we can fix the problem. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: Haroldo MM [EMAIL PROTECTED] To: ZF General List fw-general@lists.zend.com Sent: Tuesday, August 05, 2008 4:37 PM Subject: [fw-general] Zend_Date Problems Hi! I new here, and not speak english very well. So, I have some problems using Zend_Date, i don't know but year 2038 is not valid, i think some related to timestamp limit or locate, or I not using Zend_Date correct way. CODE: //date_default_timezone_set ( 'America/New_York' ); //$locale = new Zend_Locale( 'en_US' ); date_default_timezone_set ( 'America/Sao_Paulo' ); $locale = new Zend_Locale( 'pt_BR' ); function isValidDate( $value, $locale ) { if ( Zend_Date::isDate( $value, 'MM-dd-', $locale ) ) echo $value: Is Valid br/; else echo $value: Is NOT Valid br/; } isValidDate( '01-01-2008', $locale ); // Return 01-01-2008: Is Valid isValidDate( '01-01-2020', $locale ); // Return 01-01-2020: Is Valid isValidDate( '01-01-2037', $locale ); // Return 01-01-2037: Is Valid isValidDate( '01-01-2038', $locale ); // Return 01-01-2038: Is NOT Valid isValidDate( '01-01-2039', $locale ); // Return 01-01-2039: Is Valid isValidDate( '01-01-3000', $locale ); // Return 01-01-3000: Is Valid isValidDate( '01-01-0001', $locale ); // Return 01-01-0001: Is Valid --- When I change locale and time zone to en_US:America/New_York, year 2038 become valid, I make tests changing format 'MM-dd-' to my reginal format 'dd-MM-', or switching 'y' to 'Y', and still get problem. Another thing I want know, is there some option to make Zend_Date not 'try' detect time zone from date string, this generate some warnings because of @. I use error_handler to get errors, and when my application go to production, normaly I set display_errors off, and send errors by email. CODE: $zDate = new Zend_Date('01.01.2008', 'dd.MM.', 'en_US'); print $zDate-getIso(); // //[Warning]Zend\Date\DateObject.php:1016 timezone_open(): Unknown or bad timezone (2009) //[Cause] if ([EMAIL PROTECTED]($zone)) { // --- I think, if format not specify timezone, this shoud not verify it. Thanks. -- Haroldo Mitsumi Murata [K33]
Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1
Is it possible to change the error message to reflect this, or create a new exception that tests for this particular case? The current error message doesn't really point to this being the cause of the error. This has already be changed. It will be in trunk latest tomorrow. But also to mention: This behaviour is integrated since Oct. 2007. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: Matthew Ratzloff [EMAIL PROTECTED] To: Thomas Weidner [EMAIL PROTECTED] Cc: Zend Framework General fw-general@lists.zend.com Sent: Tuesday, August 05, 2008 5:41 PM Subject: Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi Thomas, Is it possible to change the error message to reflect this, or create a new exception that tests for this particular case? The current error message doesn't really point to this being the cause of the error. -Matt On Mon, Aug 4, 2008 at 11:13 PM, Thomas Weidner [EMAIL PROTECTED]wrote: You missed one thing... You can have empty-byte files: BUT: When there is no translation available at all, so if there is not a single translation, you will get an error setting the language. WHEN you set another locale with setLocale it checks if the language exists by testing if there is anything to translate at all. Setting a language without having a translation is not possible. So you can have multiple translation files and some of them are empty files... but minimum one single translation must be available. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Thomas Weidner [EMAIL PROTECTED] Cc: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 11:04 PM Subject: Re: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi Thomas, Thanks for the reply. I thought I made myself clear. Here is the simplest code that can cause the problem require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); $tr = new Zend_Translate('csv', 'en_US.txt', 'en_US'); $tr-setLocale('en_US'); If en_US.txt exists but has zero bytes I get Zend_Translate_Exception: Language (en_US) has to be added before it can be used If I add a single like test;test everything goes fine. In this example I only have one language so the setLocale should be unnecessary but in my real app I have more than two so when the user chooses one I use the setLocale. About the #zftalk how can I access this ? (off-list if found appropriate). I don't access IRC in more than a decade :) Thanks. On Mon, Aug 4, 2008 at 12:58 PM, Thomas Weidner [EMAIL PROTECTED] wrote: When there would be a problem when adding the file you would get an exception. Why do you not simply debug your code ? Look which files are added, look which locale was found, look what's requested to be translated. All needed methods and functionallities are available. Just call them and you will see what's going wrong. To note: Without any data, and believe me... it works here but not there is not enough data for reproduction, there is no way to help you. You could just go to #zftalk... there are always people online who can help you. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: mbneto [EMAIL PROTECTED] To: Zend Framework General fw-general@lists.zend.com Sent: Monday, August 04, 2008 5:27 PM Subject: [fw-general] Bug or feature in Zend_Translate 1.5.3/1.6RC1 Hi, Before opening a bug I'd like to know if this is an expected behavior change. Until 1.5.2 I could have an empty (zero bytes) file used with Zend_Translate ('csv', $path, $locale). Now with 1.5.3 and 1.6RC1 I can't . it does not complain when I create the object, it does not complain when I use addTranslation, but aborts with 'locale X must be added before it is used' when I call the setLocale(X). Thanks.
Re: [fw-general] documentation typo
In Example 10.73 of Zend_Db_Table, shouldn't bugs be capitalized? I'm new to ZF. But, all of the other Class names are capitalized. It is intentional, reflects a lowercase table name. In 12.1. Introduction of Zend_Dojo, helpers is spelled helpres. Thanks, fixed with revision 10693. Regards, Ádám
Re: [fw-general] Json + Image Stream
Havent been able to resolve this. Instead, have bundled the image in XML-RPC. With all the debate of json vs. xml, this appears to be a definite short coming of either json or Zend's implementation of json. Hoping someone proves me worng. Smiles, Paola Paolav wrote: Hi there I am need to upload an image to the server (from a j2me midlet). I have attemted uploading a byte stream but the Zend_Json_Server_Request is throwing an error. Can json handle byte streams? If not, what other format could I upload the in? Thank-you, Paola -- View this message in context: http://www.nabble.com/Json-%2B-Image-Stream-tp18827597p18836005.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Json + Image Stream
Havent been able to resolve this. Instead, have bundled the image in XML-RPC. With all the debate of json vs. xml, this appears to be a definite short coming of either json or Zend's implementation of json. Hoping someone proves me wrong. Smiles, Paola Paolav wrote: Hi there I am need to upload an image to the server (from a j2me midlet). I have attemted uploading a byte stream but the Zend_Json_Server_Request is throwing an error. Can json handle byte streams? If not, what other format could I upload the in? Thank-you, Paola -- View this message in context: http://www.nabble.com/Json-%2B-Image-Stream-tp18827597p18836014.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Paginate how to integrate?
2008/8/5 Axel Wüstemann [EMAIL PROTECTED]: I'm a bit confused, how to integrate Zend_Paginate into my app framework. In order to use the DbSelect adapter, I need a select object, which is in my model. In order to display the page numbers I need the view object which I have in the controller. Not sure if it can help, but I have written an adapter for models that extends the paginator select adapter. http://ossigeno.svn.sourceforge.net/viewvc/ossigeno/trunk/core/library/Otk/Paginator/Adapter/Model.php?view=markup Now in models I do something like: public function prepareArticles($page) { [...] $select = $table-select() -from($table, array('id')) -where('section = ?', $this-_row-id) -order('date '. $this-_row-view_order); $paginator = new Zend_Paginator( new Otk_Paginator_Adapter_Model($select, 'Otk_Content_Article')); $paginator-setItemCountPerPage((int) $this-_row-view_limit); $paginator-setCurrentPageNumber($page); return $paginator; } Otk_Content_Article is the classname of the model. (note that the adapter returns arrays of structures (associative array) calling prepare() of models, an extension of toArray(), but with little editing can return the object themselves) -- Giorgio Sironi Piccolo Principe Ossigeno Scripter http://www.sourceforge.net/projects/ossigeno
Re: [fw-general] Zend_Db not inserting UTF-8?
It's an Oracle database. Oops. Missed that piece. The data is submitted via the web through AMFPHP. The data is in the PHP variables correctly. It's just going from $db-insert() to the database it gets altered. --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ On Tue, Aug 5, 2008 at 11:14 AM, Xavier Vidal Piera [EMAIL PROTECTED]wrote: Which database are you using? MySQL, PostgreSQL, Oracle...? Have you tried to specify the client encoding in database connection setup? In MySQLi and PDO_MySQL will be $db-query('SET NAMES UTF8'); if you're inserting data with a web form, the page encoding is utf-8? On Tue, Aug 5, 2008 at 18:07, Philip G [EMAIL PROTECTED] wrote: I'm trying to insert a name into our database using the following call: $db-insert( 'MBR_GEN', $data, 'EML' ); $data includes the column names to value. One column is 'FIRST_NM' and the value is: Josué However, when I insert it into our database, it inserts as: Josu¿¿ I've even did a var_dump() of $data and it shows fine there. It's only when I insert. I manually altered the data in the table, and it's fine. So...our DB seems to support it. Any clue as to why Zend_Db is altering the value? --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ -- Xavier Vidal Piera Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] [EMAIL PROTECTED] http://web.xaviervidal.net 610.68.41.78
Re: [fw-general] Zend_Paginate how to integrate?
Giorgio Sironi wrote: 2008/8/5 Axel Wüstemann [EMAIL PROTECTED]: I'm a bit confused, how to integrate Zend_Paginate into my app framework. In order to use the DbSelect adapter, I need a select object, which is in my model. In order to display the page numbers I need the view object which I have in the controller. http://ossigeno.svn.sourceforge.net/viewvc/ossigeno/trunk/core/library/Otk/Paginator/Adapter/Model.php?view=markup Now in models I do something like: public function prepareArticles($page) { [...] $select = $table-select() -from($table, array('id')) -where('section = ?', $this-_row-id) -order('date '. $this-_row-view_order); $paginator = new Zend_Paginator( new Otk_Paginator_Adapter_Model($select, 'Otk_Content_Article')); $paginator-setItemCountPerPage((int) $this-_row-view_limit); $paginator-setCurrentPageNumber($page); return $paginator; } Otk_Content_Article is the classname of the model. (note that the adapter returns arrays of structures (associative array) calling prepare() of models, an extension of toArray(), but with little editing can return the object themselves) Yes, it seems to me a good idea to let reside the paginator in the model. What happens in the controller? How the view comes into play? -- View this message in context: http://www.nabble.com/Zend_Paginate-how-to-integrate--tp18835208p18836255.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Mail_Part::getHeader() and optional mail headers
Hi Guillaume! That's actually something I have on my TODO list. While an exception is normally correct, because the value can't be returned, it's something that gets really annoying in the view. What I've planned is adding an option to turn these exceptions off and return null instead. nico Guillaume Rossolini wrote: Hi, I just noticed that Zend_Mail_Message::getHeader() throws an exception when I try to get a header that is not there. For instance, the reply-to header isn't mandatory. Do you think I should put try/catch blocks in my code? Or maybe subclassing Zend_Mail_Message to return a false boolean would be a more sensible approach? Thanks, -- Guillaume Rossolini
Re: [fw-general] Zend_Date Problems
Sory about code, my email client cause some problens when copy/paste unix end lines. About relase, I using ZF 1.5.3. I solved my problem puting year limit on my application, tanks. The Simplfied Code is: date_default_timezone_set ( 'America/Sao_Paulo' ); $locale = new Zend_Locale( 'pt_BR' ); if ( Zend_Date::isDate( '01-01-2038', 'dd-MM-', $locale ) ) { echo Is Valid; } else { echo Is NOT Valid; } Haroldo Mitsumi Murata [K33] Thomas Weidner escreveu: I think, if format not specify timezone, this shoud not verify it. This is not true. A date/timestamp always include a timezone EXCEPT you specify UTC or GMT as timezone. If you dont specify one, it will detect it automatically. When you have problems please try always with the latest available release. When this does not help, please add a issue to jira adding description, and reproducable code so we can fix the problem. Greetings Thomas Weidner, I18N Team Leader, Zend Framework http://www.thomasweidner.com - Original Message - From: Haroldo MM [EMAIL PROTECTED] To: ZF General List fw-general@lists.zend.com Sent: Tuesday, August 05, 2008 4:37 PM Subject: [fw-general] Zend_Date Problems Hi! I new here, and not speak english very well. So, I have some problems using Zend_Date, i don't know but year 2038 is not valid, i think some related to timestamp limit or locate, or I not using Zend_Date correct way. CODE: //date_default_timezone_set ( 'America/New_York' ); //$locale = new Zend_Locale( 'en_US' ); date_default_timezone_set ( 'America/Sao_Paulo' ); $locale = new Zend_Locale( 'pt_BR' ); function isValidDate( $value, $locale ) { if ( Zend_Date::isDate( $value, 'MM-dd-', $locale ) ) echo $value: Is Valid br/; else echo $value: Is NOT Valid br/; } isValidDate( '01-01-2008', $locale ); // Return 01-01-2008: Is Valid isValidDate( '01-01-2020', $locale ); // Return 01-01-2020: Is Valid isValidDate( '01-01-2037', $locale ); // Return 01-01-2037: Is Valid isValidDate( '01-01-2038', $locale ); // Return 01-01-2038: Is NOT Valid isValidDate( '01-01-2039', $locale ); // Return 01-01-2039: Is Valid isValidDate( '01-01-3000', $locale ); // Return 01-01-3000: Is Valid isValidDate( '01-01-0001', $locale ); // Return 01-01-0001: Is Valid --- When I change locale and time zone to en_US:America/New_York, year 2038 become valid, I make tests changing format 'MM-dd-' to my reginal format 'dd-MM-', or switching 'y' to 'Y', and still get problem. Another thing I want know, is there some option to make Zend_Date not 'try' detect time zone from date string, this generate some warnings because of @. I use error_handler to get errors, and when my application go to production, normaly I set display_errors off, and send errors by email. CODE: $zDate = new Zend_Date('01.01.2008', 'dd.MM.', 'en_US'); print $zDate-getIso(); // //[Warning]Zend\Date\DateObject.php:1016 timezone_open(): Unknown or bad timezone (2009) //[Cause] if ([EMAIL PROTECTED]($zone)) { // --- I think, if format not specify timezone, this shoud not verify it. Thanks. -- Haroldo Mitsumi Murata [K33]
[fw-general] PHP 5.3 Namespaces on ZF
Hi I dont really know if this is a new topic... but here it goes. With the release of PHP 5.3 alpha1 in the past few days... * Is there any plan to include native namespace support on ZF when 5.3 is production ready? If yes... * Any expected release date? * Is there gonna be a ZF supported branch for 5.1.x - 5.2.x? If no... * Why not? * What do you think of ZF 1.5.x over 5.3? Any breaking changes? * What do you think of the migration of current non-namespaced applications / components / frameworks built over current non-namespaced ZF to a future namespaced ZF? I really want to know the future of ZF... because... Most of us have invested a lot of time building components over ZF. Most of us want to know what is gonna change for the current applications. Most of us want to use state-of-the-art technologies that make our life easier and a little bit more organized. Most of us want to know if we have to spend time in the future refactoring or migrating applications. Hope you can answer my questions... Thanks - Roberto Ramirez
Re: [fw-general] Zend_Mail_Part::getHeader() and optional mail headers
Hi! Ok, I guess that would work. However, would you consider having another look at Zend_Controller_Request::getParam() or even Zend_Form::getValue()? Neither throws any exception when I try to get a non existing value. Would that be ok with you? I think consistency would be nice here ;) Just to clarify, I thought exceptions where needed for exceptional cases? Since errors are meant for error cases, and since getting an optional value is -to my mind at least- an absolutely normal case, I don't think it would be a stretch to not throw exceptions here. Thanks in any case! Regards, -- Guillaume Rossolini On Tue, Aug 5, 2008 at 7:38 PM, Nico Edtinger [EMAIL PROTECTED] wrote: Hi Guillaume! That's actually something I have on my TODO list. While an exception is normally correct, because the value can't be returned, it's something that gets really annoying in the view. What I've planned is adding an option to turn these exceptions off and return null instead. nico Guillaume Rossolini wrote: Hi, I just noticed that Zend_Mail_Message::getHeader() throws an exception when I try to get a header that is not there. For instance, the reply-to header isn't mandatory. Do you think I should put try/catch blocks in my code? Or maybe subclassing Zend_Mail_Message to return a false boolean would be a more sensible approach? Thanks, -- Guillaume Rossolini
Re: [fw-general] Zend_Paginate how to integrate?
2008/8/5 Axel Wüstemann [EMAIL PROTECTED]: Yes, it seems to me a good idea to let reside the paginator in the model. What happens in the controller? How the view comes into play? The controller simply calls the method prepareArticles with the right page (a param of request) and pass the paginator to the view, so the view script can use it for helpers like PaginationControl. Note that because the paginator goes into the view, it return only multidimensional array and not objects. -- Giorgio Sironi Piccolo Principe Ossigeno Scripter http://www.sourceforge.net/projects/ossigeno
[fw-general] (pas de sujet)
Does this : $hasServicesModel = new HasHousing_Table(); $hasServicesModel-delete( array( 'housing_service_id' = $formData['services'][$serviceName . '_id'], 'housing_id' = $housing-housing_id ) ); Work for you folks ? The update syntax require a tab like this but for the delete method...
Re: [fw-general] Zend_Db not inserting UTF-8?
I had the same trouble about a year ago using Zend_Db and Oracle adapter. If you are using oci you can set the connection information with environment variables. /** * * Oracle Environment Variables. * * Set the default language and characters as UTF8 * Set the date format. * */ putenv(NLS_LANG=AMERICAN_AMERICA.AL32UTF8); putenv(NLS_DATE_FORMAT=-MM-DD HH24:MI:SS); By default, the connection was created using ISO-8859-1, once I changed the environment variable... every insert and update worked fine. Note: Make sure your enconding is UTF-8 for php files and input. I dunno if that works for you or with pdo_oci. But I highly recommend to use Zend Core for Oracle if you are dealing with Oracle databases. It's an Oracle database. Oops. Missed that piece. The data is submitted via the web through AMFPHP. The data is in the PHP variables correctly. It's just going from $db-insert() to the database it gets altered. --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ On Tue, Aug 5, 2008 at 11:14 AM, Xavier Vidal Piera [EMAIL PROTECTED]wrote: Which database are you using? MySQL, PostgreSQL, Oracle...? Have you tried to specify the client encoding in database connection setup? In MySQLi and PDO_MySQL will be $db-query('SET NAMES UTF8'); if you're inserting data with a web form, the page encoding is utf-8? On Tue, Aug 5, 2008 at 18:07, Philip G [EMAIL PROTECTED] wrote: I'm trying to insert a name into our database using the following call: $db-insert( 'MBR_GEN', $data, 'EML' ); $data includes the column names to value. One column is 'FIRST_NM' and the value is: Josué However, when I insert it into our database, it inserts as: Josu¿¿ I've even did a var_dump() of $data and it shows fine there. It's only when I insert. I manually altered the data in the table, and it's fine. So...our DB seems to support it. Any clue as to why Zend_Db is altering the value? --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ -- Xavier Vidal Piera Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] [EMAIL PROTECTED] http://web.xaviervidal.net 610.68.41.78
Re: [fw-general] PHP 5.3 Namespaces on ZF
-- [EMAIL PROTECTED] [EMAIL PROTECTED] wrote (on Tuesday, 05 August 2008, 10:58 AM -0700): I dont really know if this is a new topic... but here it goes. With the release of PHP 5.3 alpha1 in the past few days... * Is there any plan to include native namespace support on ZF when 5.3 is production ready? Yes. If yes... * Any expected release date? No earlier than mid-2009, and it will be added with version 2.0 of ZF. * Is there gonna be a ZF supported branch for 5.1.x - 5.2.x? If no... * Why not? We haven't decided yet. I anticipate some issues with maintaining patches between branches utilizing namespaces and those that do not. If we are able to create a (somewhat) automated tool for converting non-namespaced code to namespaced code, I can see no issues with supporting multiple branches; otherwise, we'll have to carefully evaluate the efficacy and efficiency of doing so. * What do you think of ZF 1.5.x over 5.3? Any breaking changes? We were alerted of a couple potential issues with naming that we've corrected as of 1.5.3. I personally have not yet run ZF 1.5.x or ZF 1.6.0 on PHP 5.3alpha1 yet, and likely will not get a chance to until after the 1.6.0 release. Until then, anybody who has, please post your experiences here. * What do you think of the migration of current non-namespaced applications / components / frameworks built over current non-namespaced ZF to a future namespaced ZF? We aim to provide a way to translate non-namespaced classes to namespaced versions. Implementation is still in the air -- the features have just recently frozen, so doing much before this has been low priority. I really want to know the future of ZF... because... Most of us have invested a lot of time building components over ZF. Most of us want to know what is gonna change for the current applications. Most of us want to use state-of-the-art technologies that make our life easier and a little bit more organized. Most of us want to know if we have to spend time in the future refactoring or migrating applications. My aim is to have migration tools available for 2.0 to help you migrate your code to use namespaces. I can almost guarantee that any such tooling will still require manual intervention -- but hopefully this can be mitigated with good documentation of the migration process. _YOU_ can help with this planning as we start gearing up for 5.3 support, and I'll be keeping the lists posted with current efforts and areas where assistance could be utilized. -- Matthew Weier O'Phinney Software Architect | [EMAIL PROTECTED] Zend Framework | http://framework.zend.com/
Re: [fw-general] Zend_Db not inserting UTF-8?
I did some digging around and I found the soloution on Oracle's page: http://www.oracle.com/technology/pub/articles/php_experts/otn_pdo_oracle5.html Basically, have to set charset to UTF8. It's already supported within PDO OCI, just need to pass in charset=UTF8 and the DNS will set itself all up. ^_^ --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ On Tue, Aug 5, 2008 at 2:53 PM, [EMAIL PROTECTED] wrote: I had the same trouble about a year ago using Zend_Db and Oracle adapter. If you are using oci you can set the connection information with environment variables. /** * * Oracle Environment Variables. * * Set the default language and characters as UTF8 * Set the date format. * */ putenv(NLS_LANG=AMERICAN_AMERICA.AL32UTF8); putenv(NLS_DATE_FORMAT=-MM-DD HH24:MI:SS); By default, the connection was created using ISO-8859-1, once I changed the environment variable... every insert and update worked fine. Note: Make sure your enconding is UTF-8 for php files and input. I dunno if that works for you or with pdo_oci. But I highly recommend to use Zend Core for Oracle if you are dealing with Oracle databases. It's an Oracle database. Oops. Missed that piece. The data is submitted via the web through AMFPHP. The data is in the PHP variables correctly. It's just going from $db-insert() to the database it gets altered. --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ On Tue, Aug 5, 2008 at 11:14 AM, Xavier Vidal Piera [EMAIL PROTECTED]wrote: Which database are you using? MySQL, PostgreSQL, Oracle...? Have you tried to specify the client encoding in database connection setup? In MySQLi and PDO_MySQL will be $db-query('SET NAMES UTF8'); if you're inserting data with a web form, the page encoding is utf-8? On Tue, Aug 5, 2008 at 18:07, Philip G [EMAIL PROTECTED] wrote: I'm trying to insert a name into our database using the following call: $db-insert( 'MBR_GEN', $data, 'EML' ); $data includes the column names to value. One column is 'FIRST_NM' and the value is: Josué However, when I insert it into our database, it inserts as: Josu¿¿ I've even did a var_dump() of $data and it shows fine there. It's only when I insert. I manually altered the data in the table, and it's fine. So...our DB seems to support it. Any clue as to why Zend_Db is altering the value? --- Philip [EMAIL PROTECTED] http://www.gpcentre.net/ -- Xavier Vidal Piera Enginyer Tècnic Informàtic de Gestió Tècnic Especialista Informàtic d'equips [EMAIL PROTECTED] [EMAIL PROTECTED] http://web.xaviervidal.net 610.68.41.78
Re: [fw-general] ErrorHandler and Zend_Controller_Front
On Mon, Aug 4, 2008 at 7:45 PM, Jason Webster [EMAIL PROTECTED] wrote: Exceptions within the front controller are always thrown (bypassing the error controller) if the _throwExceptions property is true. Try explicitly setting this false, in your bootstrap, by calling: $front-throwExceptions(false) Thanks so much. =) I feel kinda dumb. I thought I had tried that. It works! Thanks again, Till
[fw-general] What's up with changeset 10523?
According to FishEye, everything in standard/trunk has been deleted: http://framework.zend.com/code/changelog/Zend_Framework?cs=10523 Has the trunk moved again? I couldn't find anything in the list archive... -- Willie Alberty Spenlen Media [EMAIL PROTECTED] http://spenlen.com/