Re: [fw-general] Using a gettext Zend_Translate object with Zend_Form

2008-03-20 Thread majelbstoat


fab2008 wrote:
> 
> 
> This is a very interesting question. I have the same problem and any
> suggestion will be useful.
> 
> At current time my idea is to make a separate single file with a copy of
> all labels and error messages and parse it with xgettext -a, but this is a
> bad practice because i have to duplicate all the strings and duplication
> is always bad :-(
> 
> 

This is what I ended up doing.  I have a dummy class with a single function
that just performs a whole host of translations.  The class will never be
used and it doesn't feel good, but it does allow the error codes to appear
in the .pot file.  I know Zend_Validate isn't supposed to actually provide
real error messages, just error codes, but it's a shame that such a method
was chosen that forces such hacks if you want to use probably the most
popular method of localisation...  Not that I can think of a better method
at the moment, and not that I'm sure there isn't a better way of using what
we have.  Ah well.  For reference, here's what I'm doing:

translate('isEmpty');
// More translations here...
}   
}

?>

Any better ways than this out there?

Cheers,

Jamie.
-- 
View this message in context: 
http://www.nabble.com/Using-a-gettext-Zend_Translate-object-with-Zend_Form-tp16092578s16154p16194510.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Mark Maynereid
Here's the problem:

http://framework.zend.com/manual/en/zend.view.html#zend.view.introduction.view

Note the long tags. It's no wonder people are getting confused.

I agree with Matthew's justification and also Jordan's concerns. It just needs 
to be made crystal clear and consistent also consistent in the code examples 
I guess.

Regards,
Mark

On Thursday 20 March 2008 21:11, Jordan Moore wrote:
> My fear is that new PHP developers will see short open tags in the ZF
> documentation, think, "Sweet! That makes things easier!", and start
> using them in all areas of their applications (not just views).
>
> I don't see it being a big problem, as long as...
>
> 1. There's decent explanations in the documentation when/why short
> open tags are used.
> 2. The stream wrapper can be disabled, so I don't take a performance
> hit when I upgrade to 1.5.x. :)
>
> On Thu, Mar 20, 2008 at 1:34 PM, Matthew Weier O'Phinney
>
> <[EMAIL PROTECTED]> wrote:
> > -- Jordan Moore <[EMAIL PROTECTED]> wrote
> >
> >  (on Thursday, 20 March 2008, 01:05 PM -0700):
> > > I just verified that "short_open_tag" is disabled in the
> > >
> >  > "php.ini-recommended" file that is distributed with PHP. I believe
> >  > this is to discourage users from using short open tags in
> >  > redistributable applications to ensure greater compatibility. If logic
> >  > is added to Zend_View that "supports" this functionality, it will be
> >  > promoting something that appears to be considered bad practice. I
> >  > realize that ZF would restrict it to views, but developers/users may
> >  > get in the habit of using short open tags elsewhere.
> >
> >  So, you're advocating for more verbose view scripts, then?
> >
> >  Sorry, had to get the dig in. However, the question is serious. View
> >  scripts should be readable. If you use the same coding standards for
> >  view scripts that we have for the general framework components, they
> >  quickly become unreadable, even in a good IDE/editor with syntax
> >  highlighting.
> >
> >  I personally feel it's not difficult to switch back and forth between
> >  view scripts and regular code -- in part because there is an immediate
> >  *visual* difference when I do so.
> >
> >  I'm *not* recommending that we use short tags everywhere, and am fact
> >  recommending we restrict their usage to view scripts -- the stricter
> >  conventions would continue to apply where they matter most, which is
> >  with the core code. My proposal is that we append the manual to make
> >  this clear, and also to outline the rationale behind it.
> >
> >  Besides the typical rationale about the recommended php.ini settings
> >  (this has been brought up before), and the fact that short tags are not
> >  on by default in all configurations (which I plan to address with a
> >  stream wrapper), what other objections are there to using short tags for
> >  view scripts? I personally feel that these two objections are pedantic
> >  -- being strict for strictness' sake -- and don't focus on
> >  maintainability and readability of the view scripts. But I'm willing to
> >  listen to other arguments.
> >
> >  > On Thu, Mar 20, 2008 at 12:49 PM, Jordan Moore
> >  >
> >  > <[EMAIL PROTECTED]> wrote:
> >  > > Doesn't the recommended php.ini that is distributed with PHP disable
> >  > > short tags?
> >  > >
> >  > >
> >  > >
> >  > >  On Thu, Mar 20, 2008 at 12:28 PM, Matthew Weier O'Phinney
> >  > >
> >  > >  <[EMAIL PROTECTED]> wrote:
> >  > >  > -- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
> >  > >  >
> >  > >  >  (on Thursday, 20 March 2008, 12:06 PM -0700):
> >  > >  > > I'm sure I'll eventually appreciate it.  However, I'm a little
> >  > >  > > frustrated
> >  > >  > >
> >  > >  >  > that I'm going to have to go through and fix all the short
> >  > >  >  > tags to get it working on my servers.
> >  > >  >
> >  > >  >  Add this to your .htaccess:
> >  > >  >
> >  > >  > php_flag short_open_tag On
> >  > >  >
> >  > >  >  I'm working on a stream wrapper to transparently enable this for
> >  > >  > people who have the flag disabled, but the recommendation will be
> >  > >  > to have this on so that your view scripts will work with optimal
> >  > >  > performance.
> >  > >  >
> >  > >  >  > Ralph Schindler wrote:
> >  > >  >  > > Hello everyone,
> >  > >  >  > >
> >  > >  >  > > I have put together a demo application that showcases some
> >  > >  >  > > features of Zend_Layout and Zend_View Enhancements within
> >  > >  >  > > the MVC environment. If you would like to download, set it
> >  > >  >  > > up and play/browse the code within it, it is located here:
> >  > >  >  > >
> >  > >  >  > > http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+an
> >  > >  >  > >d+Zend_View+Enhancements+Demo
> >  > >  >  > >
> >  > >  >  > > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in
> >  > >  >  > > the download. So basically, this demo app is pretty self
> >  > >  >  > > contained.  Not alot of setup aside from pointing a doc ro

[fw-general] ZF in Japan

2008-03-20 Thread Bastian Gerhard

Hi everybody,

I'm looking for Zend Framework developers and integrators in Japan.
Does anyone know whether a community exists there?

Thanks and regards,

Bastian


[fw-general] Re: regex validator works at command line, but not web: charset issue?

