2010年1月29日星期五

Re: [fw-mvc] FlashMessenger namespace not expiring when user is logged in

Hello!

So you can see the progression, here are several var_dump()s of $_SESSION at
various times during the process.

On first visiting the login page:
array(0) {
}

When the login form is submitted, the credentials are processed; if
successful, the user is redirected to the site home page. At that point,
the FlashMessage from the processing step is displayed, and $_SESSION looks
like this:
array(1) {
["Zend_Auth"]=> array(/* stored auth info */)
}

On visiting another page right after that, the FlashMessage is still
displayed, and $_SESSION still looks like this.
array(1) {
["Zend_Auth"]=> array(/* stored auth info */)
}

All this is sort of odd to me, as I'd expected $_SESSION to contain some
evidence of the FlashMessage values; they _are_ being displayed at the
proper time.

As far as the call to getMessages() goes, I'm doing that in my layout
script. Here's the full code:

[code]
if (!is_array($this->messages)) {
$this->messages = array();
}
$this->messages = array_merge(
$this->messages,

Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->getMessages()
);
if (count($this->messages) > 0) {
echo $this->htmlList($this->messages, false, array('class' =>
'messages'));
}
[/code]

Thanks!
Adam
--
View this message in context: http://n4.nabble.com/FlashMessenger-namespace-not-expiring-when-user-is-logged-in-tp970072p1456444.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Suggestion: Zend Installer

2010/1/29 Nathan Garlington <garlinto@gmail.com>:
> Hi all,
>
> I am sitting here uploading the new 1.10.0 version of ZF. The process
> goes like this:
>
> I have three separate servers I have to upload the new version to, so
> I download the zip file, unpack it, and upload the new version to the
> servers. It takes about 20 minutes or more for each one, so I lose
> about an hour of work time to the  upload process,

You can always get a coffee, chat with your colleagues about the
weekend, clean that drawer in your office desk, and even work! :-)

> and well as the hit
> on my bandwidth while it's uploading.
>
> It would be wonderful if there was a Zend package called
> Zend_Installer(?) that could be configured with the location of the
> temp directory where the file would be downloaded, and the
> installation directory on the server, and would then just use the web
> server itself to download the new version, install it to the
> previously configured location and that's it. It could handle any
> common compression format. I don't know if such functionality runs
> against ZF's design paradigm but it would sure make the upgrading
> process much simpler and less time consuming. It wouldn't necessarily
> need to have a browser frontend (think PEAR); such could be left up to
> the developer to create.
>
> Any thoughts?
>
>
> regards,
>
> Nathan Garlington
> T&R Trailer Sales
> 5930 N Interstate 25
> Pueblo, CO  81008
>
> 719.546.2321 T
> 719.423.8033 M
> 719.404.4697 F
>
> nathan@tandrtrailer.com
> www.tandrtrailer.com
>

Re: [fw-mvc] Suggestion: Zend Installer

Hello Dolf,

PEAR channel
http://code.google.com/p/zend/

install first pear:

wget http://pear.php.net/go-pear
php go-pear

then install ZF :

pear channel-discover zend.googlecode.com/svn
pear install zend/zend

Friday, January 29, 2010, 9:25:25 PM, you wrote:
> Hi,

> Imho what you're asking is too server specific, especially when you keep
> in mind that a lot of users have a different version of ZF on a per
> project basis and have all different strategies for upgrading. Besides
> that, there already is a pear package of ZF that allows for easy
> installation maintained by a Zend employee.

> Regards,

> Dolf Schimmel
> Freeaqingme

> On 01/29/2010 08:08 PM, Nathan Garlington wrote:
>> Hi all,
>>
>> I am sitting here uploading the new 1.10.0 version of ZF. The process
>> goes like this:
>>
>> I have three separate servers I have to upload the new version to, so
>> I download the zip file, unpack it, and upload the new version to the
>> servers. It takes about 20 minutes or more for each one, so I lose
>> about an hour of work time to the upload process, and well as the hit
>> on my bandwidth while it's uploading.
>>
>> It would be wonderful if there was a Zend package called
>> Zend_Installer(?) that could be configured with the location of the
>> temp directory where the file would be downloaded, and the
>> installation directory on the server, and would then just use the web
>> server itself to download the new version, install it to the
>> previously configured location and that's it. It could handle any
>> common compression format. I don't know if such functionality runs
>> against ZF's design paradigm but it would sure make the upgrading
>> process much simpler and less time consuming. It wouldn't necessarily
>> need to have a browser frontend (think PEAR); such could be left up to
>> the developer to create.
>>
>> Any thoughts?
>>
>>
>> regards,
>>
>> Nathan Garlington
>> T&R Trailer Sales
>> 5930 N Interstate 25
>> Pueblo, CO 81008
>>
>> 719.546.2321 T
>> 719.423.8033 M
>> 719.404.4697 F
>>
>> nathan@tandrtrailer.com
>> www.tandrtrailer.com
>>


--
Julian
Zend Certified Engineer
****************************

Re: [fw-mvc] Suggestion: Zend Installer

Hi,

Imho what you're asking is too server specific, especially when you keep
in mind that a lot of users have a different version of ZF on a per
project basis and have all different strategies for upgrading. Besides
that, there already is a pear package of ZF that allows for easy
installation maintained by a Zend employee.

Regards,

Dolf Schimmel
Freeaqingme

On 01/29/2010 08:08 PM, Nathan Garlington wrote:
> Hi all,
>
> I am sitting here uploading the new 1.10.0 version of ZF. The process
> goes like this:
>
> I have three separate servers I have to upload the new version to, so
> I download the zip file, unpack it, and upload the new version to the
> servers. It takes about 20 minutes or more for each one, so I lose
> about an hour of work time to the upload process, and well as the hit
> on my bandwidth while it's uploading.
>
> It would be wonderful if there was a Zend package called
> Zend_Installer(?) that could be configured with the location of the
> temp directory where the file would be downloaded, and the
> installation directory on the server, and would then just use the web
> server itself to download the new version, install it to the
> previously configured location and that's it. It could handle any
> common compression format. I don't know if such functionality runs
> against ZF's design paradigm but it would sure make the upgrading
> process much simpler and less time consuming. It wouldn't necessarily
> need to have a browser frontend (think PEAR); such could be left up to
> the developer to create.
>
> Any thoughts?
>
>
> regards,
>
> Nathan Garlington
> T&R Trailer Sales
> 5930 N Interstate 25
> Pueblo, CO 81008
>
> 719.546.2321 T
> 719.423.8033 M
> 719.404.4697 F
>
> nathan@tandrtrailer.com
> www.tandrtrailer.com
>

[Fwd: Re: [fw-mvc] Suggestion: Zend Installer]

Forgot to add the MVC list.

-------------------

You handed the answer itself. PEAR ;). There is a PEAR channel for ZF:

http://pear.zfcampus.org/

--
Regards,

Pieter Kokx
PHP Developer
Zend Framework developer

