RE: [fw-general] ZF1: problem logging to Firebug console

2012-08-06 Thread Sergio Rinaudo

Hi Mike,
I had the same problem in the past, 
for me the solution was to enable the 'net' panel of Firebug.
Do you have it enabled?

Cheers

Sergio Rinaudo




> Date: Mon, 6 Aug 2012 10:32:37 -0700
> From: mike.wri...@mailinator.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] ZF1: problem logging to Firebug console
> 
> Hi all,
> 
> Using ZF1 on Fedora 14, Firefox 13, Firebug 1.10.2.
> 
> This is a stumper.  It used to work but stopped.
> 
> The following is in my Bootstrap.php:
> 
> protected function _initLog()
> {
>$log = new Zend_Log();
>$log->addWriter(new Zend_Log_Writer_Firebug());
>return $log;
> }
> 
> To use it I pull it into a Controller and then call it like so:
> 
> $this->log->info('some stuff to log');
> 
> Now looking at the Firebug console nothing shows up but if I inspect the 
> headers I see that all of the WildFire stuff is there and contains the 
> desired log data.
> 
> Does anybody have any idea what could be wrong?  Is there perhaps some 
> global that needs to be enabled for it to display?
> 
> Having to inspect headers or dump the log data into a View is 
> inefficient and tedious.
> 
> Thanks for any insight,
> Mike Wright
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

  

FW: [fw-general] XML Navigation: how to get params value from request

2011-10-05 Thread Sergio Rinaudo

Thank you Frank, 
with your help I wrote this plugin that makes the navigation works as I needed, 
basically it checks if an xml page has a parameter that exists in the request, 
and eventually sets the param.

If needed, the "reset" xml custom param can be implemented. 

getRequest()->getParams();
 $container = Zend_Registry::get('Zend_Navigation');
$this->_recursiveParamsSetter( $container, $params );
 }
 
 /**
  * Recursiveli apply params value to pages
  * 
  * @return void
  */
 protected function _recursiveParamsSetter( $container, $params ) {
   if( $container instanceof Zend_Navigation_Container ) {
if( $container->hasChildren() ) {
foreach( $container AS $page ) {
  if( $page instanceof Zend_Navigation_Page_Mvc) {
$pageParams = $page->get('params');
$page->setParams( array_intersect_key($params, 
$pageParams) );
   }
 $this->_recursiveParamsSetter( $page, $params );
        }
}
}
}
}

Sergio Rinaudo


> To: fw-general@lists.zend.com
> Date: Tue, 4 Oct 2011 15:09:36 +0200
> From: d...@froschdesignstudio.de
> Subject: Re: [fw-general] XML Navigation: how to get params value from request
> 
> Am 04.10.2011, 14:50 Uhr, schrieb Sergio Rinaudo  
> :
> 
> >
> > Dear ZF list,
> > I have this little problem with Zend Navigation and XML, my breadcrumbs  
> > look like this:
> >
> > home => users => customers-list => customer-branches =>  
> > customer-branch-edit
> >
> > To access "customer-branches" page I need to have an user_id param.
> > To access "customer-branch-edit" page I need to have an user_id param  
> > and also a branch_id param.
> >
> > If I am in the "customer-branch-edit" page I haven't found a way to make  
> > the breadcrumb link to "customer-branches" ( but also to  
> > "customer-branch-edit" )
> > render in the correct manner ( with the 'user_id' passed via GET ).
> >
> > I added the param "user_id" to the XML navigation
> >
> > 
> > 
> > 
> >
> > and even if I have the "reset" set to false ( false ),  
> > apparently there is no way to render the value from the request.
> >
> > For sure I am mistaking something.
> >
> > How to solve this?
> 
> For example: Create an controller plugin.
> 
> class Application_Plugin_Navigation extends Zend_Controller_Plugin_Abstract
> {
>  /**
>   *
>   * @param Zend_Controller_Request_Abstract $request
>   */
>  public function postDispatch(Zend_Controller_Request_Abstract $request)
>  {
>  // Check controller and action
>  if ('customer' == $request->getControllerName()
>  && 'branches' == $request->getActionName())
>  {
>  // Get navigation container
>  $container = Zend_Registry::get('Zend_Navigation');
> 
>  // Get page
>  $page = $container->findOneBy('route', $routeName);
> 
>  if ($page instanceof Zend_Navigation_Page_Mvc) {
>  // Set parameter (ID)
>  $page->setParams(array('user_id' =>  
> $request->getParam('id')));
>  }
>  }
>  }
> }
> 
> 
> I prefer naming conventions for all routes: "controllerAction" and  
> "moduleControllerAction".
> In your case: "customerBranches" and "customersList"
> 
> In the plugin you can check:
> 
> // Create route name
> $route = strtolower($request->getControllerName())
> . ucfirst(strtolower($request->getActionName()));
> 
> // Check current route
> switch ($route) {
>  case 'customerBranches':
>  case 'customersList':
>  // ...
>  break;
> 
>  default:
>  break;
> }
> 
> http://framework.zend.com/manual/de/zend.controller.plugins.html
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

  

[fw-general] XML Navigation: how to get params value from request

2011-10-04 Thread Sergio Rinaudo

Dear ZF list, 
I have this little problem with Zend Navigation and XML, my breadcrumbs look 
like this:

home => users => customers-list => customer-branches => customer-branch-edit

To access "customer-branches" page I need to have an user_id param.
To access "customer-branch-edit" page I need to have an user_id param and also 
a branch_id param.

If I am in the "customer-branch-edit" page I haven't found a way to make the 
breadcrumb link to "customer-branches" ( but also to "customer-branch-edit" ) 
render in the correct manner ( with the 'user_id' passed via GET ).

I added the param "user_id" to the XML navigation





and even if I have the "reset" set to false ( false ), 
apparently there is no way to render the value from the request.

For sure I am mistaking something.

How to solve this?

I hope in your kind help and advices.
Thank you!

Sergio


  

RE: [fw-general] Zend_Form and getValidValues

2011-09-19 Thread Sergio Rinaudo

Hi Konr , 

yes, you're right, I was mistaking in another part of my code and also not to 
pass tha required argument, 

I've found it a few minutes after I opened this post and replied to 
my own question, but I see the message "This post has NOT been accepted 
by the mailing list yet." so maybe you cannot see it.


However, thank you for your answer, is always good to have some good advice 
from a friend!


Regards


Sergio Rinaudo




> Date: Mon, 19 Sep 2011 14:11:14 -0500
> Subject: Re: [fw-general] Zend_Form and getValidValues
> From: konrn...@gmail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> 
> I don't think getValidValues() is the right method for your needs.
> 
> When you call isValid($data) on a form, the form elements are
> populated and validated. getValidValues() is expecting a parameter of
> $data as well, but in looking through the code it looks like it passes
> on values that don't exist in the form.
> 
> So, instead you should just call getValues() on the form. This will
> return only the values for form elements that exist in the form.
> 
> Konr
> 
> On Thu, Sep 15, 2011 at 4:50 PM, Sergio Rinaudo
>  wrote:
> >
> > Hello Everyone,
> > I am a bit confused with the "getValidValues" method of Zend_Form.
> > I am using ZF 1.11.10.
> >
> > I'll explain my problem:
> >
> > I'm trying to get all the valid values of the $data array.
> >
> > $isValid = $form->isValid( $data );
> >
> >if( $isValid ) {
> >$validValues = $form->getValidValues();
> >Zend_Debug::dump( $validValues, 'validValues' ); exit;
> >} else {
> > Zend_Debug::dump( $form->getErrors() ); exit;
> >}
> >
> > If $data contains keys that are not form elements, $validValues will 
> > contains them.
> > Is that the correct behaviour of this method?
> >
> > The result I would is an array of data that is valid and is present as a 
> > form element, discarding what is not present,
> > is there any way to accomplish this using Zend Form methods or maybe am I 
> > mistaking something?
> >
> > Thanks
> >
> > Sergio
> >
> >
> >
  

[fw-general] Zend_Form and getValidValues

2011-09-15 Thread Sergio Rinaudo

Hello Everyone, 
I am a bit confused with the "getValidValues" method of Zend_Form.
I am using ZF 1.11.10.

I'll explain my problem:

I'm trying to get all the valid values of the $data array.

$isValid = $form->isValid( $data );

if( $isValid ) {
$validValues = $form->getValidValues();
Zend_Debug::dump( $validValues, 'validValues' ); exit;
} else {
 Zend_Debug::dump( $form->getErrors() ); exit;
}

If $data contains keys that are not form elements, $validValues will contains 
them.
Is that the correct behaviour of this method?

The result I would is an array of data that is valid and is present as a form 
element, discarding what is not present,
is there any way to accomplish this using Zend Form methods or maybe am I 
mistaking something?

Thanks

Sergio


  

RE: [fw-general] Best practice with routes management using separate .ini

2011-08-17 Thread Sergio Rinaudo

Thank you Hector for your suggestion, it helped me.
I thought there was some sort of self-recognition in ZF by calling the file 
with that name.

And also I use bootstrap resource a lot and I like them so much.

Bye!

Sergio Rinaudo


> From: djvir...@gmail.com
> Date: Mon, 15 Aug 2011 14:57:44 -0700
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Best practice with routes management using separate 
> .ini
> 
> I suggest creating a new bootstrap resource plugin by the same name
> "router", extend the ZF one, and add your own logic to pull the config from
> a separate file.
> 
> Something like this should do the trick:
> 
> http://pastie.org/2377345
> 
> Then update your application.ini with this line:
> 
> resources.router.configPath = APPLICATION_PATH "/configs/routes.ini"
> 
> The benefit is that you can still leverage the logic in the original ZF
> router bootstrap resource plugin and pretty much copy/paste the routes from
> application.ini to routes.ini. Just remove "resources." from the beginning
> of each line.
> 
> I hope this helps!
> 
> --
> *Hector Virgen*
> http://www.virgentech.com
> Follow me on Twitter: @djvirgen <http://twitter.com/djvirgen>
> 
> 
> 
> On Mon, Aug 15, 2011 at 1:47 PM, Sergio Rinaudo 
> wrote:
> 
> >
> > Hi all,
> > in my ZF project I have lots of different routes that now are defined
> > within the application.ini using the "resources.router",
> > resources.router.routes.login.* for example .
> >
> > Searching on the web I found that some people are using a separate ini file
> > only for routes, called route.ini or routes.ini, omitting the
> > "resources.router" part when adding a route.
> >
> > So my questions are:
> >
> > - is it a good practice to store route configuration in a separate file?
> > - is there a standard name for this file?
> > - how and where load it?
> > - I've already an idea about the above questions answers,  so I give it a
> > try, and loading the routes with  "resources.router" throws a
> > Zend_Controller_Router_Exception 'No route configuration in section
> > 'routes'', why?
> >
> > Thanks to everyone will help me to make it clear.
> >
> > Regards
> >
> > Sergio Rinaudo
> >
  

[fw-general] Best practice with routes management using separate .ini

2011-08-15 Thread Sergio Rinaudo

Hi all, 
in my ZF project I have lots of different routes that now are defined within 
the application.ini using the "resources.router", 
resources.router.routes.login.* for example .

Searching on the web I found that some people are using a separate ini file 
only for routes, called route.ini or routes.ini, omitting the 
"resources.router" part when adding a route.

So my questions are:

- is it a good practice to store route configuration in a separate file?
- is there a standard name for this file?
- how and where load it?
- I've already an idea about the above questions answers,  so I give it a try, 
and loading the routes with  "resources.router" throws a 
Zend_Controller_Router_Exception 'No route configuration in section 'routes'', 
why?

Thanks to everyone will help me to make it clear.

Regards

Sergio Rinaudo
  

[fw-general] Custom Muklticheckbox Validator not firing

2011-04-26 Thread Sergio Rinaudo

Hi All, 
I did a custom validator for a multicheckbox field that I use in two different 
forms, the 'registration' form and the 'account edit' form, 
it works perfectly in the 'account edit' form, but it seems to be never fired 
in the 'registration' form.
Both forms are pretty similar.

This is how I add the field ( and its validator ) to my form

$this->myMulticheckboxElement()->setAllowEmpty( false )
->setRegisterInArrayValidator( false )->addValidator( new 
My_Validate_MultiCheckboxRange( array( 'min' => 2 ) ) ),


The validator My_Validate_MultiCheckboxRange checks if the selected box are at 
least the number specified by the 'min' value.

Any explanation for this issue?

Thanks


Sergio Rinaudo




  

RE: [fw-general] Little help with Zend Date

2011-04-11 Thread Sergio Rinaudo

At the moment I've fixed it using try-catch

Sergio

> From: kaiohken1...@hotmail.com
> To: fw-general@lists.zend.com
> Date: Mon, 11 Apr 2011 13:14:46 +0200
> Subject: [fw-general] Little help with Zend Date
> 
> 
> Hi All, 
> I have a little problem with Zend Date and date conversion using translated 
> date strings.
> Actually I'm doing tests using italian and english locale
> 
> If I do:
> 
> $lcode = 'it_IT';
> $value = '11 Aprile 2011';
> $inputFormat = 'dd  ';
> $outputFormat = '-MM-dd';
> 
> $locale = new Zend_Locale( $lcode );
> $date = new Zend_Date($value, $inputFormat, $locale);
> echo ucwords( $date->toString( $outputFormat ) );
> 
> I get the error: Unable to parse date '11 Aprile 2011' using 'dd  ' 
> (M <> d)
> 
> while if I use lowercase date value it works.
> 
> 
> 
> If I use english locale and string
> 
> $lcode = 'en_EN';
> $value = '11 april 2011';
> $inputFormat = 'dd  ';
> $outputFormat = '-MM-dd';
> 
> $locale = new Zend_Locale( $lcode );
> $date = new Zend_Date($value, $inputFormat, $locale);
> echo $date->toString( $outputFormat );
> 
> I get the error: Unable to parse date '11 april 2011' using 'dd  ' (M 
> <> d)
> 
> while if I use first letter capitalized date value it works.
> 
> 
> Is this a normal behaviour? Any advices on how to fix?
> 
> 
> Thanks
> 
> 
> 
> Sergio Rinaudo
> 
> 
> 
  

[fw-general] Little help with Zend Date

2011-04-11 Thread Sergio Rinaudo

Hi All, 
I have a little problem with Zend Date and date conversion using translated 
date strings.
Actually I'm doing tests using italian and english locale

If I do:

$lcode = 'it_IT';
$value = '11 Aprile 2011';
$inputFormat = 'dd  ';
$outputFormat = '-MM-dd';

$locale = new Zend_Locale( $lcode );
$date = new Zend_Date($value, $inputFormat, $locale);
echo ucwords( $date->toString( $outputFormat ) );

I get the error: Unable to parse date '11 Aprile 2011' using 'dd  ' (M 
<> d)

while if I use lowercase date value it works.



If I use english locale and string

$lcode = 'en_EN';
$value = '11 april 2011';
$inputFormat = 'dd  ';
$outputFormat = '-MM-dd';

$locale = new Zend_Locale( $lcode );
$date = new Zend_Date($value, $inputFormat, $locale);
echo $date->toString( $outputFormat );

I get the error: Unable to parse date '11 april 2011' using 'dd  ' (M 
<> d)

while if I use first letter capitalized date value it works.


Is this a normal behaviour? Any advices on how to fix?


Thanks



Sergio Rinaudo


  

RE: [fw-general] how to use json action context?

2011-03-07 Thread Sergio Rinaudo

Hi, 
there is another possible solution, in your controller init() methos

$this->getRequest()->setParam('format','json');

Hope it helps
Cheers

Sergio Rinaudo



