2008年10月28日星期二

Re: [fw-mvc] Multiple upload fields for one form element

Did you read the manual ?
Look at "setMultiFile()".

Note: Does only work on trunk without problems.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Cristian Bichis" <contact@zftutorials.com>
To: <fw-mvc@lists.zend.com>
Sent: Tuesday, October 28, 2008 3:43 PM
Subject: [fw-mvc] Multiple upload fields for one form element


> Hello,
>
> I am encountering a problem when working with Zend_Form_Element_File.
>
> My problem would be that for one file form element i need to upload
> multiple files. Aka: file[] file[] file[]
>
> How do i add all those upload fields to form ? By adding multiple fields
> eahc with same name as file[] ?
>
> --
> Best regards,
> Cristian Bichis
> www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

RE: [fw-webservices] See the soap message

I think i still don't understand it.

I tried a testserver:

<?
set_include_path('./library/');
require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();

$wsdl = "http://www.ejse.com/WeatherService/Service.asmx?WSDL";
$options = array('trace' => true);

$client = new Zend_Soap_Client($wsdl);
$client ->setEncoding("UTF-8");
$client ->setSoapVersion(SOAP_1_1);
$params = array(
"zipCode" => '1082'
);
$client->GetWeatherInfo($params);
$bla = $client->getLastRequest();
Zend_Debug::dump($bla, 'bla',true);

?>

But this gives me the result:
Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable
to process request. --> Object reference not set to an instance of an
object. in /usr/local/wwwroot/jigal/library/Zend/Soap/Client.php:887 Stack
trace: #0 [internal function]: SoapClient->__call('GetWeatherInfo', Array)
#1 [internal function]: Zend_Soap_Client_Common->GetWeatherInfo(Array) #2
/usr/local/wwwroot/jigal/library/Zend/Soap/Client.php(887):
call_user_func_array(Array, Array) #3 [internal function]:
Zend_Soap_Client->__call('GetWeatherInfo', Array) #4
/usr/local/wwwroot/jigal/wstest.php(15):
Zend_Soap_Client->GetWeatherInfo(Array) #5 {main} thrown in
/usr/local/wwwroot/jigal/library/Zend/Soap/Client.php on line 887