Nathan Garlington schreef:
> Hi all,
>
> I am sitting here uploading the new 1.10.0 version of ZF. The process
> goes like this:
>
> I have three separate servers I have to upload the new version to, so
> I download the zip file, unpack it, and upload the new version to the
> servers. It takes about 20 minutes or more for each one, so I lose
> about an hour of work time to the upload process, and well as the hit
> on my bandwidth while it's uploading.
>
> It would be wonderful if there was a Zend package called
> Zend_Installer(?) that could be configured with the location of the
> temp directory where the file would be downloaded, and the
> installation directory on the server, and would then just use the web
> server itself to download the new version, install it to the
> previously configured location and that's it. It could handle any
> common compression format. I don't know if such functionality runs
> against ZF's design paradigm but it would sure make the upgrading
> process much simpler and less time consuming. It wouldn't necessarily
> need to have a browser frontend (think PEAR); such could be left up to
> the developer to create.
>
> Any thoughts?
>
>
> regards,
>
> Nathan Garlington
> T&R Trailer Sales
> 5930 N Interstate 25
> Pueblo, CO 81008
>
> 719.546.2321 T
> 719.423.8033 M
> 719.404.4697 F
>
> nathan@tandrtrailer.com
> www.tandrtrailer.com
>
>
>
>

--
Met vriendelijke groet,

Pieter Kokx
PHP Developer
Zend Framework developer

[fw-mvc] Suggestion: Zend Installer

Hi all,

I am sitting here uploading the new 1.10.0 version of ZF. The process
goes like this:

I have three separate servers I have to upload the new version to, so
I download the zip file, unpack it, and upload the new version to the
servers. It takes about 20 minutes or more for each one, so I lose
about an hour of work time to the upload process, and well as the hit
on my bandwidth while it's uploading.

It would be wonderful if there was a Zend package called
Zend_Installer(?) that could be configured with the location of the
temp directory where the file would be downloaded, and the
installation directory on the server, and would then just use the web
server itself to download the new version, install it to the
previously configured location and that's it. It could handle any
common compression format. I don't know if such functionality runs
against ZF's design paradigm but it would sure make the upgrading
process much simpler and less time consuming. It wouldn't necessarily
need to have a browser frontend (think PEAR); such could be left up to
the developer to create.

Any thoughts?


regards,

Nathan Garlington
T&R Trailer Sales
5930 N Interstate 25
Pueblo, CO 81008

719.546.2321 T
719.423.8033 M
719.404.4697 F

nathan@tandrtrailer.com
www.tandrtrailer.com

Re: [fw-mvc] phaml

-- Virgil Reality <virgil@relativitycommunications.com> wrote
(on Friday, 29 January 2010, 09:28 PM +1100):
> For God's Sake where can I unsubscribe from these lists.
> Sorry to all for asking here.

Look in the email headers; send an email to:

fw-mvc-unsubscribe@lists.zend.com

from the address to which you're subscribed.

If that doesn't work, it means you're subscribed to fw-all, so in
that case, send an email to:

fw-all-unsubscribe@lists.zend.com


> -----Original Message-----
> From: Andreas Baumgart [mailto:ab@polycast.de]
> Sent: Friday, 29 January 2010 9:09 PM
> To: Konr Ness; Andrew Pace
> Cc: Zend Framework MVC List
> Subject: Re: [fw-mvc] phaml
>
> > I'm not sure how the rendering of the view would work since the default
> suffix will still be expected to be .phtml.
>
> You could set the suffix of choice in Bootstrap like this:
>
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
> ->setView($view)
> ->setViewSuffix('phaml');
>
>
> --
> Andreas Baumgart
> http://polycast.de
>
> On 29.01.2010, at 04:44, Konr Ness wrote:
>
> > Andrew,
> >
> > http://phaml.sourceforge.net/
> >
> > In my cursory research, this page seems to detail a way to integrate phaml
> with Zend Framework. The section "hlzendex2:A Better Solution, Use
> AA_View_pHAML Class" is what you're looking for.
> >
> > Essentially, you want to replace Zend_View with AA_View_pHAML although I
> would recommend against initializing the phaml view in your controller, and
> instead put it in your Bootstrap so it's reusable everywhere.
> >
> > For instance:
> >
> > <?php
> >
> > class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> > {
> >
> > /**
> > * Initialize the view resource
> > *
> > * @return Bear_View
> > */
> > protected function _initView()
> > {
> > $view = new AA_View_pHAML();
> >
> >
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
> > ->setView($view);
> > return $view;
> > }
> >
> > }
> >
> > Then the view should be accessible from the controller just like a normal
> view:
> > $this->view->myParam = $myParam;
> >
> > I'm not sure how the rendering of the view would work since the default
> suffix will still be expected to be .phtml.
> >
> > You might still have to do this to render the view:
> > $this->getFrontController()->setParam('noViewRenderer', true);
> > $this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
> >
> > echo $this->view->render('index.hml');
> >
> > I'm not sure if the setScriptPath is necessary.
> >
> > Anyone else?
> >
> > Konr
> >
> > p.s. Why would you want to use phaml when straight PHP is faster and
> easier?
> >
> >
> > On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <andrewppace@gmail.com>
> wrote:
> >
> > Hello all,
> >
> > I am fairly new to zend framework and still trying to get the hang of
> > it. I am curious if any of you are using phaml in your apps.
> >
> > I am hoping to use phaml in all my views for the entire app. So I want
> > to configure it once in the bootstrap class and be able to create views
> > like, "index.hml". In controllers, I would like to still assign
> > variables like, "$this->view->variable = $variable". Any good examples
> > to get me going. I followed the examples on
> > http://phaml.sourceforge.net/ , but these still required configuration
> > in the controller or view. I am hoping to do it just once in the
> > bootstrap class and be done with it.
> >
> > Thanks,
> >
> > Andrew
> >
> >
> > --
> > View this message in context:
> http://n4.nabble.com/phaml-tp1401336p1401336.html
> > Sent from the Zend MVC mailing list archive at Nabble.com.
> >
>
>
>

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Re: [fw-mvc] phaml

> Essentially, you want to replace Zend_View with AA_View_pHAML although I
> would recommend against initializing the phaml view in your controller,
> and instead put it in your Bootstrap so it's reusable everywhere.

Why bother with a templating engine at all?


Best regards,

Andreas

Re: [fw-mvc] phaml

Take a look at the headers of the emails you receive.

List-Post: <mailto:fw-mvc@lists.zend.com>
List-Help: <mailto:fw-mvc-help@lists.zend.com>
List-Unsubscribe: <mailto:fw-mvc-unsubscribe@lists.zend.com>
List-Subscribe: <mailto:fw-mvc-subscribe@lists.zend.com>

Regards,
-- Nicolas

