Re: [fw-general] accessing file_get_contents("php://input"); for a controller action to process
If you're using the MVC you can use the request object:- getRequest()->getPost('data'); // ...process $xml ... } } So your flash file would post to http://your-site/feed/submit I am writing a ZF application to process some xml sent to me by a flash client. Normally, I would this via: $xml_str=file_get_contents("php://input"); to access the raw POST variables which would kickoff whatever processing and response I would need sent out. It doesn't look like there is an intuitive way to access this via ZF. How would someone suggest that I access the raw POST? I thought maybe Zend_Feed would be helpful but it looks like if I'm outside RSS or Atom, they won't help much. I'll probably just have a process xml funciton that uses simplexml to go through the request and XMLWriter to output information. -jonathan -- View this message in context: http://www.nabble.com/accessing-file_get_contents%28%22php%3A--input%22%29--for-a-controller-action-to-process-tp16458074p16458074.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Simon Mundy | Director | PEPTOLAB """ " "" "" "" "" """ " "" " " " " "" "" " 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 http://www.peptolab.com
[fw-general] accessing file_get_contents("php://input"); for a controller action to process
I am writing a ZF application to process some xml sent to me by a flash client. Normally, I would this via: $xml_str=file_get_contents("php://input"); to access the raw POST variables which would kickoff whatever processing and response I would need sent out. It doesn't look like there is an intuitive way to access this via ZF. How would someone suggest that I access the raw POST? I thought maybe Zend_Feed would be helpful but it looks like if I'm outside RSS or Atom, they won't help much. I'll probably just have a process xml funciton that uses simplexml to go through the request and XMLWriter to output information. -jonathan -- View this message in context: http://www.nabble.com/accessing-file_get_contents%28%22php%3A--input%22%29--for-a-controller-action-to-process-tp16458074p16458074.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] is it possible to set --dry-run as option in Zend_Console_Getopt
Hi, Zend_Console_Getopt I am trying to set --dry-run as option but it accepts - as optional..so not possible. Any workaround?
Re: [fw-general] Multi-Page forms
-- Jeffrey Sambells <[EMAIL PROTECTED]> wrote (on Wednesday, 02 April 2008, 04:47 PM -0400): > I've been following the advanced multi-page form idea in the > documentation: > > http://framework.zend.com/manual/en/zend.form.advanced.html#zend.form.advanced.multiPage > > and I have a few issues. > > First, because isVaild() is used on the form before it's rendered, even > before you've had a chance to fill out all pages, the first presentation > of the page is filled with error messages if you have the element Error > decorator on. Is there a way to check if a form isValid without > triggering the error decorators? You may want to get a new instance of the new sub form you're displaying prior to displaying it in such a case. > Second, if a page of the form is valid with all null entries (all fields > are optional) then the form will be valid even if the form wasn't filled > out since isValid() will return true for all null fields. If a given sub form consists of only optional fields, probably the best idea is to simply check if you have all sub forms stored in the session; if so, then they've all passed validations. > Has anyone else had these problems? Multi-page forms are not *directly* supported at this time -- that example is for the adventurous. In the meantime, Jurrien Stutterheim has developed an action helper to make multi page forms easier, and has the proposal up on the wiki; you might want to check that out. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Multi-Page forms
Hello, I've been following the advanced multi-page form idea in the documentation: http://framework.zend.com/manual/en/zend.form.advanced.html#zend.form.advanced.multiPage and I have a few issues. First, because isVaild() is used on the form before it's rendered, even before you've had a chance to fill out all pages, the first presentation of the page is filled with error messages if you have the element Error decorator on. Is there a way to check if a form isValid without triggering the error decorators? Second, if a page of the form is valid with all null entries (all fields are optional) then the form will be valid even if the form wasn't filled out since isValid() will return true for all null fields. Has anyone else had these problems? Thanks. Jeffrey
Re: [fw-general] XML-RPC bug?
-- kabel <[EMAIL PROTECTED]> wrote (on Wednesday, 02 April 2008, 03:59 PM -0400): > In Zend_XmlRpc_Value::_stripXmlDeclaration(), the regular expression that > seems to be used to strip off the header has a trailing 'u' in it that may be > returning unexpected results. The line in question is: > > return preg_replace('/<\?xml version="1.0"( encoding="[^\"]*")?\?>\n/u', '', > $dom->saveXML()); > > With the u, the call returns nothing. Without it, it returns expected > values. > > Example: > > INPUT: > > faultCodefaultString > > With "u" returns nothing > > Without "u" returns > faultCodefaultString > > > Any thoughts? Is this something involving Perl regexes that we're missing? The 'u' switch is for unicode mode, and Zend_XmlRpc tries to play nice with Unicode. The switch is available for all versions of PHP 5, and cannot be turned off at compile time. HOWEVER, if your string has invalid UTF-8 sequences, then there's an unfortunate side effect: the preg functions fail silently. (There's a nice writeup on this in a comment on http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php.) You don't indicate if you're using the XmlRpc_Client or _Server, but I'd check whatever you're passing to the class in question to see if perhaps it's not valid UTF-8. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Zend_Form - config & HtmlTag
-- Greg Frith <[EMAIL PROTECTED]> wrote (on Wednesday, 02 April 2008, 08:45 PM +0100): > Thanks for the reply Matthew, this has indeed sorted my problem. Sorry I > should have noted the 'description' decorator previously. Naw -- that's a non-obvious solution. I've pointed it out a few times, which tells me I should probably add more documentation on that. :-) Glad I could help, though! > My form is now working perfectly. I haven't seen many examples of an > XML configuration for a form lying around. So for the benefit of the > group, I include my working configuration for my user login form below. > I'm certainly no Zend or Zend_Form expert, so I hope there are no major > errors that might miss lead. Please all feel free to correct me! Hey, if it works, it's not misleading at all. Thanks for sending this. The usage of the CDATA is a good reference for others, in particular. BTW, noticed this at the end: > :wq So, you're a vim addict, too? ;-) > > logIn > /login > post > > > text > > Email: > > > > EmailAddress > > > > StringToLower > > > > ViewHelper > > > label > > > HtmlTag > > div > > input_text > > > > > > > password > > Password: >description> > > > alnum > > true > > > > StringLength > > 5 > 20 > > > > > > ViewHelper > > > label > > > Description > > p > 0 > > > > HtmlTag > > div > > input_password > > > > > > > checkbox > > Remember my login from this > computer > 0 > > > ViewHelper > > > label > > > HtmlTag > > div > > input_checkbox > > >
[fw-general] XML-RPC bug?
In Zend_XmlRpc_Value::_stripXmlDeclaration(), the regular expression that seems to be used to strip off the header has a trailing 'u' in it that may be returning unexpected results. The line in question is: return preg_replace('/<\?xml version="1.0"( encoding="[^\"]*")?\?>\n/u', '', $dom->saveXML()); With the u, the call returns nothing. Without it, it returns expected values. Example: INPUT: faultCodefaultString With "u" returns nothing Without "u" returns faultCodefaultString Any thoughts? Is this something involving Perl regexes that we're missing? kabel
Re: [fw-general] Zend_Form - config & HtmlTag
Thanks for the reply Matthew, this has indeed sorted my problem. Sorry I should have noted the 'description' decorator previously. My form is now working perfectly. I haven't seen many examples of an XML configuration for a form lying around. So for the benefit of the group, I include my working configuration for my user login form below. I'm certainly no Zend or Zend_Form expert, so I hope there are no major errors that might miss lead. Please all feel free to correct me! logIn /login post text Email: EmailAddress StringToLower ViewHelper label HtmlTag div input_text password Password: description> alnum true StringLength 5 20 ViewHelper label Description p 0 HtmlTag div input_password checkbox Remember my login from this computer 0 ViewHelper label HtmlTag div input_checkbox submit ViewHelper HtmlTag div
Re: [fw-general] Online payment components in ZF?
Hi, there is a http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_PayPal+-+Shahar+Evron Zend_Service_PayPal proposal , but it is not developed for some time. The source is somewhere, 'cos my friend told me, that it works OK. Martin H. Ken Petri wrote: > > Hi, > > Has anyone written classes/components to communicate with any of the > online payment services, such as Authorize.net or Amazon Flexible Payment? > Or does anyone have any advice on this? > > It looks like there was a Zend_Payment component proposed a while back, > but there seems to be no further movement. > > Thanks, > ken > -- View this message in context: http://www.nabble.com/Online-payment-components-in-ZF--tp16447668p16448650.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problems with Zend_Cache & Xcache
No problem here with latest xcache and zf, using core and file -- Vianney Devreese - Lepidosteus http://lepidosteus.com
[fw-general] Online payment components in ZF?
Hi, Has anyone written classes/components to communicate with any of the online payment services, such as Authorize.net or Amazon Flexible Payment? Or does anyone have any advice on this? It looks like there was a Zend_Payment component proposed a while back, but there seems to be no further movement. Thanks, ken -- View this message in context: http://www.nabble.com/Online-payment-components-in-ZF--tp16447668p16447668.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problems with Zend_Cache & Xcache
Im using file backend and storing the files on a tmpfs mount. On 4/2/08 12:20 PM, "Pieter Kokx" <[EMAIL PROTECTED]> wrote: > Hi, > > Which cache backend are you using? > > When you are using a backend like APC, I think that it would cause > collisions between Xcache and APC. > > Ethan Zuhl | helloecho.com schreef: >> > Has anybody experienced any issues with Zend_Cache failing when Xcache is >> > turned on? Any at all? >> > >> > Running Zend Framework 1.0.3 and Xcache 1.2.1 >> > >> > >> > Thanks, >> > >> > >> > > > > -- > Regards, > > Pieter Kokx > MaakSite.nl Productions > PHP Developer > > > -- Ethan Zuhl | Application Developer [EMAIL PROTECTED] 615.371.5119 | 615.777.5119 fax echo | Hello. Hello. | helloecho.com The information contained in this message is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.
Re: [fw-general] Problems with Zend_Cache & Xcache
Hi, Which cache backend are you using? When you are using a backend like APC, I think that it would cause collisions between Xcache and APC. Ethan Zuhl | helloecho.com schreef: Has anybody experienced any issues with Zend_Cache failing when Xcache is turned on? Any at all? Running Zend Framework 1.0.3 and Xcache 1.2.1 Thanks, -- Regards, Pieter Kokx MaakSite.nl Productions PHP Developer
[fw-general] Problems with Zend_Cache & Xcache
Has anybody experienced any issues with Zend_Cache failing when Xcache is turned on? Any at all? Running Zend Framework 1.0.3 and Xcache 1.2.1 Thanks, -- Ethan Zuhl | Application Developer [EMAIL PROTECTED] 615.371.5119 | 615.777.5119 fax echo | Hello. Hello. | helloecho.com The information contained in this message is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.
[fw-general] Processing attachments using ZF
Hi all, I'd like to enable a current system to accept data coming from email. Since this email will have attachments I am considering creating a script that periodically checks for emails, retrieve it (and all attachments) and process it (inserting the data in a database, moving the files attached to a special directory). I was wondering if anyone has used Zend_Mail (or other component) to do that. Thanks.
Re: [fw-general] best practice for "Remember Me"
Hi Eric, I tend to create a HASH using a unique value and set this as a cookie. At the server I add the same hash with the username in a database (sqlite/mysql etc) with the valid until date. When the user comes back I check for the cookie and find out if it is still valid. On Tue, Apr 1, 2008 at 1:12 PM, Eric Marden <[EMAIL PROTECTED]> wrote: > There are two parts of the process: > > 1) Setting the cookie > 2) Logging in via the cookie > > For a similar feature in my ZF App, I just used the normal php > setcookie() function. My cookie contains the user's username, and a > properly salted hash of the password. To create the hash, I used a > function similar to this: > > md5(md5('password'.'secret_salt')) > > Your passwords should be stored in the db using the same hash format. > > And while not 100% secure, most brute force and rainbow table attacks > can be thwarted because the salt used, which should be a random sequence > of charcters that only you and the other developer's know, should be > enough from keeping unwanted users from cracking the password. Also, > because cookies are hard to spoof, since they can only be read by the > domain that set them, it should be reasonably secure for most > applications (if you are working on a banking app, or something else > that is highly sensative, than you shouldn't be adding this feature, and > should consider more secure 2-factor authentication schemes or even a > client certificate, etc). > > You will then need to modify your login code to support logging in from > the cookie. I use the same function in my User model for both, but have > a paramater that tells the function 'how' it should operate... In other > words, am I getting a password that is hashed or in plain text. It > should also have a feature to set the cookie, if the remember me box was > checked. > > You'll still need something that kicks off the auto-login via cookie. I > put mine in the same function that gets called to check if the user > session is valid. Personally I only call this function when a page is > requested that requires a logged in user. If you want the site to > recognize the user right away - regardless of where / when the user > entered the site, you could put it in your init() function or somewhere > else convenient. This part is kind of up to you, as it will shape the > user experience. > > Hope this gets you started. > > > > -- > Eric Marden > Sr. PHP Developer > > > -Original Message- > From: darren [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2008 11:20 AM > To: fw-general@lists.zend.com > Subject: [fw-general] best practice for "Remember Me" > > Newbie Alert: > > I would like to create a way for users to stay logged in for extended > periods of time (like 2 to 12 weeks) as you might expect with a > "Remember Me" checkbox. I have a decent amount of experience with PHP, > but not too much either ZF or with sessions and cookies. I thought I > could just use the rememberMe() method with Zend_Session. > But, that seems to only work for smaller time intervals because I can > only effectively set it for a couple of seconds to a few minutes. > Setting it to anything like hours seems to make it default to about 20 > minutes or so. I'm thinking Zend_HTTP_Cookies with Zend_Auth might be > the ticket. > > I can (and have been) read the documentation on each module. But, I > don't quite grasp the idea of how they should be glued together to > achieve what I want to do. And, for the life of me, I can't find an > example anywhere. > > So, could someone steer me in the right direction? Maybe an example or > tutorial somewhere? Or, if someone could just tell which > classes/modules I should be using, I could probably run with that. > > Thanks, > Darren >
Re: [fw-general] Zend_Form - config & HtmlTag
Answer way down below... -- Greg Frith <[EMAIL PROTECTED]> wrote (on Wednesday, 02 April 2008, 03:17 PM +0100): > I fear this might not be my first post to the group in the next day or > to in relation to Zend_Form, I just don't seem to be getting a complete > grasp of it yet. > > My first problem. I am trying to implement mark-up for an element like > this: > > > Password: > > Forgotten Password > > > I configure my form using an XML config. I can get the form element > wrapped in the div without any problems using the following config > snippet (which is the element configuration for this element): > > > password > > Password: > > > alnum > true > > > StringLength > > 5 > 20 > > > > > > ViewHelper > > > label > > > HtmlTag > > div > input_password > > > > > > > Now I understand that I cannot add a second HtmlTag decorator, but can > anyone suggest any other way of achieving my element layout (adding the > additional 'Forgotten Password' after the input > element) without using a customer decorator class? Actually, you *can* add additional decorators of the same class using aliasing. Try this: ViewHelper Label HtmlTag div input_password HtmlTag p The relevant parts are the and decorators -- notice that the type in each is an array consisting of a single key/value pair -- the key is the internal alias by which you'll refer to it, and the value is the actual decorator type. That said, you probably want to use the element description for setting that particular content, and then add a 'Description' decorator to your decorator stack. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] Zend_Search_Lucene_Index_SegmentInfo bug?
I posted a long story http://www.zfforums.com/zend-framework-components-13/mail-formats-search-14/ibm-omnifind-yahoo-edition-797.html here so I'll keep this short. In Zend Framework 1.5 it appears that there is a bug in the _loadNorm($fieldNum) method of Zend_Search_Lucene_Index_SegmentInfo. Rather than taking the value of the passed $fieldNum the function ignores it and loops over the $this->_fields array loading ALL of the fields. This is corrupting the $_norms array by adding empty elements to the array. I do not yet have permission to post this to the Issue tracker so I'll mention it here... When I made the correction illustrated in the other post I was able to query any of my IBM Omnifind collections and return results identical to what Omnifind returns! thanks jim sloan -- View this message in context: http://www.nabble.com/Zend_Search_Lucene_Index_SegmentInfo-bug--tp16447089p16447089.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend_Form - config & HtmlTag
Hi all, I fear this might not be my first post to the group in the next day or to in relation to Zend_Form, I just don't seem to be getting a complete grasp of it yet. My first problem. I am trying to implement mark-up for an element like this: Password: Forgotten Password I configure my form using an XML config. I can get the form element wrapped in the div without any problems using the following config snippet (which is the element configuration for this element): password Password: alnum true StringLength 5 20 ViewHelper label HtmlTag div input_password Now I understand that I cannot add a second HtmlTag decorator, but can anyone suggest any other way of achieving my element layout (adding the additional 'Forgotten Password' after the input element) without using a customer decorator class? The more observant amongst the group might notice I posted a different Zend_Form question a week or so ago... Don't worry... I'm not that slow, I've only just got back to my forms today!! :wq Greg.
[fw-general] re[fw-general] moveDefaultRoutes() points non-existing routes to index?
Hello, In my ZF project, I use some alternate routes. This works fine, however the default route for this is still active. For example, mysite.com/dj_tiesto is exactly the same as mysite.com/artists/details/id/10 and mysite.com/artists/details?id=10. This means there are different links pointing to one location. As I don't want to do this, I thought removeDefaultRoutes() would do the trick. Indeed only mysite.com/dj_tiesto is the only route pointing to the right location, but the other links (which should be non-existing routes by now since the default routes are gone) point to my index page?? I want to return a 404 on these links instead of returning the index. Is this a bug, or does anyone have another idea about how to solve this problem? Thanks in advance! -- View this message in context: http://www.nabble.com/removeDefaultRoutes%28%29-points-non-existing-routes-to-index--tp16446805p16446805.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Latin fonts in Zend_Pdf
Ooops... it was so easy, I found the answer two minutes after I post this message. You have the set the charset encoding: $pdf->pages[0]->drawText('Alcalá - España', 300, 770, 'ISO-8859-1'); The encoding defaults to the system locale, but my system's locale is 'ISO-8859-1' so I found it strange to have to put the parameter in the method, but it works. I hope this can help someone else. Mauricio Cuenca wrote: > > Hello, > > I am using the Zend_Pdf class to generate pdf files, but I found that > characteres like "ñ" and those with tildes like "áéíóú" are not displayed. > > These characters are mandatory in my application, I was browsing the > framework class files and I found that in > Zend/Pdf/Resource/Font/Simple/Standard.php says: > > * The PHP script used to generate this class can be found in the /tools > * directory of the framework distribution. If you need to make > modifications to > * this class, chances are the same modifications are needed for the rest > of the > * standard fonts. You should modify the script and regenerate the classes > * instead of changing this class file by hand. > > I could not found the tools directory, but my question is: can I easily > modify the fonts file so I can use those characters with my PDFs or what > other approach should I take? > > Thanks! > > > Mauricio Cuenca > -- View this message in context: http://www.nabble.com/Latin-fonts-in-Zend_Pdf-tp16445832p16445838.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Latin fonts in Zend_Pdf
Hello, I am using the Zend_Pdf class to generate pdf files, but I found that characteres like "ñ" and those with tildes like "áéíóú" are not displayed. These characters are mandatory in my application, I was browsing the framework class files and I found that in Zend/Pdf/Resource/Font/Simple/Standard.php says: * The PHP script used to generate this class can be found in the /tools * directory of the framework distribution. If you need to make modifications to * this class, chances are the same modifications are needed for the rest of the * standard fonts. You should modify the script and regenerate the classes * instead of changing this class file by hand. I could not found the tools directory, but my question is: can I easily modify the fonts file so I can use those characters with my PDFs or what other approach should I take? Thanks! Mauricio Cuenca -- View this message in context: http://www.nabble.com/Latin-fonts-in-Zend_Pdf-tp16445832p16445832.html Sent from the Zend Framework mailing list archive at Nabble.com.