2008-03-20 Thread David Mintz
Stop the presses. This is an Ajax submission (Prototype) and my request
headers showed that I was sending UTF-8. You are able to set that that with
Prototype, but that didn't help me. After some fiddling and hacking I have
managed to work around. My validate() now tests the input $value as well as
utf8_decode($value). It's kind of ugly, maybe also wrong-headed. But I don't
think it's a ZF issue after all.

On Thu, Mar 20, 2008 at 4:35 PM, David Mintz <[EMAIL PROTECTED]> wrote:

> I have a validator that is supposed to ensure that the input string has no
> character other than case-insensitive a-z, or accented characters like
> e-acute, or space.
>
> It returns false when you pass it "josé" by submitting an HTML form to my
> controller action with a browser, but  when you test it against same string
> 'josé' in a command line script, it returns true. I have tested with Opera
> 9.26 and Firefox 2.0.0.12 on a Fedora 7 system.
>
> It might be worth noting that I have used the same regex in other web
> environments, and it has worked.
>
> When I echo back the form input to the browser I see that  josé becomes
> josÃ(c) so I am guessing we have a charset issue. Any tips as to how to fix
> it? Thanks!
>
> class Model_Validator_FirstName extends Zend_Validate_Abstract {
>
> const INVALID_CHARACTERS = 'invalidCharacters';
>
> protected $pattern = "/[^a-zA-Z\xC0-\xFF ]/";
>
> protected $_messageTemplates = array(
> 'invalidCharacters' => 'Firstname contains illegal characters'
> );
>
> function isValid($name) {
>
> if (preg_match($this->pattern,$name)) {
> $this->_error(self::INVALID_CHARACTERS);
> return false;
> }
> return true;
> }
> }
>


-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness


Re: [fw-general] Using a gettext Zend_Translate object with Zend_Form

2008-03-20 Thread fab2008


majelbstoat wrote:
> 
> Hi All,
> 
> Does anybody have any suggestions on how I might generate a .po file from
> the messages to be translated in Zend_Form?  All the examples I've seen
> using Zend_Translate and Zend_Form use the 'array', rather than 'gettext'
> form.  The .po for the rest of the app is quite happily generated by
> Poedit, but I'm not sure what to do about those validator constants.  I
> have my singular Zend_Translate object in the registry and I'd like to
> reuse it for everything, if possible.
> 
> Failing that, has someone else faced the same and come up with an
> alternative solution?
> 
> Cheers,
> 
> Jamie.
> 

This is a very interesting question. I have the same problem and any
suggestion will be useful.

At current time my idea is to make a separate single file with a copy of all
labels and error messages and parse it with xgettext -a, but this is a bad
practice because i have to duplicate all the strings and duplication is
always bad :-(

An other solution is to run xgettext -a directly on files that generate the
forms, in my case when i need a new form I subclass a shared common abstract
class, so in my form files there are only label strings and some array keys,
so I can generate a po file for translators and they can safely ignore some
strings such as 'label', 'required', etc or if they translate them there is
no consequences, because those strings are not being translated with
Zend_Translate_Adapter.

In both these (poor) solutions remain the problem of validators error
messages index; in the first case i could copy such indexes in the label
files, in the second case i have no idea...

-- 
View this message in context: 
http://www.nabble.com/Using-a-gettext-Zend_Translate-object-with-Zend_Form-tp16092578s16154p16188858.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Jordan Moore
My fear is that new PHP developers will see short open tags in the ZF
documentation, think, "Sweet! That makes things easier!", and start
using them in all areas of their applications (not just views).

I don't see it being a big problem, as long as...

1. There's decent explanations in the documentation when/why short
open tags are used.
2. The stream wrapper can be disabled, so I don't take a performance
hit when I upgrade to 1.5.x. :)

On Thu, Mar 20, 2008 at 1:34 PM, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> -- Jordan Moore <[EMAIL PROTECTED]> wrote
>  (on Thursday, 20 March 2008, 01:05 PM -0700):
>
> > I just verified that "short_open_tag" is disabled in the
>  > "php.ini-recommended" file that is distributed with PHP. I believe
>  > this is to discourage users from using short open tags in
>  > redistributable applications to ensure greater compatibility. If logic
>  > is added to Zend_View that "supports" this functionality, it will be
>  > promoting something that appears to be considered bad practice. I
>  > realize that ZF would restrict it to views, but developers/users may
>  > get in the habit of using short open tags elsewhere.
>
>  So, you're advocating for more verbose view scripts, then?
>
>  Sorry, had to get the dig in. However, the question is serious. View
>  scripts should be readable. If you use the same coding standards for
>  view scripts that we have for the general framework components, they
>  quickly become unreadable, even in a good IDE/editor with syntax
>  highlighting.
>
>  I personally feel it's not difficult to switch back and forth between
>  view scripts and regular code -- in part because there is an immediate
>  *visual* difference when I do so.
>
>  I'm *not* recommending that we use short tags everywhere, and am fact
>  recommending we restrict their usage to view scripts -- the stricter
>  conventions would continue to apply where they matter most, which is
>  with the core code. My proposal is that we append the manual to make
>  this clear, and also to outline the rationale behind it.
>
>  Besides the typical rationale about the recommended php.ini settings
>  (this has been brought up before), and the fact that short tags are not
>  on by default in all configurations (which I plan to address with a
>  stream wrapper), what other objections are there to using short tags for
>  view scripts? I personally feel that these two objections are pedantic
>  -- being strict for strictness' sake -- and don't focus on
>  maintainability and readability of the view scripts. But I'm willing to
>  listen to other arguments.
>
>
>
>  > On Thu, Mar 20, 2008 at 12:49 PM, Jordan Moore
>  > <[EMAIL PROTECTED]> wrote:
>  > > Doesn't the recommended php.ini that is distributed with PHP disable 
> short tags?
>  > >
>  > >
>  > >
>  > >  On Thu, Mar 20, 2008 at 12:28 PM, Matthew Weier O'Phinney
>  > >  <[EMAIL PROTECTED]> wrote:
>  > >  > -- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
>  > >  >  (on Thursday, 20 March 2008, 12:06 PM -0700):
>  > >  >
>  > >  > > I'm sure I'll eventually appreciate it.  However, I'm a little 
> frustrated
>  > >  >  > that I'm going to have to go through and fix all the short tags to 
> get it
>  > >  >  > working on my servers.
>  > >  >
>  > >  >  Add this to your .htaccess:
>  > >  >
>  > >  > php_flag short_open_tag On
>  > >  >
>  > >  >  I'm working on a stream wrapper to transparently enable this for 
> people
>  > >  >  who have the flag disabled, but the recommendation will be to have 
> this
>  > >  >  on so that your view scripts will work with optimal performance.
>  > >  >
>  > >  >
>  > >  >
>  > >  >  > Ralph Schindler wrote:
>  > >  >  > > Hello everyone,
>  > >  >  > >
>  > >  >  > > I have put together a demo application that showcases some 
> features of
>  > >  >  > > Zend_Layout and Zend_View Enhancements within the MVC 
> environment. If you
>  > >  >  > > would like to download, set it up and play/browse the code 
> within it, it
>  > >  >  > > is located here:
>  > >  >  > >
>  > >  >  > > 
> http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
>  > >  >  > >
>  > >  >  > > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
> download.
>  > >  >  > >  So basically, this demo app is pretty self contained.  Not alot 
> of setup
>  > >  >  > > aside from pointing a doc root to its public folder is necessary.
>  > >  >  > >
>  > >  >  > > Over the course of the coming weeks, I will be taking the time 
> to add more
>  > >  >  > > examples (I will increment the version number of the download as 
> I do).
>  > >  >  > >
>  > >  >  > > If anyone has any feedback, or requests as to what you would 
> like to see
>  > >  >  > > Demo'ed within it either reply here or add comments directly to 
> that page.
>  > >  >
>  > >  >  --
>  > >  >  Matthew Weier O'Phinney
>  > >  >  PHP Developer| [EMAIL PROTECTED]
>  > >  >  Zend - The PHP Company   | http://www.zend.c