> Date: Mon, 7 Mar 2011 08:33:49 -0600
> From: caphrim...@gmail.com
> To: asthral...@gmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] how to use json action context?
> 
> Well, I wasn't expecting that code response Kizano. It's almost
> verbatim to what I did as a quick work around. How dare you peek at my
> code :-P
> 
> Thanks for both yours and Hector's responses. They were both helpful
> and provided enough info that I can work the rest of it out.
> 
> Thanks!
> -Tim
> 
> On Mon, Mar 7, 2011 at 12:25 AM, Markizano Draconus
>  wrote:
> > Hey Tim,
> >
> > You could add something to disable the layout and set the proper headers:
> > In the controller, under init() or the action you want to execute:
> >
> >
> > $this->_helper->layout->disableLayout();
> > $this->_response->setHeader('Content-Type', 'application/json');
> > $this->view->json = array(
> >  'status' => 'ok',
> >  'message' => 'This is a status message.',
> > );
> >
> >
> > In application/scripts/view/index/index.phtml (or wherever your view scripts
> > are):
> >
> > json; ?>
> >
> > It's probably looking for error.phtml because it's missing the view scripts
> > for the error controller to render the HTML for the error and exceptions.
> > Try adding that and your debugging might be  made a bit easier ;)
> >
> >
> > Hope this helps,
> > -Kizano
> > //-
> > Information Security
> > eMail: asthral...@gmail.com
> > http://www.markizano.net/
> >
> > On 03/06/2011 10:49 PM, Tim wrote:
> >>
> >> I can't seem to get my controllers to recognize that I only want them
> >> to display json. Here's my controller
> >>
> >>  >>
> >> class IndexController extends Zend_Controller_Action {
> >> public function init() {
> >> $this->_helper->contextSwitch()
> >> ->clearContexts()
> >> ->clearActionContexts()
> >> ->setDefaultContext('json')
> >> ->initContext('json');
> >> }
> >>
> >> public function indexAction() {
> >> $this->view->assign(array(
> >> 'status' =>  'ok',
> >> 'message' =>  'This is the index action'
> >> ));
> >> }
> >> }
> >>
> >> ?>
> >>
> >>
> >> All I want to do is, by default, output everything as json. I don't
> >> want to have to send a "format=json" parameter in the URL.
> >>
> >> According to
> >> http://framework.zend.com/manual/en/zend.controller.actionhelpers.html
> >> I should be able to do this, but the above controller results in the
> >> error
> >>
> >> Fatal error: Uncaught exception 'Zend_View_Exception' with message
> >> 'script 'error/error.phtml' not found in path
> >>
> >> What am I missing?
> >>
> >> Thanks,
> >> Tim
> >
  

[fw-general] Zend Search Lucene and CPU abuse

2011-02-25 Thread Sergio Rinaudo

Hi All, 
today I got my hosting suspended because of a process related with 
Zend_Search_Lucene.

The only thing they told me is the stack trace of the process that caused the 
abuse, 
but I cannot recognize which was the request that caused the issue.

So my question is a bit generic:

if I have cpu usage problem with Zend_Search_Lucene, 
what could be a common error that I might have done speaking about query the 
index or add a document to the index?

Thanks for all suggestions

Sergio

The process stack trace:

lsof -p 31400

COMMAND   PID USER   FD   TYPE DEVICE SIZE   NODE NAME

lsphp5  31400 neobazaa  cwdDIR  253,0 4096  128125283 
/home/neobazaa/public_html

lsphp5  31400 neobazaa  rtdDIR  253,0 4096  2 /

lsphp5  31400 neobazaa  txtREG  253,0 22430803   47710306 
/usr/local/lsws/fcgi-bin/lsphp-5.2.16

lsphp5  31400 neobazaa  memREG  253,0   543824   46738614 
/usr/lib64/libfreetype.so.6.3.10

lsphp5  31400 neobazaa  memREG  253,0   212896   46737366 
/usr/lib64/libfontconfig.so.1.1.0

lsphp5  31400 neobazaa  memREG  253,0  2232965   46736358 
/usr/lib64/libMagickWand.so.1.0.0

lsphp5  31400 neobazaa  memREG  253,0  5283055   46734839 
/usr/lib64/libMagickCore.so.1.0.0

lsphp5  31400 neobazaa  memREG  253,01  121569466 
/lib64/libcom_err.so.2.1

lsphp5  31400 neobazaa  memREG  253,0   139416  121569320 
/lib64/ld-2.5.so

lsphp5  31400 neobazaa  memREG  253,0  1718120  121569450 
/lib64/libc-2.5.so

lsphp5  31400 neobazaa  memREG  253,023360  121569656 
/lib64/libdl-2.5.so

lsphp5  31400 neobazaa  memREG  253,0   145824  121569657 
/lib64/libpthread-2.5.so

lsphp5  31400 neobazaa  memREG  253,0   615136  121569581 
/lib64/libm-2.5.so

lsphp5  31400 neobazaa  memREG  253,085608   46748191 
/usr/lib64/libz.so.1.2.3

lsphp5  31400 neobazaa  memREG  253,053448  121569664 
/lib64/librt-2.5.so

lsphp5  31400 neobazaa  memREG  253,0   247496  121569751 
/lib64/libsepol.so.1

lsphp5  31400 neobazaa  memREG  253,095464  121569757 
/lib64/libselinux.so.1

lsphp5  31400 neobazaa  memREG  253,0   114352  121569601 
/lib64/libnsl-2.5.so

lsphp5  31400 neobazaa  memREG  253,048600  121569667 
/lib64/libcrypt-2.5.so

lsphp5  31400 neobazaa  memREG  253,092736  121570046 
/lib64/libresolv-2.5.so

lsphp5  31400 neobazaa  memREG  253,098920  121569291 
/lib64/libaudit.so.0.0.0

lsphp5  31400 neobazaa  memREG  253,0 9472  121569768 
/lib64/libkeyutils-1.2.so

lsphp5  31400 neobazaa  memREG  253,0   143144  121569769 
/lib64/libexpat.so.0.5.0

lsphp5  31400 neobazaa  memREG  253,022032   46748531 
/usr/lib64/libXdmcp.so.6.0.0

lsphp5  31400 neobazaa  memREG  253,071608   46748537 
/usr/lib64/libXpm.so.4.11.0

lsphp5  31400 neobazaa  memREG  253,0   204600   46748498 
/usr/lib64/libidn.so.11.5.19

lsphp5  31400 neobazaa  memREG  253,0   138936   46746258 
/usr/lib64/libjpeg.so.62.0.0

lsphp5  31400 neobazaa  memREG  253,012040   46748526 
/usr/lib64/libXau.so.6.0.0

lsphp5  31400 neobazaa  memREG  253,0  1099816   46748533 
/usr/lib64/libX11.so.6.2.0

lsphp5  31400 neobazaa  memREG  253,067792   46748193 
/usr/lib64/libbz2.so.1.0.3

lsphp5  31400 neobazaa  memREG  253,037368  121569571 
/lib64/libwrap.so.0.7.6

lsphp5  31400 neobazaa  memREG  253,0   149344   46735858 
/usr/lib64/libpng12.so.0.10.0

lsphp5  31400 neobazaa  memREG  253,0  5410473   46740722 
/usr/lib64/libmysqlclient.so.16.0.0

lsphp5  31400 neobazaa  memREG  253,029952   46735070 
/usr/lib64/libltdl.so.3.1.4

lsphp5  31400 neobazaa  memREG  253,072424   46746216 
/usr/lib64/libXext.so.6.4.0

lsphp5  31400 neobazaa  memREG  253,098624   46740646 
/usr/lib64/libICE.so.6.3.0

lsphp5  31400 neobazaa  memREG  253,044232   46748524 
/usr/lib64/libSM.so.6.0.0

lsphp5  31400 neobazaa  memREG  253,0  1366272  121569306 
/lib64/libcrypto.so.0.9.8e

lsphp5  31400 neobazaa  memREG  253,0   315032  121569480 
/lib64/libssl.so.0.9.8e

lsphp5  31400 neobazaa  memREG  253,0   608680   46746867 
/usr/lib64/libnetsnmp.so.10.0.3

lsphp5  31400 neobazaa  memREG  253,058400  121569503 
/lib64/libgcc_s-4.1.2-20080825.so.1

lsphp5  31400 neobazaa  memREG  253,0   976312   46731193 
/usr/lib64/libstdc++.so.6.0.8

lsphp5  31400 neobazaa  memREG  253,046800  121569505 
/lib64/libpa

[fw-general] RE: Send xml to webservice

2011-02-04 Thread Sergio Rinaudo

Hi All, 
any advices for this issue?
Thank you

Sergio




From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Subject: Send xml to webservice
Date: Thu, 3 Feb 2011 21:00:35 +0100








Hi all, 
I'm going to develop an application that must send an XML request to a 
webservice.
What's your advice of which ZF component to use for this task?

Is it possible do this using Zend_Rest_Client?

Thanks

Sergio
  

RE: [fw-general] Lucene Range query and numbers

2011-01-06 Thread Sergio Rinaudo

Ok, 
I've apparently found a solution, threat numbers as strings, 
if the numer is 10 I save  "s10" in the document, 
and query it like

price:[s02 TO s19]

If anyone have a better solution please let me know!

Sergio






> From: kaiohken1...@hotmail.com
> To: fw-general@lists.zend.com
> Date: Thu, 6 Jan 2011 16:21:24 +0100
> Subject: [fw-general] Lucene Range query and numbers
> 
> 
> Hi all, 
> I get unexpected results using Lucene Range Query for number fields, 
> for example if the field is 'price' and the value is 19, I do not get the 
> document in the result using the query
> 
> price:[2 TO 190001] or price:[2 TO 19]
> 
> and I get it with this query
> 
> price:[100 TO 19] // the initial bound is 1 million...
> 
> So my question is, how to range filter documents with numeric value fields ?
> 
> 
> Thanks
> 
> 
> Sergio
> 
> 
> 
  

[fw-general] Lucene Range query and numbers

2011-01-06 Thread Sergio Rinaudo

Hi all, 
I get unexpected results using Lucene Range Query for number fields, 
for example if the field is 'price' and the value is 19, I do not get the 
document in the result using the query

price:[2 TO 190001] or price:[2 TO 19]

and I get it with this query

price:[100 TO 19] // the initial bound is 1 million...

So my question is, how to range filter documents with numeric value fields ?


Thanks


Sergio


  

RE: [fw-general] Distance filtering using Lucene

2011-01-05 Thread Sergio Rinaudo

Thanks Leander, 
it was very interesting, exactly what I'm looking for.

It would be awesome to have this feature inside Zend Framework in the future, 
it is possible to request it?

Thanks

Sergio






> From: m...@leander-damme.com
> Date: Wed, 5 Jan 2011 00:01:10 +0100
> CC: fw-general@lists.zend.com
> To: kaiohken1...@hotmail.com
> Subject: Re: [fw-general] Distance filtering using Lucene
> 
> Hey Sergio,
> 
> you may find the follwing Blog post interesting.
> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/
> (https://issues.apache.org/jira/browse/LUCENE-1732)
> 
> But as Zend_Lucene is a pure PHP implementation
> you probably won't directly profit from the Spatial Lucene contribution 
> (Apache Lucene /java).
> 
> Leander
> 
> 
> Am 04.01.2011 um 17:49 schrieb Sergio Rinaudo:
> 
> > 
> > Thank you Mark for your reply.
> > So, as I thought, there is no solution doing this work using Lucene?
> > 
> > Thanks
> > 
> > Sergio
> > 
> > 
> > 
> > 
> > 
> > 
> >> Date: Sat, 1 Jan 2011 19:09:11 -0700
> >> From: sparkymeis...@gmail.com
> >> To: kaiohken1...@hotmail.com
> >> CC: fw-general@lists.zend.com
> >> Subject: Re: [fw-general] Distance filtering using Lucene
> >> 
> >> I don't have any experience with lucene but I do have experience with
> >> querying geographic coordinates based on distance. If you were using
> >> mysql or postgis you could store the coordinates as a point data type
> >> and use a length or distance function to limit the result. Not sure
> >> how lucene works but you will probably need to use math to calculate
> >> the distance. If your coordinates are in degrees the math will be more
> >> complex since a distance of 1 degree is different depending on the
> >> direction and where it is. For example, 1 degree north is always the
> >> same but one degree west is much farther at the equator than it is
> >> nearer the poles. Converting the points to a projection that uses
> >> meters instead of degrees would probably make the math easier.
> >> 
> >> I quickly glanced through the Zend_Search_Lucene docs on querying and
> >> didn't see any math functions so you may need to do a search that
> >> brings back everything regardless of distance and then do the math
> >> separately to filter out everything outside your distance range. I'm
> >> sure you have your reasons for using lucene over sql but this could be
> >> a reason to use sql instead. You can review the mysql spatial
> >> extensions here:
> >> http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html
> >> 
> >> Could you store ids and coordinates in a db, query that for distance
> >> and then do a lucene search that's limited to those ids? Using sql for
> >> the distance query has the added benefit of using a spatial index for
> >> improved performance.
> >> 
> >> 
> >> 
> >> 
> >> Mark
> >> 
> >> On Sat, Jan 1, 2011 at 4:32 PM, Sergio Rinaudo  
> >> wrote:
> >>> 
> >>> Hi all,
> >>> if I have the longitude and latitude stored in my lucene documents and I 
> >>> want to get all the documents from the index
> >>> that are distant of a certain value from another longitude and latitude 
> >>> pair, what is the best or good solution to do that?
> >>> 
> >>> Thanks
> >>> 
> >>> Sergio
> >>> 
> >>> 
> >> 
> >> 
> >> 
> >> -- 
> >> Have fun or die trying - but try not to actually die.
> >   
> 
> 
  

RE: [fw-general] Distance filtering using Lucene

2011-01-04 Thread Sergio Rinaudo

Thank you Mark for your reply.
So, as I thought, there is no solution doing this work using Lucene?

Thanks

Sergio






> Date: Sat, 1 Jan 2011 19:09:11 -0700
> From: sparkymeis...@gmail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Distance filtering using Lucene
> 
> I don't have any experience with lucene but I do have experience with
> querying geographic coordinates based on distance. If you were using
> mysql or postgis you could store the coordinates as a point data type
> and use a length or distance function to limit the result. Not sure
> how lucene works but you will probably need to use math to calculate
> the distance. If your coordinates are in degrees the math will be more
> complex since a distance of 1 degree is different depending on the
> direction and where it is. For example, 1 degree north is always the
> same but one degree west is much farther at the equator than it is
> nearer the poles. Converting the points to a projection that uses
> meters instead of degrees would probably make the math easier.
> 
> I quickly glanced through the Zend_Search_Lucene docs on querying and
> didn't see any math functions so you may need to do a search that
> brings back everything regardless of distance and then do the math
> separately to filter out everything outside your distance range. I'm
> sure you have your reasons for using lucene over sql but this could be
> a reason to use sql instead. You can review the mysql spatial
> extensions here:
> http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html
> 
> Could you store ids and coordinates in a db, query that for distance
> and then do a lucene search that's limited to those ids? Using sql for
> the distance query has the added benefit of using a spatial index for
> improved performance.
> 
> 
> 
> 
> Mark
> 
> On Sat, Jan 1, 2011 at 4:32 PM, Sergio Rinaudo  
> wrote:
> >
> > Hi all,
> > if I have the longitude and latitude stored in my lucene documents and I 
> > want to get all the documents from the index
> > that are distant of a certain value from another longitude and latitude 
> > pair, what is the best or good solution to do that?
> >
> > Thanks
> >
> > Sergio
> >
> >
> 
> 
> 
> -- 
> Have fun or die trying - but try not to actually die.
  

[fw-general] Distance filtering using Lucene

2011-01-01 Thread Sergio Rinaudo

Hi all, 
if I have the longitude and latitude stored in my lucene documents and I want 
to get all the documents from the index
that are distant of a certain value from another longitude and latitude pair, 
what is the best or good solution to do that?

Thanks

Sergio

  

FW: [fw-general] RE: Get full html response in a plugin

2010-12-24 Thread Sergio Rinaudo

Hi David, 
thanks for your reply, 
it helped me a lot!

Cheers,
Sergio




> Date: Wed, 22 Dec 2010 20:28:56 -0800
> From: davidkmuir+z...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] RE: Get full html response in a plugin
> 
> 
> Sergio,
> 
> Compression by the web-server (eg. mod_deflate) will be your best bet.
> Otherwise, the cost of minifying the html would probably far outweigh*
> whatever gains you might get from the reduced bandwidth.
> 
> *I don't have any actual numbers to back up that claim.
> 
> Also see:
> http://stackoverflow.com/questions/466437/minifying-html
> 
> Cheers,
> David
> -- 
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Get-full-html-response-in-a-plugin-tp3161501p3161625.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  

RE: [fw-general] Get full html response in a plugin

2010-12-22 Thread Sergio Rinaudo

Hi Hector, 
it perfectly worked!

Do you think is a good idea minify the html response in this way to increase 
performances?

Thank you very much for your help

Sergio




Date: Wed, 22 Dec 2010 19:35:23 -0800
Subject: Re: [fw-general] Get full html response in a plugin
From: djvir...@gmail.com
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com

You'll need to register your plugin after the layout plugin, which I believe is 
registered in position 100. Try this:
$front->registerPlugin($myplugin, 150);
Also don't forget to return early in your post-dispatch hook if the request is 
not marked as dispatched (meaning a forward was detected):
if (!$request->isDispatched()) {

return;

}
--

Hector Virgen

Sent from my Droid X
On Dec 22, 2010 4:53 PM, "Sergio Rinaudo"  wrote:
> 
> Hi all, 
> how to get and set the full html response in a plugin?