Virgil Reality a écrit :
> For God's Sake where can I unsubscribe from these lists.
> Sorry to all for asking here.
>
>
>
> Virgil Reality - Professional Services
> W: http://www.relativitycommunications.com
> M: 0405 129 049
> T: +61 2 9516 0014
> E: virgil@relativitycommunications.com
> Twitter: http://twitter.com/VirgilReality
> FaceBook: http://www.facebook.com/virgil.reality
>
>
> -----Original Message-----
> From: Andreas Baumgart [mailto:ab@polycast.de]
> Sent: Friday, 29 January 2010 9:09 PM
> To: Konr Ness; Andrew Pace
> Cc: Zend Framework MVC List
> Subject: Re: [fw-mvc] phaml
>
>> I'm not sure how the rendering of the view would work since the default
> suffix will still be expected to be .phtml.
>
> You could set the suffix of choice in Bootstrap like this:
>
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
> ->setView($view)
> ->setViewSuffix('phaml');
>
>
> --
> Andreas Baumgart
> http://polycast.de
>
> On 29.01.2010, at 04:44, Konr Ness wrote:
>
>> Andrew,
>>
>> http://phaml.sourceforge.net/
>>
>> In my cursory research, this page seems to detail a way to integrate phaml
> with Zend Framework. The section "hlzendex2:A Better Solution, Use
> AA_View_pHAML Class" is what you're looking for.
>> Essentially, you want to replace Zend_View with AA_View_pHAML although I
> would recommend against initializing the phaml view in your controller, and
> instead put it in your Bootstrap so it's reusable everywhere.
>> For instance:
>>
>> <?php
>>
>> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>> {
>>
>> /**
>> * Initialize the view resource
>> *
>> * @return Bear_View
>> */
>> protected function _initView()
>> {
>> $view = new AA_View_pHAML();
>>
>>
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
>> ->setView($view);
>> return $view;
>> }
>>
>> }
>>
>> Then the view should be accessible from the controller just like a normal
> view:
>> $this->view->myParam = $myParam;
>>
>> I'm not sure how the rendering of the view would work since the default
> suffix will still be expected to be .phtml.
>> You might still have to do this to render the view:
>> $this->getFrontController()->setParam('noViewRenderer', true);
>> $this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
>>
>> echo $this->view->render('index.hml');
>>
>> I'm not sure if the setScriptPath is necessary.
>>
>> Anyone else?
>>
>> Konr
>>
>> p.s. Why would you want to use phaml when straight PHP is faster and
> easier?
>>
>> On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <andrewppace@gmail.com>
> wrote:
>> Hello all,
>>
>> I am fairly new to zend framework and still trying to get the hang of
>> it. I am curious if any of you are using phaml in your apps.
>>
>> I am hoping to use phaml in all my views for the entire app. So I want
>> to configure it once in the bootstrap class and be able to create views
>> like, "index.hml". In controllers, I would like to still assign
>> variables like, "$this->view->variable = $variable". Any good examples
>> to get me going. I followed the examples on
>> http://phaml.sourceforge.net/ , but these still required configuration
>> in the controller or view. I am hoping to do it just once in the
>> bootstrap class and be done with it.
>>
>> Thanks,
>>
>> Andrew
>>
>>
>> --
>> View this message in context:
> http://n4.nabble.com/phaml-tp1401336p1401336.html
>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>
>
>
>
>
>
>

RE: [fw-mvc] phaml

For God's Sake where can I unsubscribe from these lists.
Sorry to all for asking here.

Virgil Reality - Professional Services
W: http://www.relativitycommunications.com
M: 0405 129 049
T: +61 2 9516 0014
E: virgil@relativitycommunications.com
Twitter: http://twitter.com/VirgilReality
FaceBook: http://www.facebook.com/virgil.reality


-----Original Message-----
From: Andreas Baumgart [mailto:ab@polycast.de]
Sent: Friday, 29 January 2010 9:09 PM
To: Konr Ness; Andrew Pace
Cc: Zend Framework MVC List
Subject: Re: [fw-mvc] phaml

> I'm not sure how the rendering of the view would work since the default
suffix will still be expected to be .phtml.

You could set the suffix of choice in Bootstrap like this:

Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
->setView($view)
->setViewSuffix('phaml');


--
Andreas Baumgart
http://polycast.de

On 29.01.2010, at 04:44, Konr Ness wrote:

> Andrew,
>
> http://phaml.sourceforge.net/
>
> In my cursory research, this page seems to detail a way to integrate phaml
with Zend Framework. The section "hlzendex2:A Better Solution, Use
AA_View_pHAML Class" is what you're looking for.
>
> Essentially, you want to replace Zend_View with AA_View_pHAML although I
would recommend against initializing the phaml view in your controller, and
instead put it in your Bootstrap so it's reusable everywhere.
>
> For instance:
>
> <?php
>
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
>
> /**
> * Initialize the view resource
> *
> * @return Bear_View
> */
> protected function _initView()
> {
> $view = new AA_View_pHAML();
>
>
Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
> ->setView($view);
> return $view;
> }
>
> }
>
> Then the view should be accessible from the controller just like a normal
view:
> $this->view->myParam = $myParam;
>
> I'm not sure how the rendering of the view would work since the default
suffix will still be expected to be .phtml.
>
> You might still have to do this to render the view:
> $this->getFrontController()->setParam('noViewRenderer', true);
> $this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
>
> echo $this->view->render('index.hml');
>
> I'm not sure if the setScriptPath is necessary.
>
> Anyone else?
>
> Konr
>
> p.s. Why would you want to use phaml when straight PHP is faster and
easier?
>
>
> On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <andrewppace@gmail.com>
wrote:
>
> Hello all,
>
> I am fairly new to zend framework and still trying to get the hang of
> it. I am curious if any of you are using phaml in your apps.
>
> I am hoping to use phaml in all my views for the entire app. So I want
> to configure it once in the bootstrap class and be able to create views
> like, "index.hml". In controllers, I would like to still assign
> variables like, "$this->view->variable = $variable". Any good examples
> to get me going. I followed the examples on
> http://phaml.sourceforge.net/ , but these still required configuration
> in the controller or view. I am hoping to do it just once in the
> bootstrap class and be done with it.
>
> Thanks,
>
> Andrew
>
>
> --
> View this message in context:
http://n4.nabble.com/phaml-tp1401336p1401336.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>

Re: [fw-mvc] phaml

> I'm not sure how the rendering of the view would work since the default suffix will still be expected to be .phtml.

You could set the suffix of choice in Bootstrap like this:

Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
->setView($view)
->setViewSuffix('phaml');


--
Andreas Baumgart
http://polycast.de

On 29.01.2010, at 04:44, Konr Ness wrote:

> Andrew,
>
> http://phaml.sourceforge.net/
>
> In my cursory research, this page seems to detail a way to integrate phaml with Zend Framework. The section "hlzendex2:A Better Solution, Use AA_View_pHAML Class" is what you're looking for.
>
> Essentially, you want to replace Zend_View with AA_View_pHAML although I would recommend against initializing the phaml view in your controller, and instead put it in your Bootstrap so it's reusable everywhere.
>
> For instance:
>
> <?php
>
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
>
> /**
> * Initialize the view resource
> *
> * @return Bear_View
> */
> protected function _initView()
> {
> $view = new AA_View_pHAML();
>
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
> ->setView($view);
> return $view;
> }
>
> }
>
> Then the view should be accessible from the controller just like a normal view:
> $this->view->myParam = $myParam;
>
> I'm not sure how the rendering of the view would work since the default suffix will still be expected to be .phtml.
>
> You might still have to do this to render the view:
> $this->getFrontController()->setParam('noViewRenderer', true);
> $this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
>
> echo $this->view->render('index.hml');
>
> I'm not sure if the setScriptPath is necessary.
>
> Anyone else?
>
> Konr
>
> p.s. Why would you want to use phaml when straight PHP is faster and easier?
>
>
> On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <andrewppace@gmail.com> wrote:
>
> Hello all,
>
> I am fairly new to zend framework and still trying to get the hang of
> it. I am curious if any of you are using phaml in your apps.
>
> I am hoping to use phaml in all my views for the entire app. So I want
> to configure it once in the bootstrap class and be able to create views
> like, "index.hml". In controllers, I would like to still assign
> variables like, "$this->view->variable = $variable". Any good examples
> to get me going. I followed the examples on
> http://phaml.sourceforge.net/ , but these still required configuration
> in the controller or view. I am hoping to do it just once in the
> bootstrap class and be done with it.
>
> Thanks,
>
> Andrew
>
>
> --
> View this message in context: http://n4.nabble.com/phaml-tp1401336p1401336.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>