[fw-general] regex validator works at command line, but not web: charset issue?

2008-03-20 Thread David Mintz
I have a validator that is supposed to ensure that the input string has no
character other than case-insensitive a-z, or accented characters like
e-acute, or space.

It returns false when you pass it "josé" by submitting an HTML form to my
controller action with a browser, but  when you test it against same string
'josé' in a command line script, it returns true. I have tested with Opera
9.26 and Firefox 2.0.0.12 on a Fedora 7 system.

It might be worth noting that I have used the same regex in other web
environments, and it has worked.

When I echo back the form input to the browser I see that  josé becomes
josÃ(c) so I am guessing we have a charset issue. Any tips as to how to fix
it? Thanks!

class Model_Validator_FirstName extends Zend_Validate_Abstract {

const INVALID_CHARACTERS = 'invalidCharacters';

protected $pattern = "/[^a-zA-Z\xC0-\xFF ]/";

protected $_messageTemplates = array(
'invalidCharacters' => 'Firstname contains illegal characters'
);

function isValid($name) {

if (preg_match($this->pattern,$name)) {
$this->_error(self::INVALID_CHARACTERS);
return false;
}
return true;
}
}

-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Matthew Weier O'Phinney
-- Jordan Moore <[EMAIL PROTECTED]> wrote
(on Thursday, 20 March 2008, 01:05 PM -0700):
> I just verified that "short_open_tag" is disabled in the
> "php.ini-recommended" file that is distributed with PHP. I believe
> this is to discourage users from using short open tags in
> redistributable applications to ensure greater compatibility. If logic
> is added to Zend_View that "supports" this functionality, it will be
> promoting something that appears to be considered bad practice. I
> realize that ZF would restrict it to views, but developers/users may
> get in the habit of using short open tags elsewhere.

So, you're advocating for more verbose view scripts, then?

Sorry, had to get the dig in. However, the question is serious. View
scripts should be readable. If you use the same coding standards for
view scripts that we have for the general framework components, they
quickly become unreadable, even in a good IDE/editor with syntax
highlighting.

I personally feel it's not difficult to switch back and forth between
view scripts and regular code -- in part because there is an immediate
*visual* difference when I do so. 

I'm *not* recommending that we use short tags everywhere, and am fact
recommending we restrict their usage to view scripts -- the stricter
conventions would continue to apply where they matter most, which is
with the core code. My proposal is that we append the manual to make
this clear, and also to outline the rationale behind it.

Besides the typical rationale about the recommended php.ini settings
(this has been brought up before), and the fact that short tags are not
on by default in all configurations (which I plan to address with a
stream wrapper), what other objections are there to using short tags for
view scripts? I personally feel that these two objections are pedantic
-- being strict for strictness' sake -- and don't focus on
maintainability and readability of the view scripts. But I'm willing to
listen to other arguments.

> On Thu, Mar 20, 2008 at 12:49 PM, Jordan Moore
> <[EMAIL PROTECTED]> wrote:
> > Doesn't the recommended php.ini that is distributed with PHP disable short 
> > tags?
> >
> >
> >
> >  On Thu, Mar 20, 2008 at 12:28 PM, Matthew Weier O'Phinney
> >  <[EMAIL PROTECTED]> wrote:
> >  > -- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
> >  >  (on Thursday, 20 March 2008, 12:06 PM -0700):
> >  >
> >  > > I'm sure I'll eventually appreciate it.  However, I'm a little 
> > frustrated
> >  >  > that I'm going to have to go through and fix all the short tags to 
> > get it
> >  >  > working on my servers.
> >  >
> >  >  Add this to your .htaccess:
> >  >
> >  > php_flag short_open_tag On
> >  >
> >  >  I'm working on a stream wrapper to transparently enable this for people
> >  >  who have the flag disabled, but the recommendation will be to have this
> >  >  on so that your view scripts will work with optimal performance.
> >  >
> >  >
> >  >
> >  >  > Ralph Schindler wrote:
> >  >  > > Hello everyone,
> >  >  > >
> >  >  > > I have put together a demo application that showcases some features 
> > of
> >  >  > > Zend_Layout and Zend_View Enhancements within the MVC environment. 
> > If you
> >  >  > > would like to download, set it up and play/browse the code within 
> > it, it
> >  >  > > is located here:
> >  >  > >
> >  >  > > 
> > http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
> >  >  > >
> >  >  > > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
> > download.
> >  >  > >  So basically, this demo app is pretty self contained.  Not alot of 
> > setup
> >  >  > > aside from pointing a doc root to its public folder is necessary.
> >  >  > >
> >  >  > > Over the course of the coming weeks, I will be taking the time to 
> > add more
> >  >  > > examples (I will increment the version number of the download as I 
> > do).
> >  >  > >
> >  >  > > If anyone has any feedback, or requests as to what you would like 
> > to see
> >  >  > > Demo'ed within it either reply here or add comments directly to 
> > that page.
> >  >
> >  >  --
> >  >  Matthew Weier O'Phinney
> >  >  PHP Developer| [EMAIL PROTECTED]
> >  >  Zend - The PHP Company   | http://www.zend.com/
> >  >
> >
> >
> >
> >  --
> >  Jordan Moore - Creative Director
> >  Sanctus Studios LLC
> >  PO Box 2202
> >  Tacoma, WA 98401
> >  (253) 238-8676
> >
> 
> 
> 
> -- 
> Jordan Moore - Creative Director
> Sanctus Studios LLC
> PO Box 2202
> Tacoma, WA 98401
> (253) 238-8676
> 

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Jordan Moore
I just verified that "short_open_tag" is disabled in the
"php.ini-recommended" file that is distributed with PHP. I believe
this is to discourage users from using short open tags in
redistributable applications to ensure greater compatibility. If logic
is added to Zend_View that "supports" this functionality, it will be
promoting something that appears to be considered bad practice. I
realize that ZF would restrict it to views, but developers/users may
get in the habit of using short open tags elsewhere.