> 
> I'm trying to minify the html response but apparently I cannot get and set 
> the the full html response using response object's
> getBody/setBody methods.
> 
> I am currently working inside the postDispatch hook in my test plugin.

> 
> 
> Thanks for any help.
> 
> 
> Sergio
> 
> 
> 
  

[fw-general] Get full html response in a plugin

2010-12-22 Thread Sergio Rinaudo

Hi all, 
how to get and set the full html response in a plugin?

I'm trying to minify the html response but apparently I cannot get and set the 
the full html response using response object's
getBody/setBody methods.

I am currently working inside the postDispatch hook in my test plugin.


Thanks for any help.


Sergio


  

RE: [fw-general] Seeking guidance on implementing ACL

2010-12-22 Thread Sergio Rinaudo

Hi, 

you don't need assertion to check if a role has certain permission to a 
resource, 

just deny it.

The official documentation explains the use of ACL pretty well with examples



http://framework.zend.com/manual/en/zend.acl.refining.html


Bye


Sergio 








> Date: Wed, 22 Dec 2010 02:59:49 -0800
> From: jiewm...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] Seeking guidance on implementing ACL
> 
> 
> Suppose I have the following models/resources
> 
> - Projects (has many Lists)
> - Lists
> 
> I want only owners of the project to be able to add lists. How can I
> implement that in Zend_Acl? I think Assertion are the the way to go. But how
> does 
> 
> $acl->allow($user, $project, 'add', $assertion); // for add list make
> sense, I must somehow get the project object from what I will normally use
> to test if user is allowed?
> $acl->isAllowed($user, 'lists', 'add')
> -- 
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Seeking-guidance-on-implementing-ACL-tp3160455p3160455.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  

RE: [fw-general] Re: [ ZF 1.11.0 ] Zend Session Savehandler Db and Zend Auth

2010-11-08 Thread Sergio Rinaudo

Hi, 
I think I've found the problem ( thanks to Whisher :) ), 
after disable the param "save_path"  it started to work correctly.

Do we really need this param using DbTable Session Handler?

Thanks

Sergio



> From: kaiohken1...@hotmail.com
> To: fw-general@lists.zend.com
> Date: Mon, 8 Nov 2010 10:11:25 +0100
> Subject: RE: [fw-general] Re: [ ZF 1.11.0 ] Zend Session Savehandler Db and 
> Zend Auth
> 
> 
> Hi Ramon, 
> thanks for reply.
> My database table is exactly the same as the example ( Example #2 Using a 
> Multi-Column Primary Key ) in this documentation page.
> 
> http://framework.zend.com/manual/en/zend.session.savehandler.dbtable.html
> 
> All the setup is done using application.ini ( 
> http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session
>  ), 
> I don't have any code in my bootstrap or anywhere else about session.
> 
> Tha actual behaviour is that I have the row saved in my session table when I 
> browse any page of my project ( the session is started ), and this is correct.
> But when I try to login, submitting the login form ( authentication is done 
> using Zend_Auth ), I get that error.
> 
> What I expect is that the session row previously inserted is updated with the 
> new data ( the user data taken from the auth adapter and injected in the 
> session )
> 
> Actually I cannot send you the authorization code that causes the exception, 
> I'll send you later, but I can say it is a standard authorization code.
> 
> Thanks for your help
> 
> Sergio
> 
> 
> 
> 
> 
> 
> > Date: Sat, 6 Nov 2010 16:22:02 -0700
> > From: ramon.orn...@gmail.com
> > To: fw-general@lists.zend.com
> > Subject: [fw-general] Re: [ ZF 1.11.0 ] Zend Session Savehandler Db and 
> > Zend Auth
> > 
> > 
> > Hi
> > 
> > Maybe it is size primary key session_id, try increased the length of the key
> > in the DB.
> > 
> > Case the error persists to reproduce i need more information how:
> > (a) expected behavior;
> > (b) actual behavior;
> > (c) the minimal reproduce case required.
> > 
> > Thanks advance
> > Ramon Henrique Ornelas
> > 
> > On Sat, Nov 6, 2010 at 8:48 PM, Razorblade [via Zend Framework Community] <
> > ml-node+3030432-543054126-72...@n4.nabble.com
> > > wrote:
> > 
> > >
> > > Hi everyone,
> > > I set up my application to use the database to store sessions.
> > >
> > > On my application.ini I have all the options as specified here
> > >
> > > http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session
> > >
> > > The session is saved on the database, but if I try to login, using
> > > Zend_Auth,
> > > I get a mysql duplycate entry error:
> > >
> > > Integrity constraint violation: 1062 Duplicate entry
> > > '1f4qokoavm654b0une2j5ju5d1
> > >
> > > Doesn't it supposed to update the saved session data and not try to
> > > re-insert it?
> > > Do I have to edit something on the authorization process ( that works 
> > > using
> > > normal sessions )?
> > >
> > > Please reply.
> > >
> > > Thanks
> > >
> > > Sergio
> > >
> > >
> > >
> > >
> > > --
> > >  View message @
> > > http://zend-framework-community.634137.n4.nabble.com/ZF-1-11-0-Zend-Session-Savehandler-Db-and-Zend-Auth-tp3030432p3030432.html
> > > To start a new topic under Zend Framework, email
> > > ml-node+634138-1492779793-72...@n4.nabble.com
> > > To unsubscribe from Zend Framework, click 
> > > here.
> > >
> > >
> > >
> > 
> > -- 
> > View this message in context: 
> > http://zend-framework-community.634137.n4.nabble.com/ZF-1-11-0-Zend-Session-Savehandler-Db-and-Zend-Auth-tp3030432p3030450.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
> 
  

RE: [fw-general] Re: [ ZF 1.11.0 ] Zend Session Savehandler Db and Zend Auth

2010-11-08 Thread Sergio Rinaudo

Hi Ramon, 
thanks for reply.
My database table is exactly the same as the example ( Example #2 Using a 
Multi-Column Primary Key ) in this documentation page.

http://framework.zend.com/manual/en/zend.session.savehandler.dbtable.html

All the setup is done using application.ini ( 
http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session
 ), 
I don't have any code in my bootstrap or anywhere else about session.

Tha actual behaviour is that I have the row saved in my session table when I 
browse any page of my project ( the session is started ), and this is correct.
But when I try to login, submitting the login form ( authentication is done 
using Zend_Auth ), I get that error.

What I expect is that the session row previously inserted is updated with the 
new data ( the user data taken from the auth adapter and injected in the 
session )

Actually I cannot send you the authorization code that causes the exception, 
I'll send you later, but I can say it is a standard authorization code.

Thanks for your help

Sergio






> Date: Sat, 6 Nov 2010 16:22:02 -0700
> From: ramon.orn...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] Re: [ ZF 1.11.0 ] Zend Session Savehandler Db and Zend 
> Auth
> 
> 
> Hi
> 
> Maybe it is size primary key session_id, try increased the length of the key
> in the DB.
> 
> Case the error persists to reproduce i need more information how:
> (a) expected behavior;
> (b) actual behavior;
> (c) the minimal reproduce case required.
> 
> Thanks advance
> Ramon Henrique Ornelas
> 
> On Sat, Nov 6, 2010 at 8:48 PM, Razorblade [via Zend Framework Community] <
> ml-node+3030432-543054126-72...@n4.nabble.com
> > wrote:
> 
> >
> > Hi everyone,
> > I set up my application to use the database to store sessions.
> >
> > On my application.ini I have all the options as specified here
> >
> > http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session
> >
> > The session is saved on the database, but if I try to login, using
> > Zend_Auth,
> > I get a mysql duplycate entry error:
> >
> > Integrity constraint violation: 1062 Duplicate entry
> > '1f4qokoavm654b0une2j5ju5d1
> >
> > Doesn't it supposed to update the saved session data and not try to
> > re-insert it?
> > Do I have to edit something on the authorization process ( that works using
> > normal sessions )?
> >
> > Please reply.
> >
> > Thanks
> >
> > Sergio
> >
> >
> >
> >
> > --
> >  View message @
> > http://zend-framework-community.634137.n4.nabble.com/ZF-1-11-0-Zend-Session-Savehandler-Db-and-Zend-Auth-tp3030432p3030432.html
> > To start a new topic under Zend Framework, email
> > ml-node+634138-1492779793-72...@n4.nabble.com
> > To unsubscribe from Zend Framework, click 
> > here.
> >
> >
> >
> 
> -- 
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/ZF-1-11-0-Zend-Session-Savehandler-Db-and-Zend-Auth-tp3030432p3030450.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  

[fw-general] [ ZF 1.11.0 ] Zend Session Savehandler Db and Zend Auth

2010-11-06 Thread Sergio Rinaudo

Hi everyone, 
I set up my application to use the database to store sessions.

On my application.ini I have all the options as specified here 
http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.session

The session is saved on the database, but if I try to login, using Zend_Auth, 
I get a mysql duplycate entry error:

Integrity constraint violation: 1062 Duplicate entry '1f4qokoavm654b0une2j5ju5d1

Doesn't it supposed to update the saved session data and not try to re-insert 
it?
Do I have to edit something on the authorization process ( that works using 
normal sessions )?

Please reply.

Thanks

Sergio


  

FW: [fw-general] Custom Validator Translation

2010-09-21 Thread Sergio Rinaudo

Any advice about this issue?

Thanks :)

Sergio Rinaudo




From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Sat, 18 Sep 2010 17:46:08 +0200
Subject: [fw-general] Custom Validator Translation








Hi all, 
how to translate messages from a custom validator?

For all built-in validator I use to create the {validator_name}.php file within 
the languages/{language_code} directory, ex

languages/it/Zend_Validate_Between.php

and this works,

but for custom validator it seems this is not working, for example I have the 
My_Validate_File_MyCustomValidator ( with its messageTemplates ) that should 
get the translation from 

languages/it/My_Validate_File_MyCustomValidator.php, but I get empty error 
messages


Any advices?

Thanks


Sergio


PS about ZF list

Is the ZF mailing list working? I get always no answer to all my questions :)
And also sometimes I receive answers to discussion that I never receive the 
opening thread

Thnaks


  

[fw-general] Custom Validator Translation

2010-09-18 Thread Sergio Rinaudo

Hi all, 
how to translate messages from a custom validator?

For all built-in validator I use to create the {validator_name}.php file within 
the languages/{language_code} directory, ex

languages/it/Zend_Validate_Between.php

and this works,

but for custom validator it seems this is not working, for example I have the 
My_Validate_File_MyCustomValidator ( with its messageTemplates ) that should 
get the translation from 

languages/it/My_Validate_File_MyCustomValidator.php, but I get empty error 
messages


Any advices?

Thanks


Sergio


PS about ZF list

Is the ZF mailing list working? I get always no answer to all my questions :)
And also sometimes I receive answers to discussion that I never receive the 
opening thread

Thnaks


  

FW: [fw-general] Can you have multiple databases?

2010-09-17 Thread Sergio Rinaudo

Did you read this page of the documentation?

http://zendframework.com/manual/1.10/en/zend.application.available-resources.html#zend.application.available-resources.multidb



Sergio Rinaudo






> Date: Fri, 17 Sep 2010 11:09:18 -0600
> From: sparkymeis...@gmail.com
> To: just_for_for...@yahoo.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Can you have multiple databases?
> 
> You just need a separate db object for each database
> 
> 
> 
> Mark
> 
> On Fri, Sep 17, 2010 at 9:38 AM, tryingtolearn
>  wrote:
> >
> > I can't find anything but "hacks" that others have done.  Will zend work 
> > with
> > multiple databases at the same time?  I have data in Oracle, MySQL, and SQL
> > Server.  I need that info on one page.  Thanks.
> > --
> > View this message in context: 
> > http://zend-framework-community.634137.n4.nabble.com/Can-you-have-multiple-databases-tp2544032p2544032.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
> >
> 
> 
> 
> -- 
> Have fun or die trying - but try not to actually die.
  

[fw-general] ContextSwitch custom formats and callback function

2010-09-16 Thread Sergio Rinaudo

  




 Hi All, 
can someone please help me understand how callback function must be set using 
custom format with contextSwitch?

I have already read the documentation and this post: 
http://osdir.com/ml/php.zend.framework.mvc/2008-07/msg00120.html .

but I still got no result and no errors :/

Thanks



Sergio Rinaudo




  

[fw-general] Question about routes

2010-09-13 Thread Sergio Rinaudo

Hi All, 
is there a way in Zend Framework to create routes that are "sensible" to the 
database data?

Let's do an example: if I have three controllers, 

- categoryController 
- searchController
- pageController

and the requested url is:

www.mysite.com/keyword

what kind of routes do I have to create if I want to redirect to:

- category controller if 'keyword' is a category
- page controller  if 'keyword' is a page
- search controller if 'keyword' is not a category nor a page

Thanks

Sergio






  

[fw-general] Zend Search Lucene and character encoding

2010-08-31 Thread Sergio Rinaudo

Hi All, 
I have a problem when indexing documents on Zend Search Lucene index.
Sometimes I get this notice

Notice:  iconv() [function.iconv]: Detected an illegal character in input 
string in xxx\library\Zend\Search\Lucene\Analysis\Analyzer\Common\Utf8Num.php 
on line 77



Notice:  iconv() [function.iconv]: Detected an illegal character in input 
string inxxx\library\Zend\Search\Lucene\Field.php on line 222

My database charset is UTF8 ( and table fields too ),  I use the query "SET 
NAMES 'utf8'" before any other and I use the analyzer 
Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num()

If I have a long text data extracted from my database,  and I want to  store it 
both as UnStored and UnIndexed field ( just to have both example ), 
what is the correct way to add it? Do I have to specify the third parameter as 
utf8 ( like in the example) ? Do I have to do any other kind of 
encoding/filtering etc?

$this->addField( Zend_Search_Lucene_Field::UnStored( 'contents', 
$data['page_contents'], 'utf-8' ) );
$this->addField( Zend_Search_Lucene_Field::UnIndexed( 'abstract', 
$data['page_contents'], 'utf-8' ) ); 

Any help it is very appreciated!

Sergio 
  

RE: [fw-general] Re: Renaming file before upload

2010-07-17 Thread Sergio Rinaudo

Hi, 
actually I am using Zend_Filter_File_Rename to rename an uploaded file, but the 
renaming happens after the file is uploaded.
If you need old file not to be overwritten, Zend_Filter_File_Rename can be 
instanciated using an array of settings where you can specify 
to overwrite or not the existing file ( overwrite => false ).

Hope it helps

Sergio Rinaudo






> Date: Sat, 17 Jul 2010 12:11:01 -0700
> From: clinto...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] Re: Renaming file before upload
> 
> 
> Just to clarify a bit more...
> 
> I'm using Zend_Form_Element_File to add the file upload element to my form.
> I need to be able to rename the file before calling $form->foo->receive().
> Possible?
> -- 
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Renaming-file-before-upload-tp2292597p2292617.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  
_
Tanti account di posta? Unisci tutto sotto Hotmail
http://www.windowslive.it/hotmail/GestisciAltriAccount.aspx

RE: [fw-general] Re: Model documentation page, explanation needed

2010-07-16 Thread Sergio Rinaudo

Thank you guys for your answers, 
now I feel more comfortable, my concern is to do things 
the way they have to be done, following the "Best Practices".

Thanks

Sergio

  
_
Importa i tuoi contatti di Facebook. Chiacchiera su Messenger!
http://www.windowslive.it/importaAmici.aspx

RE: [fw-general] Model documentation page, explanation needed

2010-07-15 Thread Sergio Rinaudo

I am still stuck with these issues, 
hoping to receive some advices :)

---

Hello, 
I need some explanation of this documentation page:

http://framework.zend.com/manual/en/learning.quickstart.create-model.html

I've
 created some models following this documentation page, 
I need to 
get some content with fetchAll using some filter ( where this = 'that' 
ecc ) but the fetchAll 
method doesn't accept any arguments: it is 
because it is just an example ( and I have to edit fetchAll by myself 
providing arguments ) or 
is there any reason?

And also, find 
method requires second parameter do be a Model instance, why?
Cannot 
it be instanciated within the method ( like it happens in fetchAll )?

Maybe
 they are just dumb questions, sorry about that!

Any help is very
 appreciated!

Thanks

Sergio
_
Avatar per Messenger e sfondo per il PC. Creali gratis!
http://www.experience.windows.com/landing2.aspx?culture=it-it

[fw-general] Model documentation page, explanation needed

2010-07-14 Thread Sergio Rinaudo

Hello, 
I need some explanation of this documentation page:

http://framework.zend.com/manual/en/learning.quickstart.create-model.html

