Re: [fw-general] Re: A question about bootstrapping modules
One way to achieve this is to have separate bootstrap index.php files, i.e /admin/index.php which would then specify a specific config file to use which merges with the main (default module) config. Both config.ini specify the default module, and because of merging the two configs setting the default module to be admin in the admin config.ini will allow you to determine which specific controller directory to specify. $module = isset($options['module']) ? $options['module'] : 'default'; $frontController = Zend_Controller_Front::getInstance(); $frontController-setControllerDirectory(APPLICATION_PATH.'/modules/'.$module.'/controllers', $module) The module Directory is not specified since it will read admin, and default as available modules to bootstrap. If you google, Matthew mentioned another method that someone used whereby using a controller plugin to only call iniActive methods for the current module - but for me that still meant loading a module bootstrap class which would wouldn't be required in this particular usage.
Re: [fw-general] Files which are outside the public folder
For large files, http://tn123.ath.cx/mod_xsendfile/ is a good alternative to reading the file through php but allowing php to still maintain access control. On Fri, Jan 29, 2010 at 1:29 PM, holografix . hologra...@gmail.com wrote: Hi You can watch this cast and download the code. Maybe it helps you. http://www.zendcasts.com/protecting-assets-with-zend-controller-plugins/2009/10/ Cheers holo 2010/1/29 Ralph Schindler ralph.schind...@zend.com Well, this is gonna be tricky. Ideally, they are simply served from the public directory. But if you want to add some level of access control around them, you'll need to put them outside of the public/ directory, and wrap the download in a PHP script that will do your access control. Normally, I'd say to do this inside a controller, but Video files can get large. In addition, by using the Zend_Controller request, it will output-buffer the output by default.. Which might cause problems. Your best bet is to do a downlaod.php script, and do something similar in here, example 1: http://php.net/manual/en/function.readfile.php In the script, you'll have to do some kind of quick access control, like checking Zend_Auth for a user, or even perhaps checking the cookie against your database. Hope that helps, Ralph Kuzma wrote: Hello! I've tried to search for the solution or any information about this question but I haven't found anything. The problem is: I have a page which loads JS video player which plays video files from the public folder to all users: as example video/id/xx/main.flv But I need, that logged in users can see and another video files which are secured. In other words that someone won't download files directly. I understand that this files must be put outside public folder but in this way I don't understand how to generate links to player. Thank you! -- Greg
[fw-general] Re: Zend_Form_Element and addError function weirdness
Is this fixed? I'm calling addError() on my form object, and it owerwrites all messages if there are, if no errors, still don't get my set eror? ZF 1.10.0alpha1 Regards, Sasa Stamenkovic. -- View this message in context: http://n4.nabble.com/Zend-Form-Element-and-addError-function-weirdness-tp655747p1457366.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] quickstart question
Hello, I've decided to study the Zend Framework to use in my applications, and as first step I started the quickstart. It went very well until I had to create the 'guestbook' controller; i used the zf tool to create it and then edited accordingly to the guide, but when i lanched the page here's what i get: --- Fatal error: Class 'Application_Model_Guestbook' not found in D:\xampp\htdocs\zf\application\controllers\GuestbookController.php on line 12 --- I 'suspect' its something related to the autoload functionality, but i cant get it to work. Some data: Version ZF 1.10.0 System: Windows 7 + XAMPP (Apache 2.2 + PHP 5.3) My directory structure is exactly the default created by the zf tool plus the files in the quickstart The files have the exacly same content as the quickstart, and all the php files have ?php in the beggining Some file contents: Bootstrap.php http://pastebin.com/m4de59b79 public/index.php http://pastebin.com/m157ca31f application/controllers/GuestbookController.php http://pastebin.com/m55b71e69 This is prob something easy to fix for experienced players but i cant seem to find a solution :( Does anyone know a way to fix this? Thank you very much in advance. -- Jader Augusto Intelligence Tech - Desenvolvimento de Sistemas e Web-sites - Suporte Técnico e consultoria em TI (98) 3227 - 7978
Re: [fw-general] Quickstart Zip download package
-- Daniel Latter dan.lat...@gmail.com wrote (on Friday, 29 January 2010, 10:04 PM +): I think the download zip for the quickstart is pointing to an old version? Why? because it doesnt use Zend_Application or Bootstrap classes but instead does it the old way: heres: the index.php: http://pastebin.com/m1fd64657 heres the bootstrap: http://pastebin.com/m4aa41dd9 Appologies if this is intentional, but if not it is likely to cause confusion. I'll get this corrected early next week -- thanks for the report. -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
[fw-general] Global strategy for using Zend_Feed
I have a forum board module which uses intensively Zend_Feed. Which is the best way to implement cache for feed generation from database? How should I name cache keys? Maybe a hash of SQL query? Some model name combination? When and where to execute cache cleaning by tags? Is this a job for model? postModify() method? Feed_Controller with feed actions? or My_Action_Controller_Feed? Should feed methods be static? New Zend_Feed is great. There's a lot of simple examples. But I haven't seen complex example yet. (I'm using Doctrine with ZF) -- regards takeshin -- View this message in context: http://n4.nabble.com/Global-strategy-for-using-Zend-Feed-tp1437202p1437202.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: Global strategy for using Zend_Feed
I just cloned ZFPlanet repository from Github. Looks very nice. -- regards takeshin -- View this message in context: http://n4.nabble.com/Global-strategy-for-using-Zend-Feed-tp1437202p1439384.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: quickstart question
Jader Augusto wrote: I had to create the 'guestbook' controller; i used the zf tool to create it and then edited accordingly to the guide, but when i lanched the page here's what i get: --- Fatal error: Class 'Application_Model_Guestbook' not found in D:\xampp\htdocs\zf\application\controllers\GuestbookController.php on line 12 --- The Guestbook Model is probably missing. Have a look at this page: http://framework.zend.com/manual/en/learning.quickstart.create-model.html and scroll down to the first code example. It also shows you where to place it. -- View this message in context: http://n4.nabble.com/quickstart-question-tp1457372p1457384.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: Files which are outside the public folder
Thanks to all! With your help I've found solution!:jumping: -- View this message in context: http://n4.nabble.com/Files-which-are-outside-the-public-folder-tp1345590p1457400.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] [Zend_Search_Lucene] checking if a document is already in the index
Hi, I have a problem with Zend_Search_Lucene. I'm trying to write a script that checks if a document is already in the index and adds the document only if it's not already in the index. The problem in that code is that $index-termDocs($term) always returns an empty array (even if the document is already in the index). Can anyone help? Here is my main indexing loop (which never displays Document xxx already in index...): $index = Zend_Search_Lucene::open($indexPath); foreach ($medias as $media) { // Check if the media is already in the index $term = new Zend_Search_Lucene_Index_Term($media[media_id], media_id); $docIds = $index-termDocs($term); if (count($docIds) == 0) { // Media not already in the index print Adding document . $media[media_id] . \n; $doc = new Zend_Search_Lucene_Document(); $doc-addField(Zend_Search_Lucene_Field::unIndexed('media_id', $media[media_id])); ... add other fields ... $index-addDocument($doc); $index-commit(); } else { print Document . $media[media_id] . already in index\n; } // Optimize the index from time to time if ($cnt % 1000 == 0) $index-optimize(); $cnt++; } $index-commit(); $index-optimize(); Cheers, Olivier -- - *Olivier RICORDEAU* - oliv...@ricordeau.org
[fw-general] Zend_Filter_Input filtering not triggering
Hi all, I'm using Zend_Filter_Input on my magic getter / setter methods to validate my input and cast fields to the type I desire. The validation portion is working great, but it's like the filters aren't working at all. My model, with Zend_Filter_Input logic, is here: http://pastebin.com/m7950c5a0 Example output is here: object(MyApp_Model_User)#19 (1) { [_data:protected]= array(15) { [id]= string(1) 4 [email]= string(19) andyba...@gmail.com [password]= string(32) 594851275f207072b172d7508f037d78 [username]= string(6) abaird [first]= string(4) Andy [last]= string(5) Baird [phone]= string(10) 111222 [email_opt_in]= int(1) [zip]= string(5) 5 [birthyear]= string(4) 1984 [gender]= string(4) male [activated]= int(1) [date_joined]= string(10) 2008-03-11 [admin]= string(1) 1 [active]= string(1) 1 } } I can't figure out if it's a usage error, but I've tried tracing through the code and can't figure out why the filters don't seem to be applying. Any insight on this would be appreciated! -Andy
Re: [fw-general] Quickstart Zip download package
I reported this issue yesterday please close it when fixed: http://framework.zend.com/issues/browse/ZF-9019 On Sat, Jan 30, 2010 at 6:43 PM, Matthew Weier O'Phinney matt...@zend.comwrote: -- Daniel Latter dan.lat...@gmail.com wrote (on Friday, 29 January 2010, 10:04 PM +): I think the download zip for the quickstart is pointing to an old version? Why? because it doesnt use Zend_Application or Bootstrap classes but instead does it the old way: heres: the index.php: http://pastebin.com/m1fd64657 heres the bootstrap: http://pastebin.com/m4aa41dd9 Appologies if this is intentional, but if not it is likely to cause confusion. I'll get this corrected early next week -- thanks for the report. -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- Alexander Steshenko | http://lcf.name
[fw-general] howto define a table in a config.ini
Hi all, history I've created a generic form engine. Everything exists in .ini files. /history There is now a need to have some table structures in some of the forms but because all the forms are rendered based on .ini files I can't insert html views into them. Not sure how to google this one. Tried and failed... Does anybody know how to define an html table / structure using config.ini syntax? If so, would somebody be so kind as to post a link to an example or reference, or a hint as to how to do so? million tia, Mike Wright
Re: [fw-general] howto define a table in a config.ini
I've never used .ini files for configuring a form, but in general, you need to modify the form and element decorators to render the elements in a table (instead of the default dd's and dt's). Check this blog post out: http://zendgeek.blogspot.com/2009/07/zend-form-decorators.html It's not in .ini format, but it should hopefully get you started. Konr On Sat, Jan 30, 2010 at 3:08 PM, Mike Wright mike.wri...@mailinator.comwrote: Hi all, history I've created a generic form engine. Everything exists in .ini files. /history There is now a need to have some table structures in some of the forms but because all the forms are rendered based on .ini files I can't insert html views into them. Not sure how to google this one. Tried and failed... Does anybody know how to define an html table / structure using config.ini syntax? If so, would somebody be so kind as to post a link to an example or reference, or a hint as to how to do so? million tia, Mike Wright