On Thu, Mar 20, 2008 at 12:49 PM, Jordan Moore
<[EMAIL PROTECTED]> wrote:
> Doesn't the recommended php.ini that is distributed with PHP disable short 
> tags?
>
>
>
>  On Thu, Mar 20, 2008 at 12:28 PM, Matthew Weier O'Phinney
>  <[EMAIL PROTECTED]> wrote:
>  > -- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
>  >  (on Thursday, 20 March 2008, 12:06 PM -0700):
>  >
>  > > I'm sure I'll eventually appreciate it.  However, I'm a little frustrated
>  >  > that I'm going to have to go through and fix all the short tags to get 
> it
>  >  > working on my servers.
>  >
>  >  Add this to your .htaccess:
>  >
>  > php_flag short_open_tag On
>  >
>  >  I'm working on a stream wrapper to transparently enable this for people
>  >  who have the flag disabled, but the recommendation will be to have this
>  >  on so that your view scripts will work with optimal performance.
>  >
>  >
>  >
>  >  > Ralph Schindler wrote:
>  >  > > Hello everyone,
>  >  > >
>  >  > > I have put together a demo application that showcases some features of
>  >  > > Zend_Layout and Zend_View Enhancements within the MVC environment. If 
> you
>  >  > > would like to download, set it up and play/browse the code within it, 
> it
>  >  > > is located here:
>  >  > >
>  >  > > 
> http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
>  >  > >
>  >  > > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
> download.
>  >  > >  So basically, this demo app is pretty self contained.  Not alot of 
> setup
>  >  > > aside from pointing a doc root to its public folder is necessary.
>  >  > >
>  >  > > Over the course of the coming weeks, I will be taking the time to add 
> more
>  >  > > examples (I will increment the version number of the download as I 
> do).
>  >  > >
>  >  > > If anyone has any feedback, or requests as to what you would like to 
> see
>  >  > > Demo'ed within it either reply here or add comments directly to that 
> page.
>  >
>  >  --
>  >  Matthew Weier O'Phinney
>  >  PHP Developer| [EMAIL PROTECTED]
>  >  Zend - The PHP Company   | http://www.zend.com/
>  >
>
>
>
>  --
>  Jordan Moore - Creative Director
>  Sanctus Studios LLC
>  PO Box 2202
>  Tacoma, WA 98401
>  (253) 238-8676
>



-- 
Jordan Moore - Creative Director
Sanctus Studios LLC
PO Box 2202
Tacoma, WA 98401
(253) 238-8676


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Jordan Moore
Doesn't the recommended php.ini that is distributed with PHP disable short tags?

On Thu, Mar 20, 2008 at 12:28 PM, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> -- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
>  (on Thursday, 20 March 2008, 12:06 PM -0700):
>
> > I'm sure I'll eventually appreciate it.  However, I'm a little frustrated
>  > that I'm going to have to go through and fix all the short tags to get it
>  > working on my servers.
>
>  Add this to your .htaccess:
>
> php_flag short_open_tag On
>
>  I'm working on a stream wrapper to transparently enable this for people
>  who have the flag disabled, but the recommendation will be to have this
>  on so that your view scripts will work with optimal performance.
>
>
>
>  > Ralph Schindler wrote:
>  > > Hello everyone,
>  > >
>  > > I have put together a demo application that showcases some features of
>  > > Zend_Layout and Zend_View Enhancements within the MVC environment. If you
>  > > would like to download, set it up and play/browse the code within it, it
>  > > is located here:
>  > >
>  > > 
> http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
>  > >
>  > > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
> download.
>  > >  So basically, this demo app is pretty self contained.  Not alot of setup
>  > > aside from pointing a doc root to its public folder is necessary.
>  > >
>  > > Over the course of the coming weeks, I will be taking the time to add 
> more
>  > > examples (I will increment the version number of the download as I do).
>  > >
>  > > If anyone has any feedback, or requests as to what you would like to see
>  > > Demo'ed within it either reply here or add comments directly to that 
> page.
>
>  --
>  Matthew Weier O'Phinney
>  PHP Developer| [EMAIL PROTECTED]
>  Zend - The PHP Company   | http://www.zend.com/
>



-- 
Jordan Moore - Creative Director
Sanctus Studios LLC
PO Box 2202
Tacoma, WA 98401
(253) 238-8676


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Matthew Weier O'Phinney
-- Aaron D. Campbell <[EMAIL PROTECTED]> wrote
(on Thursday, 20 March 2008, 12:06 PM -0700):
> I'm sure I'll eventually appreciate it.  However, I'm a little frustrated 
> that I'm going to have to go through and fix all the short tags to get it 
> working on my servers.

Add this to your .htaccess:

php_flag short_open_tag On

I'm working on a stream wrapper to transparently enable this for people
who have the flag disabled, but the recommendation will be to have this
on so that your view scripts will work with optimal performance.