I've created some models following this documentation page, 
I need to get some content with fetchAll using some filter ( where this = 
'that' ecc ) but the fetchAll 
method doesn't accept any arguments: it is because it is just an example ( and 
I have to edit fetchAll by myself providing arguments ) or 
is there any reason?

And also, find method requires second parameter do be a Model instance, why?
Cannot it be instanciated within the method ( like it happens in fetchAll )?

Maybe they are just dumb questions, sorry about that!

Any help is very appreciated!

Thanks

Sergio
  
_
Importa i tuoi contatti di Facebook. Chiacchiera su Messenger!
http://www.windowslive.it/importaAmici.aspx

RE: [fw-general] custom functions

2010-07-07 Thread Sergio Rinaudo

Hi, 
in my opinion you can create custom filters ( eg. My_Filter_SafeFileRename )
and Action Helpers ( eg. My_Controller_Action_Helper_RandomString )

Regards

--

Hi,

I have some custom functions that I use in different parts of
 my application.

What is the best practice of using these 
functions?

The functions are focused on different aims. for 
example:


 randomString(),
 safeFileRename() ,
 encrypt_decrypt() ,
 bytesToMbs(),
 etc.
 

Which one you think is better?
Putting
 them into library and including where neededUsing autoloader 
of zendOr something else
  
_
Avatar per Messenger e sfondo per il PC. Creali gratis!
http://www.experience.windows.com/landing2.aspx?culture=it-it

RE: [fw-general] Zend_File_Transfer_Http strange behaviour

2010-07-02 Thread Sergio Rinaudo

Hi All, 
I temporarily solved removing the first file element if it is empty.
Before the cicle


if(isset($files["image"]) && empty($files["image"]["name"])){
unset($files["image"]);
}

then it works in all the cases.
However, it is just an 'hack' to make it works, 
I still hope in some advice :)

Regards

Sergio Rinaudo
  
_
Novità dai tuoi amici? Le trovi su Messenger
http://www.messenger.it/novita.aspx

[fw-general] Zend_File_Transfer_Http strange behaviour

2010-07-02 Thread Sergio Rinaudo

Hello, 
I'm stuck in a problem with Zend_File_Transfer_Adapter_Http and I hope somebody 
could give me an advice.
I have an html form ( not zend form ) with 2 image element:




and I have this code that process the file elements

  $adapter = new Zend_File_Transfer_Adapter_Http();
  $adapter->setDestination("/my/destination/path");
  $adapter->addValidator('Extension', false, 'png,jpg,gif')
  ->addValidator('Size', false, 8388608)
  ->addValidator('ExcludeMimeType', false, 
'application,audio,message,model,multipart,text,video');*/
  $files = $adapter->getFileInfo();

  foreach( $files as $fieldname => $fileinfo ) {

$isUploaded = $adapter->isUploaded($fileinfo['name']);

$isValid = $adapter->isValid($fileinfo['name']);

try {
  
$adapter->receive($fileinfo['name']);

} catch(Zend_File_Transfer_Exception $e) {

echo $e->getMessage();
exit;

}

  }

The strange behaviour is the value of $isUploaded and $isValid:


if I upload the same file as FIRST file ( id="image" ), both are true.

if I upload the same file as SECOND file (id="image_foto" ) and the first file 
EMPTY, $isUploaded is TRUE but isvalid is FALSE, 

when the result I expect is both the value as TRUE.

Same behaviour if I disable all the validator.

Surely there is something I did not get, but what?

Thanks for all your help.

Sergio
  
_
Novità dai tuoi amici? Le trovi su Messenger
http://www.messenger.it/novita.aspx

RE: [fw-general] Zend_Form_Element_Select - preselected drop-down list problem

2010-06-21 Thread Sergio Rinaudo

Hi, 
you can use 'setValue' method of your Zend Form Element.

$myForm->myElement->setValue();

You can also use 'populate' form method to populate all your form fields with a 
value ( 
http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.elements.values
 )

$myForm->populate($data);

$data array should contain a valid key/value pairs.

Hope it helps.

Bye

Sergio
  
_
Taglia i costi. Chiama e videochiama da Messenger
http://www.messenger.it/videoconversazioni.aspx

RE: [fw-general] Zend_Form isValidPartial always returns false

2010-05-31 Thread Sergio Rinaudo

Thank you for your help, 
however, after lots of tests,  I've found that the validation for my 
Zend_Form_Element_File is always false 
if the element is empty.

My file element has setRequired set to false and also setAllowEmpty(true)

It is possible to force the validation to true value for a certain element?

Thanks

Sergio
  
_
Importa i tuoi amici di Facebook su Messenger
http://www.windowslive.it/importaAmici.aspx

[fw-general] Zend_Form isValidPartial always returns false

2010-05-31 Thread Sergio Rinaudo

Hi All, 
I have a form sent automatically every X seconds using ajax to store 
temporarily in a session all valid element values, 
and I want to use $myForm->isValidPartial server side to do this.

Unfortunatelly it always returns  false, and I have elements that actually 
should pass validation within the not-validated elements.

Instead, If I call $myForm->isValidPartial to upload an image ( always using 
ajax ) it returns true ( like it should be ).

I have all validators disabled for each form element.

Does anybody have any clue about this issue?

Thanks!

Sergio




  
_
nome.cognome @... Verifica la disponibilità sui NUOVI domini
https://signup.live.com/signup.aspx?mkt=it-it&rollrs=12&lic=1

RE: [fw-general] Flash Messenger: retrieve messages after > 1 action request

2010-05-29 Thread Sergio Rinaudo

Thank you Dennis for your answer, 
I'm sure I am mistaking something because the message I save in a request is 
available only in the next one, I 
recall or less getMessages().

Here an example:

public function firstAction(){
 $this->_flashMessenger->setNamespace($my_namespace);
 $this->_flashMessenger->addMessage($my_data);
}


public function secondAction(){
 $this->_flashMessenger->setNamespace($my_namespace);
 $messages = $this->_flashMessenger->getMessages();
 Zend_debug::dump($messages);
}

public function thirdAction(){
 // nothing
}


If I call first and then second I get the message, then if I call second again, 
message is empty, and so should be.

If I call first and then third and then second message is empty the same, and 
should not be so...



Please note that I call flash messenger constructor in every controller's init()

$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');

Hope somebody could help 

Thanks

Sergio


  
_
Spazio gratis di 25 Gigabyte per archiviare ciò che vuoi
http://www.windowslive.it/skyDrive.aspx

[fw-general] Flash Messenger: retrieve messages after > 1 action request

2010-05-29 Thread Sergio Rinaudo

Hi All, 
I need some advices about the correct use of FlashMessenger, 
as the documentation says

"The FlashMessenger helper allows you to pass 
messages
that the user may need to see on the next request."

But if I want to have the message stored while I do not tell him to be 
destroyed ( maybe after 10 action requests ), 
may I use FlashMessenger or do I have to build my own "messenger" using  
Zend_Session_Namespace?


Thanks

Sergio


  
_
Spazio gratis di 25 Gigabyte per archiviare ciò che vuoi
http://www.windowslive.it/skyDrive.aspx

RE: [fw-general] How to get a resource from a controller plugin?

2010-05-13 Thread Sergio Rinaudo

Nice solution, 
thanks!

Sergio
  
_
Importa i tuoi amici di Facebook su Messenger
http://www.windowslive.it/importaAmici.aspx

[fw-general] How to get a resource from a controller plugin?

2010-05-13 Thread Sergio Rinaudo

Hi, 
I need to get a db resource from a controller plugin that extends 
Zend_Controller_Plugin_Abstract.
In a controller context I'll do 

  
  $bootstrap = $this->getInvokeArg('bootstrap');
  $resource = $bootstrap->getResource('myresource');
 
but what if I want to get the resource in other context, for example,a  plugin ?
Maybe it's a dumb question, sorry about that :)

Thanks in advance
  
_
MSN ti offre esattamente quello che cerchi: il tuo browser personale
http://www.pimpit.it/ie8msn/

RE: [fw-general] admin generator / separate application units

2010-05-12 Thread Sergio Rinaudo

Hi, 
from my point of view 'admin' is a module.
In this discussion

http://zend-framework-community.634137.n4.nabble.com/ZF1-8-Switching-layouts-between-modules-td659665.html

there is a clear example of what do do using a plugin.
Hope it helps.

Bye

 
  
_
MSN ti offre esattamente quello che cerchi: il tuo browser personale
http://www.pimpit.it/ie8msn/

[fw-general] About Zend Dojo Autocomplete doc

2010-04-16 Thread Sergio Rinaudo

Hi everybody, 
I have problem make the Zend_Dojo autocomplete works.
I'm following the example in this page of the documentation ( 
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html ), 
and I get 2 main problem:

the first, if I call the autocomplete action I get 

 'Zend_Dojo_Exception' with message 'Overwriting items using addItem() 
is not allowed' in ***\library\Zend\Dojo\Data.php:118

And also, client side, firebug says:

djConfig is not defineddjConfig.usePlainJson=true;

I hope in your help :)

Regards

Sergio
  
_
Naviga al sicuro. Scarica gratis Internet Explorer 8 per MSN
http://www.microsoft.com/italy/windows/internet-explorer/msn.aspx

[fw-general] Exceptions not caught by error controller

2010-04-13 Thread Sergio Rinaudo

Hi, 
I have a problem with Zend_Controller_Plugin_ErrorHandler. I have registered it 
in the bootstrap to redirect all errors to the error controller error action.

I have front controller throwExceptions set to false ( in the bootstrap ).
It works, but not with all exceptions, for example, if I have the log file or 
the cache directories "read only" I get the exception like throwExceptions is 
true.
I want also these exception to be redirected to the error controller so that I 
can show them nicely. Where is the mistake?
Thank for all your advices!
Regards


Sergio Rinaudo


  
_
Messenger e Hotmail in tasca. Provali sul tuo cellulare!
http://new.windowslivemobile.msn.com/it-it/Default.aspx

RE: [fw-general] Get query and error messages from $db->update

2010-03-29 Thread Sergio Rinaudo

Very nice :)
Thank you!

Sergio Rinaudo






> Date: Mon, 29 Mar 2010 09:09:04 +0100
> From: zfgeneral2010...@toolbox.uk.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Get query and error messages from $db->update
> 
> Hi. Something like this will work:
> 
> public function dumpSQL()
> {
> $db   = Zend_Db_Table::getDefaultAdapter();
> $dbProfiler   = $db->getProfiler();
> $dbQuery  = $dbProfiler->getLastQueryProfile();
> $dbSQL= $dbQuery->getQuery();
> 
> print_r($dbSQL);
> }
> 
> Regards,
> 
> Narinder.
> -- 
> 
>  __
> | Narinder Chandi, Director,
> | ToolBox Systems Limited, Surrey, England, UK.
> | tel : +44 (0)1372 720117, mob : +44 (0)7973 512495
> | www  : http://www.toolbox.uk.com
> | Skype: NarinderChandi
> | LinkedIn : http://www.linkedin.com/in/toolboxsystems
> | Twitter  : @ToolBoxSystems
> |__
> | Consultancy * Development * Support
> |__
> 
> 
> on 29/03/2010 09:01, Sergio Rinaudo at kaiohken1...@hotmail.com wrote:
> 
> > 
> > Hi everybody, 
> > if I construct an update query programmatically using Zend_Db, how can I get
> > this query and how to get what is the problem if the query fails?
> > Thanks
> > 
> > Sergio Rinaudo
> > 
> 
> 
  
_
Personalizza il tuo Messenger con nuove e divertenti Emoticon
http://www.pimpit.it/emoticon.html

RE: [fw-general] Get query and error messages from $db->update

2010-03-29 Thread Sergio Rinaudo

Yes, ok for the try-catch to get exceptions and to echo a select query, 
but if I want to get the update query string?


Sergio Rinaudo




> Date: Mon, 29 Mar 2010 11:13:04 +0300
> From: sasc...@gmail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Get query and error messages from $db->update
> 
> If you form the query in the following way
> $filter = $this->select()->from($this->_name, array('id', 'label'));
> then you can echo it directly
> echo $filter;
> 
> And if there is a db/sql syntax error, it already throws exception.
> For example, let's say you do not have a field named "idd" in your
> table structure
> $filter = $this->select()->from($this->_name, array('idd', 'label'));
> Then the above sql statement will throw an exception telling you that
> there is no field with name idd in the related table..
> 
> scs
> 
> On Mon, Mar 29, 2010 at 11:01 AM, Sergio Rinaudo
>  wrote:
> > Hi everybody,
> > if I construct an update query programmatically using Zend_Db, how can I get
> > this query and how to get what is the problem if the query fails?
> > Thanks
> >
> > Sergio Rinaudo
> >
> >
> >
> > 
> > Vuoi scaricare gli allegati? Guardali in anteprima, su Hotmail!
  
_
Scatta, ritocca e condividi le tue foto online. Gratis per te
http://www.windowslive.it/foto.aspx

[fw-general] Get query and error messages from $db->update

2010-03-29 Thread Sergio Rinaudo

Hi everybody, 
if I construct an update query programmatically using Zend_Db, how can I get 
this query and how to get what is the problem if the query fails?
Thanks

Sergio Rinaudo


  
_
Chiama e videochiama gratis su Messenger!
http://www.messenger.it/videoconversazioni.aspx

RE: [fw-general] Zend_Db really slow

2010-03-25 Thread Sergio Rinaudo

Hi, 
I want to thank everyone for all your kind answer, 
expecially to Matthew Weier O'Phinney, reading your answer 
I thought on a good solution to demonstrate that server was slow and not 
ZF related, write a simple db test script only using simple php


ID: %s  Name: %s", $row[0], $row["myfield"]);
}

$time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Page generated in ".$time." ";

?>


Result was 5 seconds in the current server, 0.02 seconds in another one.
Thank you!

Sergio Rinaudo






> Date: Wed, 24 Mar 2010 10:02:45 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend_Db really slow
> 
> -- Sergio Rinaudo  wrote
> (on Wednesday, 24 March 2010, 12:51 PM +0100):
> > thank you for reply, answering to your questions
> > 
> > . Did you run the sql directly from command line or via a db client?
> > 
> > This is an example query in the bootstrap
> > $db->query("SET NAMES 'utf8'");
> > but also all the other queries are slow and make not difference if
> > they are inside a controller or in an action helper.
> 
> If that's the case, then it's one of two things:
> 
>  * Network latency. This could be due to slow DNS lookups, bad network
>routing tables, etc.
> 
>  * A slow DB server.
> 
> It's likely *not* ZF in this particular case.
> 
> > I use pdo_mysql as adapter.
> > 
> > . How many records are there in the main table?
> > 
> > Not to many, but also if they are 10 is slow
> > 
> > . Are there any index fields defined?
> > 
> > Some table have primary key, some others not, but query one but the other 
> > is slow the same
> > 
> > . Any joined table?
> > 
> > I have join queries, but also simple query are slow
> > 
> > How do you determine that the sql is slow and takes 6-8seconds
> > 
> > I have to say that I am not sure that queries are slow.
> > The simpler test I've done is to put the line of code "die('test');" before 
> > and after the db call.
> > If it is before the output is generated in an instant, if it is after is 
> > slow.
> > 
> > BUT using ZFDebug plugin it says that all the queries are really fast ( 
> > 0.22 ms for example in front of a 1.00 and more ms of page loading time 
> >  )
> > 
> > Profiler is active?
> > 
> > Active or not active nothing change
> > 
> > 
> > And also I have Metadata cache ENABLED ( keep it disabled is the same )
> > 
> > 
> > 
> > Here it is a log with ZFDebug
> > 
> > Overall Time
> > 
> > default
> > index
> > index
> > 
> > Avg: 5900.1 ms / 1 requests
> > Min: 5900.1 ms
> > 
> >  Max: 5900.1 ms
> > 
> > with 2 query ( 0.16 ms and 0.07 ms )
> > 
> > 
> > The version of Zend Framework that I'm using is 1.10.2.
> > 
> > 
> > I can hypothesize a problem with Zend_Db component in the environment I 
> > actually am.
> > What's your advices?
> > 
> > Thank You!
> > 
> > 
> > 
> > 
> > Sergio
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Hi,
> > Could you write the sql sentence here?
> > How do you determine that the sql is slow and takes 6-8seconds?
> > Profiler is active?
> > Then,
> > . Did you run the sql directly from command line or via a db client?
> > . How many records are there in the main table?
> > . Are there any index fields defined?
> > . Any joined table?
> > . problem in join structure?
> > etc.
> > 
> > On Wed, Mar 24, 2010 at 12:39 PM, Sergio Rinaudo
> >  wrote:
> > > Hi everybody,
> > > I've started a new application project using Zend Framework, 
> > > unfortunatelly
> > > I am experiencing a really slow database query ( 6~8 sec for very simple
> > > queries ).
> > > I'm not mantaining the server, the only thing I know that is unix.
> > >
> > > Any advice in what should I have to look or configure?
> > > Thanks
> > >
> > > Sergio R.
> > >
> > >
> > >
> > > 
> > > Oltre 20 giochi per Messenger. Provali subito!
> > 
> > 
> > ━━━
> > Chiacchiera con i tuoi amici via Webcam su Messenger. Videochiamali!
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
  