2010年1月28日星期四

[fw-mvc] Re: phaml

Maybe it's not a good idea, but I think it makes my life as a programmer
much easier.  It very easy to maintain.  As for the slowness, I plan to
cache most of the pages anyway, so I wasn't thinking it would make a
huge difference.

Andrew

On Thu, 2010-01-28 at 19:44 -0800, Konr Ness [via Zend Framework
Community] wrote:

> Andrew,
>
> http://phaml.sourceforge.net/
>
> In my cursory research, this page seems to detail a way to integrate
> phaml with Zend Framework. The section "hlzendex2:A Better Solution,
> Use AA_View_pHAML Class" is what you're looking for.
>
> Essentially, you want to replace Zend_View with AA_View_pHAML although
> I would recommend against initializing the phaml view in your
> controller, and instead put it in your Bootstrap so it's reusable
> everywhere.
>
> For instance:
>
> <?php
>
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
>    
>     /**
>      * Initialize the view resource
>      *
>      * @return Bear_View
>      */
>     protected function _initView()
>     {
>         $view = new AA_View_pHAML();
>        
>
> Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
>                                            ->setView($view);
>         return $view;
>     }
>
> }
>
> Then the view should be accessible from the controller just like a
> normal view:
> $this->view->myParam = $myParam;
>
> I'm not sure how the rendering of the view would work since the
> default suffix will still be expected to be .phtml.
>
> You might still have to do this to render the view:
> $this->getFrontController()->setParam('noViewRenderer', true);
> $this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
>
> echo  $this->view->render('index.hml');
> I'm not sure if the setScriptPath is necessary.
>
> Anyone else?
>
> Konr
>
> p.s. Why would you want to use phaml when straight PHP is faster and
> easier?
>
>
> On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <[hidden email]> wrote:
>        
>         Hello all,
>        
>         I am fairly new to zend framework and still trying to get the
>         hang of
>         it.  I am curious if any of you are using phaml in your apps.
>        
>         I am hoping to use phaml in all my views for the entire app.
>          So I want
>         to configure it once in the bootstrap class and be able to
>         create views
>         like, "index.hml".  In controllers, I would like to still
>         assign
>         variables like, "$this->view->variable = $variable".  Any good
>         examples
>         to get me going.  I followed the examples on
>         http://phaml.sourceforge.net/ , but these still required
>         configuration
>         in the controller or view.  I am hoping to do it just once in
>         the
>         bootstrap class and be done with it.
>        
>         Thanks,
>        
>         Andrew
>        
>        
>         --
>         View this message in context:
>         http://n4.nabble.com/phaml-tp1401336p1401336.html
>         Sent from the Zend MVC mailing list archive at Nabble.com.
>
>
>
>
> ______________________________________________________________________
> View message @ http://n4.nabble.com/phaml-tp1401336p1401506.html 
> To unsubscribe from phaml, click here.
>



View this message in context: Re: phaml
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] phaml

Andrew,

http://phaml.sourceforge.net/

In my cursory research, this page seems to detail a way to integrate phaml with Zend Framework. The section "hlzendex2:A Better Solution, Use AA_View_pHAML Class" is what you're looking for.

Essentially, you want to replace Zend_View with AA_View_pHAML although I would recommend against initializing the phaml view in your controller, and instead put it in your Bootstrap so it's reusable everywhere.

For instance:

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
   
    /**
     * Initialize the view resource
     *
     * @return Bear_View
     */
    protected function _initView()
    {
        $view = new AA_View_pHAML();
       
        Zend_Controller_Action_HelperBroker::getStaticHelper("viewRenderer")
                                           ->setView($view);
        return $view;
    }

}

Then the view should be accessible from the controller just like a normal view:
$this->view->myParam = $myParam;

I'm not sure how the rendering of the view would work since the default suffix will still be expected to be .phtml.

You might still have to do this to render the view:
$this->getFrontController()->setParam('noViewRenderer', true);
$this->view->setScriptPath('D:/wamp/asf/hlzendex2/views/scripts/index');
echo $this->view->render('index.hml');
I'm not sure if the setScriptPath is necessary.

Anyone else?

Konr

p.s. Why would you want to use phaml when straight PHP is faster and easier?


On Thu, Jan 28, 2010 at 4:52 PM, Andrew Pace <andrewppace@gmail.com> wrote:

Hello all,

I am fairly new to zend framework and still trying to get the hang of
it.  I am curious if any of you are using phaml in your apps.

I am hoping to use phaml in all my views for the entire app.  So I want
to configure it once in the bootstrap class and be able to create views
like, "index.hml".  In controllers, I would like to still assign
variables like, "$this->view->variable = $variable".  Any good examples
to get me going.  I followed the examples on
http://phaml.sourceforge.net/ , but these still required configuration
in the controller or view.  I am hoping to do it just once in the
bootstrap class and be done with it.

Thanks,

Andrew


--
View this message in context: http://n4.nabble.com/phaml-tp1401336p1401336.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Setting Zend_Currency in registry, but it's not available to the view

Your resource is initializing properly and the Zend_Currency instance is properly being set to the Registry.

The error you are receiving is that a view helper cannot be found with the name "currency".

Are you sure that Currency.php exists in the /Zend/View/Helper directory?
Do any other view helpers work in your project, such as $this->url()?

Konr


On Thu, Jan 28, 2010 at 2:50 PM, Nathan Garlington <garlinto@gmail.com> wrote:
I have been trying to implement the view currency helper using the
example in the manual. I have created a  resource with the following
code:

class My_Bootstrap_Resource_Currency extends
Zend_Application_Resource_ResourceAbstract
{
   public function init()
   {
               Zend_Registry::set('Zend_Currency', new Zend_Currency('en_US'));
       }
}

In my application.ini, I added this line:

resources.currency = true


As per the example in the manual, I should now be able to use the helper thusly:

<?php
   // view script
   echo $this->currency(1342.67);
?>

However, i get this error:

Message: Plugin by name 'Currency' was not found in the registry; used
paths: Zend_Dojo_View_Helper_: Zend/Dojo/View/Helper/
Zend_View_Helper_:
Zend/View/Helper/:/home/garlinto/frontend/views/helpers/

So I thought, maybe the resource isn't being invoked. So in the
controller I ran this code:

$currency = Zend_Registry::get('Zend_Currency');
$this->view->debug = Zend_Debug::dump($currency, "Currency:", false);

And the response is:

Currency: object(Zend_Currency)#43 (2) {
 ["_locale:private"] => string(5) "en_US"
 ["_options:protected"] => array(8) {
   ["position"] => int(8)
   ["script"] => NULL
   ["format"] => NULL
   ["display"] => int(2)
   ["precision"] => int(2)
   ["name"] => string(9) "US Dollar"
   ["currency"] => string(3) "USD"
   ["symbol"] => string(1) "$"
 }
}

Anyone know what I am doing wrong? I'm sure I'm missing something...

--regards,

Nathan Garlington

[fw-mvc] phaml

Hello all,

I am fairly new to zend framework and still trying to get the hang of
it. I am curious if any of you are using phaml in your apps.