> Ralph Schindler wrote:
> > Hello everyone,
> >
> > I have put together a demo application that showcases some features of 
> > Zend_Layout and Zend_View Enhancements within the MVC environment. If you 
> > would like to download, set it up and play/browse the code within it, it 
> > is located here:
> >
> > http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
> >
> > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the download. 
> >  So basically, this demo app is pretty self contained.  Not alot of setup 
> > aside from pointing a doc root to its public folder is necessary.
> >
> > Over the course of the coming weeks, I will be taking the time to add more 
> > examples (I will increment the version number of the download as I do).
> >
> > If anyone has any feedback, or requests as to what you would like to see 
> > Demo'ed within it either reply here or add comments directly to that page.

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Aaron D. Campbell
I'm sure I'll eventually appreciate it.  However, I'm a little 
frustrated that I'm going to have to go through and fix all the short 
tags to get it working on my servers.


Ralph Schindler wrote:

Hello everyone,

I have put together a demo application that showcases some features of 
Zend_Layout and Zend_View Enhancements within the MVC environment. If 
you would like to download, set it up and play/browse the code within 
it, it is located here:


http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo 



The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
download.  So basically, this demo app is pretty self contained.  Not 
alot of setup aside from pointing a doc root to its public folder is 
necessary.


Over the course of the coming weeks, I will be taking the time to add 
more examples (I will increment the version number of the download as 
I do).


If anyone has any feedback, or requests as to what you would like to 
see Demo'ed within it either reply here or add comments directly to 
that page.


Thanks!
Ralph Schindler

--
Aaron D. Campbell
Xavisys



Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Aaron D. Campbell
I got the same thing, as well as a problem when I tried "tar -xzvf 
file.tar.bz"
However, for some reason I could "gunzip file.tar.gz" then "tar -xvf 
file.tar"  As long as I ran it as separate command it worked fine.


Jean-Marc Fontaine wrote:

Well, I am able to extract on both OSX as well as Vista with 7Zip

Ark on KDE says the archive is corrupted and extracts nothing.

Jean-Marc

--
Aaron D. Campbell
Xavisys