DerMika wrote:
>
> Well, assuming the soap server has a method TestMe (defined in the WSDL
> for example) with a parameter number (which is of type integer) you do
> this:
>
> $client->TestMe(array($number));
>
> $bla = $client->getLastRequest();
>
> You can also do this:
>
> $client->__call('TestMe', array($number));
>
> $bla = $client->getLastRequest();
>
>
>
> -----Original Message-----
> From: jjsanders [mailto:jigalroecha@gmail.com]
> Sent: dinsdag 28 oktober 2008 13:29
> To: fw-webservices@lists.zend.com
> Subject: RE: [fw-webservices] See the soap message
>
>
> ok but then I first need to do an request. .. I assume.
> How do I do that?
> How do I send out an SoapRequest?
>
> This is what I have till now:
>
> $options = array('trace' => true);
>
> $client = new Zend_Soap_Client($wsdl);
> $client ->setEncoding("UTF-8");
> $client ->setSoapVersion(SOAP_1_1);
>
> $bla = $client->getLastRequest();
>
> Zend_Debug::dump($bla, 'bla',true);
>
> beberlei wrote:
>>
>>
>> this is why its called "getLastRequest", you can only use it AFTER the
>> request has been fired. How should it know which soap Action with
> which
>> parameters you are calling?
>>
>> On Tue, 28 Oct 2008 02:00:24 -0700 (PDT), jjsanders
>> <jigalroecha@gmail.com>
>> wrote:
>>>
>>> Okaay,
>>>
>>> But why then do i get an empty string?
>>> I just want to see the soap message before it gets sent?
>>>
>>> DerMika wrote:
>>>>
>>>> Trace is enabled by default in Zend_Soap_Client. You don't have to
>>>> define it.
>>>>
>>>> Just use the getlastresponse and getlastrequest methods, they should
>>>> work.
>>>>
>>>> Dieter
>>>>
>>>> -----Original Message-----
>>>> From: jjsanders [mailto:jigalroecha@gmail.com]
>>>> Sent: dinsdag 28 oktober 2008 9:20
>>>> To: fw-webservices@lists.zend.com
>>>> Subject: Re: [fw-webservices] See the soap message
>>>>
>>>>
>>>> When i do $client = new Zend_Soap_Client($wsdl, array('trace' =>
> true));
>>>> I get the error message:
>>>> Fatal error: Uncaught exception 'Zend_Soap_Client_Exception' with
>>>> message
>>>> 'Unknown SOAP client option' in
>>>> /usr/local/wwwroot/jigal/library/Zend/Soap/Client.php:223 Stack
> trace:
>>>> #0
>>>> /usr/local/wwwroot/jigal/library/Zend/Soap/Client.php(122):
>>>> Zend_Soap_Client->setOptions(Array) #1
>>>> /usr/local/wwwroot/jigal/wstest.php(10):
>>>> Zend_Soap_Client->__construct('http://andijvie...', Array) #2 {main}
>>>> thrown
>>>> in /usr/local/wwwroot/jigal/library/Zend/Soap/Client.php on line 223
>>>>
>>>> Furthermore:
>>>>
>>>> this
>>>> $client = new Zend_Soap_Client($wsdl, $options);
>>>> $client ->setEncoding("UTF-8");
>>>> $client ->setSoapVersion(SOAP_1_1);
>>>> $bla = $client->getLastRequest();
>>>> Zend_Debug::dump($bla, 'bla',true);
>>>>
>>>> gives me an empty string.
>>>>
>>>>
>>>> beberlei wrote:
>>>>>
>>>>> yes, there are possibilities to see both request and response:
>>>>>
>>>>> $client = new Zend_Soap_Client($wsdl, array('trace' => true));
>>>>>
>>>>> $client->... do stuff;
>>>>>
>>>>> and then you can do:
>>>>>
>>>>> $client->getLastRequest();
>>>>> $client->getLastResponse();
>>>>> $client->getLastRequestHeaders();
>>>>> $client->getLastResponseHeaders();
>>>>>
>>>>> On Monday 27 October 2008 17:45:29 Jigal sanders wrote:
>>>>>> Hello everyone.
>>>>>>
>>>>>> I have the following test stuff for a soap message :
>>>>>>
>>>>>> <?
>>>>>> //if(is_dir('./library/')) echo "ja"; exit;
>>>>>> set_include_path('./library/');
>>>>>> require_once('Zend/Loader.php');
>>>>>> Zend_Loader::registerAutoload();
>>>>>> $wsdl = "http://buzz.nl/WSCRM/SubscriptionService?wsdl";
>>>>>> $client = new Zend_Soap_Client($wsdl);
>>>>>> $client ->setEncoding("UTF-8");
>>>>>> $client ->setSoapVersion(SOAP_1_1);
>>>>>>
>>>>>> Zend_Debug::dump($client, 'bla',true);
>>>>>>
>>>>>> ?>
>>>>>>
>>>>>> is there a way to see the acutal soap message in xml?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Benjamin Eberlei
>>>>> http://www.beberlei.de
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/See-the-soap-message-tp20191520p20202969.html
>>>> Sent from the Zend Web Services mailing list archive at Nabble.com.
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - http://www.avg.com
>>>> Version: 8.0.175 / Virus Database: 270.8.3/1748 - Release Date:
>>>> 27/10/2008 7:57
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/See-the-soap-message-tp20191520p20203472.html
>>> Sent from the Zend Web Services mailing list archive at Nabble.com.
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/See-the-soap-message-tp20191520p20206306.html
> Sent from the Zend Web Services mailing list archive at Nabble.com.
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.175 / Virus Database: 270.8.3/1748 - Release Date:
> 27/10/2008 22:44
>
>

--
View this message in context: http://www.nabble.com/See-the-soap-message-tp20191520p20209124.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

[fw-mvc] Best Practices for layout, view helpers and placeholders

Hi All,

I have a question about the best practices for displaying the output from
different controller/actions to different places in a page layout. Let me
ask he question by example.

Suppose I want to build a home page layout that has a header (with a logo,
some navigation and breadcrumbs), a main content area (that will have a
description of the site and links to various related articles and such), a
sidebar (with a login form and a web services output such as RSS or stock
quotes) and finally a footer. If I were to login, I would like to go to a
new layout with the same header and footer. That part does not seem to be
much of a problem. Where I need help is if the login fails I would like the
login form to redisplay in the sidebar (not in the content area) with the
error messages added and the content area to remain the same. What is the
best practice for doing this?

Thanks for your help,
Barry


--
View this message in context: http://www.nabble.com/Best-Practices-for-layout%2C-view-helpers-and-placeholders-tp20208592p20208592.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Multiple upload fields for one form element

Hello,

I am encountering a problem when working with Zend_Form_Element_File.

My problem would be that for one file form element i need to upload
multiple files. Aka: file[] file[] file[]

How do i add all those upload fields to form ? By adding multiple fields
eahc with same name as file[] ?

--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

Re: [fw-mvc] Flushing the Buffer Early in ZF

