Re: AW: [fw-general] Using Amazon S3 with Zend Framework
Hi Leo, > And I think it's acctualy not possible to solve it > without external libaries, as there is currently no Hmac coding avable in > Zend which is needed for S3. HMAC coding is available in PHP itself : http://www.php.net/manual/en/function.hash-hmac.php My implementation successfully use this function to generate the signature. I can provide some code if needed. Regards, Jean-Marc Kanopée - Développement Informatique Durable 56 rue de Saint André 59800 Lille Tél : 03 20 74 61 25 Portable : 06 88 56 50 79 Fax : 03 20 06 51 26 Web : http://www.kanopee.net/
AW: [fw-general] ZVE dispatch controller action
Dont worry! We acctually planing to go live with ZVE, on a site that has some more than millions of page views. I really hope ZF 1.1 will come out befor we have to go online. It might be sound crazy to go online with proposal code, but we did a lot of testing and and we think Paddys code is stable enough for us. Cheers, leo Von: David Koblas [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 19. September 2007 16:45 An: Pádraic Brady Cc: Adam Torrino; Zend Framework General Betreff: Re: [fw-general] ZVE dispatch controller action Is there a timeline for when the ZF+ZVE+ZL components are going to show up in the tree? Since, I'm currently a loyal and heavy user of the ZVE infrastructure (one facebook app and two other sites). I was curious as to when I was going to have to start thinking about managing the "bugs" that will come out of the updates... One of the barriers to my putting ZF into my "big" site (millions of page views) is pending on ZF 1.1 since it'll have the necessary support for what I really need -- without the worries of having to do a bunch of fixes. Thanks, --koblas Pádraic Brady wrote: Hi Adam, The way the current proposal version (which is alpha at best) works is that it requires a change to the ViewRenderer class to allow for Request substitution. Mainly this was because ViewRenderer was stuck on the original request data so much that relying on it to update view script names was difficult. You can either add this method to ViewRenderer yourself - it's just a simple setter/getter pair and no other fancy coding. Or I think you can disable ViewRenderer for your sub-controllers and set the Response body manually. Hope this throw some light on the subject :). Paddy P.S. The current code was only ever intended to support a proposal (i.e. I assumed a proposal did not require actual working code beyond a demo implementation) but so far I've heard of ZVE in use on about 5-6 projects whose team is in contact every week or so with me. You'll be glad to hear that whatever the rough cut version's flaws are, work will progress on an official version (Layouts will be delegated to Zend_Layout instead however) in the near future which will do away with such uncertainties and support some extra edge cases. If you have any other issues feel free to contact me. Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com - Original Message From: Adam Torrino <[EMAIL PROTECTED]> To: fw-general@lists.zend.com Sent: Wednesday, September 19, 2007 3:10:33 PM Subject: [fw-general] ZVE dispatch controller action Hi all, LOVE Zend_View Enhanced and have begun using it for a large project... only problem I've noticed is when trying to render the result of a controller action into a layout. The idea is to have a Sidebar controller just for this purpose, and each action being a separate sidebar "widget", and no publicly mapped routes of course. In layout: echo $this->controller('tagCloud', 'sidebarwidgets', null, array()); Gives: Fatal error: Call to undefined method Zend_Controller_Action_Helper_ViewRenderer::setRequest() in /www/project1/Zend/View/Helper/Controller.php on line 56 Seen this on the astrumfutura blog too but no resolution - I know its a work in progress...any ideas on this? Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more! Check out the hottest 2008 models today at Yahoo! Autos.
AW: [fw-general] Using Amazon S3 with Zend Framework
I would really like to see a S3 Service in ZF. But acctualy it does not have priority for us as well. And I think it's acctualy not possible to solve it without external libaries, as there is currently no Hmac coding avable in Zend which is needed for S3. Cheers, Leo -Ursprüngliche Nachricht- Von: Stefan Pettersson [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 19. September 2007 21:46 An: fw-general@lists.zend.com Betreff: [fw-general] Using Amazon S3 with Zend Framework I'm about to implement Amazon S3 usage in a current ZF application. Since there is no existing Zend_Service for it I wonder if there is any other code available suitable to use with ZF? I did find a component proposal but (surprisingly IMHO) it seems like nothing more happened with it. Looking at the Amazon sample code they seem to require some external libraries. I rather prefer a more "clean" ZF-only solution if possible. Any pointers, recommendations or tips (or code) greatly appreciated. Best regards, Stefan Pettersson
Re: [fw-general] Lucene index permissions
Doh--should've (re-)checked first. I updated to the release branch ZSL and it works perfectly. Thanks! On 20-Sep-07, at 9:37 AM, Alexander Veremyev wrote: Hi Nathan, It's ZF-1429. It's fixed and I just committed it to the release branch. So it's included into ZF 1.0.2 which is coming soon. With best regards, Alexander Veremyev. -Original Message- From: Nathan Wright [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 10:33 AM To: Zend Framework General Subject: [fw-general] Lucene index permissions Hi all, I have an index that's generated and queried by Apache's 'nobody' user (which works well), but I'm having trouble updating it from a cron job. There is a JIRA issue on this subject (JIRA's currently down so no link), but the workaround solution someone posted wasn't much help. It actually made the indexes inaccessible to both Apache & the cron job after the initial index creation. (Can't post the code as this attempt was some time ago, but I followed that example code *exactly*.) Maybe I need to route the cron job through apache so that the index is being accessed by the same user? I'm not sure how this would work though. I'm not so brilliant when it comes to this sort of *nix issue, so any help would be most appreciated. Cheers, ncw No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 19.09.2007 15:59 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 19.09.2007 15:59
Re: [fw-general] Using a complete HTML Template
Thanks a lot to all for the comprehensive information in this issue -and for your patience ;) > The Zend_Layout methodology has been decided to be used in ZF 1.1 so I > can point you to the soon-to-be-official approach offered by Ralph > Schindler. This is a clear statement. Thus, I'll use Zend_Layout as of now. I wonder where is the right place to asks questions about this proposal, since not even the Milestone 1 is marked as "DONE" Best regards /Ralf
[fw-general] Re: Filter Output?
An update on Filter Output -- advice always welcome... Found the $view->addFilter(...) method, which does filter output. Doh. Here's a few thoughts for those paying attention (if anybody is). $view->addFilter('Macro'); $macro = $view->getFilter('Macro'); $macro->addPath("../{$app}/views/macros"); Feature request: Have a way to add a filter from a constructed object e.g: $macro = new Macro(...arguments...); $view->addFilterObject($macro); On the view front, since a Macro needs to do a render pass, I've ended up creating subsclass of Zend_View_Abstract that implements a render method that doesn't use the script search path (rather the macro search path). If it was possible to do one of a few things: Make _addPath() protected (rather than private) so you could add additional path groups to a search set. Make render() or another protected variant take a "search group" (default 'script') for finding objects to render. Without that support, I'm creating secondary view objects to render against... --koblas David Koblas wrote: Got it working, but it leaves a little to be desired: Objective: Filter the output after all rendering has happened. Initial thoughts: First thought: Look at views/filters/ .. hmm, focused on Input Filtering, not Output filtering... -- Output filtering is a very handy thing for some views. Second choice: Look into Helpers .. hmm, not really in the rendering chain, part of the rendering process. Third choice: Plugin .. gack. Ok, it does work. But, I'm now faced with: IndexController { function init() { create and initialize the plugin } } Why is it in the init() step (it'll probably move to the postDispatch() step) it's because it's a per-view dependant behavior. I can either create the filter in the main dispatch and then disable, or enable on a case by case basis... Final thought: * Could it be possible to have a mechansim that is based on the Zend_Filter system that can do output filtering of data. Is it already in plans? --koblas
Re: [fw-general] How to use Zend_Validate_Date to validate date format MM/DD/YYYY or m/d/yyyy
Hello, You can reformat the date such that it follows the -MM-DD format, and then the current Zend_Validate_Date will work for you. Perhaps better would be to file a JIRA issue, since this class is not at all flexible with the input format as it is, and furthermore, it should most likely make use of Zend_Date so that it is more DRY: http://framework.zend.com/issues/secure/CreateIssue!default.jspa Best regards, Darby Kexiao Liao wrote: > How do I use Zend_Validate_Date to valide date format as > MM/DD/(09/20/2007) or m/d/(9/1/2007)?
Re: [fw-general] Zend_Cache & MVC
I think this could be done with a plugin, you can check inside you module which module/controller/action is requested and then just act as needed. JARUZ wrote: > Hello: > > Are there examples on how to use Zend_Cache together with the MVC pattern? > The documentation (and also this mailing list after several hours of > searching) provide only examples for old-style procedural PHP applications > (basically using Zend_Cache as a stand-alone package), but nothing about how > to combine Zend_Cache with Controllers/Actions/Views/etc. > > I do not have any 'echo' statements in my code; everything is sent to the > browser through $frontController->dispatch();... I would like to use cache > within certain specific Actions from certain specific Controllers. > > For example: > > class IndexController extends Zend_Controller_Action > { > public function indexAction() > { > if($cache->start('mycache')) { > $this->view->title = 'Cached' . time(); > } > else { > $this->view->title = 'Not Cached' . time(); > } > } > } > > Do I make sense or am I just not getting something on how the Cache should > work? If anybody could give me some pointers, I really appreciate it. > > Thanks for your help! > > Cheers, > > > Antonio >
Re: [fw-general] How to use Zend_Validate_Date to validate date format MM/DD/YYYY or m/d/yyyy
Zend_Validate_Date is not able to validate other date formats than _MM_DD. But you can use Zend_Date::isDate($date, $format, $locale = null); which is able to check all formats dynamically. f.e. Zend_Date::isDate($input, 'M/d/'); which should give true for '4/9/2007' but false for '13/5/2007'... Greetings Thomas I18N Team Leader - Original Message - From: "Kexiao Liao" <[EMAIL PROTECTED]> To: Sent: Thursday, September 20, 2007 10:31 PM Subject: [fw-general] How to use Zend_Validate_Date to validate date format MM/DD/ or m/d/ How do I use Zend_Validate_Date to valide date format as MM/DD/(09/20/2007) or m/d/(9/1/2007)? -- View this message in context: http://www.nabble.com/How-to-use-Zend_Validate_Date-to-validate-date-format-MM-DD--or-m-d--tf4489966s16154.html#a12805269 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Passing information between controllers
-- debussy007 <[EMAIL PROTECTED]> wrote (on Thursday, 20 September 2007, 01:33 PM -0700): > Thank you all for your advices. > > I do not want to use FlashMessenger because I want to avoid creating > sessions for guests who didn't authenticated, for permance reasons. > > I will opt for the easiest one, set the view variable in the AuthController. > I think the best solution is to pass the parameter to the IndexController > since it is not the role of the AuthController to render the view of the > IndexController, The AuthController isn't rendering the view in this case; it's simply giving the view some information to use in its display logic. > but the code gets dirty since those kind of operations > demand some if statements etc. > > > Matthew Weier O'Phinney-3 wrote: > > > > -- debussy007 <[EMAIL PROTECTED]> wrote > > (on Thursday, 20 September 2007, 12:56 PM -0700): > >> I wondered how to pass info between two controllers. > >> Here is the case explained where I need it : > >> > >> I have an AuthController which is responsible for all login/logout > >> actions. > >> > >> When I notice someone put a bad username and/or password, > >> the AuthController forwards the flow to the IndexController which will > >> render the home page > >> and I want to display a message to explain it is a bad user and/or > >> password > >> on this home page. > >> > >> So the question is how do I specify that there was a bad connection > >> attempt > >> between the AuthController and the IndexController ? > >> > >> In other words how do I transfer the information between the > >> AuthController > >> and the IndexController > >> that the connection failed ? What is the best way ? > > > > The fourth parameter to _forward() is an array of paramater values to > > set in the request object: > > > > $this->_forward('index', 'index', null, array('error' => 'Bad login > > credentials')); > > > > You'd then retrieve this in the other controller using _getParam(): > > > > $error = $this->_getParam('error', false); > > if ($error) { > > // assign error to view? > > } > > > > Alternatively, you could simply set a view variable, and check for that > > in the home page view script: > > > > $this->view->error = 'Bad login credentials'; > > > > Finally, you could use the FlashMessenger helper (as Darby has already > > noted); this helper is best used for passing messages to subsequent > > requests. > > > > -- > > 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/Passing-information-between-controllers-tf4489758s16154.html#a12805273 > Sent from the Zend Framework mailing list archive at Nabble.com. > -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Passing information between controllers
Thank you all for your advices. I do not want to use FlashMessenger because I want to avoid creating sessions for guests who didn't authenticated, for permance reasons. I will opt for the easiest one, set the view variable in the AuthController. I think the best solution is to pass the parameter to the IndexController since it is not the role of the AuthController to render the view of the IndexController, but the code gets dirty since those kind of operations demand some if statements etc. Matthew Weier O'Phinney-3 wrote: > > -- debussy007 <[EMAIL PROTECTED]> wrote > (on Thursday, 20 September 2007, 12:56 PM -0700): >> I wondered how to pass info between two controllers. >> Here is the case explained where I need it : >> >> I have an AuthController which is responsible for all login/logout >> actions. >> >> When I notice someone put a bad username and/or password, >> the AuthController forwards the flow to the IndexController which will >> render the home page >> and I want to display a message to explain it is a bad user and/or >> password >> on this home page. >> >> So the question is how do I specify that there was a bad connection >> attempt >> between the AuthController and the IndexController ? >> >> In other words how do I transfer the information between the >> AuthController >> and the IndexController >> that the connection failed ? What is the best way ? > > The fourth parameter to _forward() is an array of paramater values to > set in the request object: > > $this->_forward('index', 'index', null, array('error' => 'Bad login > credentials')); > > You'd then retrieve this in the other controller using _getParam(): > > $error = $this->_getParam('error', false); > if ($error) { > // assign error to view? > } > > Alternatively, you could simply set a view variable, and check for that > in the home page view script: > > $this->view->error = 'Bad login credentials'; > > Finally, you could use the FlashMessenger helper (as Darby has already > noted); this helper is best used for passing messages to subsequent > requests. > > -- > 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/Passing-information-between-controllers-tf4489758s16154.html#a12805273 Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] How to use Zend_Validate_Date to validate date format MM/DD/YYYY or m/d/yyyy
How do I use Zend_Validate_Date to valide date format as MM/DD/(09/20/2007) or m/d/(9/1/2007)? -- View this message in context: http://www.nabble.com/How-to-use-Zend_Validate_Date-to-validate-date-format-MM-DD--or-m-d--tf4489966s16154.html#a12805269 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Passing information between controllers
-- debussy007 <[EMAIL PROTECTED]> wrote (on Thursday, 20 September 2007, 12:56 PM -0700): > I wondered how to pass info between two controllers. > Here is the case explained where I need it : > > I have an AuthController which is responsible for all login/logout actions. > > When I notice someone put a bad username and/or password, > the AuthController forwards the flow to the IndexController which will > render the home page > and I want to display a message to explain it is a bad user and/or password > on this home page. > > So the question is how do I specify that there was a bad connection attempt > between the AuthController and the IndexController ? > > In other words how do I transfer the information between the AuthController > and the IndexController > that the connection failed ? What is the best way ? The fourth parameter to _forward() is an array of paramater values to set in the request object: $this->_forward('index', 'index', null, array('error' => 'Bad login credentials')); You'd then retrieve this in the other controller using _getParam(): $error = $this->_getParam('error', false); if ($error) { // assign error to view? } Alternatively, you could simply set a view variable, and check for that in the home page view script: $this->view->error = 'Bad login credentials'; Finally, you could use the FlashMessenger helper (as Darby has already noted); this helper is best used for passing messages to subsequent requests. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Passing information between controllers
Hi, In your AuthController do: $this->_forward(action, controller, module, array('myVariable' => 'value')); And then in the ErrorController do: $myVariable = $this->getRequest()->getParam('myVariable'); debussy007 wrote: Hello, another question ... If anyone of you has some time to advice me I wondered how to pass info between two controllers. Here is the case explained where I need it : I have an AuthController which is responsible for all login/logout actions. When I notice someone put a bad username and/or password, the AuthController forwards the flow to the IndexController which will render the home page and I want to display a message to explain it is a bad user and/or password on this home page. So the question is how do I specify that there was a bad connection attempt between the AuthController and the IndexController ? In other words how do I transfer the information between the AuthController and the IndexController that the connection failed ? What is the best way ? Thank you for any advice & help !! -- Jack
Re: [fw-general] Passing information between controllers
Hi, In your AuthController do: $this->_forward(action, controller, module, array('myVariable' => 'value')); And then in the ErrorController do: $myVariable = $this->getRequest()->getParam('myVariable'); debussy007 wrote: Hello, another question ... If anyone of you has some time to advice me I wondered how to pass info between two controllers. Here is the case explained where I need it : I have an AuthController which is responsible for all login/logout actions. When I notice someone put a bad username and/or password, the AuthController forwards the flow to the IndexController which will render the home page and I want to display a message to explain it is a bad user and/or password on this home page. So the question is how do I specify that there was a bad connection attempt between the AuthController and the IndexController ? In other words how do I transfer the information between the AuthController and the IndexController that the connection failed ? What is the best way ? Thank you for any advice & help !! -- Jack
Re: [fw-general] Passing information between controllers
Hi, You might try the FlashMessenger helper; it is quite good for such use in many cases: http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelper.stockhelpers Hope that helps! Best regards, Darby debussy007 wrote: > Hello, another question ... If anyone of you has some time to advice me > > I wondered how to pass info between two controllers. > Here is the case explained where I need it : > > I have an AuthController which is responsible for all login/logout actions. > > When I notice someone put a bad username and/or password, > the AuthController forwards the flow to the IndexController which will > render the home page > and I want to display a message to explain it is a bad user and/or password > on this home page. > > So the question is how do I specify that there was a bad connection attempt > between the AuthController and the IndexController ? > > In other words how do I transfer the information between the AuthController > and the IndexController > that the connection failed ? What is the best way ? > > Thank you for any advice & help !!
[fw-general] Passing information between controllers
Hello, another question ... If anyone of you has some time to advice me I wondered how to pass info between two controllers. Here is the case explained where I need it : I have an AuthController which is responsible for all login/logout actions. When I notice someone put a bad username and/or password, the AuthController forwards the flow to the IndexController which will render the home page and I want to display a message to explain it is a bad user and/or password on this home page. So the question is how do I specify that there was a bad connection attempt between the AuthController and the IndexController ? In other words how do I transfer the information between the AuthController and the IndexController that the connection failed ? What is the best way ? Thank you for any advice & help !! -- View this message in context: http://www.nabble.com/Passing-information-between-controllers-tf4489758s16154.html#a12804643 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Auth : getIdentity issue
Thank you for clarifying ! Darby Felton wrote: > > Hi, > > The getIdentity() method is documented to return a mixed value - it > could be an integer (e.g., primary key value) or a string (e.g., > username) or some kind of object (e.g., table row data). The DbTable > authentication adapter returns an instance of stdClass that represents > the table row data. > > I think that the problem we see here is that you are passing an object, > rather than a string, to the logger. If you want to pass the username, > then: > > $logger->debug($auth->getIdentity()); > > should instead be more like: > > $logger->debug($auth->getIdentity()->username); > > Best regards, > Darby > > debussy007 wrote: >> Hello, >> >> When I try to print the identity : >> $auth = Zend_Auth::getInstance(); >> $logger->debug($auth->hasIdentity()); // prints 1 >> $logger->debug($auth->getIdentity()); // prints exception >> >> I have the following exception : >> Catchable fatal error: Object of class stdClass could not be converted to >> string in D:\websites\mysite\library\Zend\Log\Formatter\Simple.php on >> line >> 70 >> >> Though, I think it should returns me the username. >> >> This is my auth code: >> >> // in bootstrap >> [...] >> $authAdapter = new MyZend_Auth_Adapter_DbTable($dbAdapter); >> $authAdapter->setTableName('members') >> ->setIdentityColumn('username') >> ->setCredentialColumn('password') >> ->setCodeColumn('code'); >> Zend_Registry::set('authAdapter', $authAdapter); >> [...] >> >> // in authController >> [...] >> $result = $authAdapter->authenticate(); >> [...] >> case MyZend_Auth_Result::SUCCESS: >> $omit = array( >> 'id_member', >> 'password', >> 'email', >> 'date_of_birth', >> 'country', >> 'code', >> 'valid_code' >> ); >> $data = $authAdapter->getResultRowObject(null, $omit); >> >> $logger->debug(print_r($data, true)); >> /* PRINTS : >> 2007-09-20T12:19:22+02:00 DEBUG (7): stdClass Object >> ( >> [username] => mathi >> ) >> */ >> >> $auth = Zend_Auth::getInstance(); >> $auth->getStorage()->write($data); >> $logger->debug($auth->hasIdentity()); >> $logger->debug($auth->getIdentity()); // <- EXCEPTION >> >> break; >> [...] >> >> Thank you. > > > -- View this message in context: http://www.nabble.com/Zend_Auth-%3A-getIdentity-issue-tf4486708s16154.html#a12804531 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Date and MySQL datetime
We can not integrate all just for fun... The more we integrate the slower will Zend_Date work. It would be no problem to have interfaces integrated for the best xx databases. (mssql, mysql, oracle, postgres, dbm2, sqlite,...) But this would mean to include about 100-200 new lines of code. Because when we decide to add db-dependence code we should do it for all db formats and not only for mysql. If you think it's worth doing feel free to add an jira issue and we will discuss it in the dev-team. Greetings Thomas I18N Team Leader - Original Message - From: "Dale McNeill" <[EMAIL PROTECTED]> Cc: "Zend Framework General" Sent: Thursday, September 20, 2007 8:56 PM Subject: Re: [fw-general] Zend_Date and MySQL datetime Thomas - It would certainly make sense to add an interface/constant to aid in getting a MySQL compatible string. Seems like one of the more, if not the most, common output usages. Dale Thomas Weidner wrote: Hy, you are wrong... The manual does not state that getIso() creates MySql Syntax. It is written that you can use all ISO formats as input for Zend_Date. As there are over 50 different ISO formats it would be nonsense to define as much constants. But creating an non-standard Zend_Date output is also very easy... Instead of getIso() just use toString('-MM-dd HH:mm:ss'); and you have your self defined output. Greetings Thomas I18N Team Leader - Original Message - From: "Jack Sleight" <[EMAIL PROTECTED]> To: "Zend Framework General" Sent: Thursday, September 20, 2007 7:38 PM Subject: [fw-general] Zend_Date and MySQL datetime Hi, The ZF manual states that for MySQL datetime values you can use the Zend_Date::ISO_8601 format, and the $date->getIso() method. It is true that if you parse in a date from a MySQL field with the ISO 8601 format constant it will work, but strictly speaking they are not (correctly) ISO 8601 formatted. This becomes a problem when trying to save a date into the database, because the value returned by $date->getIso() is not accepted by MySQL, and it throws an error (Incorrect datetime value: '2007-09-20T18:36:59+01:00'). The correct format for a MySQL datetime string is "-MM-dd HH:mm:ss". Could we add this as a new constant in Zend_Date? -- Jack -- Dale McNeill | Alchemy Systems | phone: (512) 532-8050 http://www.alchemysystems.com | email: [EMAIL PROTECTED]
Re: [fw-general] Zend_Date and MySQL datetime
Thomas - It would certainly make sense to add an interface/constant to aid in getting a MySQL compatible string. Seems like one of the more, if not the most, common output usages. Dale Thomas Weidner wrote: Hy, you are wrong... The manual does not state that getIso() creates MySql Syntax. It is written that you can use all ISO formats as input for Zend_Date. As there are over 50 different ISO formats it would be nonsense to define as much constants. But creating an non-standard Zend_Date output is also very easy... Instead of getIso() just use toString('-MM-dd HH:mm:ss'); and you have your self defined output. Greetings Thomas I18N Team Leader - Original Message - From: "Jack Sleight" <[EMAIL PROTECTED]> To: "Zend Framework General" Sent: Thursday, September 20, 2007 7:38 PM Subject: [fw-general] Zend_Date and MySQL datetime Hi, The ZF manual states that for MySQL datetime values you can use the Zend_Date::ISO_8601 format, and the $date->getIso() method. It is true that if you parse in a date from a MySQL field with the ISO 8601 format constant it will work, but strictly speaking they are not (correctly) ISO 8601 formatted. This becomes a problem when trying to save a date into the database, because the value returned by $date->getIso() is not accepted by MySQL, and it throws an error (Incorrect datetime value: '2007-09-20T18:36:59+01:00'). The correct format for a MySQL datetime string is "-MM-dd HH:mm:ss". Could we add this as a new constant in Zend_Date? -- Jack -- Dale McNeill | Alchemy Systems | phone: (512) 532-8050 http://www.alchemysystems.com | email: [EMAIL PROTECTED]
Re: [fw-general] Zend_Date and MySQL datetime
Thomas Weidner wrote: Hy, you are wrong... The manual does not state that getIso() creates MySql Syntax. Ah.. yeah, my mistake. Just saw the MySQL part and made the assumption, sorry. But creating an non-standard Zend_Date output is also very easy... Instead of getIso() just use toString('-MM-dd HH:mm:ss'); and you have your self defined output. Yeah sure, I had done this anyway, so I'll just carry on with that. Cheers, -- Jack
Re: [fw-general] Zend_Date and MySQL datetime
Hy, you are wrong... The manual does not state that getIso() creates MySql Syntax. It is written that you can use all ISO formats as input for Zend_Date. As there are over 50 different ISO formats it would be nonsense to define as much constants. But creating an non-standard Zend_Date output is also very easy... Instead of getIso() just use toString('-MM-dd HH:mm:ss'); and you have your self defined output. Greetings Thomas I18N Team Leader - Original Message - From: "Jack Sleight" <[EMAIL PROTECTED]> To: "Zend Framework General" Sent: Thursday, September 20, 2007 7:38 PM Subject: [fw-general] Zend_Date and MySQL datetime Hi, The ZF manual states that for MySQL datetime values you can use the Zend_Date::ISO_8601 format, and the $date->getIso() method. It is true that if you parse in a date from a MySQL field with the ISO 8601 format constant it will work, but strictly speaking they are not (correctly) ISO 8601 formatted. This becomes a problem when trying to save a date into the database, because the value returned by $date->getIso() is not accepted by MySQL, and it throws an error (Incorrect datetime value: '2007-09-20T18:36:59+01:00'). The correct format for a MySQL datetime string is "-MM-dd HH:mm:ss". Could we add this as a new constant in Zend_Date? -- Jack
[fw-general] Zend_Date and MySQL datetime
Hi, The ZF manual states that for MySQL datetime values you can use the Zend_Date::ISO_8601 format, and the $date->getIso() method. It is true that if you parse in a date from a MySQL field with the ISO 8601 format constant it will work, but strictly speaking they are not (correctly) ISO 8601 formatted. This becomes a problem when trying to save a date into the database, because the value returned by $date->getIso() is not accepted by MySQL, and it throws an error (Incorrect datetime value: '2007-09-20T18:36:59+01:00'). The correct format for a MySQL datetime string is "-MM-dd HH:mm:ss". Could we add this as a new constant in Zend_Date? -- Jack
Re: [fw-general] Implementing a Security Access system.
Hi. Set /throwExecptions/ to /false/, so Exception will automatically forward to ErrorController/errorAction. There you also can display the Exceptions not caught by the ErrorController. Darby Felton schrieb: Hi Mat, You might try something like the following: $request->setControllerName('access') ->setActionName('denied') ->setDispatched(false); Hope that helps! Best regards, Darby Mathew Byrne wrote: I'm attempting to implement a security system as a Controller plugin. On each request the preDispatch function checks if a current user is logged in and then checks their permissions against a list of pages they have access to. Is there a good method properly skip the dispatching of the action if they do not have access? I tried throwing an Exception however if $front->throwExceptions () is true then the exception is caught, stored in the response object and the action is still dispatched. Can anyone suggest a better method that does NOT allow the action to be dispatched? Mat Byrne
RE: [fw-general] Lucene index permissions
Hi Nathan, It's ZF-1429. It's fixed and I just committed it to the release branch. So it's included into ZF 1.0.2 which is coming soon. With best regards, Alexander Veremyev. > -Original Message- > From: Nathan Wright [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 20, 2007 10:33 AM > To: Zend Framework General > Subject: [fw-general] Lucene index permissions > > Hi all, > > I have an index that's generated and queried by Apache's 'nobody' > user (which works well), but I'm having trouble updating it from a > cron job. > > There is a JIRA issue on this subject (JIRA's currently down so no > link), but the workaround solution someone posted wasn't much help. > It actually made the indexes inaccessible to both Apache & the cron > job after the initial index creation. (Can't post the code as this > attempt was some time ago, but I followed that example code > *exactly*.) > > Maybe I need to route the cron job through apache so that the index > is being accessed by the same user? I'm not sure how this would work > though. > > I'm not so brilliant when it comes to this sort of *nix > issue, so any > help would be most appreciated. > > Cheers, > ncw > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release > Date: 19.09.2007 15:59 > > No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 19.09.2007 15:59
Re: [fw-general] Validate PDF?
thanks for making this clear to me Alexander :) 2007/9/20, Alexander Veremyev <[EMAIL PROTECTED]>: > > Hi Tobias, > > Yes, that's not a big deal to check PDF header and for example trailer. So > such "isPdf()" function shouldn't use a lot of resources. > > But offered workaround may do this. > Zend_Pdf::load() method parses object reference tables and preloads some > objects (ex. pages structure). > > > With best regards, >Alexander Veremyev. > > -- > *From:* Tobias Gies [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, September 20, 2007 3:06 PM > *To:* Zend Framework General > *Subject:* Re: [fw-general] Validate PDF? > > Hi gu > problem is, you will have to open the file anyway to get the first bytes > of the file (i.e., the PDF file header), so I'm unsure if this is actually > that much overhead :) > > Greetings > Tobias > > 2007/9/20, Alexander Veremyev <[EMAIL PROTECTED]>: > > > > PS I just saw you already created JIRA issue :) > > > > With best regards, > >Alexander Veremyev. > > > > -- > > *From:* Alexander Veremyev [mailto:[EMAIL PROTECTED] > > *Sent:* Thursday, September 20, 2007 2:45 AM > > *To:* Jack Sleight > > *Cc:* Zend Framework General > > *Subject:* RE: [fw-general] Validate PDF? > > > > Hi Jack, > > > > Yes, please do this. Or (if you don't have JIRA account yet) I can add > > this. > > > > Yes, you can try to load it and check if an exception is thrown. The > > side effect is actual PDF loading :) (that's possible you don't need it) > > > > > > With best regards, > >Alexander Veremyev. > > > > -- > > *From:* Jack Sleight [mailto:[EMAIL PROTECTED] > > *Sent:* Wednesday, September 19, 2007 4:41 PM > > *To:* Alexander Veremyev > > *Cc:* Zend Framework General > > *Subject:* Re: [fw-general] Validate PDF? > > > > Hi Alexander, > > Ok, should I add it to the issue tracker? In the meantime, would > > something like this do the job (as a quick hack): > > > > function validatePdf($fileName) > > { > > try { > > Zend_Pdf::load($fileName); > > } catch (Zend_Pdf_Exception $e) { > > return false; > > } > > return true; > > } > > > > > > Alexander Veremyev wrote: > > > > Hi Jack, > > > > No. But it's good idea. > > > > With best regards, > >Alexander Veremyev. > > > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > > > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > > 18.09.2007 11:53 > > > > > > > > > > -- > > Jack > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > > 18.09.2007 11:53 > > > > > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > > 18.09.2007 11:53 > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > > 18.09.2007 11:53 > > > > > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > > 18.09.2007 11:53 > > > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: > 19.09.2007 15:59 > > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: > 19.09.2007 15:59 >
RE: [fw-general] Validate PDF?
Hi Tobias, Yes, that's not a big deal to check PDF header and for example trailer. So such "isPdf()" function shouldn't use a lot of resources. But offered workaround may do this. Zend_Pdf::load() method parses object reference tables and preloads some objects (ex. pages structure). With best regards, Alexander Veremyev. _ From: Tobias Gies [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 3:06 PM To: Zend Framework General Subject: Re: [fw-general] Validate PDF? Hi gu problem is, you will have to open the file anyway to get the first bytes of the file (i.e., the PDF file header), so I'm unsure if this is actually that much overhead :) Greetings Tobias 2007/9/20, Alexander Veremyev mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]>: PS I just saw you already created JIRA issue :) With best regards, Alexander Veremyev. _ From: Alexander Veremyev [mailto:HYPERLINK "mailto:[EMAIL PROTECTED]" [EMAIL PROTECTED] Sent: Thursday, September 20, 2007 2:45 AM To: Jack Sleight Cc: Zend Framework General Subject: RE: [fw-general] Validate PDF? Hi Jack, Yes, please do this. Or (if you don't have JIRA account yet) I can add this. Yes, you can try to load it and check if an exception is thrown. The side effect is actual PDF loading :) (that's possible you don't need it) With best regards, Alexander Veremyev. _ From: Jack Sleight [mailto:HYPERLINK "mailto:[EMAIL PROTECTED]" [EMAIL PROTECTED] Sent: Wednesday, September 19, 2007 4:41 PM To: Alexander Veremyev Cc: Zend Framework General Subject: Re: [fw-general] Validate PDF? Hi Alexander, Ok, should I add it to the issue tracker? In the meantime, would something like this do the job (as a quick hack): function validatePdf($fileName) { try { Zend_Pdf::load($fileName); } catch (Zend_Pdf_Exception $e) { return false; } return true; } Alexander Veremyev wrote: Hi Jack, No. But it's good idea. With best regards, Alexander Veremyev. No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 11:53 -- Jack No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 11:53 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 11:53 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 11:53 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 11:53 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 19.09.2007 15:59 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 19.09.2007 15:59
[fw-general] Reminder: 1.0.2 code freeze tomorrow at 21:00 PDT
Hi all, This is another reminder that the code freeze for the 1.0.2 release is currently scheduled for tomorrow, Friday, September 21 at 21:00 (9:00 pm) Pacific time (PDT). Developers should have reviewed and merge all changes that are intended for delivery to the release-1.0 branch by this time. (Documentation changes need not be merged, since it is built from the trunk.) At the time of this writing there are 63 issues fixed for 1.0.2. Keep up the great work, and thanks again for your support! Best regards, Darby
[fw-general] Zend_Cache & MVC
Hello: Are there examples on how to use Zend_Cache together with the MVC pattern? The documentation (and also this mailing list after several hours of searching) provide only examples for old-style procedural PHP applications (basically using Zend_Cache as a stand-alone package), but nothing about how to combine Zend_Cache with Controllers/Actions/Views/etc. I do not have any 'echo' statements in my code; everything is sent to the browser through $frontController->dispatch();... I would like to use cache within certain specific Actions from certain specific Controllers. For example: class IndexController extends Zend_Controller_Action { public function indexAction() { if($cache->start('mycache')) { $this->view->title = 'Cached' . time(); } else { $this->view->title = 'Not Cached' . time(); } } } Do I make sense or am I just not getting something on how the Cache should work? If anybody could give me some pointers, I really appreciate it. Thanks for your help! Cheers, Antonio -- View this message in context: http://www.nabble.com/Zend_Cache---MVC-tf4488489s16154.html#a12800270 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend View questions
On 9/20/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > > First off, in plugins, you don't need to define every method. Just > override the methods you wish to utilize, such as the one below: Yeah, I just have those there, for now, so I know what I have access to. As you can see, I still have the example "print" commented out above. > > > public function dispatchLoopStartup(Zend_Controller_Request_Abstract > > $response) { > > > > >$viewRenderer = > > Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); > >$view = $viewRenderer->view; > > At this point, the ViewRenderer hasn't needed to do anything with the > view yet, so it actually hasn't even instantiated it! If you'd had on > error_reporting, you would have seen some notices and warnings about the > view property not existing. > > Easy solution: before the line above, add this: > > $viewRenderer->initView(); > > This will instantiate the view object, allowing you to then access it. > Ah ha! Well, that did work! Yeah, I need to turn on error reporting for this site in my testing. I normally see this stuff in my dev env (at home) but I've done so much work server side, my "prod" environment and dev code is all out of sync. ha. Looks like it's time to insure error reporting and display errors are turned on! Thanks much. All working now. One more step out of the way. -- Philip [EMAIL PROTECTED] http://www.gpcentre.net/
Re: [fw-general] Zend View questions
-- Philip G <[EMAIL PROTECTED]> wrote (on Thursday, 20 September 2007, 09:44 AM -0500): > On 9/20/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > > There's got to be something in your code that's wrong; I do exactly this > > sort of thing in several applications, and it just works. I think to > > diagnose this, I'd need to see: > > > > * The plugin > > * The controller class > > * The view scripts > > > > If you can attach those, or send a link to where to view them, I'll see > > if I can figure out why you're having the issues you are. My inclination > > is that you're not using the same view object in all locations somehow, > > but I won't know for sure unless I see the code. > > > > Sure, here's the code ( long email ): Thanks -- between this and an answer I just gave someone else, I know what the issue is. Scroll on for a solution: > Controller Plugin: > ( http://www.gpcentre.net/tmp/Plugin.phps ) > -- > > require_once ('Zend/Auth.php'); > require_once ('Zend/Cache.php'); > require_once ('Zend/Registry.php'); > require_once ('Zend/Config/Ini.php'); > require_once ('Zend/Controller/Plugin/Abstract.php'); > require_once ('Zend/Db/Adapter/Pdo/Mysql.php'); > > require_once ('Gpc/User.php'); > > class Gpc_Controller_Plugin extends Zend_Controller_Plugin_Abstract { > > public function routeStartup(Zend_Controller_Request_Abstract $response) { > } > > public function routeShutdown(Zend_Controller_Request_Abstract $response) > { > } First off, in plugins, you don't need to define every method. Just override the methods you wish to utilize, such as the one below: > public function dispatchLoopStartup(Zend_Controller_Request_Abstract > $response) { >$viewRenderer = > Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); >$view = $viewRenderer->view; At this point, the ViewRenderer hasn't needed to do anything with the view yet, so it actually hasn't even instantiated it! If you'd had on error_reporting, you would have seen some notices and warnings about the view property not existing. Easy solution: before the line above, add this: $viewRenderer->initView(); This will instantiate the view object, allowing you to then access it. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend View questions
On 9/20/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > > There's got to be something in your code that's wrong; I do exactly this > sort of thing in several applications, and it just works. I think to > diagnose this, I'd need to see: > > * The plugin > * The controller class > * The view scripts > > If you can attach those, or send a link to where to view them, I'll see > if I can figure out why you're having the issues you are. My inclination > is that you're not using the same view object in all locations somehow, > but I won't know for sure unless I see the code. > Sure, here's the code ( long email ): Controller Plugin: ( http://www.gpcentre.net/tmp/Plugin.phps ) -- (string)$config->database->host, 'username' => (string)$config->database->user, 'password' => (string)$config->database->password, 'dbname' => (string)$config->database->dbname, )); Zend_Registry::set('config', $config); Zend_Registry::set('db', $db); $this->user = Gpc_User::factory($config->forum->software); $this->user->checkForCookie(); // Checks for the user data cookie and moves forward $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $view = $viewRenderer->view; if ( Zend_Auth::getInstance()->hasIdentity() ) { $identity = Zend_Auth::getInstance()->getIdentity(); Zend_Registry::set('identity', $identity); $view->user = $this->user; $view->testVar = "This is a test"; print "logged in"; $view->login = "Yes"; } else { print "not logged in"; $view->login = "No"; } } public function preDispatch(Zend_Controller_Request_Abstract $response) { } public function postDispatch(Zend_Controller_Request_Abstract $response) { } public function dispatchLoopShutdown() { } } The IndexController: ( http://www.gpcentre.net/tmp/IndexController.phps ) -- view->test2 = "run!"; } } -- The View file (under views/scripts/index/index.phtml): ( http://www.gpcentre.net/tmp/index.phps ) --- File: index/index.phtml user) ?> login) ?> testVar) ?> test2) ?> - I successfully get the prints on the page, but fail to get anything else. I'd give you the link where it's currently running, but it's behind a passwd protected wall at the moment due to some other software I have installed there for testing (TOS requires I passwd protect it if I'm testing not purchasing). -- Philip [EMAIL PROTECTED] http://www.gpcentre.net/
Re: [fw-general] Base view in modular design
-- Michael Raymond <[EMAIL PROTECTED]> wrote (on Thursday, 20 September 2007, 12:44 PM +0700): > In developing app which using the conventional modules design > > Application/ > configs/ > modules/ > default/ > controllers/ > views/ > blog/ > controllers/ > views/ > > > Each modules has directories for controllers and views. I want to have a > base view directory to store the view files which will be use in every > modules (say, common layout files like html header and footer). I've consult > the programmer's reference/manual of the Zend_Controller but couldn't find > any info about it, but I might have miss it. > > What is the best way to achieve this? In your bootstrap or an early-running plugin (routeStartup(), routeShutdown(), dispatchLoopStartup()), either create your own view object and feed it into the ViewRenderer, or pull the view object from the ViewRenderer and set a base path: // first option: $view = new Zend_View(array('basePath' => 'path/to/base/views')); Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setView($view); // second option: $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->initView(); $viewRenderer->view->setBasePath('path/to/base/views'); -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend View questions
-- Philip G <[EMAIL PROTECTED]> wrote (on Wednesday, 19 September 2007, 03:36 PM -0500): > On 9/19/07, Joó Ádám <[EMAIL PROTECTED]> wrote: > On 9/19/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote: > > You've got the order wrong. At dispatchLoopShutdown(), the action has > > already been performed, and the template already rendered -- the way you > > have it now, you're assigning variables to the view object, but then not > > rendering anything afterwards (index/index.phtml was rendered *before* > > this plugin action was ever invoked). > > > > Make the plugin operate at either dispatchLoopStartup() or preDispatch() > > (the first will be executed exactly once, the second during each > > iteration of the dispatch loop). > > Okay, makes sense. So, let me make sure I get this. preDispatch() is > called every time an action is dispatched; majority of the time it'll > be called just once, but in cases where I use _forward() it'll get > called twice? But dispatchLoopStartup() is only called once in that > instance? > > Either way, I moved all the code to the dispatchLoopStartup() and > changed the get to getStaticHelper (was getExistingHelper) and it's > still not working. > > I also added a print statement to insure it's accessing that > condition, and it is. I get no values from either variables. > > > I also followed the examples in Zend_View() docs and it all fails > badly. Creating a new Zend_View() instance, assigning a variable and > calling render() -- Exception. Remove render() call -- no variable > data. > > I found out I need to use $this->view->variable but that doesn't work > in the controller plugin either. There's got to be something in your code that's wrong; I do exactly this sort of thing in several applications, and it just works. I think to diagnose this, I'd need to see: * The plugin * The controller class * The view scripts If you can attach those, or send a link to where to view them, I'll see if I can figure out why you're having the issues you are. My inclination is that you're not using the same view object in all locations somehow, but I won't know for sure unless I see the code. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend_Auth : getIdentity issue
Hi, The getIdentity() method is documented to return a mixed value - it could be an integer (e.g., primary key value) or a string (e.g., username) or some kind of object (e.g., table row data). The DbTable authentication adapter returns an instance of stdClass that represents the table row data. I think that the problem we see here is that you are passing an object, rather than a string, to the logger. If you want to pass the username, then: $logger->debug($auth->getIdentity()); should instead be more like: $logger->debug($auth->getIdentity()->username); Best regards, Darby debussy007 wrote: > Hello, > > When I try to print the identity : > $auth = Zend_Auth::getInstance(); > $logger->debug($auth->hasIdentity()); // prints 1 > $logger->debug($auth->getIdentity()); // prints exception > > I have the following exception : > Catchable fatal error: Object of class stdClass could not be converted to > string in D:\websites\mysite\library\Zend\Log\Formatter\Simple.php on line > 70 > > Though, I think it should returns me the username. > > This is my auth code: > > // in bootstrap > [...] > $authAdapter = new MyZend_Auth_Adapter_DbTable($dbAdapter); > $authAdapter->setTableName('members') > ->setIdentityColumn('username') > ->setCredentialColumn('password') > ->setCodeColumn('code'); > Zend_Registry::set('authAdapter', $authAdapter); > [...] > > // in authController > [...] > $result = $authAdapter->authenticate(); > [...] > case MyZend_Auth_Result::SUCCESS: > $omit = array( > 'id_member', > 'password', > 'email', > 'date_of_birth', > 'country', > 'code', > 'valid_code' > ); > $data = $authAdapter->getResultRowObject(null, $omit); > > $logger->debug(print_r($data, true)); > /* PRINTS : > 2007-09-20T12:19:22+02:00 DEBUG (7): stdClass Object > ( > [username] => mathi > ) > */ > > $auth = Zend_Auth::getInstance(); > $auth->getStorage()->write($data); > $logger->debug($auth->hasIdentity()); > $logger->debug($auth->getIdentity()); // <- EXCEPTION > > break; > [...] > > Thank you.
Re: [fw-general] Implementing a Security Access system.
Hi Mat, You might try something like the following: $request->setControllerName('access') ->setActionName('denied') ->setDispatched(false); Hope that helps! Best regards, Darby Mathew Byrne wrote: > I'm attempting to implement a security system as a Controller plugin. On > each request the preDispatch function checks if a current user is logged > in and then checks their permissions against a list of pages they have > access to. > > Is there a good method properly skip the dispatching of the action if > they do not have access? I tried throwing an Exception however if > $front->throwExceptions () is true then the exception is caught, stored > in the response object and the action is still dispatched. > > Can anyone suggest a better method that does NOT allow the action to be > dispatched? > > Mat Byrne >
Re: [fw-general] Base view in modular design
Can your modules run natural? I mean can you share your index.php . Carl 2007/9/20, Michael Raymond <[EMAIL PROTECTED]>: > > In developing app which using the conventional modules design > > Application/ > configs/ > modules/ > default/ > controllers/ > views/ > blog/ > controllers/ > views/ > > > Each modules has directories for controllers and views. I want to have a > base view directory to store the view files which will be use in every > modules (say, common layout files like html header and footer). I've > consult > the programmer's reference/manual of the Zend_Controller but couldn't find > any info about it, but I might have miss it. > > What is the best way to achieve this? > > Any feedback is highly appreciated. > > Thanks > > > > --- > > > -- Zengpu
Re: [fw-general] Validate PDF?
Hi gu problem is, you will have to open the file anyway to get the first bytes of the file (i.e., the PDF file header), so I'm unsure if this is actually that much overhead :) Greetings Tobias 2007/9/20, Alexander Veremyev <[EMAIL PROTECTED]>: > > PS I just saw you already created JIRA issue :) > > With best regards, >Alexander Veremyev. > > -- > *From:* Alexander Veremyev [mailto:[EMAIL PROTECTED] > *Sent:* Thursday, September 20, 2007 2:45 AM > *To:* Jack Sleight > *Cc:* Zend Framework General > *Subject:* RE: [fw-general] Validate PDF? > > Hi Jack, > > Yes, please do this. Or (if you don't have JIRA account yet) I can add > this. > > Yes, you can try to load it and check if an exception is thrown. The side > effect is actual PDF loading :) (that's possible you don't need it) > > > With best regards, >Alexander Veremyev. > > -- > *From:* Jack Sleight [mailto:[EMAIL PROTECTED] > *Sent:* Wednesday, September 19, 2007 4:41 PM > *To:* Alexander Veremyev > *Cc:* Zend Framework General > *Subject:* Re: [fw-general] Validate PDF? > > Hi Alexander, > Ok, should I add it to the issue tracker? In the meantime, would something > like this do the job (as a quick hack): > > function validatePdf($fileName) > { > try { > Zend_Pdf::load($fileName); > } catch (Zend_Pdf_Exception $e) { > return false; > } > return true; > } > > > Alexander Veremyev wrote: > > Hi Jack, > > No. But it's good idea. > > With best regards, >Alexander Veremyev. > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: 18.09.2007 > 11:53 > > > > > -- > Jack > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > 18.09.2007 11:53 > > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > 18.09.2007 11:53 > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > 18.09.2007 11:53 > > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.487 / Virus Database: 269.13.22/1015 - Release Date: > 18.09.2007 11:53 >
[fw-general] Zend_Auth : getIdentity issue
Hello, When I try to print the identity : $auth = Zend_Auth::getInstance(); $logger->debug($auth->hasIdentity()); // prints 1 $logger->debug($auth->getIdentity()); // prints exception I have the following exception : Catchable fatal error: Object of class stdClass could not be converted to string in D:\websites\mysite\library\Zend\Log\Formatter\Simple.php on line 70 Though, I think it should returns me the username. This is my auth code: // in bootstrap [...] $authAdapter = new MyZend_Auth_Adapter_DbTable($dbAdapter); $authAdapter->setTableName('members') ->setIdentityColumn('username') ->setCredentialColumn('password') ->setCodeColumn('code'); Zend_Registry::set('authAdapter', $authAdapter); [...] // in authController [...] $result = $authAdapter->authenticate(); [...] case MyZend_Auth_Result::SUCCESS: $omit = array( 'id_member', 'password', 'email', 'date_of_birth', 'country', 'code', 'valid_code' ); $data = $authAdapter->getResultRowObject(null, $omit); $logger->debug(print_r($data, true)); /* PRINTS : 2007-09-20T12:19:22+02:00 DEBUG (7): stdClass Object ( [username] => mathi ) */ $auth = Zend_Auth::getInstance(); $auth->getStorage()->write($data); $logger->debug($auth->hasIdentity()); $logger->debug($auth->getIdentity()); // <- EXCEPTION break; [...] Thank you. -- View this message in context: http://www.nabble.com/Zend_Auth-%3A-getIdentity-issue-tf4486708s16154.html#a12794585 Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Wiki
Somebody please charge to maximum volts and apply the paddles...
Re: [fw-general] Base view in modular design
Hi Michael, Your best bet is to read up on the ViewRenderer (Zend_Controller_Action_Helper_ViewRenderer) which controls a lot of the View location/format conventions. Combine this, with Zend_View's ability to register scriptPaths and it should be sufficient to get the directory layout you need. Just remember that any changes done here will alter the view script name/location conventions for the entire application. If you need any other help, just give the list a shout ;) Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com OpenID Europe Foundation Member-Subscriber - Original Message From: Michael Raymond <[EMAIL PROTECTED]> To: fw-general@lists.zend.com Sent: Thursday, September 20, 2007 6:44:11 AM Subject: [fw-general] Base view in modular design In developing app which using the conventional modules design Application/ configs/ modules/ default/ controllers/ views/ blog/ controllers/ views/ Each modules has directories for controllers and views. I want to have a base view directory to store the view files which will be use in every modules (say, common layout files like html header and footer). I've consult the programmer's reference/manual of the Zend_Controller but couldn't find any info about it, but I might have miss it. What is the best way to achieve this? Any feedback is highly appreciated. Thanks --- Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting
Re: [fw-general] Using a complete HTML Template
Hi Ralf, >The MVC component determines (somehow), based on the route, which view >script is supposed to be rendered. This view script will have such a >structure which renders a valid HTML document: The MVC component utilises an optional (enabled by default) plugin called Zend_Controller_Action_Helper_ViewRenderer which insitutes a convention of mapping Module/Controller/Action names to a relevent view script name. So IndexController::saveAction() will automatically render the view script at {viewBasePath}/index/save.phtml. You can modify the convention by altering a few settings on the ViewRenderer (covered at least once in the past day on the mailing lists ;)). Or even disable the automated rendering if you prefer. >I'd like to have it vice versa, where the layout is a full HTML document >which renders the related view script. So I managed my application to >work with this "layout" view script: Indeed, there have been proposals for achieving this hanging around from months addressing the concept of common "Layouts". This was captured in two proposals - Zend_View Enhanced and Zend_Layout. The Zend_Layout methodology has been decided to be used in ZF 1.1 so I can point you to the soon-to-be-official approach offered by Ralph Schindler. Unfortunately the ZF Wiki cannot be referred to since it is perfectly useless to anyone in GMT and is presently offline as usual. But there's a good blog post containing all the details and a brief tutorial of usage: http://www.spotsec.com/blogs/archive/the-basics-of-zend_layout-ahem-xend_layout.html In combination with Zend_Layout, pretty much all of the remaining Zend_View Enhanced (excepting its Layout solution) is also to be implemented in ZF 1.1. This adds concepts such as Partials, Components (controller calls), Placeholders (capture data from view scripts for inclusion in a Layout/Other View), and some other stuff. In combination, both ZL and ZVE should be sufficient to resolve most of the problems people currently have with Zend_View. Regards, Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com OpenID Europe Foundation Member-Subscriber - Original Message From: Ralf Kramer <[EMAIL PROTECTED]> To: fw-general@lists.zend.com Sent: Thursday, September 20, 2007 12:30:46 AM Subject: [fw-general] Using a complete HTML Template Hi, as I understood the common process of template rendering it works in this manner: The MVC component determines (somehow), based on the route, which view script is supposed to be rendered. This view script will have such a structure which renders a valid HTML document: render('layouts/__header.phtml'); ?> some stuff fromView ?> render('layouts/__footer.phtml'); ?> I'd like to have it vice versa, where the layout is a full HTML document which renders the related view script. So I managed my application to work with this "layout" view script: header stuff render( $this->viewScript ) ?> footer stuff In my controller I do this on postDispatch() public function postDispatch() { $this->view->viewScript = $this->getRequest()->getControllerName() . "/" . $this->getRequest()->getActionName() . ".phtml"; $this->_helper->viewRenderer->renderScript("layouts/main.phtml" ); } It works, but it is not flexible cause _forward() renders the layout view script a second time. Invocation on preDispatch() or smth. else dont works, cause there are no assigned data available in the view scripts. Now I believe my approach is a dead-end street...any help is appreciated ;-) Best regards /Ralf Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
Re: [fw-general] Using a complete HTML Template
Hi Ralf, you should check out Zend_Layout for this purpose. Just search for it in the MVC Mailing List. Regards, Sascha Ralf Kramer schrieb: Hi, as I understood the common process of template rendering it works in this manner: The MVC component determines (somehow), based on the route, which view script is supposed to be rendered. This view script will have such a structure which renders a valid HTML document: render('layouts/__header.phtml'); ?> some stuff fromView ?> render('layouts/__footer.phtml'); ?> I'd like to have it vice versa, where the layout is a full HTML document which renders the related view script. So I managed my application to work with this "layout" view script: header stuff render( $this->viewScript ) ?> footer stuff In my controller I do this on postDispatch() public function postDispatch() { $this->view->viewScript = $this->getRequest()->getControllerName() . "/" . $this->getRequest()->getActionName() . ".phtml"; $this->_helper->viewRenderer->renderScript("layouts/main.phtml" ); } It works, but it is not flexible cause _forward() renders the layout view script a second time. Invocation on preDispatch() or smth. else dont works, cause there are no assigned data available in the view scripts. Now I believe my approach is a dead-end street...any help is appreciated ;-) Best regards /Ralf