_
Scatta, ritocca e condividi le tue foto online. Gratis per te
http://www.windowslive.it/foto.aspx

RE: [fw-general] Zend_Db really slow

2010-03-24 Thread Sergio Rinaudo

Hi, 
thank you for reply, answering to your questions

. Did you run the sql directly from command line or via a db client?

This is an example query in the bootstrap 
$db->query("SET NAMES 'utf8'");
but also all the other queries are slow and make not difference if they are 
inside a controller or in an action helper.
I use pdo_mysql as adapter.

. How many records are there in the main table?

Not to many, but also if they are 10 is slow

. Are there any index fields defined?

Some table have primary key, some others not, but query one but the other is 
slow the same

. Any joined table?

I have join queries, but also simple query are slow

How do you determine that the sql is slow and takes 6-8seconds

I have to say that I am not sure that queries are slow. 
The simpler test I've done is to put the line of code "die('test');" before and 
after the db call.
If it is before the output is generated in an instant, if it is after is slow.

BUT using ZFDebug plugin it says that all the queries are really fast ( 0.22 ms 
for example in front of a 1.00 and more ms of page loading time  )

Profiler is active?

Active or not active nothing change


And also I have Metadata cache ENABLED ( keep it disabled is the same )



Here it is a log with ZFDebug

Overall Time

default
index
index

Avg: 5900.1 ms / 1 requests
Min: 5900.1 ms
   
 Max: 5900.1 ms

with 2 query ( 0.16 ms and 0.07 ms )


The version of Zend Framework that I'm using is 1.10.2.


I can hypothesize a problem with Zend_Db component in the environment I 
actually am.
What's your advices?

Thank You!




Sergio








Hi,
Could you write the sql sentence here?
How do you determine that the sql is slow and takes 6-8seconds?
Profiler is active?
Then,
. Did you run the sql directly from command line or via a db client?
. How many records are there in the main table?
. Are there any index fields defined?
. Any joined table?
. problem in join structure?
etc.
 
On Wed, Mar 24, 2010 at 12:39 PM, Sergio Rinaudo
 wrote:
> Hi everybody,
> I've started a new application project using Zend Framework, unfortunatelly
> I am experiencing a really slow database query ( 6~8 sec for very simple
> queries ).
> I'm not mantaining the server, the only thing I know that is unix.
>
> Any advice in what should I have to look or configure?
> Thanks
>
> Sergio R.
>
>
>
> 
> Oltre 20 giochi per Messenger. Provali subito!
>   
_
Scatta, ritocca e condividi le tue foto online. Gratis per te
http://www.windowslive.it/foto.aspx

[fw-general] Zend_Db really slow

2010-03-24 Thread Sergio Rinaudo

Hi everybody, 
I've started a new application project  using Zend Framework, unfortunatelly I 
am experiencing a really slow database query ( 6~8 sec for very simple queries 
).
I'm not mantaining the server, the only thing I know that is unix.

Any advice in what should I have to look or configure?
Thanks

Sergio R.


  
_
Personalizza il tuo Messenger con nuove e divertenti Emoticon
http://www.pimpit.it/emoticon.html

[fw-general] Multidb configuration issue

2010-03-23 Thread Sergio Rinaudo

Hi, 
I'm actually trying to understand how to get multidb resource from 
application.ini.
I have this page of the documentation opened

http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.multidb

and this line of code to retrieve the multidb resource

$resource = $bootstrap->getPluginResource('multidb');

the question is, how to get the $bootstrap object?
Can this object be generated everywhere in the code?

I hope in your kind and explicative answer :)

Thank you very much.



Sergio Rinaudo


  
_
Chiama e videochiama gratis su Messenger!
http://www.messenger.it/videoconversazioni.aspx

RE: [fw-general] Using an external database for user credential

2010-03-23 Thread Sergio Rinaudo

Hi everybody, 
I tried to setup multiple db in my application.ini, then instanciate $db object 
with the following line of code

$db = 
Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('multidb')->getDb('db1');

but I get "Call to a member function on a non-object" for getResource if I call 
it in "My_Acl extends Zend_Acl".

Please, can anybody give any advices?

Do I have to add some init function in the bootstrap?

Thanks






Sergio Rinaudo







From: djvir...@gmail.com
Date: Fri, 19 Mar 2010 08:12:48 -0700
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com
Subject: Re: [fw-general] Using an external database for user credential

The only thing that is "automatic" regarding the DB is Zend_Db_Table and its 
default adapter. You can specify the default by using this confing option:
resources.multidb.db2.default = true


For everything else, you'll need to inject the db instance into your models 
(for example, by injecting into a data mapper) or access it statically with:
$db = 
Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('multidb')->getDb('db2');


Injection is preferred because it makes unit testing easier.
--
Hector



On Fri, Mar 19, 2010 at 2:15 AM, Sergio Rinaudo  
wrote:







Thank you very much for your advices Hector.
I have one more question, is anything changing on models management using 
multidb?
How do a model know which database resource must use?
Thanks




Sergio 




From: djvir...@gmail.com
Date: Tue, 16 Mar 2010 09:23:26 -0700


Subject: Re: [fw-general] Using an external database for user credential
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com



Take a look at the "multidb" resource:
http://framework.zend.com/manual/en/zend.application.available-resources.html




You could then inject your authentication adapter with the correct db:


// in controller

$db = 
$this->getInvokeArg('bootstrap')->getResource('multidb')->getDb('db2')$authAdapter
 = new Zend_Auth_Adapter_DbTable(



$db,$tabUsers,'username',



'password');


This would eliminate the need for you to construct your own db adapter from the 
config.
Also, you'll want to use boolean false for isDefaultTableAdapter -- when it's 
set to true, that db instance will be used for all Zend_Db_Table instances by 
default.




--
Hector



On Tue, Mar 16, 2010 at 2:34 AM, Sergio Rinaudo  
wrote:









Hello, 
I am in a situation where I have to use an external database to check 
credential for user.
Is there any right way to do this in the application ini?

I thoughts something like

  resources.db2.adapter = // external db adapter




  resources.db2.params.host = // external db host
  resources.db2.params.username = // external db user
  resources.db2.params.password = // external db pass
  resources.db2.params.dbname = // external db name




  resources.db2.isDefaultTableAdapter =  // what am I supposed to put here?
  resources.db2.params.charset = UTF8
  resources.db2.profiler.enabled = true

Save it in the registry whitin bootstrap

$db2 = // some code




$registry->db2 = $db2;

Use $db2 to check credential in auth controller

$db2 = Zend_Registry::get('db2');
$authAdapter = new Zend_Auth_Adapter_DbTable(
  $db2,
  $tabUsers,




  'username',
  'password',
  "SHA1(CONCAT('".$salt."',?)) AND status_id = '".$status_id."' "
  );


Is that a correct way to do or there is something better?




Thanks in advance for all your advices.



Sergio 




  
Lo spazio su Hotmail aumente con le tue esigenze... Vai oltre i 5GB



  
Lo spazio su Hotmail aumente con le tue esigenze... Vai oltre i 5GB



  
_
Proteggi i tuoi segreti con internet Explorer 8
http://www.microsoft.com/italy/windows/internet-explorer/features/stay-safer-online.aspx

RE: [fw-general] Using an external database for user credential

2010-03-22 Thread Sergio Rinaudo

And how to inject $db inside a model so that all the method inside that model 
take the new $db instance as $this ( if it is possible.. )?
Thanks

Sergio 






From: djvir...@gmail.com
Date: Fri, 19 Mar 2010 08:12:48 -0700
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com
Subject: Re: [fw-general] Using an external database for user credential

The only thing that is "automatic" regarding the DB is Zend_Db_Table and its 
default adapter. You can specify the default by using this confing option:
resources.multidb.db2.default = true


For everything else, you'll need to inject the db instance into your models 
(for example, by injecting into a data mapper) or access it statically with:
$db = 
Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('multidb')->getDb('db2');


Injection is preferred because it makes unit testing easier.
--
Hector



On Fri, Mar 19, 2010 at 2:15 AM, Sergio Rinaudo  
wrote:







Thank you very much for your advices Hector.
I have one more question, is anything changing on models management using 
multidb?
How do a model know which database resource must use?
Thanks




Sergio 




From: djvir...@gmail.com
Date: Tue, 16 Mar 2010 09:23:26 -0700


Subject: Re: [fw-general] Using an external database for user credential
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com



Take a look at the "multidb" resource:
http://framework.zend.com/manual/en/zend.application.available-resources.html




You could then inject your authentication adapter with the correct db:


// in controller

$db = 
$this->getInvokeArg('bootstrap')->getResource('multidb')->getDb('db2')$authAdapter
 = new Zend_Auth_Adapter_DbTable(



$db,$tabUsers,'username',



'password');


This would eliminate the need for you to construct your own db adapter from the 
config.
Also, you'll want to use boolean false for isDefaultTableAdapter -- when it's 
set to true, that db instance will be used for all Zend_Db_Table instances by 
default.




--
Hector



On Tue, Mar 16, 2010 at 2:34 AM, Sergio Rinaudo  
wrote:









Hello, 
I am in a situation where I have to use an external database to check 
credential for user.
Is there any right way to do this in the application ini?

I thoughts something like

  resources.db2.adapter = // external db adapter




  resources.db2.params.host = // external db host
  resources.db2.params.username = // external db user
  resources.db2.params.password = // external db pass
  resources.db2.params.dbname = // external db name




  resources.db2.isDefaultTableAdapter =  // what am I supposed to put here?
  resources.db2.params.charset = UTF8
  resources.db2.profiler.enabled = true

Save it in the registry whitin bootstrap

$db2 = // some code




$registry->db2 = $db2;

Use $db2 to check credential in auth controller

$db2 = Zend_Registry::get('db2');
$authAdapter = new Zend_Auth_Adapter_DbTable(
  $db2,
  $tabUsers,




  'username',
  'password',
  "SHA1(CONCAT('".$salt."',?)) AND status_id = '".$status_id."' "
  );


Is that a correct way to do or there is something better?




Thanks in advance for all your advices.



Sergio 




  
Lo spazio su Hotmail aumente con le tue esigenze... Vai oltre i 5GB



  
Lo spazio su Hotmail aumente con le tue esigenze... Vai oltre i 5GB



  
_
Personalizza il tuo Messenger con nuove e divertenti Emoticon
http://www.pimpit.it/emoticon.html

RE: [fw-general] RE: Graphs using Zend Framework

2010-03-20 Thread Sergio Rinaudo

Thank you guys for all your advices, 
I've discovered some free charts I didn't even know thanks to you all.

Actually, for my project, I decided to use Fusion Charts ( 
http://www.fusioncharts.com/free/demos/ ), 
I found them really nice to see and complete.

Bye!

Sergio
  
_
Personalizza il tuo Messenger con nuove e divertenti Emoticon
http://www.pimpit.it/emoticon.html

RE: [fw-general] Using an external database for user credential

2010-03-19 Thread Sergio Rinaudo

Thank you very much for your advices Hector.
I have one more question, is anything changing on models management using 
multidb?
How do a model know which database resource must use?
Thanks


Sergio 




From: djvir...@gmail.com
Date: Tue, 16 Mar 2010 09:23:26 -0700
Subject: Re: [fw-general] Using an external database for user credential
To: kaiohken1...@hotmail.com
CC: fw-general@lists.zend.com

Take a look at the "multidb" resource:
http://framework.zend.com/manual/en/zend.application.available-resources.html


You could then inject your authentication adapter with the correct db:
// in controller

$db = 
$this->getInvokeArg('bootstrap')->getResource('multidb')->getDb('db2')$authAdapter
 = new Zend_Auth_Adapter_DbTable(

$db,$tabUsers,'username',

'password');


This would eliminate the need for you to construct your own db adapter from the 
config.
Also, you'll want to use boolean false for isDefaultTableAdapter -- when it's 
set to true, that db instance will be used for all Zend_Db_Table instances by 
default.


--
Hector



On Tue, Mar 16, 2010 at 2:34 AM, Sergio Rinaudo  
wrote:







Hello, 
I am in a situation where I have to use an external database to check 
credential for user.
Is there any right way to do this in the application ini?

I thoughts something like

  resources.db2.adapter = // external db adapter


  resources.db2.params.host = // external db host
  resources.db2.params.username = // external db user
  resources.db2.params.password = // external db pass
  resources.db2.params.dbname = // external db name


  resources.db2.isDefaultTableAdapter =  // what am I supposed to put here?
  resources.db2.params.charset = UTF8
  resources.db2.profiler.enabled = true

Save it in the registry whitin bootstrap

$db2 = // some code


$registry->db2 = $db2;

Use $db2 to check credential in auth controller

$db2 = Zend_Registry::get('db2');
$authAdapter = new Zend_Auth_Adapter_DbTable(
  $db2,
  $tabUsers,


  'username',
  'password',
  "SHA1(CONCAT('".$salt."',?)) AND status_id = '".$status_id."' "
  );


Is that a correct way to do or there is something better?


Thanks in advance for all your advices.



Sergio 




  
Lo spazio su Hotmail aumente con le tue esigenze... Vai oltre i 5GB



  
_
Più spazio per le tue esigenze. Hotmail va oltre i 5GB
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx

RE: [fw-general] Graphs using Zend Framework

2010-03-18 Thread Sergio Rinaudo

Thank you Ralph, 
is exactly what I wanted to know.
Do you ( or anybody else ) have any advice how to implement swf charts in ZF?
Thanks

Sergio










There is no graphing component in ZF.
 
You might want to have a look at this proposal:
 
http://framework.zend.com/wiki/display/ZFPROP/Zend_Image+-+Dolf+Schimmel
 
But you also might want to have a look at a few other technologies:
 
   * jpgraph you already mentioned is very good
   * outputing XML from the controller to 
http://www.maani.us/xml_charts/ is also an option (i've used xml/swf 
charts in the past)
   * things that look interesting from google:
  * http://www.ebrueggeman.com/phpgraphlib/
  * http://sparkline.org/
 
Good luck!
Ralph
 
Sergio Rinaudo wrote:
> Hello,
> I'm wondering if is there any component to manage graph using Zend 
> Framework ( like jpgraph for example ) or if I have to use an external 
> php library.
> I've already searched the documentation, I did not find any.
> Thanks
> 
> Sergio
> 
> 
> 
> 
_
Personalizza il tuo Messenger con nuove e divertenti Emoticon
http://www.pimpit.it/emoticon.html

[fw-general] Using an external database for user credential

2010-03-16 Thread Sergio Rinaudo

Hello, 
I am in a situation where I have to use an external database to check 
credential for user.
Is there any right way to do this in the application ini?

I thoughts something like

  resources.db2.adapter = // external db adapter
  resources.db2.params.host = // external db host
  resources.db2.params.username = // external db user
  resources.db2.params.password = // external db pass
  resources.db2.params.dbname = // external db name
  resources.db2.isDefaultTableAdapter =  // what am I supposed to put here?
  resources.db2.params.charset = UTF8
  resources.db2.profiler.enabled = true

Save it in the registry whitin bootstrap

$db2 = // some code
$registry->db2 = $db2;

Use $db2 to check credential in auth controller

$db2 = Zend_Registry::get('db2');
$authAdapter = new Zend_Auth_Adapter_DbTable(
  $db2,
  $tabUsers,
  'username',
  'password',
  "SHA1(CONCAT('".$salt."',?)) AND status_id = '".$status_id."' "
  );


Is that a correct way to do or there is something better?
Thanks in advance for all your advices.



Sergio 




  
_
Più spazio per le tue esigenze. Hotmail va oltre i 5GB
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx

[fw-general] Graphs using Zend Framework

2010-03-15 Thread Sergio Rinaudo

Hello, 
I'm wondering if is there any component to manage graph using Zend Framework ( 
like jpgraph for example ) or if I have to use an external php library.
I've already searched the documentation, I did not find any.
Thanks

Sergio




  
_
Scatta, ritocca e condividi le tue foto online. Gratis per te
http://www.windowslive.it/foto.aspx

[fw-general] Lucene and ZF 1.10

2010-02-04 Thread Sergio Rinaudo