Re: [fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread Kai Meder

Willie Alberty wrote:
Although you can open a PDF file in a text editor and more or less 
follow its structure, it is not a text file. PDF documents are binary 
files. You can irreparably damage a PDF by doing string replacement 
operations.


The reason for this is the document trailer which appears at the end of 
every PDF file. This is an array of byte offsets to the various objects 
contained within the document. If you do a string replacement that 
changes the byte length of the string, you've wrecked this offsets 
table, and the PDF viewer will be unable to read the document.


If you're very careful to maintain the byte length of the strings you're 
replacing, you can actually change existing PDF content in this way, but 
you're treading on thin ice. If you keep the byte offsets in document 
trailer updated, you can change string lengths too, but this gets to be 
rather difficult.


thanks for that thorough explanation and thanks for the fop-link, 
thomas. will take a look at it.


thanks,
kai


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Jean-Marc Fontaine

Well, I am able to extract on both OSX as well as Vista with 7Zip

Ark on KDE says the archive is corrupted and extracts nothing.

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  : 09 59 77 04 28
Web  : http://www.kanopee.net/



Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Ralph Schindler

Well, I am able to extract on both OSX as well as Vista with 7Zip

I will talk to the team more over the next few days on perhaps finding a 
better way to distribute demo like applications.


-ralph

Julian Davchev wrote:

Is it just me or archive is broken and cannot extract.


Ralph Schindler wrote:

Hello everyone,

I have put together a demo application that showcases some features of 
Zend_Layout and Zend_View Enhancements within the MVC environment. If 
you would like to download, set it up and play/browse the code within 
it, it is located here:


http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo 



The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
download.  So basically, this demo app is pretty self contained.  Not 
alot of setup aside from pointing a doc root to its public folder is 
necessary.


Over the course of the coming weeks, I will be taking the time to add 
more examples (I will increment the version number of the download as 
I do).


If anyone has any feedback, or requests as to what you would like to 
see Demo'ed within it either reply here or add comments directly to 
that page.


Thanks!
Ralph Schindler










Re: [fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread Willie Alberty

On Mar 20, 2008, at 7:14 AM, basecode wrote:


There is no "good" solution for this task I think.
Willie Alberty described why:

http://www.nabble.com/Zend_Pdf-replace-placeholders-- 
td4988495s16154.html#a5015716


Thanks for the link--I had forgotten about that message. After re- 
reading that technical explanation, I realize I left out one  
important piece of information:


Although you can open a PDF file in a text editor and more or less  
follow its structure, it is not a text file. PDF documents are binary  
files. You can irreparably damage a PDF by doing string replacement  
operations.


The reason for this is the document trailer which appears at the end  
of every PDF file. This is an array of byte offsets to the various  
objects contained within the document. If you do a string replacement  
that changes the byte length of the string, you've wrecked this  
offsets table, and the PDF viewer will be unable to read the document.


If you're very careful to maintain the byte length of the strings  
you're replacing, you can actually change existing PDF content in  
this way, but you're treading on thin ice. If you keep the byte  
offsets in document trailer updated, you can change string lengths  
too, but this gets to be rather difficult.


Of course, this all assumes that the page's content stream is not  
compressed and you can actually find the string you're looking to  
replace. Most PDF generators compress content streams to save space,  
as Kai observed with the example document from MS Publisher.



On Mar 19, 2008, at 4:39 PM, Kai Meder wrote:


does anyone know a good solution to:
- create a fully designed PDF template (e.g. from MS Publisher)
- replace embedded placeholders in this PDF to bulk-create PDFs.

It seems any PDF I create contains a binary data-stream and no raw- 
text whatsoever. So whats the best way to create such Template-PDFs?

Is there any official Variable/Placeholder Syntax for PDFs?



The only real solution with Zend_Pdf today is to design your template  
in such a way that you leave "holes" for the replacement text (think  
form fields). You then use Zend_Pdf to then draw your new text in a  
new layer on top of the page, effectively filling in these holes.


--

Willie Alberty, Owner
Spenlen Media
[EMAIL PROTECTED]

http://www.spenlen.com/



Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Karl Katzke
Worked fine for me on OSX, but StuffIt did crash after unpacking it.

-K

On Thu, Mar 20, 2008 at 11:50 AM, Julian Davchev <[EMAIL PROTECTED]> wrote:

> Is it just me or archive is broken and cannot extract.
>
>
> Ralph Schindler wrote:
> > Hello everyone,
> >
> > I have put together a demo application that showcases some features of
> > Zend_Layout and Zend_View Enhancements within the MVC environment. If
> > you would like to download, set it up and play/browse the code within
> > it, it is located here:
> >
> >
> http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo
> >
> >
> > The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the
> > download.  So basically, this demo app is pretty self contained.  Not
> > alot of setup aside from pointing a doc root to its public folder is
> > necessary.
> >
> > Over the course of the coming weeks, I will be taking the time to add
> > more examples (I will increment the version number of the download as
> > I do).
> >
> > If anyone has any feedback, or requests as to what you would like to
> > see Demo'ed within it either reply here or add comments directly to
> > that page.
> >
> > Thanks!
> > Ralph Schindler
> >
> >
> >
>
>


Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Julian Davchev

Is it just me or archive is broken and cannot extract.


Ralph Schindler wrote:

Hello everyone,

I have put together a demo application that showcases some features of 
Zend_Layout and Zend_View Enhancements within the MVC environment. If 
you would like to download, set it up and play/browse the code within 
it, it is located here:


http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo 



The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
download.  So basically, this demo app is pretty self contained.  Not 
alot of setup aside from pointing a doc root to its public folder is 
necessary.


Over the course of the coming weeks, I will be taking the time to add 
more examples (I will increment the version number of the download as 
I do).


If anyone has any feedback, or requests as to what you would like to 
see Demo'ed within it either reply here or add comments directly to 
that page.


Thanks!
Ralph Schindler







Re: [fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Jean-Marc Fontaine

Thank you very much Ralph !

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  : 09 59 77 04 28
Web  : http://www.kanopee.net/


[fw-general] Zend_Layout & Zend_View Enhancements Demo

2008-03-20 Thread Ralph Schindler

Hello everyone,

I have put together a demo application that showcases some features of 
Zend_Layout and Zend_View Enhancements within the MVC environment. If 
you would like to download, set it up and play/browse the code within 
it, it is located here:


http://framework.zend.com/wiki/display/ZFUSER/Zend_Layout+and+Zend_View+Enhancements+Demo

The demo currently includes ZF version 1.5 and Dojo 1.0.2 in the 
download.  So basically, this demo app is pretty self contained.  Not 
alot of setup aside from pointing a doc root to its public folder is 
necessary.


Over the course of the coming weeks, I will be taking the time to add 
more examples (I will increment the version number of the download as I do).


If anyone has any feedback, or requests as to what you would like to see 
Demo'ed within it either reply here or add comments directly to that page.


Thanks!
Ralph Schindler





Re: [fw-general] formCheckbox bug in ZendFramework-1.5.0RC1

2008-03-20 Thread Kexiao Liao

I belive Zend_View_Helper->FormCheckbox.php(in ZF1.5.0) has some bugs, it can
not create the checkbox correctly. The one in ZF1.0.3 works well

Kevin


dinoboff wrote:
> 
> I think you have the set the initial state of of the checkbox with the
> checked attibute. The value of the checkbox is now fixed; it doesn't
> depend any more of the initial state of the checkbox.
> 
> It should look like that:
> formCheckbox("complete", 1,
>array(
>'checked' => $this->mainContents->complete,
>'onChange' => "change(document.main);"
>)); ?>
> 
> When validating the form, you would do something like that:
> $complete = empty($_FORM['complete']) ? false : true;
> 
> 
> Kexiao  Liao wrote:
>> 
>> I still got the same problem by using Zend_Framework 1.5. Any comments
>> regarding this issue.
>> 
>> Kevin
>> 
>> 
>> Matthew Weier O'Phinney-3 wrote:
>>> 
>>> -- Kexiao Liao <[EMAIL PROTECTED]> wrote
>>> (on Tuesday, 11 March 2008, 11:07 AM -0700):
 I switched ZendFramework from 1.0.3 to 1.5.0RC1, the following
 formCheckbox
 can not save the the checkbox data into the database table? On 1.0.3 it
 works pretty well.
 
 formCheckbox("complete",
 $this->escape($this->mainContents->complete),array('onChange' =>
 "change(document.main);"),array(0 =>'true', 1=>'false')) ?>
>>> 
>>> Please try from svn trunk, and read the docs in svn trunk regarding the
>>> formCheckbox helper (found in
>>> documentation/manual/en/module_specs/Zend_View_Helpers.xml, IIRC); I've
>>> made some significant improvements to it in the past week.
>>> 
>>> -- 
>>> 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/formCheckbox-bug-in-ZendFramework-1.5.0RC1-tp15982415s16154p16181466.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Speeding up Lucene

2008-03-20 Thread Eric Marden
Well to be fair, this query is 30+ terms, and probably should just be
turned into a SQL Call. I'll be implementing all of the suggestions, and
see if I can't get the time down to a reasonable level.


 
--
Eric Marden
Sr. PHP Developer


-Original Message-
From: Markus Fischer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 5:00 PM
To: Eric Marden
Cc: fw-general@lists.zend.com
Subject: Re: [fw-general] Speeding up Lucene

Are you using one of your queries already takes 23seconds with an index
as small as 80kb?

Eric Marden wrote:
>> Do you have a lot of data in your index, essentially using the index
> as a database replacement? 
> 
> 20 documents. Index is about 80kb or so. We are using it as DB 
> replacement, due to the fact that the production set up will have a 
> mysql cluster behind it (no FULLTEXT index available). However this 
> will grow when we reimport all of the production data into the new
schema.
> 
> 
>  
> --
> Eric Marden
> 
> 
> -Original Message-
> From: Kevin Schroeder [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 19, 2008 4:33 PM
> To: Eric Marden; fw-general@lists.zend.com
> Subject: RE: [fw-general] Speeding up Lucene
> 
> 
> 
> 
>  
> Kevin Schroeder
> Technical Consultant
> Zend Technologies, Ltd.
> 
> www.zend.com
>  
>  
>  
>  
>  
>  
>  
>  
>> -Original Message-
>> From: Eric Marden [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, March 19, 2008 3:23 PM
>> To: fw-general@lists.zend.com
>> Subject: RE: [fw-general] Speeding up Lucene
>>
>> P.S. - This is the only one of my search types that takes a long
time.
>> All the others can return the page in 3 seconds (timed with Yslow). 
>> This one is doing it in 23seconds. I've reduced other bottlenecks (it

>> was plus 30seconds).
>>
>>
>>
>> --
>> Eric Marden
> 
> 


Re: [fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread basecode

There is no "good" solution for this task I think.
Willie Alberty described why:

http://www.nabble.com/Zend_Pdf-replace-placeholders--td4988495s16154.html#a5015716


Kai Meder-3 wrote:
> 
> Hello,
> 
> does anyone know a good solution to:
> - create a fully designed PDF template (e.g. from MS Publisher)
> - replace embedded placeholders in this PDF to bulk-create PDFs.
> 
> It seems any PDF I create contains a binary data-stream and no raw-text 
> whatsoever. So whats the best way to create such Template-PDFs?
> Is there any official Variable/Placeholder Syntax for PDFs?
> 
> Thanks!
> Kai
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_PDF%3A-creating-a-template-PDF-and-replacing-placeholders-tp16177220s16154p16178966.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread Thomas Fritz
Hi Kai!

Take a look at fop. http://xmlgraphics.apache.org/fop/ - It takes a XSLT
File and a XML File and creates a PDF.
or a simpler solution, if you have already a letter paper, pdftk. Both are
java programs and you have to call it in php via 'system'.


If anyone knows a PHP Only Solution i am also interested to know this
solution.



2008/3/20, Kai Meder <[EMAIL PROTECTED]>:
>
> Hello,
>
> does anyone know a good solution to:
> - create a fully designed PDF template (e.g. from MS Publisher)
> - replace embedded placeholders in this PDF to bulk-create PDFs.
>
> It seems any PDF I create contains a binary data-stream and no raw-text
> whatsoever. So whats the best way to create such Template-PDFs?
> Is there any official Variable/Placeholder Syntax for PDFs?
>
> Thanks!
>
> Kai
>


Re: [fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread Jack Sleight
As far as I know there's no way to modify text that's already in the 
PDF. I've done a similar thing by just creating a template that just 
consists on the basic elements that never change (background, logo etc.) 
and then writing a script that puts in all the text and images using 
Zend_Pdf. I /think /this is the only way to do it.


Kai Meder wrote:

Hello,

does anyone know a good solution to:
- create a fully designed PDF template (e.g. from MS Publisher)
- replace embedded placeholders in this PDF to bulk-create PDFs.

It seems any PDF I create contains a binary data-stream and no 
raw-text whatsoever. So whats the best way to create such Template-PDFs?

Is there any official Variable/Placeholder Syntax for PDFs?

Thanks!
Kai


--
Jack


[fw-general] Zend_PDF: creating a template PDF and replacing placeholders

2008-03-20 Thread Kai Meder

Hello,

does anyone know a good solution to:
- create a fully designed PDF template (e.g. from MS Publisher)
- replace embedded placeholders in this PDF to bulk-create PDFs.

It seems any PDF I create contains a binary data-stream and no raw-text 
whatsoever. So whats the best way to create such Template-PDFs?

Is there any official Variable/Placeholder Syntax for PDFs?

Thanks!
Kai


Re: [fw-general] Zend_Date and GMT problem

2008-03-20 Thread tflessak

Hi!

It worked!
Thank you so much!

Best regards
Thiago


holografix wrote:
> 
> Hi
> 
> You need to add Zend_Date::setOptions(array('extend_month' => true));
> before doing month calculation.
> 
> best regards,
> holo
> 
> 
> 2008/3/18, tflessak <[EMAIL PROTECTED]>:
>>
>>  Hi,
>>
>>  I mean the method subMonth doesn't subtract 5 months correctly. For
>> example
>>  (my timezone is Sao Paulo/Brazil):
>>
>>
>>  date_default_timezone_set('America/Sao_Paulo');
>>
>> $dt = new Zend_Date();
>>  $dt->subMonth(5);
>>
>> $result = $dt->toString('dd/MM/');
>>
>>  On version 1.0.3 $result is the current date minus 5 months
>> (18/10/2007). On
>>  version 1.0.4 and 1.5 $result is always the first day of the month, in
>> that
>>  case, 18/03/2008 - 5 months = 01/10/2007.
>>  I didn't set any specific Zend_Date option.
>>
>>  Thank you
>>
>>
>>
>>
>>
>>  thomasW wrote:
>>  >
>>  > Hy Thiago,
>>  >
>>  > please provide us with all informations...
>>  >
>>  > What do you mean with "the code does not work anymore" ?
>>  > When I run your code it works without problems.
>>  >
>>  > Which timezone have you set ? ... it's not declared in your example.
>>  > What is the date-time you executed it ?
>>  > What was the result ?
>>  > What did you expect to be returned ?
>>  > Did you set any options before initiation ?
>>  >
>>  > Greetings
>>  > Thomas Weidner, I18N Team Leader
>>  > http://www.thomasweidner.com
>>  >
>>  > - Original Message -
>>  > From: "tflessak" <[EMAIL PROTECTED]>
>>  > To: 
>>  > Sent: Tuesday, March 18, 2008 4:05 PM
>>  > Subject: [fw-general] Zend_Date and GMT problem
>>  >
>>  >
>>  >>
>>  >> Hi!
>>  >>
>>  >> I was using Zend Framework 1.0.3
>>  >> Into my code there are situations where I use some month calculation
>> like
>>  >> this:
>>  >>
>>  >> $dt = new Zend_Date();
>>  >> $dt->subMonth(5);
>>  >>
>>  >> After update to version 1.5, this code doesn't work anymore.
>>  >> Doing some comparison with version 1.0.3, I could see that the
>> function
>>  >> which manipulates the month calculation includes the function
>>  >> 'DateObject::mktime' it has a boolean parameter called 'gmt'. On
>> version
>>  >> 1.0.3, internally this parameter was false when I call the functions
>>  >> 'subMonth' ou 'addMonth'. On version 1.0.4 and 1.5 the 'gmt'
>> parameter
>>  >> passed to true and consequently internally the 'DateObject::mktime'
>> use
>>  >> the
>>  >> php function gmmktime.
>>  >> I'm having problems after this modification, because the gmmktime is
>>  >> returning me a wrong date. I tried this code:
>>  >>
>>  >> date_default_timezone_set('America/Sao_Paulo');
>>  >> $dategmt =  @gmmktime(0, 0, 0, 3, 18, 2008);
>>  >> $datemk = @mktime(0, 0, 0, 3, 18, 2008);
>>  >>
>>  >> ... and the return of gmmktime is 3 hour less then mktime, and the
>> date
>>  >> get
>>  >> back to the day before.
>>  >>
>>  >> My question is: Am I doing something wrong? Somebody knows the reason
>> of
>>  >> why
>>  >> the gmmktime is used instead mktime on version 1.0.4 and 1.5 ?
>>  >>
>>  >> Thank you for help!
>>  >> Regards
>>  >> Thiago
>>  >> --
>>  >> View this message in context:
>>  >>
>> http://www.nabble.com/Zend_Date-and-GMT-problem-tp16122102s16154p16122102.html
>>  >> Sent from the Zend Framework mailing list archive at Nabble.com.
>>  >
>>  >
>>  >
>>
>>  --
>>
>> View this message in context:
>> http://www.nabble.com/Zend_Date-and-GMT-problem-tp16122102s16154p16126515.html
>>
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Date-and-GMT-problem-tp16122102s16154p16177071.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Question about running multiple actions in a request

2008-03-20 Thread Matthew Weier O'Phinney
-- OakBehringer <[EMAIL PROTECTED]> wrote
(on Wednesday, 19 March 2008, 10:37 PM -0700):
> OK. So, say I have an action, the createFolderAction, which creates a folder
> on a filesystem. It creates an instance of Zend_Form, adds a text element to
> allow the user to specify the folder name, and adds a validator that
> verifies that the folder does not already exist before creating it. If the
> validation fails, the user gets a message that says something like "folder
> already exists, pick a new name".
> 
> Now, a new action is being added to the same controller, the
> uploadFileAction. It creates an instance of Zend_Form, adds a file element
> to it, and a select element to choose what folder to put the file in. Yay.
> Oh, there is one more field, and that's the one that matters. This is a text
> element that allows the end user to create a, you guessed it, new folder to
> upload the file to.
> 
> In order to avoid duplicate code, it seems like I should delegate [from the
> uploadFileAction] to the createFolderAction to handle the optional folder
> creation. I understand that you can push actions into the action stack or
> forward from one action to the next. Unless I'm missing something, this
> creates a problem for me:
> 
> When I create an instance of Zend_Form in uploadFileAction. It has three
> elements: 
> 
> file element - the file to be uploaded
> select element - the folder to upload it into
>  - or - text element - new folder to create and upload to (if "new" is
> selected in the select folder element, this value is used)
> 
> That's pretty much the problem... I can't really forward to the
> createFolderAction from here, because that will create an different instance
> of Zend_Form / text (foldername) element. It will see the posted value, but
> if it does not validate the error will not be returned to the correct form,
> etc. 

Move the logic to create the folder into a separate, non-action method
in your controller; that way you can call it from your
uploadFileAction() when necessary, and not need to go through the other
controller logic in createFolderAction.

class FooController extends Zend_Controller_Action
{
public function createFolderAction()
{
$form = new FolderForm();

// ...
if (!$form->isValid($data)) {
$this->view->form = $form;
return;
}

$this->createFolder($form->getValue('path'));

// ...
}

public function createFolder($path)
{
// ...
}

public function uploadFileAction()
{
$form = new UploadFileForm();

// ...
if (!$form->isValid($data)) {
$this->view->form = $form;
return;
}

if (!empty($form->getValue('folder'))) {
$this->createFolder($form->getValue('path'));
}

// ...
}
}

You should also consider having your uploadFile form extend the
createFolder form, and have it simply add the extra element. This will
encourage re-use, and also make certain that the validations for the
folder stay the same between the two forms. 

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


RE: [fw-general] Speeding up Lucene

2008-03-20 Thread Keith Pope
 
Hi,

Make sure you optimise your index, I had queries taking 15sec+ and using a lot 
of memory. After optimisation I am getting 3 - 6 sec results and better memory 
usage. The index is 40,000 news articles.

I have also been looking at creating an indexing & search server based on ZSL, 
which would handle caching, backup, pagination, indexing etc via REST.


 
-Original Message-
From: Kevin Schroeder [mailto:[EMAIL PROTECTED] 
Sent: 19 March 2008 21:06
To: 'Eric Marden'; fw-general@lists.zend.com
Subject: RE: [fw-general] Speeding up Lucene

One thing to note with that is that due to the way the data is handled deep in 
the code is that if you store a lot of data directly in the index, there is a 
loop that can get iterated over thousands of times even for small pieces of 
data.  It is generally better to create the index and store a primary key or 
some other unique identifier of the data being represented and then retrieve 
the data based off of that unique identifier out of the database.  That will 
minimize the time in that loop, minimize the amount of data being retrieved 
from the index, minimize the data being serialized and could (potentially) 
decrease the search response times by a significant amount.

Don't know if that's the problem but it's often solved performance problems in 
the past, in my experience.

If you have a profiler (like what's available in Zend Studio) you can take a 
look at the query and see if there's excessive code iteration in the request.

 
Kevin Schroeder
Technical Consultant
Zend Technologies, Ltd.

www.zend.com
 
 
 
 
 
 
 
 

> -Original Message-
> From: Eric Marden [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 19, 2008 3:53 PM
> To: fw-general@lists.zend.com
> Subject: RE: [fw-general] Speeding up Lucene
> 
> > Do you have a lot of data in your index, essentially using the index
> as a database replacement?
> 
> 20 documents. Index is about 80kb or so. We are using it as DB 
> replacement, due to the fact that the production set up will have a 
> mysql cluster behind it (no FULLTEXT index available). However this 
> will grow when we reimport all of the production data into the new schema.
> 
> 
> 
> --
> Eric Marden
> 
> 
> -Original Message-
> From: Kevin Schroeder [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 19, 2008 4:33 PM
> To: Eric Marden; fw-general@lists.zend.com
> Subject: RE: [fw-general] Speeding up Lucene
> 
> 
> 
> 
> 
> Kevin Schroeder
> Technical Consultant
> Zend Technologies, Ltd.
> 
> www.zend.com
> 
> 
> 
> 
> 
> 
> 
> 
> > -Original Message-
> > From: Eric Marden [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 19, 2008 3:23 PM
> > To: fw-general@lists.zend.com
> > Subject: RE: [fw-general] Speeding up Lucene
> >
> > P.S. - This is the only one of my search types that takes a long time.
> > All the others can return the page in 3 seconds (timed with Yslow).
> > This one is doing it in 23seconds. I've reduced other bottlenecks 
> > (it was plus 30seconds).
> >
> >
> >
> > --
> > Eric Marden



--

allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, 
Hereford, HR1 3SE.

Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88.



Telephone: 0870 243 3434, Fax: 0870 243 6041.

Website: www.allpay.net

Email: [EMAIL PROTECTED]



This email, and any files transmitted with it, is confidential and intended 
solely for the use of the individual or entity to whom it is addressed. If you 
have received this email in error please notify the allpay.net Information 
Security Manager at the number above.