I am hoping to use phaml in all my views for the entire app. So I want
to configure it once in the bootstrap class and be able to create views
like, "index.hml". In controllers, I would like to still assign
variables like, "$this->view->variable = $variable". Any good examples
to get me going. I followed the examples on
http://phaml.sourceforge.net/ , but these still required configuration
in the controller or view. I am hoping to do it just once in the
bootstrap class and be done with it.

Thanks,

Andrew


--
View this message in context: http://n4.nabble.com/phaml-tp1401336p1401336.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Setting Zend_Currency in registry, but it's not available to the view

I have been trying to implement the view currency helper using the
example in the manual. I have created a resource with the following
code:

class My_Bootstrap_Resource_Currency extends
Zend_Application_Resource_ResourceAbstract
{
public function init()
{
Zend_Registry::set('Zend_Currency', new Zend_Currency('en_US'));
}
}

In my application.ini, I added this line:

resources.currency = true


As per the example in the manual, I should now be able to use the helper thusly:

<?php
// view script
echo $this->currency(1342.67);
?>

However, i get this error:

Message: Plugin by name 'Currency' was not found in the registry; used
paths: Zend_Dojo_View_Helper_: Zend/Dojo/View/Helper/
Zend_View_Helper_:
Zend/View/Helper/:/home/garlinto/frontend/views/helpers/

So I thought, maybe the resource isn't being invoked. So in the
controller I ran this code:

$currency = Zend_Registry::get('Zend_Currency');
$this->view->debug = Zend_Debug::dump($currency, "Currency:", false);

And the response is:

Currency: object(Zend_Currency)#43 (2) {
["_locale:private"] => string(5) "en_US"
["_options:protected"] => array(8) {
["position"] => int(8)
["script"] => NULL
["format"] => NULL
["display"] => int(2)
["precision"] => int(2)
["name"] => string(9) "US Dollar"
["currency"] => string(3) "USD"
["symbol"] => string(1) "$"
}
}

Anyone know what I am doing wrong? I'm sure I'm missing something...

--regards,

Nathan Garlington

Re: [fw-db] Caching SQL query results

Much of this can probably be done with page level caching, instead of caching the SQL Queries. MySQL can cache queries itself, as well.

On Thu, Jan 28, 2010 at 12:01 PM, Andreas Möller <localheinz@l8m.de> wrote:
* In an e-commerce context, how many SQL queries would you consider to
be too much, for example on a complex product page, with nested
categories, products and multiple references, collections of products,
multi-product kits, temporary events, promotions, and everything plus a
bit of AJAX all over it?

You mean, in a year?

Doesn't make any sense counting queries, if the total is not set in relation with a specified time.


* We have a lot of these SQL queries at the moment, and we're
considering enabling a SQL query result caching mecanism soon. But right
now, we're wondering where we're supposed to add this kind of system in
Zend_Db. There don't seem to be any useful hook around it (except
insert, update & delete). We didn't find where we should hook the system
because there's so much methods... find(), fetchRow(), fetchAll(),
findDependentRowset(), findManyToManyRowset() and so on... Moreover,
since it's not designed to handle ORDB, there don't seem to be any way
of catching IDs (or whatever column is used as an identifier) in the
queries. Which is kind of a problem if we want to use it as the cache
identifier.

Use

 [x] Zend_Cache_Manager

and prepare as many cache templates as you like, and then cache results with cache instances retrieved from there.


* On the other hand, we do know that MySQL already have some internal
caching mecanism, but the application still sends dozens of duplicated
requests to the server on the same page. We don't know if this cache is
of any help or it's just smoke and mirrors.

Maybe it helps taking a look at an ORM such as Doctrine?


I already crawled the web, searching for elegant solutions, but all I
found was some tips'n tricks that are of no use in our situation (static
caching and manual caching at each query). We really need to automate
the process because we're kinda building a massive application here.

How about caching at model level?


Best regards,

Andreas


Re: [fw-db] Caching SQL query results

> * In an e-commerce context, how many SQL queries would you consider to
> be too much, for example on a complex product page, with nested
> categories, products and multiple references, collections of products,
> multi-product kits, temporary events, promotions, and everything plus a
> bit of AJAX all over it?

You mean, in a year?

Doesn't make any sense counting queries, if the total is not set in
relation with a specified time.

> * We have a lot of these SQL queries at the moment, and we're
> considering enabling a SQL query result caching mecanism soon. But right
> now, we're wondering where we're supposed to add this kind of system in
> Zend_Db. There don't seem to be any useful hook around it (except
> insert, update & delete). We didn't find where we should hook the system
> because there's so much methods... find(), fetchRow(), fetchAll(),
> findDependentRowset(), findManyToManyRowset() and so on... Moreover,
> since it's not designed to handle ORDB, there don't seem to be any way
> of catching IDs (or whatever column is used as an identifier) in the
> queries. Which is kind of a problem if we want to use it as the cache
> identifier.

Use

[x] Zend_Cache_Manager

and prepare as many cache templates as you like, and then cache results
with cache instances retrieved from there.

> * On the other hand, we do know that MySQL already have some internal
> caching mecanism, but the application still sends dozens of duplicated
> requests to the server on the same page. We don't know if this cache is
> of any help or it's just smoke and mirrors.

Maybe it helps taking a look at an ORM such as Doctrine?

> I already crawled the web, searching for elegant solutions, but all I
> found was some tips'n tricks that are of no use in our situation (static
> caching and manual caching at each query). We really need to automate
> the process because we're kinda building a massive application here.

How about caching at model level?


Best regards,

Andreas

[fw-db] Caching SQL query results

Hello,

It's been a while since I last asked for some help, but the time has now
come again. There's a few questions I'd like to ask, and I hope you'll
manage to help me regarding these.

* In an e-commerce context, how many SQL queries would you consider to
be too much, for example on a complex product page, with nested
categories, products and multiple references, collections of products,
multi-product kits, temporary events, promotions, and everything plus a
bit of AJAX all over it?

* We have a lot of these SQL queries at the moment, and we're
considering enabling a SQL query result caching mecanism soon. But right
now, we're wondering where we're supposed to add this kind of system in
Zend_Db. There don't seem to be any useful hook around it (except
insert, update & delete). We didn't find where we should hook the system
because there's so much methods... find(), fetchRow(), fetchAll(),
findDependentRowset(), findManyToManyRowset() and so on... Moreover,
since it's not designed to handle ORDB, there don't seem to be any way
of catching IDs (or whatever column is used as an identifier) in the
queries. Which is kind of a problem if we want to use it as the cache
identifier.

* On the other hand, we do know that MySQL already have some internal
caching mecanism, but the application still sends dozens of duplicated
requests to the server on the same page. We don't know if this cache is
of any help or it's just smoke and mirrors.

I already crawled the web, searching for elegant solutions, but all I
found was some tips'n tricks that are of no use in our situation (static
caching and manual caching at each query). We really need to automate
the process because we're kinda building a massive application here.

I hope someone will be able to help us around here.

Regards,
-- Nicolas

Re: [fw-mvc] Re: [fw-general] Bootstrap Resource usage in model - best practice advice please

> And yes, there should be no more than one cache instance (at least 1 backend for cache).

Have a look at

[x] Zend_Cache_Manager

and the accompanied

[x] Zend_Application_Resource_Cachemanager

that you can use for bootstrapping multiple caches via

[x] application.ini

and

[x] Zend_Controller_Action_Helper_Cache

which you can use in your controllers to access caches (or, use
Zend_Cache_Manager::hasCache() and Zend_Cache_Manager::getCache()).
- as it does what you need. And I, of course.


