Re: [fw-general] Models, Objects and RDBMS - Best Practise
Perhaps I've missed something here, but why are you extending your classes to the nth degree to achieve this? I can't see any real reason for using the gateway factory. It's not as if you'll be using different Product models with separate backends within the one application, so why not just have it extend Zend_Db_Table? If you change to an XML backend, then you can update your class definition then rather than have a config file determine it. Besides, isn't there a Zend_Db_Adapter_Xml anyway? I'd go for simplicity as much as possible - don't try to over-engineer your solution for the sake of theory if your application doesn't really benefit from it. Hi, Even though my application doesn't need this flexability... I thought that in the interest of polymorphism and basically to practise my OO skills I'll implement my factory abstraction to see what other people think of the solution. My directory stucture is now |-- controllers |-- models | |-- Product.php | |-- Product | | | Db | | | | -- Gateway.php | |-- Manufacturer.php | |-- Manufacturer | | | Db | | | | -- Gateway.php | |-- Distributor.php | |-- Distributor | | | Db | | | | -- Gateway.php |-- views This gives rise to a renaming of my gateway classes to Product_Db_Gateway, Manfacturer_Db_Gateway and Distributor_Db_Gateway. Now in my config.ini file I simply specify a storage engine [general] storage_engine = Db So I just need a Factory class to server up a persistence gateway which I have implemented like this: class PersistenceGatewayFactory { public static function getGateway($type) { $registry = Zend_Registry::getInstance(); $config = $registry->get('config'); $config->storage_engine; $gateway_class = $type."_".$config->storage_engine."_Gateway"; // e.g. gateway_class = Product_Db_Gateway if(class_exists($gateway_class)) { return new $gateway_class; } else { throw new Exception("The gateway class does not exist"); } } } This means that my models now gets its persistence object in the following way class Product { public function gateway() { try { $gateway = PersistenceGatewayFactory::getGateway('Product'); } catch (Exception $e) { throw $e; } return $gateway; } } This means that I can change the storage engine if I need to. So for example if I suddenly wanted to store everything as Xml then I would define Product_Xml_Gateway, Manufacturer_Xml_Gateway, Distributor_Xml_Gateway. Provided any of these Gateway classes implement a particular interface which includes the insert, update, delete, findByFilter methods then it should all work. $this->model = new Product(); $this->model->gateway()->insert($data); $this->model->gateway()->update($data); $this->model->gateway()->delete($data); I can see how Jurriën's approach would work, this is just my take on it. Can people give me some feedback on my approach? I know there are many ways to develop OO code... but I always find that 3 months down the line I work out a new way to do stuff which should have been obvious in the begining. Or there is a problem that I didn't see that someone points out later. It helps to get feedback from other experienced OO developers, although my application is still really simple I've already refactored it a number of times mainly because of this post. Thanks -- View this message in context: http://www.nabble.com/Models%2C-Objects-and-RDBMS---Best-Practise-tf4052812s16154.html#a11569435 Sent from the Zend Framework mailing list archive at Nabble.com. -- Simon Mundy | Director | PEPTOLAB """ " "" "" "" "" """ " "" " " " " "" "" " 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
[fw-general] SOAP
I need create WebService to use SOAP in ZF. Red about SOAP in php.net, and I learnt to create a file WSDL. Its file includes a description for my objects. But it needs to write one by one. I learnt to code for Zend_Soap more than this frequents in the incubator state. Outside the ZF, I see a code for http://www.jool.Nl/new/3,tutorial.html, do not like most it. Does exist for mode have create WSDL cadges automatic in PHP? Do Or create for plug in have Zend Framework? Greetings ZED
RE: [fw-general] Zend_Db_Statement_Pdo->bindParam fails with parameters with capital letter
Thanks Paolo, I have logged this as a bug: http://framework.zend.com/issues/browse/ZF-1716 We should probably just match the pattern supported by PDO, so the regular expression should be: /(\?|\:[a-zA-Z0-9_]+)/ Or else we could simplify this and use the builtin "word" metasequence: /(\?|\:\w+)/ I'll make this fix in the near future. Regards, Bill Karwin > -Original Message- > From: Paolo Casarini [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 11, 2007 9:00 AM > To: fw-general@lists.zend.com > Subject: [fw-general] Zend_Db_Statement_Pdo->bindParam fails > with parameters with capital letter > > Hi, > > now that Zend_Db_Adapter_Pdo_Abstract->prepare returns a > Zend_Db_Statement_Pdo, I receive a > Zend_Db_Statement_Exception('Invalid bind-variable position') > each time I user a paramenter with a capital letter within > (like (:moduleName). > > The solution I found is to change the regexp used to parse > the sql query while feching for parameters. In > Zend_Db_Parameter->_parseParameters() I replaced the following lines > > // split into text and params > $this->_sqlSplit = preg_split('/(\?|\:[a-z_]+)/', > $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); > > with > > // split into text and params > $this->_sqlSplit = preg_split('/(\?|\:[a-zA-Z_]+)/', > $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); > > > It works for me, but I don't know it could be a good solution for all. > > TIA, > Paolo. > -- > GPG key: 1024D/9C5AE886 2004-10-21 Paolo Casarini > <[EMAIL PROTECTED]>
Re: [fw-general] Models, Objects and RDBMS - Best Practise
Hi, Even though my application doesn't need this flexability... I thought that in the interest of polymorphism and basically to practise my OO skills I'll implement my factory abstraction to see what other people think of the solution. My directory stucture is now |-- controllers |-- models | |-- Product.php | |-- Product | | | Db | | | | -- Gateway.php | |-- Manufacturer.php | |-- Manufacturer | | | Db | | | | -- Gateway.php | |-- Distributor.php | |-- Distributor | | | Db | | | | -- Gateway.php |-- views This gives rise to a renaming of my gateway classes to Product_Db_Gateway, Manfacturer_Db_Gateway and Distributor_Db_Gateway. Now in my config.ini file I simply specify a storage engine [general] storage_engine = Db So I just need a Factory class to server up a persistence gateway which I have implemented like this: class PersistenceGatewayFactory { public static function getGateway($type) { $registry = Zend_Registry::getInstance(); $config = $registry->get('config'); $config->storage_engine; $gateway_class = $type."_".$config->storage_engine."_Gateway"; // e.g. gateway_class = Product_Db_Gateway if(class_exists($gateway_class)) { return new $gateway_class; } else { throw new Exception("The gateway class does not exist"); } } } This means that my models now gets its persistence object in the following way class Product { public function gateway() { try { $gateway = PersistenceGatewayFactory::getGateway('Product'); } catch (Exception $e) { throw $e; } return $gateway; } } This means that I can change the storage engine if I need to. So for example if I suddenly wanted to store everything as Xml then I would define Product_Xml_Gateway, Manufacturer_Xml_Gateway, Distributor_Xml_Gateway. Provided any of these Gateway classes implement a particular interface which includes the insert, update, delete, findByFilter methods then it should all work. $this->model = new Product(); $this->model->gateway()->insert($data); $this->model->gateway()->update($data); $this->model->gateway()->delete($data); I can see how Jurriën's approach would work, this is just my take on it. Can people give me some feedback on my approach? I know there are many ways to develop OO code... but I always find that 3 months down the line I work out a new way to do stuff which should have been obvious in the begining. Or there is a problem that I didn't see that someone points out later. It helps to get feedback from other experienced OO developers, although my application is still really simple I've already refactored it a number of times mainly because of this post. Thanks -- View this message in context: http://www.nabble.com/Models%2C-Objects-and-RDBMS---Best-Practise-tf4052812s16154.html#a11569435 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Getting a grip on Zend_Service_Delicious
Hi Markus, I have filed this issue as: http://framework.zend.com/issues/browse/ZF-1714 Goran, would you be able to address this for us? Thank you for the report! Best regards, Darby Markus Wolff wrote: > Hey there, > > I have found my error: > > $posts = $feed->getUserPosts('mwolff'); > > ...is not enough, you *have* to specify the number of posts to retrieve > as the second parameter: > > $posts = $feed->getUserPosts('mwolff', 10); > > That does the trick. It's a bit counter-intuitive to me, I would have > expected it to return *all* posts if I specify null or 0 as the second > parameter. Oh, well... thanks anyway :-) > > CU > Markus > > Am Freitag, den 06.07.2007, 15:49 +0200 schrieb Markus Wolff: >> Hey Darby, >> >> unfortunately, it's zero. :-( >> >> Here's a dump of the PostList object: >> >> Zend_Service_Delicious_PostList Object >> ( >> [_posts:protected] => Array >> ( >> ) >> >> [_service:protected] => Zend_Service_Delicious Object >> ( >> [_rest:protected] => Zend_Rest_Client Object >> ( >> [_data:protected] => Array >> ( >> ) >> >> [_uri:protected] => Zend_Uri_Http Object >> ( >> [_username:protected] => >> [_password:protected] => >> [_host:protected] => del.icio.us >> [_port:protected] => 80 >> [_path:protected] => /feeds/json/mwolff/ >> [_query:protected] => >> [_fragment:protected] => >> [_regex:protected] => Array >> ( >> [alphanum] => [^\W_] >> [escaped] => (?:%[\da-fA-F]{2}) >> [mark] => [-_.!~*'()\[\]] >> [reserved] => [;\/?:@&=+$,] >> [unreserved] => >> (?:[^\W_]|[-_.!~*'()\[\]]) >> [segment] => >> (?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*) >> [path] => >> (?:\/(?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*)?)+ >> [uric] => >> (?:[;\/?:@&=+$,]|(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})) >> ) >> >> [_scheme:protected] => http >> ) >> >> ) >> >> [_authUname:protected] => >> [_authPass:protected] => >> ) >> >> [_iteratorKey:protected] => 0 >> ) >> >> As you can see, it tries to fetch http://del.icio.us/feeds/json/mwolff/, >> which >> is not only correct, but also contains a number of posts. >> >> Bug? >> >> CU >> Markus >> >> Am Freitag, den 06.07.2007, 09:21 -0400 schrieb Darby Felton: >>> Hi Markus, >>> >>> It appears that your usage is correct... what is the result of >>> count($posts)? >>> >>> Best regards, >>> Darby >>> >>> Markus Wolff wrote: Hey guys, I'm currently trying to figure out Zend_Service_Delicious. I really don't want to do anything complicated, just fetch a user's public posts. According to the manual, this should work nicely: $feed = new Zend_Service_Delicious(); $posts = $feed->getUserPosts('mwolff'); foreach($posts as $item) { echo ""; print_r($item); echo "\n"; } After the call to getUserPosts(), $posts does contain a Zend_Service_Delicious_PostList object. The following iteration, however, yields no results whatsoever. This is with a checkout of trunk from Monday. What am I doing wrong? Am I doing anything wrong?? Thanks, Markus > >
Re: [fw-general] Temperature conversions
No problem... Keep in mind that you have to create an account at jira to send an bug. This was not done because we dont want to have bugs submitted but as protection against spammers ;-) Greetings Thomas I18N Team Leader - Original Message - From: "Belmin Fernandez" <[EMAIL PROTECTED]> To: "Thomas Weidner" <[EMAIL PROTECTED]> Cc: Sent: Thursday, July 12, 2007 8:37 PM Subject: Re: [fw-general] Temperature conversions Thank you Thomas for your help in this issue. I am not sure if I'm interpreting your last reply correctly but if I offended you by my wording I apologize! Thanks again for your help! I'll be submitting the bug. I'm just hesitant in the fear of being flamed. Hard to believe I am the first to catch that. --Belmin On 7/12/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: As I am not someone else I did not respond... If you want to submit a bug you have to file it to jira: http://framework.zend.com/issues/ Greetings Thomas I18N Team Leader - Original Message - From: "Belmin Fernandez" <[EMAIL PROTECTED]> To: Cc: "Thomas Weidner" <[EMAIL PROTECTED]> Sent: Thursday, July 12, 2007 8:01 PM Subject: Re: [fw-general] Temperature conversions Well, since noone has responded: How do I submit a bug? Or am I just missing something? --Belmin On 7/11/07, Belmin Fernandez <[EMAIL PROTECTED]> wrote: > But according to the 'Temperature.php' library > > 1 C = 275,15 K > 1F = -1.7E+25 K (as oppose to onlineconversions.com that > says 255.92778 K) > > Again, I might be missing something but that is what I'm getting. > Should I post code? Maybe I'm doing it incorrectly. Can someone else > test this? > > On 7/11/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: > > The translation maths are from "onlineconversions.com"... > > I could hardly believe that they would not see this sort of failure in > > their > > data because they are there since several years and were one of the > > first. > > > > Maths: > > 1 Celsius equals 274,15 Kelvin > > 1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin > > I see no failure here. > > And the standard unit has no  included... > > > > Sorry, but I dont see any problem on the mentioned lines. > > > > To say it once more for all... > > We can not expect what you mean... > > We are no clairvoyants... > > > > PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION > > > > Greetings > > Thomas > > I18N Team Leader > > > > - Original Message - > > From: "Belmin Fernandez" <[EMAIL PROTECTED]> > > To: > > Sent: Wednesday, July 11, 2007 2:41 PM > > Subject: [fw-general] Temperature conversions > > > > > > I was trying out the temperature conversions and I realized I was > > getting the wrong values. I looked at Zend/Measure/Temperature.php and > > it seems the math is incorrect. Currently: > > > > 'CELSIUS'=> array(array('' => 1, '+' => 274.15),'°C'), > > 'FAHRENHEIT' => array(array('' => 1, '-' => 32, '/' => 1.8, > > '+' => 273.15),'°F'), > > > > Should be: > > > > 'CELSIUS'=> array(array('' => 1, '+' => 273.15),'°C'), > > 'FAHRENHEIT' => array(array('' => 1, '+' => 459.67, '/' => 9, > > '*' => 5 ),'°F'), > > > > I am incorrect about this? I'm assuming I'm missing something or > > atleast doubt I'm the first person to catch it. > > > > --Belmin > > > > >
Re: [fw-general] Temperature conversions
Thank you Thomas for your help in this issue. I am not sure if I'm interpreting your last reply correctly but if I offended you by my wording I apologize! Thanks again for your help! I'll be submitting the bug. I'm just hesitant in the fear of being flamed. Hard to believe I am the first to catch that. --Belmin On 7/12/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: As I am not someone else I did not respond... If you want to submit a bug you have to file it to jira: http://framework.zend.com/issues/ Greetings Thomas I18N Team Leader - Original Message - From: "Belmin Fernandez" <[EMAIL PROTECTED]> To: Cc: "Thomas Weidner" <[EMAIL PROTECTED]> Sent: Thursday, July 12, 2007 8:01 PM Subject: Re: [fw-general] Temperature conversions Well, since noone has responded: How do I submit a bug? Or am I just missing something? --Belmin On 7/11/07, Belmin Fernandez <[EMAIL PROTECTED]> wrote: > But according to the 'Temperature.php' library > > 1 C = 275,15 K > 1F = -1.7E+25 K (as oppose to onlineconversions.com that > says 255.92778 K) > > Again, I might be missing something but that is what I'm getting. > Should I post code? Maybe I'm doing it incorrectly. Can someone else > test this? > > On 7/11/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: > > The translation maths are from "onlineconversions.com"... > > I could hardly believe that they would not see this sort of failure in > > their > > data because they are there since several years and were one of the > > first. > > > > Maths: > > 1 Celsius equals 274,15 Kelvin > > 1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin > > I see no failure here. > > And the standard unit has no  included... > > > > Sorry, but I dont see any problem on the mentioned lines. > > > > To say it once more for all... > > We can not expect what you mean... > > We are no clairvoyants... > > > > PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION > > > > Greetings > > Thomas > > I18N Team Leader > > > > - Original Message - > > From: "Belmin Fernandez" <[EMAIL PROTECTED]> > > To: > > Sent: Wednesday, July 11, 2007 2:41 PM > > Subject: [fw-general] Temperature conversions > > > > > > I was trying out the temperature conversions and I realized I was > > getting the wrong values. I looked at Zend/Measure/Temperature.php and > > it seems the math is incorrect. Currently: > > > > 'CELSIUS'=> array(array('' => 1, '+' => 274.15),'°C'), > > 'FAHRENHEIT' => array(array('' => 1, '-' => 32, '/' => 1.8, > > '+' => 273.15),'°F'), > > > > Should be: > > > > 'CELSIUS'=> array(array('' => 1, '+' => 273.15),'°C'), > > 'FAHRENHEIT' => array(array('' => 1, '+' => 459.67, '/' => 9, > > '*' => 5 ),'°F'), > > > > I am incorrect about this? I'm assuming I'm missing something or > > atleast doubt I'm the first person to catch it. > > > > --Belmin > > > > >
Re: [fw-general] Temperature conversions
As I am not someone else I did not respond... If you want to submit a bug you have to file it to jira: http://framework.zend.com/issues/ Greetings Thomas I18N Team Leader - Original Message - From: "Belmin Fernandez" <[EMAIL PROTECTED]> To: Cc: "Thomas Weidner" <[EMAIL PROTECTED]> Sent: Thursday, July 12, 2007 8:01 PM Subject: Re: [fw-general] Temperature conversions Well, since noone has responded: How do I submit a bug? Or am I just missing something? --Belmin On 7/11/07, Belmin Fernandez <[EMAIL PROTECTED]> wrote: But according to the 'Temperature.php' library 1 C = 275,15 K 1F = -1.7E+25 K (as oppose to onlineconversions.com that says 255.92778 K) Again, I might be missing something but that is what I'm getting. Should I post code? Maybe I'm doing it incorrectly. Can someone else test this? On 7/11/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: > The translation maths are from "onlineconversions.com"... > I could hardly believe that they would not see this sort of failure in > their > data because they are there since several years and were one of the > first. > > Maths: > 1 Celsius equals 274,15 Kelvin > 1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin > I see no failure here. > And the standard unit has no  included... > > Sorry, but I dont see any problem on the mentioned lines. > > To say it once more for all... > We can not expect what you mean... > We are no clairvoyants... > > PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION > > Greetings > Thomas > I18N Team Leader > > - Original Message - > From: "Belmin Fernandez" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, July 11, 2007 2:41 PM > Subject: [fw-general] Temperature conversions > > > I was trying out the temperature conversions and I realized I was > getting the wrong values. I looked at Zend/Measure/Temperature.php and > it seems the math is incorrect. Currently: > > 'CELSIUS'=> array(array('' => 1, '+' => 274.15),'°C'), > 'FAHRENHEIT' => array(array('' => 1, '-' => 32, '/' => 1.8, > '+' => 273.15),'°F'), > > Should be: > > 'CELSIUS'=> array(array('' => 1, '+' => 273.15),'°C'), > 'FAHRENHEIT' => array(array('' => 1, '+' => 459.67, '/' => 9, > '*' => 5 ),'°F'), > > I am incorrect about this? I'm assuming I'm missing something or > atleast doubt I'm the first person to catch it. > > --Belmin > >
Re: [fw-general] Temperature conversions
Well, since noone has responded: How do I submit a bug? Or am I just missing something? --Belmin On 7/11/07, Belmin Fernandez <[EMAIL PROTECTED]> wrote: But according to the 'Temperature.php' library 1 C = 275,15 K 1F = -1.7E+25 K (as oppose to onlineconversions.com that says 255.92778 K) Again, I might be missing something but that is what I'm getting. Should I post code? Maybe I'm doing it incorrectly. Can someone else test this? On 7/11/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: > The translation maths are from "onlineconversions.com"... > I could hardly believe that they would not see this sort of failure in their > data because they are there since several years and were one of the first. > > Maths: > 1 Celsius equals 274,15 Kelvin > 1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin > I see no failure here. > And the standard unit has no  included... > > Sorry, but I dont see any problem on the mentioned lines. > > To say it once more for all... > We can not expect what you mean... > We are no clairvoyants... > > PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION > > Greetings > Thomas > I18N Team Leader > > - Original Message - > From: "Belmin Fernandez" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, July 11, 2007 2:41 PM > Subject: [fw-general] Temperature conversions > > > I was trying out the temperature conversions and I realized I was > getting the wrong values. I looked at Zend/Measure/Temperature.php and > it seems the math is incorrect. Currently: > > 'CELSIUS'=> array(array('' => 1, '+' => 274.15),'°C'), > 'FAHRENHEIT' => array(array('' => 1, '-' => 32, '/' => 1.8, > '+' => 273.15),'°F'), > > Should be: > > 'CELSIUS'=> array(array('' => 1, '+' => 273.15),'°C'), > 'FAHRENHEIT' => array(array('' => 1, '+' => 459.67, '/' => 9, > '*' => 5 ),'°F'), > > I am incorrect about this? I'm assuming I'm missing something or > atleast doubt I'm the first person to catch it. > > --Belmin > >
Re: [fw-general] Framework Docs in PDF Format
Just modify Makefile by hand, and use "fo" creating pdf format. Have down the chm format, if you need I can do it with pdf format. Regards Xing 2007/7/12, Jay M. Keith <[EMAIL PROTECTED]>: Hey all, I know during the RC's someone converted all the docs to PDF format. I was curious if this had been done yet for the 1.0 release yet, if so I'd greatly appreciate it. -- 广州市一方信息咨询有限公司 地址:广州市 江南大道中 穗花村 三巷12号204 邮编:510245 电话:020-39738561 020-39738571 传真:020-84476279 网站:www.i-fang.com [EMAIL PROTECTED]
[fw-general] Question about table querying
Friends, I have two tables: Users ( Id, Name, Type_Id, Username, Password ) Types ( Id, TypeName ) And Type_Id refereer to field Id from table Users. My query for retrieve information is $users = new Users(); $users = $users->fetchAll(" Name LIKE '$query' "); $users = $users->toArray(); But I need to show all fields from Users but with TypeName instead of Type_Id. What can I do? Best Regards, José
Re: [fw-general] Searching database
Thanks! I have checked, but I am not good enough to see... 2007/7/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hi José, Have you checked the manual for Zend_Db_Table? getAdapter()->quoteInto('bug_status = ?', 'NEW'); $order = 'bug_id'; // Return the 21st through 30th rows $count = 10; $offset = 20; $rows = $table->fetchAll($where, $order, $count, $offset); ?> This is outlined further at http://framework.zend.com/manual/en/zend.db.table.html -Ryan On Thu, 12 Jul 2007 12:54:09 -0300, "José de Menezes Soares Neto" < [EMAIL PROTECTED]> wrote: > everyone forget things :P > > can I limit the numbers of results of a query using fetchAll()? > > > > > 2007/7/11, ViShap <[EMAIL PROTECTED]>: >> >> ACK >> >> josé, look for tutorials and books to get the basics of php =) >> >> good ressources are google, o´reilleys and of corse ZEND (articles and >> tutorials)! >> >> regards >> >> 2007/7/12, till < [EMAIL PROTECTED]>: >> > >> > On 7/11/07, ViShap < [EMAIL PROTECTED]> wrote: >> > > (...) >> > > 2007/7/11, José de Menezes Soares Neto < [EMAIL PROTECTED]>: >> > > > (...) >> > >> > Guys, >> > >> > not to be mean - well forget that! ;-) But maybe a PHP primer is >> > necessary here and this should be discussed off list? >> > >> > Regards, >> > Till >> > >> >> > >
Re: [fw-general] Searching database
Hi José, Have you checked the manual for Zend_Db_Table? getAdapter()->quoteInto('bug_status = ?', 'NEW'); $order = 'bug_id'; // Return the 21st through 30th rows $count = 10; $offset = 20; $rows = $table->fetchAll($where, $order, $count, $offset); ?> This is outlined further at http://framework.zend.com/manual/en/zend.db.table.html -Ryan On Thu, 12 Jul 2007 12:54:09 -0300, "José de Menezes Soares Neto" <[EMAIL PROTECTED]> wrote: > everyone forget things :P > > can I limit the numbers of results of a query using fetchAll()? > > > > > 2007/7/11, ViShap <[EMAIL PROTECTED]>: >> >> ACK >> >> josé, look for tutorials and books to get the basics of php =) >> >> good ressources are google, o´reilleys and of corse ZEND (articles and >> tutorials)! >> >> regards >> >> 2007/7/12, till < [EMAIL PROTECTED]>: >> > >> > On 7/11/07, ViShap < [EMAIL PROTECTED]> wrote: >> > > (...) >> > > 2007/7/11, José de Menezes Soares Neto < [EMAIL PROTECTED]>: >> > > > (...) >> > >> > Guys, >> > >> > not to be mean - well forget that! ;-) But maybe a PHP primer is >> > necessary here and this should be discussed off list? >> > >> > Regards, >> > Till >> > >> >> > >
Re: [fw-general] Searching database
everyone forget things :P can I limit the numbers of results of a query using fetchAll()? 2007/7/11, ViShap <[EMAIL PROTECTED]>: ACK josé, look for tutorials and books to get the basics of php =) good ressources are google, o´reilleys and of corse ZEND (articles and tutorials)! regards 2007/7/12, till < [EMAIL PROTECTED]>: > > On 7/11/07, ViShap < [EMAIL PROTECTED]> wrote: > > (...) > > 2007/7/11, José de Menezes Soares Neto < [EMAIL PROTECTED]>: > > > (...) > > Guys, > > not to be mean - well forget that! ;-) But maybe a PHP primer is > necessary here and this should be discussed off list? > > Regards, > Till >
[fw-general] ZF & OO based shopping cart: opinion, where would you store this?
Hi, I am putting together my own Cart component, that will work with ZF and provide the back end for the shopping cart. The cart is made up of various objects including the Cart, Items, Delivery Services, and Taxes etc. Now, although when a customer selects which delivery service they want it gets added to the basket, somewhere I need to store the three separate delivery service objects so that one can be chosen from in the first place. The same applies to the various tax zones and rates (which is a whole other problem); these objects are global to the whole shop. So my question is where would you store this data? Obviously the objects are initially generated from data retrieved from the database (although some of it is hard coded), but I want to be able to have and use them as objects because, well, that's the whole point of this OO approach. Up until now I have been storing them in the session data, but this means that they are duplicated for every user, when actually they should be global for all of the users (or should they?). Apologies if the ZF mailing list isn't the right place to ask this, but this is directly built on ZF, and given the 100% OO nature of ZF there's got to be some real OO experts on this list. Whenever I've asked OO questions elsewhere I mostly just get people who don't really understand OO, or don't know how to implement it in PHP. Any guidance on how other people have implemented OO based carts/shops would be incredibly helpful. This is my third rewrite of this component now, and I just cant get my head around some aspects of it, e.g. the fact that an item object has a tax object, but the tax is only applicable in certain countries, but without making the users country setting a global, the tax object cant calculate the tax amount correctly, argh! Thanks in advance, -- Jack
[fw-general] Framework Docs in PDF Format
Hey all, I know during the RC's someone converted all the docs to PDF format. I was curious if this had been done yet for the 1.0 release yet, if so I'd greatly appreciate it.
Re: [fw-general] fw-all list broken?
Yep, I just got a couple from fw-formats, but I was DEFINITELY missing stuff from fw-mvc (I ended up signing up for that separately). Jack Sleight wrote: Yes, as I said, I am subscribed to general, announce and all. fw-all should cover the mvc, formats, locale etc, but I am not receiving all the mail from these lists.
[fw-general] Re: Re: Zend_Filter_Input fields meta command with arrays problem
Thanks Bill! "Bill Karwin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi Joshua, Ok, I took a look at the code you mention. I see that it does have a bug in it. Yes, let's log a bug report so the issue doesn't get forgotten. I'll work on a fix soon. I've copied your original issue report into this bug: http://framework.zend.com/issues/browse/ZF-1709 Regards, Bill Karwin > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf > Of Joshua Ross > Sent: Wednesday, July 11, 2007 2:09 PM > To: fw-general@lists.zend.com > Subject: [fw-general] Re: Zend_Filter_Input fields meta > command with arrays problem > > Guess I need to submit a bug report? Noone has any thoughts?
Re: [fw-general] Session data getting erased on another page
Hi Matt, Are you working with iframes, and testing in IE 7? There is a bug/security feature in IE 7, when working with sessions and iframes ... Best, -- Andries Seutens http://andries.systray.be Darby Felton schreef: Hi Matt, It's hard to say what might be the problem in your situation without additional information. Try the following script: The above should cause the text "set user" to appear on the first request. Subsequent requests should cause the text "username exists: someuser" to appear. If this works as expected for you, then I would call into question the application logic. Best regards, Darby Matt Needles wrote: I am seeing a strange behavior using zend session. Here is what I have in my bootstrap: require( 'Zend/Session.php' ); Zend_Session::start(); On the login page, I am storing user-id in session (my own implementation, not using zend-auth): $_SESSION[ 'auth' ][ 'user' ] = $id; I can print_r the session on the login page and see the value is assigned. On surfing to another page, I see the value assigned to session->auth->user above is gone and the page is getting redirected to the login page again. What am i doing worng? Thanks, matt Gecontroleerd op virussen door de JOJO Secure Gateway.
Re: [fw-general] Session data getting erased on another page
Hi Matt, It's hard to say what might be the problem in your situation without additional information. Try the following script: The above should cause the text "set user" to appear on the first request. Subsequent requests should cause the text "username exists: someuser" to appear. If this works as expected for you, then I would call into question the application logic. Best regards, Darby Matt Needles wrote: > I am seeing a strange behavior using zend session. Here is what I have > in my bootstrap: > > require( 'Zend/Session.php' ); > Zend_Session::start(); > > On the login page, I am storing user-id in session (my own > implementation, not using zend-auth): > > $_SESSION[ 'auth' ][ 'user' ] = $id; > > I can print_r the session on the login page and see the value is > assigned. On surfing to another page, I see the value assigned to > session->auth->user above is gone and the page is getting redirected to > the login page again. What am i doing worng? > > Thanks, > > matt >
Re: [fw-general] Getting a grip on Zend_Service_Delicious
-- Markus Wolff <[EMAIL PROTECTED]> wrote (on Thursday, 12 July 2007, 04:00 PM +0200): > I have found my error: > > $posts = $feed->getUserPosts('mwolff'); > > ...is not enough, you *have* to specify the number of posts to retrieve > as the second parameter: > > $posts = $feed->getUserPosts('mwolff', 10); > > That does the trick. It's a bit counter-intuitive to me, I would have > expected it to return *all* posts if I specify null or 0 as the second > parameter. Oh, well... thanks anyway :-) Markus, please post this as an issue in the tracker. That certainly seems non-intuitive, and it either needs to be a documentation issue (for instance, if del.icio.us *requires* the post limit), given a reasonable default (other than 0, again, if del.icio.us requires a limit), or fixed to pull all posts if no second parameter is provided. > Am Freitag, den 06.07.2007, 15:49 +0200 schrieb Markus Wolff: > > Hey Darby, > > > > unfortunately, it's zero. :-( > > > > Here's a dump of the PostList object: > > > > Zend_Service_Delicious_PostList Object > > ( > > [_posts:protected] => Array > > ( > > ) > > > > [_service:protected] => Zend_Service_Delicious Object > > ( > > [_rest:protected] => Zend_Rest_Client Object > > ( > > [_data:protected] => Array > > ( > > ) > > > > [_uri:protected] => Zend_Uri_Http Object > > ( > > [_username:protected] => > > [_password:protected] => > > [_host:protected] => del.icio.us > > [_port:protected] => 80 > > [_path:protected] => /feeds/json/mwolff/ > > [_query:protected] => > > [_fragment:protected] => > > [_regex:protected] => Array > > ( > > [alphanum] => [^\W_] > > [escaped] => (?:%[\da-fA-F]{2}) > > [mark] => [-_.!~*'()\[\]] > > [reserved] => [;\/?:@&=+$,] > > [unreserved] => > > (?:[^\W_]|[-_.!~*'()\[\]]) > > [segment] => > > (?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*) > > [path] => > > (?:\/(?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*)?)+ > > [uric] => > > (?:[;\/?:@&=+$,]|(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})) > > ) > > > > [_scheme:protected] => http > > ) > > > > ) > > > > [_authUname:protected] => > > [_authPass:protected] => > > ) > > > > [_iteratorKey:protected] => 0 > > ) > > > > As you can see, it tries to fetch http://del.icio.us/feeds/json/mwolff/, > > which > > is not only correct, but also contains a number of posts. > > > > Bug? > > > > CU > > Markus > > > > Am Freitag, den 06.07.2007, 09:21 -0400 schrieb Darby Felton: > > > Hi Markus, > > > > > > It appears that your usage is correct... what is the result of > > > count($posts)? > > > > > > Best regards, > > > Darby > > > > > > Markus Wolff wrote: > > > > Hey guys, > > > > > > > > I'm currently trying to figure out Zend_Service_Delicious. I really > > > > don't want to do anything complicated, just fetch a user's public posts. > > > > According to the manual, this should work nicely: > > > > > > > > $feed = new Zend_Service_Delicious(); > > > > $posts = $feed->getUserPosts('mwolff'); > > > > foreach($posts as $item) { > > > > echo ""; print_r($item); echo "\n"; > > > > } > > > > > > > > After the call to getUserPosts(), $posts does contain a > > > > Zend_Service_Delicious_PostList object. The following iteration, > > > > however, yields no results whatsoever. > > > > > > > > This is with a checkout of trunk from Monday. What am I doing wrong? Am > > > > I doing anything wrong?? > > > > > > > > Thanks, > > > > Markus > > > > > > > > > > > -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Getting a grip on Zend_Service_Delicious
Hey there, I have found my error: $posts = $feed->getUserPosts('mwolff'); ...is not enough, you *have* to specify the number of posts to retrieve as the second parameter: $posts = $feed->getUserPosts('mwolff', 10); That does the trick. It's a bit counter-intuitive to me, I would have expected it to return *all* posts if I specify null or 0 as the second parameter. Oh, well... thanks anyway :-) CU Markus Am Freitag, den 06.07.2007, 15:49 +0200 schrieb Markus Wolff: > Hey Darby, > > unfortunately, it's zero. :-( > > Here's a dump of the PostList object: > > Zend_Service_Delicious_PostList Object > ( > [_posts:protected] => Array > ( > ) > > [_service:protected] => Zend_Service_Delicious Object > ( > [_rest:protected] => Zend_Rest_Client Object > ( > [_data:protected] => Array > ( > ) > > [_uri:protected] => Zend_Uri_Http Object > ( > [_username:protected] => > [_password:protected] => > [_host:protected] => del.icio.us > [_port:protected] => 80 > [_path:protected] => /feeds/json/mwolff/ > [_query:protected] => > [_fragment:protected] => > [_regex:protected] => Array > ( > [alphanum] => [^\W_] > [escaped] => (?:%[\da-fA-F]{2}) > [mark] => [-_.!~*'()\[\]] > [reserved] => [;\/?:@&=+$,] > [unreserved] => (?:[^\W_]|[-_.!~*'()\[\]]) > [segment] => > (?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*) > [path] => > (?:\/(?:(?:(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})|[:@&=+$,;])*)?)+ > [uric] => > (?:[;\/?:@&=+$,]|(?:[^\W_]|[-_.!~*'()\[\]])|(?:%[\da-fA-F]{2})) > ) > > [_scheme:protected] => http > ) > > ) > > [_authUname:protected] => > [_authPass:protected] => > ) > > [_iteratorKey:protected] => 0 > ) > > As you can see, it tries to fetch http://del.icio.us/feeds/json/mwolff/, which > is not only correct, but also contains a number of posts. > > Bug? > > CU > Markus > > Am Freitag, den 06.07.2007, 09:21 -0400 schrieb Darby Felton: > > Hi Markus, > > > > It appears that your usage is correct... what is the result of > > count($posts)? > > > > Best regards, > > Darby > > > > Markus Wolff wrote: > > > Hey guys, > > > > > > I'm currently trying to figure out Zend_Service_Delicious. I really > > > don't want to do anything complicated, just fetch a user's public posts. > > > According to the manual, this should work nicely: > > > > > > $feed = new Zend_Service_Delicious(); > > > $posts = $feed->getUserPosts('mwolff'); > > > foreach($posts as $item) { > > > echo ""; print_r($item); echo "\n"; > > > } > > > > > > After the call to getUserPosts(), $posts does contain a > > > Zend_Service_Delicious_PostList object. The following iteration, > > > however, yields no results whatsoever. > > > > > > This is with a checkout of trunk from Monday. What am I doing wrong? Am > > > I doing anything wrong?? > > > > > > Thanks, > > > Markus > > > > > > >
Re: [fw-general] fw-all list broken?
Yes, as I said, I am subscribed to general, announce and all. fw-all should cover the mvc, formats, locale etc, but I am not receiving all the mail from these lists. -- Jack
Re: [fw-general] consultants?
Hi Hoopes, Zend Technologies offers a wide range of consulting services for Zend Framework. For more information on Zend services, please contact [EMAIL PROTECTED] Best regards, Darby Hoopes wrote: > Hi guys, > > Apologies in advance if this is not the place for this type of message, > feel free to delete it if so. > > My company is making a move from old code to a more framework oriented, > standardized solution. (We'd like to bring in outside help, and our > non-standard way of doing things takes more time to spin them up than > get the work done). So, we're attempting to move to the ZF so hopefully > the MVC-ness of it will allow people to come in and contribute more easily. > > So, we're actually looking for someone to come to the office, and teach > us a bit to get us started on this. > Specifically the Model part of the MVC, but overall education is the > goal. :) > > We're a Pittsburgh based company, and if anyone reading this has some > time (and patience), and wants to try to make some money, please email > [EMAIL PROTECTED] with any inquiries for further information. > > Thanks > - hoopes >
Re: [fw-general] fw-all list broken?
Straight from the wiki: You may subscribe to each list individually, according to your preference, or you may use a shortcut to subscribe to all the lists, except fw-announce, fw-general, fw-docs, fw-svn. The shortcut is [EMAIL PROTECTED] Notice if you subscribe to all you don't get announce, general, docs, or svn Thank you, Jordan Raub Systems Adminstrator / Developer Novatex Solutions <[EMAIL PROTECTED]> 1.888.NTS.1.SEO He that teaches himself hath a fool for his master. -- Benjamin Franklin Poor is the pupil who does not surpass his master. -- Leonardo da Vinci. - Original Message From: Joó Ádám <[EMAIL PROTECTED]> To: fw-general@lists.zend.com Sent: Thursday, July 12, 2007 4:50:11 AM Subject: Re: [fw-general] fw-all list broken? There's (was?) some problem with the fw-all sure, I also wanted to subscribe to it, then I had to subscribe to each list separately. Ádám
Re: [fw-general] Searching database
if a type http://localhost/search?query=123, its ok but if I type http://localhost/search it shows a notice "undefined index" 2007/7/11, José de Menezes Soares Neto <[EMAIL PROTECTED]>: i want matching... but i try to get $query = $_GET["query"] and there appears a message: *Notice*: Undefined index: query in *C:\www\was\application\controllers\FuncionariosController.php * on line *81 * 2007/7/11, ViShap <[EMAIL PROTECTED]>: > > Hi josé! > > What kind of search should this be? Full-Text or matching (LIKE > %$string% ) ? > > For Like execute a simple Query select . from . LIKE %$string% limit > ... > > for full text i strongly recommend google-searching - many good articles > about it =) > (i think also zend has sth in their tutorials-section ... > > It was when I viewed it in Beginner Tutorials -> Using MySQL Full-text- > ... (26.01.06 ^^) > > I hope i helped ya out! > > regards > > 2007/7/11, José de Menezes Soares Neto <[EMAIL PROTECTED]>: > > > > Hi friends, > > > > I would like to make a search for search user details in my database, > > how do I start with it? > > > > Best regards, > > > > José de Menezes > > > >
Re: [fw-general] Searching database
i want matching... but i try to get $query = $_GET["query"] and there appears a message: *Notice*: Undefined index: query in * C:\www\was\application\controllers\FuncionariosController.php* on line *81 * 2007/7/11, ViShap <[EMAIL PROTECTED]>: Hi josé! What kind of search should this be? Full-Text or matching (LIKE %$string% ) ? For Like execute a simple Query select . from . LIKE %$string% limit ... for full text i strongly recommend google-searching - many good articles about it =) (i think also zend has sth in their tutorials-section ... It was when I viewed it in Beginner Tutorials -> Using MySQL Full-text- ... (26.01.06 ^^) I hope i helped ya out! regards 2007/7/11, José de Menezes Soares Neto <[EMAIL PROTECTED]>: > > Hi friends, > > I would like to make a search for search user details in my database, > how do I start with it? > > Best regards, > > José de Menezes >
Re: [fw-general] fw-all list broken?
There's (was?) some problem with the fw-all sure, I also wanted to subscribe to it, then I had to subscribe to each list separately. Ádám
Re: [fw-general] fw-all list broken?
Well, yes they do, but they're not supposed to: http://www.nabble.com/Posting-to-fw-general%3A-please-think-twice-before-tf4056518s16154.html And some people do post to the correct lists, and I'm not receiving (most of) these messages. -- Jack
Re: [fw-general] fw-all list broken?
I think that everyone writes to fw-general@lists.zend.com, instead of writing to the specific group mail list. Svetlin Tsvetanov On 7/12/07, Jack Sleight <[EMAIL PROTECTED]> wrote: I think its just started working, maybe someone fixed it, or maybe it was a temporary error? At least I've started receiving messages from fw-formats now, no others though. -- Jack -- http://www.spetrov.com
Re: [fw-general] fw-all list broken?
I think its just started working, maybe someone fixed it, or maybe it was a temporary error? At least I've started receiving messages from fw-formats now, no others though. -- Jack