-- Daniel Skinner <skinner@destiny-denied.co.uk> wrote
(on Tuesday, 28 October 2008, 02:09 PM +0000):
> This is not going to be easy due to the nature of the MVC implementation.
>
> For starters, you can never be sure that the <head> is completely ready until
> all possible view scripts have been executed (as they may add CSS/JS etc...).
> By this time the entire response is ready so you might aswell send the full
> payload. Also, the YSlow rules suggest putting all JS including external
> scripts at the bottom you should only be putting <link type="text/css"> in the
> head and <script> belong just before </body> which reduces the effect this will
> have to CSS assets only. The best performance optimisation you can do is ensure
> that external assets are cached, 302'd and gzipped.
>
> Did you see much of a performance improvement by flushing previously? I would
> suggest benchmarking using flush against the standard MVC method (by simularing
> the additional processing time using wait()) just to check it's actually worth
> the fairly big compromise you would need to make.

Something else to test: determine how long it takes to generate the page
using the MVC. You can do this using microtime() surrounding the call to
dispatch(). In most cases, I'm going to guess it's going to be < 1s.

The next thing to test then is the actual size of the payload. If the
HTML is relatively well-structured and not displaying hundreds of
database results, most likely you will have nothing to gain by flushing
early.

As Daniel suggests, most likely the best things you can do with regards
to CSS and JS are to include them at the most optimal locations in your
document, and ensure that you have appropriate HTTP-level caching of
them (and optional compression).

For the ZF side, if you're noticing that the page loads are slow due to
actual processing, start caching. Zend_Cache is definitely a viable
option, but don't skip less obvious solutions such as memcached, APC, or
Zend Platform's dynamic content cache.


> Sandeep Manne wrote:
>
> Hi
>
> While trying to improve the performance of our customer's website we came
> to know about early flushing the buffers as soon as the headers is
> processed so that the css and js files will download before the body is
> processed. I want to know whether there is any method in Zend Framework to
> do this early flushing the buffer.
>
> Reference:
> http://developer.yahoo.com/performance/rules.html
>
> --
> Regards
> Sandeep Manne
> S/W Engineer
> Sourcebits
>

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

Re: [fw-mvc] Flushing the Buffer Early in ZF

That should read 'cached, 304'd and gzipped'

Kind Regards,

Daniel Skinner



Daniel Skinner wrote:
Hi,

This is not going to be easy due to the nature of the MVC implementation.

For starters, you can never be sure that the <head> is completely ready until all possible view scripts have been executed (as they may add CSS/JS etc...). By this time the entire response is ready so you might aswell send the full payload. Also, the YSlow rules suggest putting all JS including external scripts at the bottom you should only be putting <link type="text/css"> in the head and <script> belong just before </body> which reduces the effect this will have to CSS assets only. The best performance optimisation you can do is ensure that external assets are cached, 302'd and gzipped.

Did you see much of a performance improvement by flushing previously? I would suggest benchmarking using flush against the standard MVC method (by simularing the additional processing time using wait()) just to check it's actually worth the fairly big compromise you would need to make.

Kind Regards,

Daniel Skinner



Sandeep Manne wrote:
Hi

While trying to improve the performance of our customer's website we came to know about early flushing the buffers as soon as the headers is processed so that the css and js files will download before the body is processed. I want to know whether there is any method in Zend Framework to do this early flushing the buffer.

Reference:
http://developer.yahoo.com/performance/rules.html

--
Regards
Sandeep Manne
S/W Engineer
Sourcebits

Re: [fw-mvc] Flushing the Buffer Early in ZF

Hi,

This is not going to be easy due to the nature of the MVC implementation.

For starters, you can never be sure that the <head> is completely ready until all possible view scripts have been executed (as they may add CSS/JS etc...). By this time the entire response is ready so you might aswell send the full payload. Also, the YSlow rules suggest putting all JS including external scripts at the bottom you should only be putting <link type="text/css"> in the head and <script> belong just before </body> which reduces the effect this will have to CSS assets only. The best performance optimisation you can do is ensure that external assets are cached, 302'd and gzipped.

Did you see much of a performance improvement by flushing previously? I would suggest benchmarking using flush against the standard MVC method (by simularing the additional processing time using wait()) just to check it's actually worth the fairly big compromise you would need to make.

Kind Regards,

Daniel Skinner



Sandeep Manne wrote:
Hi

While trying to improve the performance of our customer's website we came to know about early flushing the buffers as soon as the headers is processed so that the css and js files will download before the body is processed. I want to know whether there is any method in Zend Framework to do this early flushing the buffer.

Reference:
http://developer.yahoo.com/performance/rules.html

--
Regards
Sandeep Manne
S/W Engineer
Sourcebits