Best regards,

Andreas

Re: [fw-mvc] zend_registry or zend_cache_manager

Really depends. Zend_Cache_Manager was designed as a "Lazy Loader". You set your configuration for caches on it, and instantiate them later using Zend_Cache_Manager::getCache() if needed. Otherwise they are not instantiated. Using it as a Registry (which it is of sorts) is also fine. You can retrieve it from any Controller using:

$this->_helper->getHelper('Cache')->getManager()->getCache('myCache');

Important point is that sticking an existing cache object anywhere is fairly cheap - all you are doing is passing around object references ;).
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative



From: sina miandashti <miandashti@gmail.com>
To: Zend MVC <fw-mvc@lists.zend.com>
Sent: Thu, January 28, 2010 1:45:14 PM
Subject: [fw-mvc] zend_registry or zend_cache_manager

hi all developers ;)


$cache = Zend_Cache::factory('Core','File',$frontend,$backend);

1:


$manager = new Zend_Cache_Manager;
$manager->setCache('appcache', $cache);


2:

Zend_Registry::set ( 'cache', $cache );

------------------------------------------------------------------------

which one is better for storing the $cache object ...   ?

for better performance and better memory usage and etc...

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin

[fw-mvc] zend_registry or zend_cache_manager

hi all developers ;)


$cache = Zend_Cache::factory('Core','File',$frontend,$backend);

1:


$manager = new Zend_Cache_Manager;
$manager->setCache('appcache', $cache);


2:

Zend_Registry::set ( 'cache', $cache );

------------------------------------------------------------------------

which one is better for storing the $cache object ...   ?

for better performance and better memory usage and etc...

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin

2010年1月27日星期三

Re: [fw-webservices] Re: Recursion issue with Zend_Soap_AutoDiscovery.

-- Richard Quadling <rquadling@googlemail.com> wrote
(on Wednesday, 27 January 2010, 01:47 PM +0000):

<snip>

> Typo : http://framework.zend.com/issues/browse/ZF-8949
> and
> Recursion : http://framework.zend.com/issues/browse/ZF-8948
>
> I'm not convinced that the recursion fix is 100% as ...

No worries -- add the below information to the ticket as well. I think
your fix is in the right direction, but, as you note, may need a more
sophisticated treatment.

Thanks for filing the tickets!

> class SingleEntity{
> /** @var SingleEntity[] */
> public $Entities = array();
>
> /** @return SingleEntity */
> public function SingleEntity(){
> return new SingleEntity();
> }
> }
>
> produces types of ...
>
> <xsd:complexType name="ArrayOfSingleEntity">
> <xsd:complexContent>
> <xsd:restriction base="soap-enc:Array">
> <xsd:attribute ref="soap-enc:arrayType"
> wsdl:arrayType="tns:SingleEntity[]" />
> </xsd:restriction>
> </xsd:complexContent>
> </xsd:complexType>
>
> <xsd:complexType name="SingleEntity">
> <xsd:all>
> <xsd:element name="Entities" type="tns:SingleEntity[]" />
> </xsd:all>
> </xsd:complexType>
>
> <xsd:complexType name="SingleEntity">
> <xsd:all>
> <xsd:element name="Entities" type="tns:ArrayOfSingleEntity" />
> </xsd:all>
> </xsd:complexType>
>
> and I've no idea if that is valid.
>
> I'm new with this, so please check this.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

Re: [fw-webservices] Re: Recursion issue with Zend_Soap_AutoDiscovery.