Hello, 
I have the following line of code in my bootstrap


Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('UTF-8');
Zend_Search_Lucene::setDefaultSearchField(null);
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new 
Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive());

Inside a method that called _initLucene().
With ZF version 1.9.6 and previous everything works well, with the 1.10 version 
I get some error.
I cannot say exactly what kind of error now, because that 3 lines of code 
causes internal server error 500.

If I comment this code I get errors using lucene index, so the question is, 
how to make everything works again with this new version? I admit that I still 
have not open the documentation, but because I hope in a quicker solution from 
one of You, however I'm trying to see by myself.

Thanks in advance!

Sergio Rinaudo


  
_
Tutto lo spazio che ti serve, lo trovi su Hotmail
http://www.windowslive.it/hotmail/SpazioDisponibile.aspx

RE: [fw-general] Internal Server Error and ZF

2010-01-07 Thread Sergio Rinaudo

Ok, 
it is solved, in part.
My subdomains does not have and index.php file, and so the error.

Still getting it when generating some of the pdf file, but I think the solution 
is nearly related..
Thanks

Sergio Rinaudo






From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Fri, 8 Jan 2010 00:49:51 +0100
Subject: [fw-general] Internal Server Error and ZF








Hi, 
I need your kind help again to understand what's wrong in my configuration.
Some of my pages give '500 - Internal Server Error', my hosting told me this is 
the error logged:

Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use 'LimitInternalRecursion' to increase the limit
if necessary. Use 'LogLevel debug' to get a backtrace.




My current configuration:

- I use ZF 1.9.6 ( the error comes with 1.9.2 and 1.9.5 as well ).

- I use different instances of Zend_Controller_Router_Route_Hostname in my 
bootstrap, 
however I tried to keep only one instance, and I still get the error.

- My rewrite rule is tiny, the following one

RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteRule .* index.php  

And I have this .htaccess in the root directory and inside other 3 directories 
( that I use for some of mine subdomains ), 
however I tried to keep the .htaccess only in the root to do a test, the error 
remains.



You can reproduce an example of this error ( make appropriate substitutions ) 
within my image upload subdomain, NO .htaccess inside this subdomain, 404 is 
expected, 500 is what I get

http://ups DOT neobazaar DOT com/dgsjgajh  ( you can substitute 'dgsjgajh' with 
any name you like )

If the file exist, there's no problem.

Sometime I get Internal server error when generating pdf and in other part of 
my application.

Does anybody have a clue on what's wrong? 
Thanks for your help


Sergio Rinaudo




  
Foto delle vacanze? Crea il tuo album online e condividile con gli amici!   
  
_
Non sei a casa? Prova il nuovo Web Messenger
http://www.messenger.it/web/default.aspx

[fw-general] Internal Server Error and ZF

2010-01-07 Thread Sergio Rinaudo

Hi, 
I need your kind help again to understand what's wrong in my configuration.
Some of my pages give '500 - Internal Server Error', my hosting told me this is 
the error logged:

Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use 'LimitInternalRecursion' to increase the limit
if necessary. Use 'LogLevel debug' to get a backtrace.




My current configuration:

- I use ZF 1.9.6 ( the error comes with 1.9.2 and 1.9.5 as well ).

- I use different instances of Zend_Controller_Router_Route_Hostname in my 
bootstrap, 
however I tried to keep only one instance, and I still get the error.

- My rewrite rule is tiny, the following one

RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteRule .* index.php  

And I have this .htaccess in the root directory and inside other 3 directories 
( that I use for some of mine subdomains ), 
however I tried to keep the .htaccess only in the root to do a test, the error 
remains.



You can reproduce an example of this error ( make appropriate substitutions ) 
within my image upload subdomain, NO .htaccess inside this subdomain, 404 is 
expected, 500 is what I get

http://ups DOT neobazaar DOT com/dgsjgajh  ( you can substitute 'dgsjgajh' with 
any name you like )

If the file exist, there's no problem.

Sometime I get Internal server error when generating pdf and in other part of 
my application.

Does anybody have a clue on what's wrong? 
Thanks for your help


Sergio Rinaudo




  
_
Sei bravo con le parole? Gioca su Typectionary
http://typectionary.it.msn.com/

RE: [fw-general] Sitemap headers

2010-01-02 Thread Sergio Rinaudo

Here it is



  $response = $this->getResponse();

  $response->setHeader('Cache-Control', 'public', true)

->setHeader('Content-Description', 'File Transfer', true)

->setHeader('Content-Type', 'application/xml', true)

->setHeader('Content-Transfer-Encoding', 'binary', true)

->appendBody($xmlString);





Sergio 






> Date: Sat, 2 Jan 2010 12:56:54 -0800
> From: admi...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] Sitemap headers
> 
> 
> How to set valid headers for a sitemap?
> 
> Here is my try,
> but I still get text/html content-type:
> 
>  
> /**
>  * Class Taat_Controller_Sitemap
>  * Displays sitemaps
>  */
> class My_Controller_Sitemap extends Zend_Controller_Action
> {
> 
> /**
>  * Initialize Controller
>  *
>  * @return null
>  */
> public function init()
> {
> $this->_helper->viewRenderer->setNoRender(true);
> parent::init();
> }
> 
> /**
>  * Display sitemap in xml format
>  * @see http://sitemaps.org
>  * @return null
>  */
> public function xmlAction ()
> {
> 
> //header('Content-Type: text/xml; charset=utf-8');
> $this->getResponse()->setHeader('Content-Type', 'text/xml;
> charset=utf-8', true);
> $this->_helper->layout->disableLayout(true);
> 
> echo $this->view->navigation()->sitemap();
> }
> }
> 
> -- 
> regards
> takeshin
> -- 
> View this message in context: 
> http://n4.nabble.com/Sitemap-headers-tp997420p997420.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  
_
25 Gigabyte per le tue foto online
http://www.windowslive.it/foto.aspx

[fw-general] A strange error working with pdf

2009-12-31 Thread Sergio Rinaudo






Hi everybody, 
I use Zend_Pdf to dinamically create Pdf files in my application.

Today I've noticed that the link used to download Pdf files causes a

500 Internal Server error.



After a while, I discovered that the error was caused by the line 334 in 
Zend/Pdf/Page.php 



$this->_pageDictionary->LastModified = new 
Zend_Pdf_Element_String(Zend_Pdf::pdfDate());



Now this line is commented and Pdf are working again.

However, the real problem was inside Zend_Pdf::pdfDate(), where php's date() 
function is called.

Then I've done a test creating a new tests controller ( and related view )



view->dt = date("l");

}



  }



And calling www.mysite.com/tests/

What I've got is again 500 Internal Server error.

And if a change date() for example with gmdate() it works.

I've also done another test creating a file called date.php with the this 
content



and calling it directly ( www.mysite.com/date.php )  it works.



Does anybody noticed a similar behaviour or have an explaination for this?



Thank you


Sergio






  
_
Scopri tuttele novità di Internet Explorer 8
http://www.microsoft.com/italy/windows/internet-explorer/msn.aspx

RE: [fw-general] Problem in displaying favicon in Zend

2009-12-02 Thread Sergio Rinaudo

Hi, 
try use 'shortcut icon' instead of 'favicon' as rel attribute.


Sergio Rinaudo






> Date: Wed, 2 Dec 2009 00:08:18 -0800
> From: vikramvmalhotra1...@gmail.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Problem in displaying favicon in Zend
> 
> 
> Placing the favicon.ico file in my webroot displays the favicon in Google
> chrome, but in firefox and safari it still doesn't display. That's just the
> default behavior I guess. Chrome looks for a favicon in website root,
> firefox & safari don't.
> 
> What could be going wrong?
> 
> Thanks and Regards
> ShiVik
> 
> 
> 
> shivik wrote:
> > 
> > Hello all
> > 
> > I cannot get to display the favicon on my zend application. I put the
> > favicon in my webroot/images folder and used the headLink() helper to
> > define the favicon in my Bootstrap file. But I just cannot get it to
> > display.
> > 
> > here is what I did...
> >  
> >   protected function _initView()
> >   {
> > // Initialize view
> > $view = new Zend_View();
> >  
> > $view->headLink()->headLink( array( 'rel' => 'favicon',
> > 'href' => $view->baseUrl( 'images/favicon.ico' ),
> > 'type' => 'image/x-icon' ));
> > 
> > // Add it to the ViewRenderer
> > $viewRenderer =
> >
> > Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
> > $viewRenderer->setView($view);
> >  
> > // Return it, so that it can be stored by the bootstrap
> > return $view;
> > }
> > 
> > 
> > Thanks and Regards
> > ShiVik
> > 
> 
> -- 
> View this message in context: 
> http://n4.nabble.com/Problem-in-displaying-favicon-in-Zend-tp932853p932858.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
  
_
I tuoi amici sempre a portata di clic, sul nuovo Web Messenger
http://www.windowslive.it/foto.aspx

RE: [fw-general] Zend Pdf: how to output for download?

2009-10-11 Thread Sergio Rinaudo

Ok, 
I reply to myself.
Add this methods in the controller


public function preDispatch(){
  $this->_helper->layout()->disableLayout();
  $this->_helper->viewRenderer->setNoRender(true);
}

public function init(){}

and it works! ;)






From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Sun, 11 Oct 2009 10:41:12 +0200
Subject: [fw-general] Zend Pdf: how to output for download?








Hello, 
another pdf question.
After I've created the pdf, how to output it for download?
This is the code I actually use and it doesn't work ( pdf is corrupted )

  $pdfString  = $pdf->render();
  $response = $this->getResponse();
  $response->setHeader('Cache-Control', 'public', true)
