Re: [fw-general] ZF and SEO issues
Thank you! As for the example url's, I tried it and they go all of the three to the same place, whether I use camelcase or an underscore or dash ... * http://www.example.com/read_inbox/mail/15 * http://www.example.com/read-inbox/mail/15 * http://www.example.com/readInbox/mail/15 Matthew Weier O'Phinney-3 wrote: -- debussy007 [EMAIL PROTECTED] wrote (on Tuesday, 12 February 2008, 08:20 AM -0800): Some of my content can have more than one Url, e.g. : * http://www.example.com/read_inbox/mail/15 * http://www.example.com/read-inbox/mail/15 * http://www.example.com/readInbox/mail/15 Well, this last one won't go to the same place, but the other two will. * etc. This is wrong regarding SEO. You will probably reply me that I should just use one type of url in my application, but what if someone links a different url to my site ? Also maybe someone that doesn't want your site to get well ranked can use this trick. And why would they substitute another character than the ones published? How would they know which URLs worked that way, and which didn't? If you want to be paranoid about it, it's an easy change: just limit the word delimiter characters the dispatcher can understand: $dispatcher-setWordDelimiter('-'); $dispatcher-setPathDelimiter('-'); Done. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/ -- View this message in context: http://www.nabble.com/ZF-and-SEO-issues-tp15434531s16154p15451408.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Help with helpers
Hello, I just followed the tutorial found on: http://www.ingredients.com.au/nick/2006/06/26/custom-view-helpers-in-zend-framework/ But I want to group several functions into one single helper. For example, to have a Calculation helper with methods like add, substract, multiple, etc... Is this possible??? Mauricio Cuenca wrote: Hello, I am an old PHP (structured programming) programmer starting with Zend Framework. I am building a new app with ZF but now I need to use helpers. I kind of know what exactly they do, but I need some indications about the position they should have into the application's file structure, what is the exact syntax for declaration and how can I invoke a helper from a controller action. I was searching in the framework documentation and googling for a while but could not find any really usefull. Thanks! -- View this message in context: http://www.nabble.com/Help-with-helpers-tp15456824s16154p15456864.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Help with helpers
Sure! Just pass an instance of the helper back from its default method. E.g:- class MyHelper_Calculator { public function calculator() { return $this; } public function add($a, $b) { return $a + $b; } ...etc... } ...and in your script you'd simply call it like so:- ?php $this-Calculator()-add(3, 4) ? But I want to group several functions into one single helper. For example, to have a Calculation helper with methods like add, substract, multiple, etc... Is this possible??? -- 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] Zend DB
Hi Just wondered what the best methods were to do Bulk Inserts Do I loop through the array foreach insert Or is there some other methods that I can use I can see - anything else ? $bugs = new Bugs(); $newRow = $bugs-createRow(); // Data are arranged in an associative array $data = array( 'bug_description' = '...description...', 'bug_status' = 'NEW' ); // Set all the column values at once $newRow-setFromArray($data); // INSERT the new row to the database $newRow-save();
[fw-general] Making a request with Zend_HTTP and checking for timeout
Hi, I have this bit of code using the default timeout of 10 seconds $oClient = new Zend_Http_Client($sURL); $oResponse = $oClient-request(); I want to know how to detect for a timeout, does it throw an exception such that I need to wrap the request around a try catch block? Thanks Haddad -- Haddad Said Developer Eckoh UK Limited Telford House, Corner Hall, Hemel Hempstead, Hertfordshire HP3 9HN T 01442 458400 F 01442 458443 M n/a W www.eckoh.com Winner, Best Use of Technology Partnership, CCA Excellence Awards 2007 Winner, Innovation of the Year Award, Transport Innovations 2007 This communication contains information, which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s) only. If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender and then delete it. Opinions expressed in this message are those of the author, and are not binding on the company. Registered in England and Wales, No. 2796531 Registered office: Telford House, Corner Hall, Hemel Hempstead, Hertfordshire HP3 9HN A member of the Eckoh Plc group of companies.
[fw-general] _forward() question
hi there, I'm using $this-_forward() in a controller method to forward the request onto a login page, this can't be done that easily in pre- dispatch since different methods have different requirements for ACL and we have a rather complex custom route system going on (part of which happens in specific controllers). At present we're not using Zend ACL. It seems the default behaviour of _forward() is to continue processing the current method's code, and then forward to the new controller/ action. So if multiple forwards exist in that method's code, only the last one actually works. Is this correct? I had presumed _forward() would forward to the new controller/action and exit the code at that specific point. Is this possible? Or do I have to just return from the method at that point in the code? I.e. $this-_forward(index, login); return; Further to this, if the above is the recommended way to forward and quit the current method then this of course becomes problematic if I abstracted the login check. I.e. if I called a function to do something like: $this-checkLogin(); And the function checkLogin() did the necessary ACL check and also included the forward() - to avoid DRY. comments appreciated! Simon
Re: [fw-general] Zend_Validate_Alnum
Filled issue http://framework.zend.com/issues/browse/ZF-2646 -- Łukasz Wojciechowski
Re: [fw-general] Zend DB
Ian Warner-4 wrote: Just wondered what the best methods were to do Bulk Inserts I assume that by best you mean that you want this to run fast (everybody does). Although the Table-createRow() solution is the most convenient and consistent with the OO usage, it's actually the slowest solution, because it prepares and executes a new SQL statement for each row. One improvement is to prepare an INSERT query with parameter placeholders, and execute the prepared query in a loop, providing one row to be inserted as parameters. Another way to speed up bulk inserts is to use explicit transactions, instead of committing after each row inserted. This applies to autocommit as well. $db = $bugs-getAdapter(); $db-beginTransacation(); $stmt = $db-prepare(INSERT INTO bugs (bug_description, bug_status, ...) VALUES (?, ?, ...)); for ($arrayOfRows as $row) { // $row is an array of values matching the columns in the INSERT statement $stmt-execute($row); } $db-commit(); However, the fastest solution is to use MySQL's LOAD DATA INFILE statement (or equivalent for other brands). Using the database's solution for bulk loading can be ten to twenty times faster than doing inserts in a loop. See also http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html for more tips. Regards, Bill Karwin -- View this message in context: http://www.nabble.com/Zend-DB-tp15459316s16154p15461543.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] _forward() question
-- Simon R Jones [EMAIL PROTECTED] wrote (on Wednesday, 13 February 2008, 05:14 PM +): I'm using $this-_forward() in a controller method to forward the request onto a login page, this can't be done that easily in pre-dispatch since different methods have different requirements for ACL and we have a rather complex custom route system going on (part of which happens in specific controllers). At present we're not using Zend ACL. It seems the default behaviour of _forward() is to continue processing the current method's code, and then forward to the new controller/action. So if multiple forwards exist in that method's code, only the last one actually works. Is this correct? I had presumed _forward() would forward to the new controller/action and exit the code at that specific point. Is this possible? Or do I have to just return from the method at that point in the code? I.e. $this-_forward(index, login); return; Correct -- you need to return. I actually usually write it as: return $this-_forward('index', 'login'); as the return value of an action is ignored anyways. The reason it works this way (i.e., you need to return when forwarding) is because you can't have a called function force the calling function to return -- it's a language limitation. Further to this, if the above is the recommended way to forward and quit the current method then this of course becomes problematic if I abstracted the login check. I.e. if I called a function to do something like: $this-checkLogin(); And the function checkLogin() did the necessary ACL check and also included the forward() - to avoid DRY. Unfortunate, but necessary. I typically have methods like this return a boolean, so I can then do something like this: if (!$this-checkLogin() { return $this-_forward('index', 'login'); } -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] English grammar check
Hi guys, I need an official English grammar check for an update to the official documentation I'd like to commit. Here the details http://framework.zend.com/issues/browse/ZF-2140#action_18996 Can someone help me? :) -- View this message in context: http://www.nabble.com/English-grammar-check-tp15469144s16154p15469144.html Sent from the Zend Framework mailing list archive at Nabble.com.
RE: [fw-general] English grammar check
I just put a comment on the issue. Looks good to this English- I mean Americanish- speaker. :) ,Wil -Original Message- From: Simone Carletti [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 13, 2008 2:17 PM To: fw-general@lists.zend.com Subject: [fw-general] English grammar check Hi guys, I need an official English grammar check for an update to the official documentation I'd like to commit. Here the details http://framework.zend.com/issues/browse/ZF-2140#action_18996 Can someone help me? :) -- View this message in context: http://www.nabble.com/English-grammar- check-tp15469144s16154p15469144.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] 1.5 Release Rollout
I can attest to the fact that we here at Zend have been working our tushes off trying to get 1.5 wrapped up and in to the hands of our users. Judging by all the repository, issue tracker, etc. notifications I've had in my inbox, a lot of people in the ZF community can say the same. So I absolutely refuse to say another word until I extend thanks from everyone at Zend to all the contributors, tester, and documentation writers for all their efforts on 1.5. Thank you! . . .and keep it coming. ;) I'm very pleased to say we have reached the point where we must start planning the path to our final release. Our plans include at least one release candidate which will be made available at the simultaneously with 1.0.4. Please note that 1.0.4 will be our *final* release from the 1.0 branch. You should all receive a code freeze announcement for both of these releases in the next day or so. If all goes well, we will be releasing a 'sanity check' tarballs for 1.5 RC1 and 1.0.4 on 2/22 for everyone to test over the weekend, with the 1.5 RC1 and 1.0.4 releases posted on the website for the following Monday- 2/25. It's difficult to set a date for the final release until we all have a chance to put the release candidates through the wringer, but suffice it to say we hope to make a big announcement sometime in mid-March. :) You can help us get there by: * Finishing any work you are targeting for inclusion in 1.5 ASAP * Taking on some of the bugs from our most wanted list: http://framework.zend.com/wiki/x/SaM * Fixing broken unit tests (Please check JIRA to see if there is an unassigned issue for it first. If not, feel free to create one and assign it to yourself if you plan to fix it.) * Building the documentation and fixing any errors * Testing, testing, testing, and more testing Again, thanks to everyone who has helped make this one of our most eagerly anticipated releases yet! ,Wil