2010/1/27 Richard Quadling <rquadling@googlemail.com>:
> 2010/1/27 Matthew Weier O'Phinney <matthew@zend.com>:
>> -- Richard Quadling <rquadling@googlemail.com> wrote
>> (on Wednesday, 27 January 2010, 10:03 AM +0000):
>>> 2010/1/25 Richard Quadling <rquadling@googlemail.com>:
>>> > I'm in the process of building a web service which incorporates the
>>> > ability for the server to inform the client that a particular call has
>>> > been superseded by another.
>>> >
>>> > So, cut down (I've removed all the other details), ...
>>> >
>>> > class ServiceDetails
>>> >        {
>>> >        /**
>>> >         * Superseded by
>>> >         *
>>> >         * Details of the replacement service that is now available.
>>> >         *
>>> >         * @var ServiceDetails
>>> >         */
>>> >        public $SupersededBy = Null;
>>> >        }
>>> >
>>> > When I try to use Zend_Soap_AutoDiscover() against this class, I get ...
>>> >
>>> > "Infinite recursion, cannot nest 'ServiceDetails' into itsself." (sic)
>>> >
>>> > There has to be recursion, as there could be many levels of
>>> > supersedence, each one providing the details of their own replacement.
>>> >
>>> > The call to return the service details read the requested
>>> > services/class constants. If there is a superseded entry, it creates a
>>> > new request for service details on the new class (the recursion).
>>> >
>>> > If the value is Null, then there is no recursion.
>>> >
>>> >
>>> >
>>> > I'm using ...
>>> >
>>> > new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
>>> >
>>> > as the strategy as the service has arrays of complex types in the output.
>>> >
>>> >
>>> >
>>> > If I use @var string and then manually replace the type in the WSDL
>>> > file from ...
>>> >
>>> >          <xsd:element name="SupersededBy" type="xsd:string" />
>>> >
>>> > to
>>> >
>>> >          <xsd:element name="SupersededBy" type="tns:ServiceDetails" />
>>> >
>>> > and use wsdl2php against this, it all _SEEMS_ to work OK.
>>> >
>>> > So. Is this my best option? Or is there a way to do this that I'm missing?
>>> >
>>> >
>>> > Any ideas really.
>>> >
>>> >
>>> > Is this even a bug in the Zend_Soap_AutoDiscover class?
>>>
>>> I amended Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex::addComplexType().
>>>
>>> Changing the (sic) ...
>>>
>>> throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest
>>> '".$type."' into itsself.");
>>>
>>> to ...
>>>
>>> return "tns:$type";
>>>
>>> and all is working just fine.
>>>
>>> Obviously, I may be breaking something here, but I've not come across
>>> it yet. Early days .... !
>>
>> Can you open an issue in the tracker and provide a test case and your
>> patch? This does sound like a bug, and from what you've described, I
>> think you hit on the appropriate solution.
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead            | matthew@zend.com
>> Zend Framework          | http://framework.zend.com/
>> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>>
>
> OK.
>
> I think there is more to do though as I suspect if you have type a
> contains type b contains type a then you will need to know what types
> have already been added.
>
> Probably does that already.
>
> Will see if I can make a sensible test.
>
> Currently, an exception is thrown saying that this is not allowed. So
> really it is an enhancement.
>
> Oh. There is a "bug". A typo. "itsself" is in exception rather than "itself".
>
> I'll report this as an enhancement.
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

Typo : http://framework.zend.com/issues/browse/ZF-8949
and
Recursion : http://framework.zend.com/issues/browse/ZF-8948

I'm not convinced that the recursion fix is 100% as ...

class SingleEntity{
/** @var SingleEntity[] */
public $Entities = array();

/** @return SingleEntity */
public function SingleEntity(){
return new SingleEntity();
}
}

produces types of ...

<xsd:complexType name="ArrayOfSingleEntity">
<xsd:complexContent>
<xsd:restriction base="soap-enc:Array">
<xsd:attribute ref="soap-enc:arrayType"
wsdl:arrayType="tns:SingleEntity[]" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="SingleEntity">
<xsd:all>
<xsd:element name="Entities" type="tns:SingleEntity[]" />
</xsd:all>
</xsd:complexType>

<xsd:complexType name="SingleEntity">
<xsd:all>
<xsd:element name="Entities" type="tns:ArrayOfSingleEntity" />
</xsd:all>
</xsd:complexType>

and I've no idea if that is valid.

I'm new with this, so please check this.

Thank you.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

Re: [fw-webservices] Re: Recursion issue with Zend_Soap_AutoDiscovery.

2010/1/27 Matthew Weier O'Phinney <matthew@zend.com>:
> -- Richard Quadling <rquadling@googlemail.com> wrote
> (on Wednesday, 27 January 2010, 10:03 AM +0000):
>> 2010/1/25 Richard Quadling <rquadling@googlemail.com>:
>> > I'm in the process of building a web service which incorporates the
>> > ability for the server to inform the client that a particular call has
>> > been superseded by another.
>> >
>> > So, cut down (I've removed all the other details), ...
>> >
>> > class ServiceDetails
>> >        {
>> >        /**
>> >         * Superseded by
>> >         *
>> >         * Details of the replacement service that is now available.
>> >         *
>> >         * @var ServiceDetails
>> >         */
>> >        public $SupersededBy = Null;
>> >        }
>> >
>> > When I try to use Zend_Soap_AutoDiscover() against this class, I get ...
>> >
>> > "Infinite recursion, cannot nest 'ServiceDetails' into itsself." (sic)
>> >
>> > There has to be recursion, as there could be many levels of
>> > supersedence, each one providing the details of their own replacement.
>> >
>> > The call to return the service details read the requested
>> > services/class constants. If there is a superseded entry, it creates a
>> > new request for service details on the new class (the recursion).
>> >
>> > If the value is Null, then there is no recursion.
>> >
>> >
>> >
>> > I'm using ...
>> >
>> > new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
>> >
>> > as the strategy as the service has arrays of complex types in the output.
>> >
>> >
>> >
>> > If I use @var string and then manually replace the type in the WSDL
>> > file from ...
>> >
>> >          <xsd:element name="SupersededBy" type="xsd:string" />
>> >
>> > to
>> >
>> >          <xsd:element name="SupersededBy" type="tns:ServiceDetails" />
>> >
>> > and use wsdl2php against this, it all _SEEMS_ to work OK.
>> >
>> > So. Is this my best option? Or is there a way to do this that I'm missing?
>> >
>> >
>> > Any ideas really.
>> >
>> >
>> > Is this even a bug in the Zend_Soap_AutoDiscover class?
>>
>> I amended Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex::addComplexType().
>>
>> Changing the (sic) ...
>>
>> throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest
>> '".$type."' into itsself.");
>>
>> to ...
>>
>> return "tns:$type";
>>
>> and all is working just fine.
>>
>> Obviously, I may be breaking something here, but I've not come across
>> it yet. Early days .... !
>
> Can you open an issue in the tracker and provide a test case and your
> patch? This does sound like a bug, and from what you've described, I
> think you hit on the appropriate solution.
>
> --
> Matthew Weier O'Phinney
> Project Lead            | matthew@zend.com
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>

OK.

I think there is more to do though as I suspect if you have type a
contains type b contains type a then you will need to know what types
have already been added.

Probably does that already.

Will see if I can make a sensible test.

Currently, an exception is thrown saying that this is not allowed. So
really it is an enhancement.

Oh. There is a "bug". A typo. "itsself" is in exception rather than "itself".

I'll report this as an enhancement.

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

Re: [fw-webservices] Re: Recursion issue with Zend_Soap_AutoDiscovery.

-- Richard Quadling <rquadling@googlemail.com> wrote
(on Wednesday, 27 January 2010, 10:03 AM +0000):
> 2010/1/25 Richard Quadling <rquadling@googlemail.com>:
> > I'm in the process of building a web service which incorporates the
> > ability for the server to inform the client that a particular call has
> > been superseded by another.
> >
> > So, cut down (I've removed all the other details), ...
> >
> > class ServiceDetails
> >        {
> >        /**
> >         * Superseded by
> >         *
> >         * Details of the replacement service that is now available.
> >         *
> >         * @var ServiceDetails
> >         */
> >        public $SupersededBy = Null;
> >        }
> >
> > When I try to use Zend_Soap_AutoDiscover() against this class, I get ...
> >
> > "Infinite recursion, cannot nest 'ServiceDetails' into itsself." (sic)
> >
> > There has to be recursion, as there could be many levels of
> > supersedence, each one providing the details of their own replacement.
> >
> > The call to return the service details read the requested
> > services/class constants. If there is a superseded entry, it creates a
> > new request for service details on the new class (the recursion).
> >
> > If the value is Null, then there is no recursion.
> >
> >
> >
> > I'm using ...
> >
> > new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
> >
> > as the strategy as the service has arrays of complex types in the output.
> >
> >
> >
> > If I use @var string and then manually replace the type in the WSDL
> > file from ...
> >
> >          <xsd:element name="SupersededBy" type="xsd:string" />
> >
> > to
> >
> >          <xsd:element name="SupersededBy" type="tns:ServiceDetails" />
> >
> > and use wsdl2php against this, it all _SEEMS_ to work OK.
> >
> > So. Is this my best option? Or is there a way to do this that I'm missing?
> >
> >
> > Any ideas really.
> >
> >
> > Is this even a bug in the Zend_Soap_AutoDiscover class?
>
> I amended Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex::addComplexType().
>
> Changing the (sic) ...
>
> throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest
> '".$type."' into itsself.");
>
> to ...
>
> return "tns:$type";
>
> and all is working just fine.
>
> Obviously, I may be breaking something here, but I've not come across
> it yet. Early days .... !

Can you open an issue in the tracker and provide a test case and your
patch? This does sound like a bug, and from what you've described, I
think you hit on the appropriate solution.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

[fw-webservices] Re: Recursion issue with Zend_Soap_AutoDiscovery.

2010/1/25 Richard Quadling <rquadling@googlemail.com>:
> Hi.
>
> I'm in the process of building a web service which incorporates the
> ability for the server to inform the client that a particular call has
> been superseded by another.
>
> So, cut down (I've removed all the other details), ...
>
> class ServiceDetails
>        {
>        /**
>         * Superseded by
>         *
>         * Details of the replacement service that is now available.
>         *
>         * @var ServiceDetails
>         */
>        public $SupersededBy = Null;
>        }
>
> When I try to use Zend_Soap_AutoDiscover() against this class, I get ...
>
> "Infinite recursion, cannot nest 'ServiceDetails' into itsself." (sic)
>
> There has to be recursion, as there could be many levels of
> supersedence, each one providing the details of their own replacement.
>
> The call to return the service details read the requested
> services/class constants. If there is a superseded entry, it creates a
> new request for service details on the new class (the recursion).
>
> If the value is Null, then there is no recursion.
>
>
>
> I'm using ...
>
> new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
>
> as the strategy as the service has arrays of complex types in the output.
>
>
>
> If I use @var string and then manually replace the type in the WSDL
> file from ...
>
>          <xsd:element name="SupersededBy" type="xsd:string" />
>
> to
>
>          <xsd:element name="SupersededBy" type="tns:ServiceDetails" />
>
> and use wsdl2php against this, it all _SEEMS_ to work OK.
>
> So. Is this my best option? Or is there a way to do this that I'm missing?
>
>
> Any ideas really.
>
>
> Is this even a bug in the Zend_Soap_AutoDiscover class?
>
>
>
> Regards,
>
> Richard Quadling.
>
>
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>

I amended Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex::addComplexType().

Changing the (sic) ...

throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest
'".$type."' into itsself.");

to ...

return "tns:$type";

and all is working just fine.

Obviously, I may be breaking something here, but I've not come across
it yet. Early days .... !

--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

Re: [fw-mvc] php apc

APC is an op-code cache and not intended to reduce memory usage.
http://en.wikipedia.org/wiki/PHP_accelerator

It's probably not what you're looking for.


On 27.01.2010, at 10:53, huajun qi wrote:

> I add apc extension to my zend project to reduce memory usage, but the memory instead increases, any idea?
>
> this is my configuration:
>
> apc.enabled = 1
> apc.cache_by_default = on
> apc.shm_segments = 1
> apc.shm_size =128
> apc.ttl =36000
> apc.user_ttl = 36000
> apc.gc_ttl=3600
> apc.num_files_hint = 0
> apc.write_lock = On
> apc.optimization=3
> apc.slam_defense = 0
> apc.stat=Off
>
> --
> Location:

[fw-mvc] php apc

 I add apc extension to my zend project to reduce memory usage, but the memory instead increases, any idea?

this is my configuration:

apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size =128
apc.ttl =36000
apc.user_ttl = 36000
apc.gc_ttl=3600
apc.num_files_hint = 0
apc.write_lock = On
apc.optimization=3
apc.slam_defense = 0
apc.stat=Off

--
Location:

Re: [fw-mvc] Stop Dispatching Process not working

Hello again,

ok, this works. but this was not my biggest problem.

If i change my request to a empty controller, this needs 32 milliseconds (just for dispatching - because of some plugins and my view controller) and the hole loading of the page needs 92 milliseconds. If i change the ZF Front.php to stop the dispatching (i don't need the dispatching because the output is cached) my hole script needs aprox. 70 - 75 milliseconds. This is my problem and i think is necessary to build a function to stop dispatching in the official ZF.

I cannot use the Zend_Page cache, because i have some Controller Plugins/helper for tracking and so on.

Where can i submit a feature request ?

Thanks

Marcel

Am 26.01.2010 um 18:53 schrieb Hector Virgen:

The current code is working as expected. From what I understand, if the request is marked as "not dispatched", then the dispatch loop is started over again, which is why it uses "continue".

So you were correct, you should be setting the dispatched flag to false, but in order to prevent an infinite loop you need to to test from within your plugin if it has already run or not. This can be done with an $_enabled property:

protected $_enabled = true;

public function preDispatch(Zend_Controller_Request_Abstract $request)
{
    if (true === $this->_enabled) {
        $request->setDispatched(false);
        // Prevent this plugin from running on the next dispatch loop
        $this->_enabled = false;
    }
}

If you want to skip the current action but continue with the rest of the dispatch loop, alter the request (perhaps by setting it to a dummy controller/action) and set the dispatched flag to false.

Other than that, I don't think there's a way to exit the dispatch loop unless you use exit.

--
Hector


On Tue, Jan 26, 2010 at 4:29 AM, Marcel Alburg <m.alburg@weeaar.com> wrote:
Hello,

this is not working.

If i Register my Cache Plugin to my Frontcontroller an set the $request->setDispatched(true) in the PRE DISPATCH() (i'll stop the hole dispatch process) - the script run into endless.

a Snipped from the ZF doku.

preDispatch() is called before an action is dispatched by the dispatcher. This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via Zend_Controller_Request_Abstract::setDispatched(false)), the current action may be skipped and/or replaced.                 


my Plugin.

  class Default_Plugin_Cache extends Zend_Controller_Plugin_Abstract
  {
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
      $this->_sCacheString = md5( $request->getRequestUri() . ' ' . $request->getControllerName() . ' ' . $request->getActionName() . ' ' . __DEFAULT_MODULE__); 

      if ( ($return = Default_Cache::checkCache($this->_sCacheString)) )
      {
...
        $request->setDispatched(false);
      }
...
    }


and the Front.php from the ZF Beta.

            do {
                $this->_request->setDispatched(true);

                /**
                 * Notify plugins of dispatch startup
                 */
                $this->_plugins->preDispatch($this->_request);

                /**
                 * Skip requested action if preDispatch() has reset it
                 */
                if (!$this->_request->isDispatched()) {
                    continue;
                }

                /**
                 * Dispatch request
                 */
                try {
                    $dispatcher->dispatch($this->_request, $this->_response);
                } catch (Exception $e) {
                    if ($this->throwExceptions()) {
                        throw $e;
                    }
                    $this->_response->setException($e);
                }

                /**
                 * Notify plugins of dispatch completion
                 */
                $this->_plugins->postDispatch($this->_request);
            } while (!$this->_request->isDispatched());


because of that, it is NOT POSSIBLE (runs to endless) to stop Dispatching from the preDispatch but i need this.

in my opinion, the "continue" must be change to "break";

Thanks
Marcel


Am 26.01.2010 um 01:54 schrieb Hector Virgen:

I think you want to use $request->setDispatched(true). That should inform the dispatcher that the request has already been fulfilled and continue on to postDispatch().

--
Hector


On Mon, Jan 25, 2010 at 5:27 AM, Marcel Alburg <m.alburg@weeaar.com> wrote:
Hello,

is it possible to Implement a Hook/Callback to stop dispatching in the FrontController in a official version of ZF ?

Thanks
Marcel


Am 22.01.2010 um 17:17 schrieb Marcel Alburg:

> Hi,
>
>
> i played with ZF 1.10beta and wrote a Zend_Controller_Plugin
>
>   class Default_Plugin_Cache extends Zend_Controller_Plugin_Abstract
>   {
>     public function preDispatch(Zend_Controller_Request_Abstract $request)
>     {
>        ...
>       $request->setDispatched(false);
>        ...
>     }
>   }
>
> this should stopping the dispatching process but it not works. The snipped (Zend_Controller_Request_Abstract::setDispatched(false);) from the ZF Doku works not too.
>
> if i look in the Zend/Controller/Front.php line 941 i found this
>
>   $this->_plugins->preDispatch($this->_request);
>
>                 /**
>                  * Skip requested action if preDispatch() has reset it
>                  */
>                 if (!$this->_request->isDispatched()) {
>                    continue;
>                 }
>
> i wonder because a continue begins the while loop again. if i change continue to break it works correctly for me.
>
>
> Marcel



--  Weeaar Web- und Softwareentwicklung  http://www.weeaar.com/  Tel: +49 (0)30 2089 6809 Mail: m.alburg@weeaar.com  SteuerID: 049 / 200 / 00385 Inhaber: Marcel Alburg
-------

<banner_728x90.png>
 

www.beatboat.de - Dein Musikpreisvergleich
Nominiert für den Onlinestar 2009



--  Weeaar Web- und Softwareentwicklung  http://www.weeaar.com/  Tel: +49 (0)30 2089 6809 Mail: m.alburg@weeaar.com  SteuerID: 049 / 200 / 00385 Inhaber: Marcel Alburg
-------



www.beatboat.de - Dein Musikpreisvergleich
Nominiert für den Onlinestar 2009