->setHeader('Content-Description', 'File Transfer', true)
->setHeader('Content-Disposition', 'attachment; 
filename=volantino.pdf', true)
->setHeader('Content-Type', 'application/pdf', true)
->setHeader('Content-Transfer-Encoding', 'binary', true)
->appendBody($pdfString);
  $this->_helper->layout->disableLayout(); 
  $this->_helper->viewRenderer->setNoRender(true);

What is the mistake?
Thanks




  
Un' immagine personale per Messenger? Crea il tuo Avatar!   
  
_
Le tue Emoticon ti sembrano poche? Scaricane di nuove!
http://intrattenimento.it.msn.com/emoticon/

[fw-general] Zend Pdf: how to output for download?

2009-10-11 Thread Sergio Rinaudo

Hello, 
another pdf question.
After I've created the pdf, how to output it for download?
This is the code I actually use and it doesn't work ( pdf is corrupted )

  $pdfString  = $pdf->render();
  $response = $this->getResponse();
  $response->setHeader('Cache-Control', 'public', true)
->setHeader('Content-Description', 'File Transfer', true)
->setHeader('Content-Disposition', 'attachment; 
filename=volantino.pdf', true)
->setHeader('Content-Type', 'application/pdf', true)
->setHeader('Content-Transfer-Encoding', 'binary', true)
->appendBody($pdfString);
  $this->_helper->layout->disableLayout(); 
  $this->_helper->viewRenderer->setNoRender(true);

What is the mistake?
Thanks




  
_
Le tue Emoticon ti sembrano poche? Scaricane di nuove!
http://intrattenimento.it.msn.com/emoticon/

RE: [fw-general] Zend pdf and vertical text

2009-10-10 Thread Sergio Rinaudo

Great, 
thanks!

I just need to 'rotate' the page
$page->rotate(0, 0, M_PI/12); 
$page->drawText('Hello world!', 150, 100);






> Date: Sun, 11 Oct 2009 01:02:34 -0500
> From: ralph.schind...@zend.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend pdf and vertical text
> 
> Have a look here:
> http://devzone.zend.com/article/2525
> 
> There are some hints in there.
> 
> Hope it helps,
> -ralph
> 
> Sergio Rinaudo wrote:
> > Hello,
> > is it possible using Zend_Pdf to draw a text vertically?
> > I did not find anything in the documentation.
> > Thanks
> > 
> > 
> > Un' immagine personale per Messenger? Crea il tuo Avatar! 
> > <http://avatarstudio.it.msn.com/>
  
_
Scrivi, parla, gioca... Scopri Messenger 2009
http://www.messenger.it/home_comunica.aspx

[fw-general] Zend pdf and vertical text

2009-10-10 Thread Sergio Rinaudo

Hello, 
is it possible using Zend_Pdf to draw a text vertically?
I did not find anything in the documentation.
Thanks
  
_
Le tue Emoticon ti sembrano poche? Scaricane di nuove!
http://intrattenimento.it.msn.com/emoticon/

FW: [fw-general] Zend_Form_Element_MultiCheckbox values

2009-09-21 Thread Sergio Rinaudo






Hi, 
I am not sure if this is your solution, but after you instanciate the form, try 
to set RegisterInArrayValidator to false


$form = new Your_Form(); // just an example
$form->groups->setRegisterInArrayValidator(false);

Give it a try.
Bye




> Date: Mon, 21 Sep 2009 16:58:15 +0200
> From: and...@metropolis.se
> To: fw-general@lists.zend.com
> Subject: [fw-general] Zend_Form_Element_MultiCheckbox values
> 
> Hi
> 
> My checked checkboxes are missing in the Post.
> 
> I'm making checkboxes like this:
> 
> $group = new Zend_Form_Element_MultiCheckbox('groups');
> $group->addMultiOption(1,'A');
> $group->addMultiOption(2,'B');
> $group->addMultiOption(3,'C');
> $form->addElement($group);
> 
> They look good in the html, and when posted I can see "groups" as an 
> array in $_POST,
> but just an empty string when looking in the
> $form->getValues()
> 
> What do I need to do to make the checkboxes appere in $form->getValues() ?
> 
> regards
> Anders
  
Preparati alla sfida all'ultima combinazione, gioca con Crosswire!  
  
_
Quante ne sai? Gioca con Crosswire e mettiti alla prova!
http://livesearch.games.msn.com/crosswire/default_it/

[fw-general] Zend Search Lucene and result limit

2009-09-21 Thread Sergio Rinaudo

Hi, 
I'm trying to query Lucene with result limit but I do not obtain last records 
as I expected, this is my code


Zend_Search_Lucene::setResultSetLimit(5);
$last = 
$index->find($query,'dateUpdated',SORT_REGULAR,SORT_DESC);


If I omit the limit, it is ok, I have my result well sorted. If I run the above 
code, I get the first five records ( like it was SORT_ASC ), not last five. Why?
Where I do mistake? It is any other method to limit a single query?

Thanks


  
_
Naviga al sicuro, usa Windows Live Messenger!
http://messenger.it/home_sicurezza.aspx

RE: [fw-general] Navigation view helper and nofollow links

2009-09-21 Thread Sergio Rinaudo

Nobody know that? 



From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Mon, 21 Sep 2009 04:48:34 +0200
Subject: [fw-general] Navigation view helper and nofollow links








Hello, 
I use to build menu in my application using 

$this->navigation()->menu($container)

where $container is a Zend_Navigation instance that contains instances of 
Zend_Navigation_Page.
Everything works fine, except that I cannot find the correct way to render the 
'rel' attribute with nofollow value.

This is an example of the code I use

$container->addPage(Zend_Navigation_Page::factory(array(
  'uri' => $myuri,
  'label' => $mylabel,
  'class' => $myclass,
  'rel' => array('nofollow'=>'nofollow'), // something wrong here...
  'order' => $sort
))

Links are rendered without rel, so the question is, what should be the rel 
array to be rendered as 'nofollow' ?
Thanks
  
Scarica Messenger gratis:  comunica, divertiti e condividi rapidamente! 
  
_
Messenger 2009: vieni a scoprire tutte le novità!
http://www.messenger.it/

[fw-general] Navigation view helper and nofollow links

2009-09-20 Thread Sergio Rinaudo

Hello, 
I use to build menu in my application using 

$this->navigation()->menu($container)

where $container is a Zend_Navigation instance that contains instances of 
Zend_Navigation_Page.
Everything works fine, except that I cannot find the correct way to render the 
'rel' attribute with nofollow value.

This is an example of the code I use

$container->addPage(Zend_Navigation_Page::factory(array(
  'uri' => $myuri,
  'label' => $mylabel,
  'class' => $myclass,
  'rel' => array('nofollow'=>'nofollow'), // something wrong here...
  'order' => $sort
))

Links are rendered without rel, so the question is, what should be the rel 
array to be rendered as 'nofollow' ?
Thanks
  
_
Quante ne sai? Gioca con Crosswire e mettiti alla prova!
http://livesearch.games.msn.com/crosswire/default_it/

RE: [fw-general] Zend Auth and subdomains

2009-08-30 Thread Sergio Rinaudo

I've probably found the problem

suhosin.cookie.cryptdocroot  = 1

suhosin.session.cryptdocroot = 1

and I cannot change these params for my host :)

Is it any other method to keep the user logged between subdomains?

Sergio Rinaudo




From: kaiohken1...@hotmail.com
To: m...@dasprids.de; fw-general@lists.zend.com
Date: Sun, 30 Aug 2009 04:01:19 +0200
Subject: RE: [fw-general] Zend Auth and subdomains








I still have this problem, I've done some tests:
The value of $_COOKIE["PHPSESSID"] is readable and identical on every subdomain.

The problem is that if I change subdomain I am automatically disconnected.

Maybe is there some other configuration with Zend_Auth?


Sergio Rinaudo






From: kaiohken1...@hotmail.com
To: m...@dasprids.de; fw-general@lists.zend.com
Date: Sun, 30 Aug 2009 02:26:01 +0200
Subject: RE: [fw-general] Zend Auth and subdomains








Hi, 
thanks for your reply.
According with this documentation page 
http://framework.zend.com/manual/en/zend.session.global_session_management.html#zend.session.global_session_management.setoptions.example

and also with your advice, I added the line cookie_domain in my application.ini

[..]
resources.session.cookie_domain = .mysite.com
[..]

then, in the bootstrap

Zend_Session::setOptions($config->resources->session->toArray());

The array contains the correct data.
After that, I tried to logout and login in again, but it does'n work, I am 
logged only in the domain where I've logged in.
Do you have an idea on where I do mistake?

Many thanks

Sergio Rinaudo






> Date: Sun, 30 Aug 2009 02:09:55 +0200
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend Auth and subdomains
> 
> -----BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Sergio Rinaudo wrote on 30.08.2009 01:44:
> > If a website is structured between various subdomains, what should be a
> > solution with Zend Framework to have an user logged for each subdomain?
> > I'm stuck with this problem..
> 
> Just set the cookie domain in the Zend_Session options to ".example.com"
> 
> - --
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : m...@dasprids.de   :
> : Jabber : jab...@dasprids.de :
> : ICQ: 105677955  :
> :::
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkqZw1AACgkQ0HfT5Ws789BStQCggv7Jic0LbYjazFQ6lp7bTt/N
> AL4AoNCt09IlEgua5cK4LaIea8sZKlCx
> =A5tE
> -END PGP SIGNATURE-

Screensaver e Sfondi: personalizza il tuo PC con Messenger!
Crea l'Avatar con la tua faccia.  Personalizza il tuo Messenger!
_
Racconta la tua estate, crea il tuo blog.
http://www.windowslive.it/spaces.aspx

RE: [fw-general] Zend Auth and subdomains

2009-08-29 Thread Sergio Rinaudo

I still have this problem, I've done some tests:
The value of $_COOKIE["PHPSESSID"] is readable and identical on every subdomain.

The problem is that if I change subdomain I am automatically disconnected.

Maybe is there some other configuration with Zend_Auth?


Sergio Rinaudo






From: kaiohken1...@hotmail.com
To: m...@dasprids.de; fw-general@lists.zend.com
Date: Sun, 30 Aug 2009 02:26:01 +0200
Subject: RE: [fw-general] Zend Auth and subdomains








Hi, 
thanks for your reply.
According with this documentation page 
http://framework.zend.com/manual/en/zend.session.global_session_management.html#zend.session.global_session_management.setoptions.example

and also with your advice, I added the line cookie_domain in my application.ini

[..]
resources.session.cookie_domain = .mysite.com
[..]

then, in the bootstrap

Zend_Session::setOptions($config->resources->session->toArray());

The array contains the correct data.
After that, I tried to logout and login in again, but it does'n work, I am 
logged only in the domain where I've logged in.
Do you have an idea on where I do mistake?

Many thanks

Sergio Rinaudo






> Date: Sun, 30 Aug 2009 02:09:55 +0200
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend Auth and subdomains
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Sergio Rinaudo wrote on 30.08.2009 01:44:
> > If a website is structured between various subdomains, what should be a
> > solution with Zend Framework to have an user logged for each subdomain?
> > I'm stuck with this problem..
> 
> Just set the cookie domain in the Zend_Session options to ".example.com"
> 
> - --
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : m...@dasprids.de   :
> : Jabber : jab...@dasprids.de :
> : ICQ: 105677955  :
> :::
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkqZw1AACgkQ0HfT5Ws789BStQCggv7Jic0LbYjazFQ6lp7bTt/N
> AL4AoNCt09IlEgua5cK4LaIea8sZKlCx
> =A5tE
> -END PGP SIGNATURE-

Screensaver e Sfondi: personalizza il tuo PC con Messenger!
_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx

RE: [fw-general] Zend Auth and subdomains

2009-08-29 Thread Sergio Rinaudo

Hi, 
thanks for your reply.
According with this documentation page 
http://framework.zend.com/manual/en/zend.session.global_session_management.html#zend.session.global_session_management.setoptions.example

and also with your advice, I added the line cookie_domain in my application.ini

[..]
resources.session.cookie_domain = .mysite.com
[..]

then, in the bootstrap

Zend_Session::setOptions($config->resources->session->toArray());

The array contains the correct data.
After that, I tried to logout and login in again, but it does'n work, I am 
logged only in the domain where I've logged in.
Do you have an idea on where I do mistake?

Many thanks

Sergio Rinaudo






> Date: Sun, 30 Aug 2009 02:09:55 +0200
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend Auth and subdomains
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Sergio Rinaudo wrote on 30.08.2009 01:44:
> > If a website is structured between various subdomains, what should be a
> > solution with Zend Framework to have an user logged for each subdomain?
> > I'm stuck with this problem..
> 
> Just set the cookie domain in the Zend_Session options to ".example.com"
> 
> - --
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : m...@dasprids.de   :
> : Jabber : jab...@dasprids.de :
> : ICQ: 105677955  :
> :::
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkqZw1AACgkQ0HfT5Ws789BStQCggv7Jic0LbYjazFQ6lp7bTt/N
> AL4AoNCt09IlEgua5cK4LaIea8sZKlCx
> =A5tE
> -END PGP SIGNATURE-

_
Porta Messenger in Vacanza! Scaricalo sul cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-messenger/default.aspx

[fw-general] Zend Auth and subdomains

2009-08-29 Thread Sergio Rinaudo

Hi, 
If a website is structured between various subdomains, what should be a 
solution with Zend Framework to have an user logged for each subdomain?
I'm stuck with this problem..
Hope to receive some advices :)
Thanks

Sergio Rinaudo





_
Porta Messenger in Vacanza! Scaricalo sul cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-messenger/default.aspx

[fw-general] Simple question About Error Controller

2009-08-27 Thread Sergio Rinaudo

Hi, 
in my application I use an ErrorController like the one explained here

http://framework.zend.com/manual/en/zend.controller.plugins.html#zend.controller.plugins.standard.errorhandler

and I have a Layout composed by different parts ( header, footer ecc.. ) loaded 
by the render() method.

I noticed that if the url calls an existing controller and a non existing 
action, I get my layout with all is parts and the ErrorController:error.

Instead, if the controller is non existing ( whatever action ), all the parts 
in my layout are missing ( except ErrorController:error ), like 
$this->getResponse()->clearBody(); is automatically called.

It is a problem only for my application ( maybe I have some code that cause 
this... ) or is a normal behaviour?
Thanks


Sergio

_
Scarica i nuovi gadget per personalizzare Messenger!
http://www.messenger.it/home_gadget.aspx

RE: [fw-general] Zend_Router Question

2009-08-25 Thread Sergio Rinaudo

Hi, 
the default route in ZF is a Module Route. Try this in your bootstrap :

  $this->bootstrap('frontController');
  $front = $this->getResource('FrontController');
  $router = $front->getRouter();
  $dispatcher = $front->getDispatcher();
  $request= $front->getRequest();

  $hostnameRoute = new Zend_Controller_Router_Route_Hostname(
':account.localhost',
array(),
array(
  'account' => '([a-z0-9]+)',
)
  );
  $plainPathRoute = new Zend_Controller_Router_Route_Module(array(),
$dispatcher,
$request);
  $router->addRoute('default', $hostnameRoute->chain($plainPathRoute));
  $front->setRouter($router);


This should work, let me know.
Bye



Sergio Rinaudo



> Date: Tue, 25 Aug 2009 18:03:32 -0700
> From: mile...@gmail.com
> To: fw-general@lists.zend.com
> Subject: [fw-general] Zend_Router Question
> 
> 
> Hello Everyone!
> 
> I've successfully setup a custom router that allows me to use sub-domains as
> account key's. For example http://foo21.example.com get's routed to
> www.example.com with an account param of foo21. However, when I add
> additional parameters to the link, the router no longer works:
> 
> http://foo21.example.com/home/index (WORKS)
> http://foo21.example.com/home/index?param1=value1 (WORKS)
> http://foo21.example.com/home/index/param1/value1 (DOES NOT WORK, router
> displays index controller and action irregardless of what's in the link)
> 
> 
> I've read the article located at
> http://www.noginn.com/2008/09/03/using-subdomains-as-account-keys/ as well
> as this mailing list for as much information as I could find on the matter.
> The following code is in my bootstrap file:
> 
> public function configureRouter()
>   {
>   $frontController = Zend_Controller_Front::getInstance();
>   $router = $frontController->getRouter();
>   $router->removeDefaultRoutes();
> 
> $pathRoute = new Zend_Controller_Router_Route(
> ':controller/:action/*',
>  array(
>   'controller' => 'index',
>   'action' => 'index'
>  )
>  );
> 
>  $accountRoute = new Zend_Controller_Router_Route_Hostname(
>   ':account.localhost',
>NULL,
>array(
> 'account' => '([a-z0-9]+)',
>)
>  );
>  $router->addRoute('default',
> $accountRoute->chain($pathRoute));
> 
>   }
> 
> What am I doing wrong here? I've been playing around with the above code for
> hours but nothing seems to work! Any help would be greatly appreciated!
> -- 
> View this message in context: 
> http://www.nabble.com/Zend_Router-Question-tp25144950p25144950.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

_
Scarica i nuovi gadget per personalizzare Messenger!
http://www.messenger.it/home_gadget.aspx

RE: [fw-general] Get a date from a string

2009-08-19 Thread Sergio Rinaudo

Forget it, 
solved

$date = new Zend_Date($formattedStringDate, 'MMdd', $locale); 

Bye

Sergio Rinaudo



From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Wed, 19 Aug 2009 16:48:23 +0200
Subject: [fw-general] Get a date from a string








Dear list, 
I am reading the documentation about Zend_Date, I noticed that I can get a 
string from a date using the toString() method. 
But what about if I want to get a date from a string? For example from 20090819 
( MMdd )?
Please help as I cannot find how to do this in the docs.
Thanks

Sergio Rinaudo

Scatta, Scarica, Modifica... Condividi le tue foto con Windows Live!
_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx

[fw-general] Get a date from a string

2009-08-19 Thread Sergio Rinaudo

Dear list, 
I am reading the documentation about Zend_Date, I noticed that I can get a 
string from a date using the toString() method. 
But what about if I want to get a date from a string? For example from 20090819 
( MMdd )?
Please help as I cannot find how to do this in the docs.
Thanks

Sergio Rinaudo

_
Taglia i costi con Messenger! Chiama e videochiama da PC a PC!
http://www.messenger.it/videoconversazioni.aspx

[fw-general] Zend Search Lucene: filter result by date

2009-08-19 Thread Sergio Rinaudo

Hi, 
using a database, for example, mysql, we have lots of date and time functions 
to filter our result properly. 
How about zend_search_lucene?

What should be the correct method for filtering record that are not older than 
a certain amount of days?
Many thanks.

Sergio Rinaudo


_
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx

RE: [fw-general] Multiselect form element and validation

2009-08-17 Thread Sergio Rinaudo

Thank you very much for this example, it helped me understand the way to do it.
Bye!

Sergio Rinaudo



> Date: Sun, 16 Aug 2009 20:58:01 -0700
> From: jo...@accentwebdesign.nl
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Multiselect form element and validation
> 
> 
> I don't think so, but it should not be too hard to write your own, since the
> value for your multiselect is an array. Something in the lines of the code
> below (not tested)
> 
>  class MyLib_Validate_MaxSelect extends Zend_Validate_Abstract
> {
> const TOO_MANY_SELECTED = 'notEither';
> 
> protected $_maxNumber;
> protected $_messageTemplates = array(self::TOO_MANY_SELECTED => 'You
> selected too many options.');
> 
> public function __construct ($maxNumber = 999)
> {
> $this->_maxNumber = (int) $maxNumber;
> }
> 
> public function isValid ($value)
> {
> if (count($value) <= $this->_maxNumber) {
> $this->_error(self::TOO_MANY_SELECTED);
> return false;
> }
> }
> }
> -- 
> View this message in context: 
> http://www.nabble.com/Multiselect-form-element-and-validation-tp24996346p25000698.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx

RE: [fw-general] New Router Question

2009-08-16 Thread Sergio Rinaudo

Hi, 
how to instance dispatcher and request objects in the bootstrap?
Thanks

Sergio

> Date: Sun, 16 Aug 2009 16:57:09 -0400
> From: matt...@zend.com
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] New Router Question
> 
> -- milesap  wrote
> (on Monday, 10 August 2009, 05:57 AM -0700):
> > This is the first time I need to change the default Zend Router, so I want 
> > to
> > make sure I'm doing it right. I need to have my links like so;
> > http://register.example.com/companyname/controller/action. 
> > 
> > I looked on this forum and found a solution that might work:
> > 
> > $route = new Zend_Controller_Router_Route(
> > ':companyname/:controller/:action/*',
> > array(
> > 'module' => 'default',
> > 'controller' => 'index',
> > 'action' => 'index'
> > )
> > );
> > $router->addRoute('newroute', $route); 
> > 
> > Is this the proper way to solve my problem? Finally, how would I be able to
> > determine the companyname in the link in my bootstrap file? Thanks so much
> > for your help!
> 
> If you will only have one module, yes, this will work. The companyname
> will then be pushed into the request object, and you can grab it using
> getParam('companyname').
> 
> If *all* controllers will be accessed this way, I'd recommend you set
> this as the "default" route (instead of "newroute"), to ensure that te
> companyname identifier is required for all controller/action pairs.
> 
> Finally, you should likely look into the route chaining mechanism:
> 
> 
> http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.chain
> 
> In this case, you would do something like this:
> 
> $companyRoute = new Zend_Controller_Router_Route(':companyname');
> $defaultRoute = new Zend_Controller_Router_Route_Module(
> array(),
> $dispatcher,
> $request
> );
> $chainRoute = new Zend_Controller_Router_Route_Chain();
> $chainRoute->chain($companyRoute)
>->chain($defaultRoute);
> 
> $router->addRoute('default', $chainRoute);
> 
> (You'll have to grab the dispatcher and request prior to this, obviously.)
> The above has the advantage of also allowing multiple modules in your
> application, while still requiring the companyname prefix.
> 
> -- 
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/

_
Taglia i costi con Messenger! Chiama e videochiama da PC a PC!
http://www.messenger.it/videoconversazioni.aspx

[fw-general] Multiselect form element and validation

2009-08-16 Thread Sergio Rinaudo

Hi, 
I need to limit the selection for a multiselect element, is there any validator 
for this purpose?
Thanks

Sergio Rinaudo

_
Taglia i costi con Messenger! Chiama e videochiama da PC a PC!
http://www.messenger.it/videoconversazioni.aspx

FW: [fw-general] Chain default route

2009-08-14 Thread Sergio Rinaudo

How to get these in the bootstrap?
Thanks

Sergio Rinaudo




> Date: Fri, 14 Aug 2009 19:25:46 +0200
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Chain default route
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Sergio Rinaudo wrote on 14.08.2009 18:27:
> > Hi,
> > yes, the default route is a Zend_Controller_Router_Route_Module as
> > explained in this page of the doc
> > http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.default-routes.
> > I tried to do a chain between the host route and a Module route with
> > empty constructor, but I got NULL as module value
> > when requesting mysite/admin.
> > 
> > Any other advices?
> > Thanks
> > 
> > 
> > Sergio Rinaudo
> 
> You must assign a dispatcher and request object in the constructor, else
> it won't find any module.
> 
> - --
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : m...@dasprids.de   :
> : Jabber : jab...@dasprids.de :
> : ICQ: 105677955  :
> :::
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkqFnhcACgkQ0HfT5Ws789CiPQCgvVH2fQN1bKlL44QC4tF0SyrR
> wzAAn3RzwU88OTZkkvMfbWd0WPfHLebq
> =kbIn
> -END PGP SIGNATURE-

Screensaver e Sfondi: personalizza il tuo PC con Messenger!
_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx

RE: [fw-general] Chain default route

2009-08-14 Thread Sergio Rinaudo

Hi, 
yes, the default route is a Zend_Controller_Router_Route_Module as explained in 
this page of the doc 
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.default-routes.
I tried to do a chain between the host route and a Module route with empty 
constructor, but I got NULL as module value 
when requesting mysite/admin.

Any other advices?
Thanks


Sergio Rinaudo




From: vinc...@delau.nl
To: kaiohken1...@hotmail.com; sayusi.a...@gmail.com
CC: fw-general@lists.zend.com
Date: Fri, 14 Aug 2009 14:53:52 +0200
Subject: RE: [fw-general] Chain default route




















I think that the default route is a Zend_Controller_Router_Route_Module
route. It does some checking if a module exists. You use that as your
$plainPathRoute. I suppose you can leave the constructor for this route empty.

 

Vincent de Lau

 vinc...@delau.nl

 

 

 







From: Sergio Rinaudo
[mailto:kaiohken1...@hotmail.com] 

Sent: Friday, August 14, 2009 1:46 PM

To: sayusi.a...@gmail.com

Cc: fw-general@lists.zend.com

Subject: RE: [fw-general] Chain default route





 

Yes, 

I'll explain my problem better.

For my project I've created an hostname chained route, this one



  $hostnameRoute = new
Zend_Controller_Router_Route_Hostname(

  ':myvar.mysite.com',

  array()

  );

  $plainPathRoute = new
Zend_Controller_Router_Route(

':controller/:action/*',

array(

  'module'=>'default',

 
'controller'=>'index',

  'action' => 'index'

)

  );

  $router->addRoute('myRoute',
$hostnameRoute->chain($plainPathRoute));

  $front->setRouter($router);



That works pretty well when we talk about the default module, but if I want to
get my admin module, 

by request 'www.mysite.com/admin', I get an error that says there is no
controller 'Admin' ( in fact there is not, I have an admin module ).



Then I tried to comment the hostname route and I can get again inside the admin
module, so I think the problem is that 'www.mysite.com/admin' 

match the hostname route, and a good solution could be use the default module
route as $plainPathRoute.



Actually, I temporarily solved the problem creating another route, this one





  $hostnameRoute = new
Zend_Controller_Router_Route_Hostname(

 ':myvar.mysite.com',

  array()

  );

  $plainPathRoute = new
Zend_Controller_Router_Route(

'admin/:controller/:action/*',

array(

  'module'=>'admin',

 
'controller'=>'index',

      'action' => 'index'

)

  );

  $router->addRoute('admin',
$hostnameRoute->chain($plainPathRoute));



that matches the admin module requests.

Hope it is clear, advices are welcome :)





Sergio Rinaudo





> Date: Fri, 14 Aug 2009 13:29:01 +0200

> From: sayusi.a...@gmail.com

> To: kaiohken1...@hotmail.com

> CC: fw-general@lists.zend.com

> Subject: Re: [fw-general] Chain default route

> 

> 2009/8/14 Sergio Rinaudo :

> > Hi,

> > it is possible to do an hostname route chain with the default module
route?

> > If yes, how?

> > I want to do this in the bootstrap.

> > Thanks

> 

> May I ask what do you want exactly? With an example would be better.

> 

> András

> 

> -- 

> - -

> -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando

> -- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell







Musica,
Cinema, Sport, News... Accendi
la Messenger TV!




_
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx

RE: [fw-general] Chain default route

2009-08-14 Thread Sergio Rinaudo

Yes, 
I'll explain my problem better.
For my project I've created an hostname chained route, this one

  $hostnameRoute = new Zend_Controller_Router_Route_Hostname(
  ':myvar.mysite.com',
  array()
  );
  $plainPathRoute = new Zend_Controller_Router_Route(
':controller/:action/*',
array(
  'module'=>'default',
  'controller'=>'index',
  'action' => 'index'
)
  );
  $router->addRoute('myRoute', $hostnameRoute->chain($plainPathRoute));
  $front->setRouter($router);

That works pretty well when we talk about the default module, but if I want to 
get my admin module, 
by request 'www.mysite.com/admin', I get an error that says there is no 
controller 'Admin' ( in fact there is not, I have an admin module ).

Then I tried to comment the hostname route and I can get again inside the admin 
module, so I think the problem is that 'www.mysite.com/admin' 
match the hostname route, and a good solution could be use the default module 
route as $plainPathRoute.

Actually, I temporarily solved the problem creating another route, this one


  $hostnameRoute = new Zend_Controller_Router_Route_Hostname(
 ':myvar.mysite.com',
  array()
  );
  $plainPathRoute = new Zend_Controller_Router_Route(
'admin/:controller/:action/*',
array(
  'module'=>'admin',
  'controller'=>'index',
      'action' => 'index'
)
  );
  $router->addRoute('admin', $hostnameRoute->chain($plainPathRoute));

that matches the admin module requests.
Hope it is clear, advices are welcome :)


Sergio Rinaudo


> Date: Fri, 14 Aug 2009 13:29:01 +0200
> From: sayusi.a...@gmail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> Subject: Re: [fw-general] Chain default route
> 
> 2009/8/14 Sergio Rinaudo :
> > Hi,
> > it is possible to do an hostname route chain with the default module route?
> > If yes, how?
> > I want to do this in the bootstrap.
> > Thanks
> 
> May I ask what do you want exactly? With an example would be better.
> 
> András
> 
> -- 
> - -
> --  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
> --  "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell

_
Scarica i nuovi gadget per personalizzare Messenger!
http://www.messenger.it/home_gadget.aspx

[fw-general] Chain default route

2009-08-14 Thread Sergio Rinaudo

Hi, 
it is possible to do an hostname route chain with the default module route?
If yes, how?
I want to do this in the bootstrap.
Thanks

Sergio Rinaudo


_
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx

RE: [fw-general] Zend_Controller_Router_Route_Regex and Apache 403 Forbidden error

2009-08-02 Thread Sergio Rinaudo

Thanks Dasprids, 
I tried, it doesn't work.
However I think I've found the cause of this error, this is the apache error log

(20024)The given path is misformatted or contained invalid characters: Cannot 
map GET

I am testing on my localhost and I use Windows as O.S. After searching on 
Google I've found that the cause it's a problem between Apache and Windows. 
I'll try on a Linux system as soon as possible hoping not to get this error :)

Regards

Sergio Rinaudo



> Date: Sat, 1 Aug 2009 20:46:42 +0200
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend_Controller_Router_Route_Regex and Apache 403 
> Forbidden error
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Sergio Rinaudo wrote on 01.08.2009 17:11:
> > Hi,
> > I'm using a Zend_Controller_Router_Route_Regex to make searches on my
> > application,
> > unfortunatelly, when I search special characters like double quote " or
> > also < or > I get
> > the Apache 403 forbidden error
> 
> Try rawurlencode() on the value before.
> 
> - --
> ...
> :  ___   _   ___ ___ ___ _ ___:
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :::
> : Web: http://www.dasprids.de :
> : E-mail : m...@dasprids.de   :
> : Jabber : jab...@dasprids.de :
> : ICQ: 105677955  :
> :::
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkp0jZEACgkQ0HfT5Ws789C9TACgrflgogTxYokHGlUg4yv4z01H
> yJMAoJmdbgM2JNOHmL/pu85oenPxwmEN
> =rNPJ
> -END PGP SIGNATURE-

_
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx

[fw-general] Zend_Controller_Router_Route_Regex and Apache 403 Forbidden error

2009-08-01 Thread Sergio Rinaudo

Hi, 
I'm using a Zend_Controller_Router_Route_Regex to make searches on my 
application, 
unfortunatelly, when I search special characters like double quote " or also < 
or > I get 
the Apache 403 forbidden error

You don't have permission to access /staticword-dynamicword".html
on this server.

This is my route

  $route = new Zend_Controller_Router_Route_Regex(
'staticword-(.+)\.html',
array(
  'module'=>'default',
  'controller' => 'search',
  'action' => 'index',
  'lang' => ''
),
array(
  1 => 'query'
),
'staticword-%s.html'
  );
  $router->addRoute('regexQuery', $route);

If I use a normal form/get search ( searchcontroller/?query=[...]  ), I have no 
problem, I can use any character.
I know it is more related to Apache than ZF, but I hope somebody could explain 
me what I should do to make it works.

Thank you

Sergio Rinaudo



_
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx

RE: [fw-general] Some strange behaviour with Zend_Search_Lucene

2009-08-01 Thread Sergio Rinaudo

I also tried to search numbers, but I don't get the right listing.
Does anybody notices same issues on their applications?

Advices are really appreciated.
Thanks

Sergio Rinaudo



From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Sat, 1 Aug 2009 06:41:44 +0200
Subject: [fw-general] Some strange behaviour with Zend_Search_Lucene








Hi, 
I'm trying to improve my search queries using Zend_Search_Lucene, 
according with this documentation page 
http://framework.zend.com/manual/en/zend.search.lucene.query-language.html, 
these '+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
' are special characters that needs to be escaped.

I've done some testing but I am not able to get the right result, I have for 
example something like this inside my contents

[word1 word2]

and I tried this query

+(+\[word1 +word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 


and also



+(+\[word1 word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 


and also



+(\[word1 word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 

and also



+("\[word1 word2\]") +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 

and +(+\[word1 +word2\]) ( sorry for this long list )

This query is constructed with the API, basically a Boolean query with 2 
subqueryes, the second one always a MultiTerm, for the first 
I tried with both MultiTerm and Phrase.
Using Luke I get the expected result.

So I am asking some advice to make an eventually special character search to be 
working...



Second question, only If I do a particular search, I get this Notice

Notice:  Undefined offset:  9 in 
C:\wamp\proj\library\Zend\Search\Lucene\Search\Query\MultiTerm.php on line 473

The query is something like +(+word1 +word2) +(+someField:someWord 
+someField2:someWord2 +someField3:someWord3)  
where word1 and word2 could be anything. Hovewer this is not a real problem, 
just a notice.

All tests done with ZF Version 1.9.0b1



I have a third and last question, does ZF documentation site uses Lucene?
I tried to search (1+1):2

and I did not get the expected page ( 
http://framework.zend.com/manual/en/zend.search.lucene.query-language.html )



Regards



Sergio Rinaudo
Sviluppatore Web - Esperto SEO - Zend Framework
Blog Tecnico: http://razorblade.netsons.org/



Condividi i tuoi ricordi online con chi vuoi tu chi vuoi tu.
_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx

[fw-general] Some strange behaviour with Zend_Search_Lucene

2009-07-31 Thread Sergio Rinaudo

Hi, 
I'm trying to improve my search queries using Zend_Search_Lucene, 
according with this documentation page 
http://framework.zend.com/manual/en/zend.search.lucene.query-language.html, 
these '+ - && || ! ( ) { } [ ] ^ " ~ * ? : \
' are special characters that needs to be escaped.

I've done some testing but I am not able to get the right result, I have for 
example something like this inside my contents

[word1 word2]

and I tried this query

+(+\[word1 +word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 


and also



+(+\[word1 word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 


and also



+(\[word1 word2\]) +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 

and also



+("\[word1 word2\]") +(+someField:someWord +someField2:someWord2 
+someField3:someWord3) 

and +(+\[word1 +word2\]) ( sorry for this long list )

This query is constructed with the API, basically a Boolean query with 2 
subqueryes, the second one always a MultiTerm, for the first 
I tried with both MultiTerm and Phrase.
Using Luke I get the expected result.

So I am asking some advice to make an eventually special character search to be 
working...



Second question, only If I do a particular search, I get this Notice

Notice:  Undefined offset:  9 in 
C:\wamp\proj\library\Zend\Search\Lucene\Search\Query\MultiTerm.php on line 473

The query is something like +(+word1 +word2) +(+someField:someWord 
+someField2:someWord2 +someField3:someWord3)  
where word1 and word2 could be anything. Hovewer this is not a real problem, 
just a notice.

All tests done with ZF Version 1.9.0b1



I have a third and last question, does ZF documentation site uses Lucene?
I tried to search (1+1):2

and I did not get the expected page ( 
http://framework.zend.com/manual/en/zend.search.lucene.query-language.html )



Regards



Sergio Rinaudo
Sviluppatore Web - Esperto SEO - Zend Framework
Blog Tecnico: http://razorblade.netsons.org/



_
Condividi i tuoi ricordi online con chi vuoi tu.
http://www.microsoft.com/italy/windows/windowslive/products/photos-share.aspx?tab=1

[fw-general] Access Zend_View properties from Zend_Paginator view script

2009-07-30 Thread Sergio Rinaudo

It is possible to access View properties created on My_Controller_Action in a 
Zend_Paginator view script?
Thanks.

Sergio Rinaudo


_
Con Windows Live, puoi organizzare, modificare e condividere le tue foto.
http://www.microsoft.com/italy/windows/windowslive/products/photo-gallery-edit.aspx

RE: [fw-general] Using url() view helper with regex route

2009-07-28 Thread Sergio Rinaudo

I've Also tried using the third parameter of Zend_Controller_Router_Route_Regex,
 to map the variable name

$route = new Zend_Controller_Router_Route_Regex(
 [...],
 [...],
 array(
  1 => 'myvar'
 ))
$router->addRoute('myregexroute', $route);

then in a view script


$this->url(array('myvar'' => $myparam),'myregexroute');



Same error.


Sergio Rinaudo


From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Tue, 28 Jul 2009 15:14:40 +0200
Subject: [fw-general] Using url() view helper with regex route








Dear list, 
I am using some regexRoutes and I need to use the url view helper.
Unfortunatelly, I get this error:

"Cannot assemble. Reversed route is not specified."

I don't have any problem with normal routes.
This is an example of the code I use:

$this->url(array('1' => $myparam),'myregexroute')

and I tried also with


$this->url(array($myparam),'myregexroute')

and



$this->url(1 => array($myparam),'myregexroute')



Any advices?

Many thanks


Sergio Rinaudo


Solo con Messenger, nuovi gadget gratuiti per te. Vieni a scoprirli!
_
Con Windows Live, puoi organizzare, modificare e condividere le tue foto.
http://www.microsoft.com/italy/windows/windowslive/products/photo-gallery-edit.aspx

[fw-general] Using url() view helper with regex route

2009-07-28 Thread Sergio Rinaudo

Dear list, 
I am using some regexRoutes and I need to use the url view helper.
Unfortunatelly, I get this error:

"Cannot assemble. Reversed route is not specified."

I don't have any problem with normal routes.
This is an example of the code I use:

$this->url(array('1' => $myparam),'myregexroute')

and I tried also with


$this->url(array($myparam),'myregexroute')

and



$this->url(1 => array($myparam),'myregexroute')



Any advices?

Many thanks


Sergio Rinaudo


_
Accendi le casse, è ora della Messenger Radio!
http://www.messenger.it/radioMessenger.aspx  

RE: [fw-general] Routing question

2009-07-25 Thread Sergio Rinaudo

Ok, I solved.
I'll post my solution in case will help somebody in the future

  $route = new Zend_Controller_Router_Route_Regex(
  'staticword-(.+)\.html',
  array(
'module' => 'default',
'controller' => 'search', 
'action' => 'index',
'lang' => ''
  )
  );


http://framework.zend.com/manual/en/zend.controller.router.html

Sergio Rinaudo




From: kaiohken1...@hotmail.com
To: fw-general@lists.zend.com
Date: Sun, 26 Jul 2009 01:44:49 +0200
Subject: [fw-general] Routing question








Hi, 
I want to make this kind of route:

www.mysite.com/staticword-dynamicword.html

where 'dynamicword' will be a variable.
I tried do make this route without success, I always get an 'Invalid controller 
specified' exception.

My test was with this code

  $route = new Zend_Controller_Router_Route_Static(
  'staticword-*.html',
  array(
'module' => 'default',
'controller' => 'search', 
'action' => 'index',
'lang' => ''
  )
  );
  $router->addRoute('routeTest', $route);

  $front->setRouter($router);

and also with





  $route = new Zend_Controller_Router_Route_Static(

  'staticword-:variable.html',

  array(

'module' => 'default',

'controller' => 'search', 

'action' => 'index',

'lang' => ''

  )

  );

  $router->addRoute('routeTest', $route);
  $front->setRouter($router);


Any advices are very appreciated.
Thank you


Sergio Rinaudo

Con Windows Live, puoi organizzare, modificare e  condividere le tue foto.
_
Con Windows Live, puoi organizzare, modificare e condividere le tue foto.
http://www.microsoft.com/italy/windows/windowslive/products/photo-gallery-edit.aspx

  1   2   >