Re: [fw-general] Zend_File_Transfer

2008-11-04 Thread Thomas Weidner

Use it...
In future it will be reworked so that it uses the rename filter but I have 
not finished my thoughts and it will not be reworked for 1.7 anyway.


If you don't set it, it will use the systems temp path, so there is nothing 
which you can do wrong.


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

- Original Message - 
From: "Tim Nagel" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, November 05, 2008 12:15 AM
Subject: Re: [fw-general] Zend_File_Transfer



Thomas,

Thanks for the response. While going through the
Zend_File_Transfer_Adapter_Abstract looking for the appropriate function, 
I

noticed that setDestination() is depreciated in favour of using a filter.

How do I set the destination path for the adapter if the method is
depreciated? Or, has it not yet been depreciated and I should continue to
use it until such time as the rename filter will deal with this itself?

Or am I missing something else? :-)



Tim

On Mon, Nov 3, 2008 at 18:19, Thomas Weidner <[EMAIL PROTECTED]> 
wrote:



First the files are uploaded to the destination path using
move_uploaded_file.
This is done in background when you use receive() or any method which 
calls

receive() in background.
Afterwards the filters are applied, and the file will be renamed.

The warning itself is thrown by php and means that it is not allowed to
move (rename) the file from it's destination directory to the defined
resourcepath.

I think that even if the directory is world wide accessable, there seems 
to

be a problem with the file permission itself.
You can simply test this out, by not applying the filter and then
rename/move the file from within the same script "manually" from the
destination path to the resourcepath.

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


- Original Message - From: "Tim Nagel" <[EMAIL PROTECTED]>
To: 
Sent: Monday, November 03, 2008 1:59 AM
Subject: [fw-general] Zend_File_Transfer


  Hello,


I am trying to write the server side component of a file uploading form,
which worked fine in its previous version with nothing to do with zend.
(using move_uploaded_file, rather than rename())

At this point, the front end is done and posts files as expected, the 
php

code:

 public function imageuploadAction()
 {
 if ($this->getRequest()->isPost())
 {
  $uploadAdapter = new Zend_File_Transfer_Adapter_Http(); // TODO: 
change

to Zend_File_Transfer when the factory is stable
  $resourcePath = APPLICATION_PATH .
Zend_Registry::get('config')->resourcepath . "/images";
  if (!is_dir($resourcePath))
  {
   throw new Exception('Savepath not found in config.ini or it isnt a
directory: ' . $resourcePath);
  }

  $uploadAdapter->addFilter('Rename', $resourcePath);
  if (!$uploadAdapter->receive())
  {
   $messages = $uploadAdapter->getMessages();
   echo implode('', $messages); die;
   //throw new Infinite_Exception_SystemError('receive returned false');
  }
  echo "redirect to edit screen"; die;
 }
 }

Results in the file ending up in the appropriate location at the end,
however it results in the output:


*Warning*:

rename(/var/tmp/AccessibleMarshal.dll,/usr/home/share/webdocs/tnagel/project/application/resources/images/filename.jpg)
[function.rename 
]:


Operation not permitted in *

/usr/home/share/webdocs/tnagel/project/library/Zend/Filter/File/Rename.php*on
line
*206*
redirect to edit screen

The resource directory is world writable.

It does seem 'safe' to ignore the warning, I assume move_uploaded_file 
is

where the file is getting copied rather than rename?


Tim










[fw-general] Re: [zf-contributors] Zend Framework SVN Commit Proposal

2008-11-04 Thread Matthew Ratzloff
Might want to make the ticket expression /ZF\-\d+/ just to make maintenance
of the hook easier.  You'll also want to prevent commits to tickets that are
closed.
The way that I've worked in the past with hooks like these is to use open
tickets for common tasks so that all Spanish documentation updates are
ZF-12345, for example, and this ticket tracks all Spanish language changes.
 Everything else (including general maintenance) is then tracked through a
ticket.  It can be a ticket like "Reorganization of repository layout" or
whatever, but it helps keep everything in one place and makes it easily
searchable.

For projects with a large number of committers, I've found this to be the
best way to keep things organized.

-Matt

On Tue, Nov 4, 2008 at 4:26 PM, Ralph Schindler <[EMAIL PROTECTED]>wrote:

>
> Hello all,
>
> I am proposing we introduce a pre-commit hook on the framework subversion
> repository that will help ensure that commit messages are properly
> formatted
> before the commit goes through.  The driving factor behind this proposal is
> simply integration.  Ideally, we would like to see all svn commits better
> formatted so that both our tools and processes can be more effective.
>
> So what does this all mean?
>
> Well, as some of you might be aware of, JIRA/Confluence/Fisheye is a pretty
> robust system with lots of features.  One of the more useful features is to
> be able to open an issue and in the Fisheye tab, be able to see all of the
> commit to the SVN repository that go along with that JIRA issue number.
>
> For example, take a look at this issue:
>
> http://framework.zend.com/issues/browse/ZF-4174
>
> Once inside the issue, click "Fisheye" at the bottom.  From here, we are
> able to see which revision it was fixed in, can click through to that
> revision, which files were changes, and the diff of the fix - all from
> within the issue.  Furthermore, it is easy to see if the fix was merged to
> the appropriate branch.  From a code management perspective this type of
> information is INVALUABLE.
>
> There are other side consequences: better continuous integration, better
> commit messages in the svn history of a file, encouragement of "atomic"
> commits (* see footnote), and once we get fisheye re-indexed, it too will
> have more invaluable information on a per commit level.
>
> All that said, this is the proposed pre-commit hook..
>
> All commit messages should at least contain one or more of the following
> tokens in the *first* line:
>
>DOCUMENTATION
>or DOC-LANGUAGE (such as DOC-ENGLISH, DOC-SPANISH)
>- this token is for documentation only commits
>GENERAL
>- this is to be avoided, but will be available for
>  svn maintenance and SELECT projects tasks
>ZF-1234 (/ZF-[0-9]{3,4})
>- this is to be the most common format as it will
>  reference JIRA issue numbers for which 99% of all
>  commits (outside of doc translations) are for.
>  Generally this should only be a single issue as
>  multiple issues should have multiple commits.
>
> If you have any special concerns with this plan, please let me know,
> Thanks,
> Ralph
>
>
>
> Footnotes:
> * "atomic commits" - each issue solved should have its own commit.  This
> means that if in the course of a nights work you fix 2 distinctly different
> issues, for example one in Zend_Controller and another in Zend_Db, they
> should each be committed to svn within their own separate commit.  This
> will
> help in not only merging, but backing out regressive issues.
>
>
>
> --
> Ralph Schindler
> Software Engineer | [EMAIL PROTECTED]
> Zend Framework| http://framework.zend.com/
>
>
>


[fw-general] Zend Framework SVN Commit Proposal

2008-11-04 Thread Ralph Schindler

Hello all,

I am proposing we introduce a pre-commit hook on the framework subversion
repository that will help ensure that commit messages are properly formatted
before the commit goes through.  The driving factor behind this proposal is
simply integration.  Ideally, we would like to see all svn commits better
formatted so that both our tools and processes can be more effective.

So what does this all mean?

Well, as some of you might be aware of, JIRA/Confluence/Fisheye is a pretty
robust system with lots of features.  One of the more useful features is to
be able to open an issue and in the Fisheye tab, be able to see all of the
commit to the SVN repository that go along with that JIRA issue number.

For example, take a look at this issue:

http://framework.zend.com/issues/browse/ZF-4174

Once inside the issue, click "Fisheye" at the bottom.  From here, we are
able to see which revision it was fixed in, can click through to that
revision, which files were changes, and the diff of the fix - all from
within the issue.  Furthermore, it is easy to see if the fix was merged to
the appropriate branch.  From a code management perspective this type of
information is INVALUABLE.

There are other side consequences: better continuous integration, better
commit messages in the svn history of a file, encouragement of "atomic"
commits (* see footnote), and once we get fisheye re-indexed, it too will
have more invaluable information on a per commit level.

All that said, this is the proposed pre-commit hook..

All commit messages should at least contain one or more of the following
tokens in the *first* line:

DOCUMENTATION
or DOC-LANGUAGE (such as DOC-ENGLISH, DOC-SPANISH)
- this token is for documentation only commits
GENERAL
- this is to be avoided, but will be available for
  svn maintenance and SELECT projects tasks
ZF-1234 (/ZF-[0-9]{3,4})
- this is to be the most common format as it will
  reference JIRA issue numbers for which 99% of all
  commits (outside of doc translations) are for.
  Generally this should only be a single issue as
  multiple issues should have multiple commits.

If you have any special concerns with this plan, please let me know,
Thanks,
Ralph



Footnotes:   
* "atomic commits" - each issue solved should have its own commit.  This
means that if in the course of a nights work you fix 2 distinctly different
issues, for example one in Zend_Controller and another in Zend_Db, they
should each be committed to svn within their own separate commit.  This will
help in not only merging, but backing out regressive issues.



-- 
Ralph Schindler
Software Engineer | [EMAIL PROTECTED]
Zend Framework| http://framework.zend.com/




Re: [fw-general] Dijit Editor

2008-11-04 Thread Matthew Lurz

I've been unable to get this working and so thought I would post some code to
see if anyone might see something out of place.

Here's the form class:

http://www.paste2.org/p/97000

I found this post,
http://www.nabble.com/two-column-site-to19665005.html#a19670193, but
changing the location where the element is created didn't have any impact
for me.

Here's an action method. The other form elements are saved, but not
'content'. I've checked the values of $_POST as well and seems the element
is never populated though the JavaScript (see below) looks good to me.

http://www.paste2.org/p/97003

Here's the HTML output:

http://www.paste2.org/p/97004

As I stated in the initial post, I've tried several variations of ZF and
Dojo versions. Any help would be greatly appreciated.


Matthew Lurz wrote:
> 
> I've been unable to get the Dijit.Editor element to work using trunk or
> the the 1.7 preview release. When using Dojo 1.2, from either the official
> Dojo 1.2 release or CDN, I receive this error: "RichText should not be
> used with the TEXTAREA tag. See dijit._editor.RichText docs.". When using
> Dojo from trunk or the 1.7 preview release I receive the same error as
> well as the errors due to the following missing files.
> 
> dijit/form/nls/en/Textarea.js
> dijit/_editor/nls/en/commands.js
> 

-- 
View this message in context: 
http://www.nabble.com/Dijit-Editor-tp20141019p20334087.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Call for Resumes!

2008-11-04 Thread Wil Sinclair
Hi all, sorry for being a bit OT here, but Zend currently has some very
high-impact positions that require strong ZF expertise. Here is the job
board as it currently stands:
http://www.zend.com/en/company/jobs-at-zend/. We need people to do
training, support, and- a very special position that our own Cal Evans
left open- *DevZone editor in Chief*. If you'd like to work with Zend
Framework at the company behind it, please send your resume directly to
me at the reply-to address
If you aren't interested in/don't quality for one of these positions,
but you'd just like me to hold your resume for any future positions at
Zend, feel free to send me your resume, too.
If you are interested in the Zend Community Manager/Leader & DevZone
Editor-In-Chief position, please send me your resume ASAP!

Thanks.
,Wil


Re: [fw-general] Zend_File_Transfer

2008-11-04 Thread Tim Nagel
Thomas,

Thanks for the response. While going through the
Zend_File_Transfer_Adapter_Abstract looking for the appropriate function, I
noticed that setDestination() is depreciated in favour of using a filter.

How do I set the destination path for the adapter if the method is
depreciated? Or, has it not yet been depreciated and I should continue to
use it until such time as the rename filter will deal with this itself?

Or am I missing something else? :-)



Tim

On Mon, Nov 3, 2008 at 18:19, Thomas Weidner <[EMAIL PROTECTED]> wrote:

> First the files are uploaded to the destination path using
> move_uploaded_file.
> This is done in background when you use receive() or any method which calls
> receive() in background.
> Afterwards the filters are applied, and the file will be renamed.
>
> The warning itself is thrown by php and means that it is not allowed to
> move (rename) the file from it's destination directory to the defined
> resourcepath.
>
> I think that even if the directory is world wide accessable, there seems to
> be a problem with the file permission itself.
> You can simply test this out, by not applying the filter and then
> rename/move the file from within the same script "manually" from the
> destination path to the resourcepath.
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
>
> - Original Message - From: "Tim Nagel" <[EMAIL PROTECTED]>
> To: 
> Sent: Monday, November 03, 2008 1:59 AM
> Subject: [fw-general] Zend_File_Transfer
>
>
>   Hello,
>>
>> I am trying to write the server side component of a file uploading form,
>> which worked fine in its previous version with nothing to do with zend.
>> (using move_uploaded_file, rather than rename())
>>
>> At this point, the front end is done and posts files as expected, the php
>> code:
>>
>>  public function imageuploadAction()
>>  {
>>  if ($this->getRequest()->isPost())
>>  {
>>   $uploadAdapter = new Zend_File_Transfer_Adapter_Http(); // TODO: change
>> to Zend_File_Transfer when the factory is stable
>>   $resourcePath = APPLICATION_PATH .
>> Zend_Registry::get('config')->resourcepath . "/images";
>>   if (!is_dir($resourcePath))
>>   {
>>throw new Exception('Savepath not found in config.ini or it isnt a
>> directory: ' . $resourcePath);
>>   }
>>
>>   $uploadAdapter->addFilter('Rename', $resourcePath);
>>   if (!$uploadAdapter->receive())
>>   {
>>$messages = $uploadAdapter->getMessages();
>>echo implode('', $messages); die;
>>//throw new Infinite_Exception_SystemError('receive returned false');
>>   }
>>   echo "redirect to edit screen"; die;
>>  }
>>  }
>>
>> Results in the file ending up in the appropriate location at the end,
>> however it results in the output:
>>
>>
>> *Warning*:
>>
>> rename(/var/tmp/AccessibleMarshal.dll,/usr/home/share/webdocs/tnagel/project/application/resources/images/filename.jpg)
>> [function.rename ]:
>>
>> Operation not permitted in *
>>
>> /usr/home/share/webdocs/tnagel/project/library/Zend/Filter/File/Rename.php*on
>> line
>> *206*
>> redirect to edit screen
>>
>> The resource directory is world writable.
>>
>> It does seem 'safe' to ignore the warning, I assume move_uploaded_file is
>> where the file is getting copied rather than rename?
>>
>>
>> Tim
>>
>>
>


Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Jason Webster

You can manually clear the response body.

$response->clearBody()

I think I'll file a ticket and start work on improving the Exception 
handling with regards to plugins.


Waigani wrote:

Yeah, I'm trying that:

$this->getResponse()->setException(new Zend_Exception("test"));

It does get handled in dispatchLoopStartup by the error controller, but
orginal action also gets called as well as the error action (and you get two
views rendered - orginal and error). When I throw an exception in a plugin,
I want to stop everything and just handle that exception in the error
controller.



keith Pope-4 wrote:
  

Would adding an exception to the Response work though?

2008/11/4 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:


-- Waigani <[EMAIL PROTECTED]> wrote
(on Monday, 03 November 2008, 09:59 PM -0800):
  

Is it possible? I want to throw an exception in the preDispatch of a
plugin
if you are not allowed to view the page. I then want to handle that
exception via the errorController. I can wrap the $front->dispatch() in
a
try / catch and catch the exception in the bootstrap, but then how do I
forward that onto the errorController, as the front controller has not
been
dispatched? I've read the manual and other posts and have not found an
answer nor an alternative method.


Currently, throwing exceptions in plugins is unhandled, and you must
handle them manually, as you are attempting to do.

Probably the easiest way to re-dispatch in this case is to simply set an
error message in the session, and then redirect to an error page where
you display that message.

We *have* noted this issue for a future Zend_Controller improvement.

--
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/

  


--
--
[MuTe]
--





  




Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Waigani

Yeah, I'm trying that:

$this->getResponse()->setException(new Zend_Exception("test"));

It does get handled in dispatchLoopStartup by the error controller, but
orginal action also gets called as well as the error action (and you get two
views rendered - orginal and error). When I throw an exception in a plugin,
I want to stop everything and just handle that exception in the error
controller.



keith Pope-4 wrote:
> 
> Would adding an exception to the Response work though?
> 
> 2008/11/4 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
>> -- Waigani <[EMAIL PROTECTED]> wrote
>> (on Monday, 03 November 2008, 09:59 PM -0800):
>>> Is it possible? I want to throw an exception in the preDispatch of a
>>> plugin
>>> if you are not allowed to view the page. I then want to handle that
>>> exception via the errorController. I can wrap the $front->dispatch() in
>>> a
>>> try / catch and catch the exception in the bootstrap, but then how do I
>>> forward that onto the errorController, as the front controller has not
>>> been
>>> dispatched? I've read the manual and other posts and have not found an
>>> answer nor an alternative method.
>>
>> Currently, throwing exceptions in plugins is unhandled, and you must
>> handle them manually, as you are attempting to do.
>>
>> Probably the easiest way to re-dispatch in this case is to simply set an
>> error message in the session, and then redirect to an error page where
>> you display that message.
>>
>> We *have* noted this issue for a future Zend_Controller improvement.
>>
>> --
>> Matthew Weier O'Phinney
>> Software Architect   | [EMAIL PROTECTED]
>> Zend Framework   | http://framework.zend.com/
>>
> 
> 
> 
> -- 
> --
> [MuTe]
> --
> 
> 

-- 
View this message in context: 
http://www.nabble.com/handle-any-exception-with-errorController-tp20316623p20328794.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Atlassian feature requests for PHP developers. . .

2008-11-04 Thread Wil Sinclair
Hey all, Atlassian has expressed interest in support PHP development, so
I'd like to help them by providing feature requests from actual PHP
developers. To this end, I've set up this wiki page:
http://framework.zend.com/wiki/display/ZFDEV/Feature+Requests+for+Atassi
an+Toolset. I'd like to focus on PHP-related features, but feel free to
enter more general feature requests if you believe they would
significantly benefit the project. After I've had a chance to go through
and figure out which product issue tracker they should be entered in, I
will register them on Atlassian's site.

Thanks.
,Wil


Re: [fw-general] APC and ZF tutorial

2008-11-04 Thread Tobias Gies
 Hey davideFashionPeople,

First off, sorry for sounding like a teacher now, but begging for answers in
other threads is gonna get you some instant *plonk*s. You know that, right?
Second, most people on this list use their real names to post, and I
personally like it that way :-).

About your question: Your post seems to have never reached this list, or any
other ZF list I'm subscribed to. are you sure you really have sent it?

Best regards,
Tobias

2008/11/4 davideFashionPeople <[EMAIL PROTECTED]>

>
> Sorry for off topic:
>
> But AnyBody Could you help in my thead "layout.phtml calling action"
> --
> View this message in context:
> http://www.nabble.com/APC-and-ZF-tutorial-tp20319957p20324493.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] Framework speed shotout -- question

2008-11-04 Thread ekerazha

That's only the Active Record implementation (I did miss that 2 files
though). We are at 4 files found now - excluding yiilite.php obviously -.

However, I think these few situations do make a good use of multiple classes
inside a file (PHP doesn't allow nested classes but at least it allows
multiple classes inside the same file, like C#).


Matthew Ratzloff wrote:
> 
> e.g.,
> http://yii.googlecode.com/svn/trunk/framework/db/ar/CActiveRecord.php
> http://yii.googlecode.com/svn/trunk/framework/db/ar/CActiveFinder.php
> 
> -Matt
> 
-- 
View this message in context: 
http://www.nabble.com/Framework-speed-shotoutquestion-tp19914787p20327430.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Zend_Capcha

2008-11-04 Thread dele454

Thanks for the code. Am not using Zend_Form for my forms. Am using plain
html. I just didnt find it flexible enough for views such as floating three
drop downs side by side and etc. It was taking too much of my time trying to
make my view display as intended.

Thanks for the code anyway.



vRandom wrote:
> 
> 
> I found this example code in one of the bug reports ...
> (http://framework.zend.com/issues/browse/ZF-4045)
> 
> Works good enough to get an idea of how to put the captcha to use. (as
> there
> is limited documentation examples)
> 
> I didn't see one of these Zend_Form_Element_Captcha in your code, maybe it
> is what you need.
> 
> Slightly modified for quick test...
> 
> Try something like this : 
> 
>   // (fix pathing for your dev setup)
>   // setup for captcha image
> 
> $captchaImage = new Zend_Captcha_Image();
> $captchaImage->setFont(DATAPATH.'/VeraBd.ttf');
> $captchaImage->setFontSize(30);
> $captchaImage->setWordlen(6);
> $captchaImage->setImgDir(CAPTCHAPATH);
> $captchaImage->setImgUrl('/images/captcha/');
> $captchaImage->setWidth(175);
> $captchaImage->setHeight(75);
> $captchaImage->setName('captcha');
> 
>   // text box for user input
> $elementCaptcha = new Zend_Form_Element_Captcha(
> 'captcha', array('captcha' => $captchaImage)
> );
> 
>   // make form
> $form = new Zend_Form(array(
> 'action' => '/manage/',
> 'method' => 'post',
> ));
> 
>   // add items to form
> $form->addElement($elementCaptcha, 'captcha')
> ->addElement('submit', 'process', array(
> 'required' => false,
> 'ignore'   => true,
> 'label'=> 'Process',
> ));
> 
>   // set image to view
> $this->view->captcha = $captchaImage;
> 
>   // check if form post
> $request = $this->getRequest();
> if (!$request->isPost()) {
>   // if not show form
> $this->view->form = $form;  
> }
> 
>   // test form valid?
> if (!$form->isValid($request->getPost())) {
>   // if not show form
> $this->view->form = $form;
> }
> 
>   
>   // this was originally in the view script
>   // but I didn't want to wack my existing so
>   // modified it to work here
> 
>   // if we have form, show it - or form did validate
>  if (isset($this->view->form)) {
>   echo 'Testing Captcha';
>   echo $this->view->form;
>  } else {
>   echo 'Captcha Form validated!';
>  }
> 
>   // dump the capcha data
>  if (isset($this->view->captcha)) {
>   echo 'Captcha word dump';
>   echo ''.
> var_dump($this->view->captcha->getWord()).'';
>  } 
> 
> 
> 
> -Original Message-
> From: dele454 [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 04, 2008 5:19 AM
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend_Capcha
> 
> 
> Any one out there with help? Please!!
> 
> dele454 wrote:
>> 
>> hi,
>> 
>> i am trying to verify the text submitted to match that of the captcha. 
>> If
>> valid(same) echo 'validated'.
>> 
>> class JoinController extends Zend_Controller_Action {
>> 
>>  public function indexAction(){
>>  
>>  $this->_helper->layout->setLayout('layout-site');
>>  $view = new Zend_View();
>>  // Originating request:
>>  $captcha = new Zend_Captcha_Image(array(
>>  'name' => 'foo',
>>  'height' => 100,
>>  'width' => 202,
>>  'wordLen'=> '6',
>>  'expiration' => '300',
>>  'font' =>
>> 'C:/xampp/htdocs/xampp/mainevent/public_html/img/font/ravie.ttf',
>>
> 'imgDir'=>'C:/xampp/htdocs/xampp/mainevent/public_html/img/captcha',
>>  'imgUrl' => '../img/captcha',
>>  'fontSize' => '24',
>>  
>>  
>>  
>>  ));
>>  $id = $captcha->generate();
>>  $this->view->showCaptcha = $captcha->render($view);
>>  
>>  
>>  
>>  if ($captcha->isValid($_POST['captcha'])) {
>>echo "Validated!";
>>
>>  }
>>   else{ echo "no";
>>   print_r($captcha->getMessages());}
>>  }   
>>   
>>  
>> 
>> }
>> 
>> When i submit the form it always echos 'no'!. Printing the error 
>> message i get this
>> 
>> Array ( [missingValue] => Empty captcha value )
>> 
>> How can i sort this out. I am thinking the captcha will always have a 
>> different value on post when compared to the text field. How can i 
>> resolve this.

Re: [fw-general] Framework speed shotout -- question

2008-11-04 Thread Matthew Ratzloff
>
> In the framework/db/ dir I can't see any file with multiple classes.
>

e.g.,
http://yii.googlecode.com/svn/trunk/framework/db/ar/CActiveRecord.php
http://yii.googlecode.com/svn/trunk/framework/db/ar/CActiveFinder.php

-Matt

On Mon, Nov 3, 2008 at 10:54 PM, ekerazha <[EMAIL PROTECTED]> wrote:

>
>
> Matthew Ratzloff wrote:
> >
> > The database classes, for instance.
> >
> In the framework/db/ dir I can't see any file with multiple classes.
>
>
> Matthew Ratzloff wrote:
> >
> > One class per file is not "over-engineering".
> >
> It does depend on the situation.
> --
> View this message in context:
> http://www.nabble.com/Framework-speed-shotoutquestion-tp19914787p20317056.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Matthew Weier O'Phinney
-- Jason Webster <[EMAIL PROTECTED]> wrote
(on Tuesday, 04 November 2008, 08:26 AM -0800):
> Huh? I really don't understand. Matthew, could you please elaborate?
>
> The preDispatch method of the Plugin Broker has a try/catch block that  
> should grab anything, and send it to the request object? no?

Oh, never mind. I forgot that Ralph added that for 1.6.

The problem now is one of making sure that on preDispatch(), we forward
to the ErrorController if an exception is present in the response. Can
you open an issue for that, please?


> Matthew Weier O'Phinney wrote:
>> -- Waigani <[EMAIL PROTECTED]> wrote
>> (on Monday, 03 November 2008, 09:59 PM -0800):
>>   
>>> Is it possible? I want to throw an exception in the preDispatch of a plugin
>>> if you are not allowed to view the page. I then want to handle that
>>> exception via the errorController. I can wrap the $front->dispatch() in a
>>> try / catch and catch the exception in the bootstrap, but then how do I
>>> forward that onto the errorController, as the front controller has not been
>>> dispatched? I've read the manual and other posts and have not found an
>>> answer nor an alternative method.
>>> 
>>
>> Currently, throwing exceptions in plugins is unhandled, and you must
>> handle them manually, as you are attempting to do.
>>
>> Probably the easiest way to re-dispatch in this case is to simply set an
>> error message in the session, and then redirect to an error page where
>> you display that message.
>>
>> We *have* noted this issue for a future Zend_Controller improvement.
>>
>>   
>

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] Zend_Translate and 1.7.0PR issue/question

2008-11-04 Thread Robert Castley
Hi,
 
I thought I would take the Preview Release for a spin.  But I immediately
hit an issue with Zend_Translate.
 
My error message is:
 
Notice: No translation for the language 'en_GB' available. in
/Users/rwc/Sites/ZendFramework-SVN/library/Zend/Translate/Adapter.php on
line 301
 
I have a language plugin I call in my bootstrap.  This works perfectly under
1.6.3, here is the code:
 
 0,
'cache_id_prefix' => 'Magik_',
'lifetime' => null
);

$backendOptions = array(
'cache_dir' => CACHE
);

$cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
$backendOptions);
Zend_Translate::setCache($cache);
  
$options = array('scan' => Zend_Translate::LOCALE_DIRECTORY);
 
$translate = new Zend_Translate('csv', 'languages', 'auto',
$options);
 
if ($translate->isAvailable($locale->getLanguage()) != 1) {
$locale->setLocale('en');
}
 
$translate->setLocale($locale->getLanguage());

setcookie('lang', $locale->getLanguage(), null, '/');

Zend_Registry::set('locale', $locale->getLanguage());
Zend_Registry::set('Zend_Translate', $translate);
}
}

The other interesting thing to note is that in my cache directory with 1.6.3
I get two files, but with the PR I get loads!  One for each lang file and
one for each file under my CVS directory (repository, entries, root etc).
 
I had a look at the docs online and there was some mention of Zend Locale
compatibility mode which I have set to false, but still no luck.
 
Any pointers?
 
Cheers,
- Robert
 



This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.


RE: [fw-general] Zend_Capcha

2008-11-04 Thread Terre Porter

I found this example code in one of the bug reports ...
(http://framework.zend.com/issues/browse/ZF-4045)

Works good enough to get an idea of how to put the captcha to use. (as there
is limited documentation examples)

I didn't see one of these Zend_Form_Element_Captcha in your code, maybe it
is what you need.

Slightly modified for quick test...

Try something like this : 

// (fix pathing for your dev setup)
// setup for captcha image

  $captchaImage = new Zend_Captcha_Image();
$captchaImage->setFont(DATAPATH.'/VeraBd.ttf');
$captchaImage->setFontSize(30);
$captchaImage->setWordlen(6);
$captchaImage->setImgDir(CAPTCHAPATH);
$captchaImage->setImgUrl('/images/captcha/');
$captchaImage->setWidth(175);
$captchaImage->setHeight(75);
$captchaImage->setName('captcha');

// text box for user input
$elementCaptcha = new Zend_Form_Element_Captcha(
'captcha', array('captcha' => $captchaImage)
);

// make form
$form = new Zend_Form(array(
'action' => '/manage/',
'method' => 'post',
));

// add items to form
$form->addElement($elementCaptcha, 'captcha')
->addElement('submit', 'process', array(
'required' => false,
'ignore'   => true,
'label'=> 'Process',
));

// set image to view
$this->view->captcha = $captchaImage;

// check if form post
$request = $this->getRequest();
if (!$request->isPost()) {
// if not show form
$this->view->form = $form;  
}

// test form valid?
if (!$form->isValid($request->getPost())) {
// if not show form
$this->view->form = $form;
}


// this was originally in the view script
// but I didn't want to wack my existing so
// modified it to work here

// if we have form, show it - or form did validate
   if (isset($this->view->form)) {
echo 'Testing Captcha';
echo $this->view->form;
 } else {
echo 'Captcha Form validated!';
 }

// dump the capcha data
   if (isset($this->view->captcha)) {
echo 'Captcha word dump';
echo ''.
var_dump($this->view->captcha->getWord()).'';
   } 



-Original Message-
From: dele454 [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 04, 2008 5:19 AM
To: fw-general@lists.zend.com
Subject: Re: [fw-general] Zend_Capcha


Any one out there with help? Please!!

dele454 wrote:
> 
> hi,
> 
> i am trying to verify the text submitted to match that of the captcha. 
> If
> valid(same) echo 'validated'.
> 
> class JoinController extends Zend_Controller_Action {
> 
>   public function indexAction(){
>   
>   $this->_helper->layout->setLayout('layout-site');
>   $view = new Zend_View();
>   // Originating request:
>   $captcha = new Zend_Captcha_Image(array(
>   'name' => 'foo',
>   'height' => 100,
>   'width' => 202,
>   'wordLen'=> '6',
>   'expiration' => '300',
>   'font' =>
> 'C:/xampp/htdocs/xampp/mainevent/public_html/img/font/ravie.ttf',
>
'imgDir'=>'C:/xampp/htdocs/xampp/mainevent/public_html/img/captcha',
>   'imgUrl' => '../img/captcha',
>   'fontSize' => '24',
>   
>   
>   
>   ));
>   $id = $captcha->generate();
>   $this->view->showCaptcha = $captcha->render($view);
>   
>   
>   
>   if ($captcha->isValid($_POST['captcha'])) {
>echo "Validated!";
> 
>  }
>else{ echo "no";
>print_r($captcha->getMessages());}
>   }   
>
>   
> 
> }
> 
> When i submit the form it always echos 'no'!. Printing the error 
> message i get this
> 
> Array ( [missingValue] => Empty captcha value )
> 
> How can i sort this out. I am thinking the captcha will always have a 
> different value on post when compared to the text field. How can i 
> resolve this.
> 


-
dee
--
View this message in context:
http://www.nabble.com/Zend_Capcha-tp20300142p20319514.html
Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Zend_Capcha

2008-11-04 Thread dele454

http://www.nabble.com/file/p20325789/1.gif 

The captcha gets created but i noticed besides the fact that i cant get the
text on the captcha validated with entered text. On my folder two captcha
images are created on hiting the page.

I have tried to figure out what might be causing this but to no avail. Any
suggestions?

http://www.nabble.com/file/p20325789/2.gif 





dele454 wrote:
> 
> Any one out there with help? Please!!
> 
> dele454 wrote:
>> 
>> hi,
>> 
>> i am trying to verify the text submitted to match that of the captcha. If
>> valid(same) echo 'validated'.
>> 
>> class JoinController extends Zend_Controller_Action
>> {
>> 
>>  public function indexAction(){
>>  
>>  $this->_helper->layout->setLayout('layout-site');
>>  $view = new Zend_View();
>>  // Originating request:
>>  $captcha = new Zend_Captcha_Image(array(
>>  'name' => 'foo',
>>  'height' => 100,
>>  'width' => 202,
>>  'wordLen'=> '6',
>>  'expiration' => '300',
>>  'font' =>
>> 'C:/xampp/htdocs/xampp/mainevent/public_html/img/font/ravie.ttf',
>>  
>> 'imgDir'=>'C:/xampp/htdocs/xampp/mainevent/public_html/img/captcha',
>>  'imgUrl' => '../img/captcha',
>>  'fontSize' => '24',
>>  
>>  
>>  
>>  ));
>>  $id = $captcha->generate();
>>  $this->view->showCaptcha = $captcha->render($view);
>>  
>>  
>>  
>>  if ($captcha->isValid($_POST['captcha'])) {
>>echo "Validated!";
>>
>>  }
>>   else{ echo "no";
>>   print_r($captcha->getMessages());}
>>  }   
>>   
>>  
>> 
>> }
>> 
>> When i submit the form it always echos 'no'!. Printing the error message
>> i get this
>> 
>> Array ( [missingValue] => Empty captcha value ) 
>> 
>> How can i sort this out. I am thinking the captcha will always have a
>> different value on post when compared to the text field. How can i
>> resolve this.
>> 
> 
> 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Captcha-tp20300142p20325789.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Jason Webster

Huh? I really don't understand. Matthew, could you please elaborate?

The preDispatch method of the Plugin Broker has a try/catch block that 
should grab anything, and send it to the request object? no?



Matthew Weier O'Phinney wrote:

-- Waigani <[EMAIL PROTECTED]> wrote
(on Monday, 03 November 2008, 09:59 PM -0800):
  

Is it possible? I want to throw an exception in the preDispatch of a plugin
if you are not allowed to view the page. I then want to handle that
exception via the errorController. I can wrap the $front->dispatch() in a
try / catch and catch the exception in the bootstrap, but then how do I
forward that onto the errorController, as the front controller has not been
dispatched? I've read the manual and other posts and have not found an
answer nor an alternative method.



Currently, throwing exceptions in plugins is unhandled, and you must
handle them manually, as you are attempting to do.

Probably the easiest way to re-dispatch in this case is to simply set an
error message in the session, and then redirect to an error page where
you display that message.

We *have* noted this issue for a future Zend_Controller improvement.

  




Re: [fw-general] Filter Digits on Zend_Form

2008-11-04 Thread Matthew Weier O'Phinney
-- Bagus Nugroho <[EMAIL PROTECTED]> wrote
(on Tuesday, 04 November 2008, 10:18 PM +0700):
> I'm trying using 'Digits' filter on Zend_Form like this :
> ==
> class My_Form_Project_Test extends Zend_Form{
>  public function __construct($options = null){
>   parent::__construct($options);
>   
>   $update = new Zend_Form_Element_Text('test');
>   $update->setLabel('Test')
>   ->addFilter('Digits');
>  
>  
>   $submit = new Zend_Form_Element_Submit('submit');
>   $submit->setLabel('Submit');
>  
>  
>   $this->addElements(array($update, $submit));
>  }
> }
>  
> then, when input '1000asdf', I'm expecting get '1000' but the code above give
> me '1000asdf' instead of '1000' as expected.
> Is any wrong with my code above.

How are you retrieving the element value?

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] APC and ZF tutorial

2008-11-04 Thread davideFashionPeople

Sorry for off topic:

But AnyBody Could you help in my thead "layout.phtml calling action"
-- 
View this message in context: 
http://www.nabble.com/APC-and-ZF-tutorial-tp20319957p20324493.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Filter Digits on Zend_Form

2008-11-04 Thread Bagus Nugroho
Hi All,
I'm trying using 'Digits' filter on Zend_Form like this :
==
class My_Form_Project_Test extends Zend_Form{
 public function __construct($options = null){
  parent::__construct($options);
  
  $update = new Zend_Form_Element_Text('test');
  $update->setLabel('Test')
  ->addFilter('Digits');
  
  
  $submit = new Zend_Form_Element_Submit('submit');
  $submit->setLabel('Submit');
  
  
  $this->addElements(array($update, $submit));
 }
}
 
then, when input '1000asdf', I'm expecting get '1000' but the code above give 
me '1000asdf' instead of '1000' as expected.
Is any wrong with my code above.
..
 
thanks in advance, bn



RE: [fw-general] APC and ZF tutorial

2008-11-04 Thread Robert Castley
 Thanks Guys!

Tried it on my ageing XP Pro laptop and it made the Apache Benchmark slower.
But I have read the other threads and understand that this might be the case
because:

A) I am not on a production machine
B) I am using Windows!

Cheers,

- Robert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of till
Sent: 04 November 2008 11:43
To: Robert Castley
Cc: Jan Pieper; fw-general@lists.zend.com; Tobias Gies
Subject: Re: [fw-general] APC and ZF tutorial

Robert,

read the following:
http://docs.php.net/manual/en/apc.configuration.php

IMHO, I think there is no one way to run APC. It all depends on your
traffic/needs (size of application), etc.. There are a couple different
option (not too many), so just make sure you read all of the above to make
sure you run with the correct ones.

I'd also suggest benchmarking each of the changes when you implement them.
Helps you figure out what has the greatest impact on your setup.

Till


On Tue, Nov 4, 2008 at 12:22 PM, Tobias Gies <[EMAIL PROTECTED]>
wrote:
> indeed :-)
>
> 2008/11/4 Jan Pieper <[EMAIL PROTECTED]>
>>
>> I think you mean "extension=php_apc.dll" and not 
>> "extension=php_apc.so" on Windows systems :-)
>>
>>
>> 
>> Von: Tobias Gies [mailto:[EMAIL PROTECTED]
>> Gesendet: Dienstag, 4. November 2008 12:18
>> An: Robert Castley
>> Cc: fw-general@lists.zend.com
>> Betreff: Re: [fw-general] APC and ZF tutorial
>>
>> Hi Robert,
>>
>> it's really simple: APC is a PHP extension that will work out of the 
>> box when installed.
>>
>> On Unixoid systems, simply run pecl install apc and add
"extension=apc.so"
>> to your php.ini.
>> On Windows systems, download php_apc.dll from pecl4win, drop it in 
>> your PHP extension directory and add "extension=php_apc.so" to your
php.ini.
>>
>> Best regards,
>> Tobias
>>
>> 2008/11/4 Robert Castley <[EMAIL PROTECTED]>
>>>
>>> Hi
>>>
>>> I see APC mentioned a lot on this list and I was wondering if anyone 
>>> has a tutorial for configuring APC for use with ZF?
>>>
>>> I have a default PHP and Apache install on Windows XP/Ubuntu/Mac and 
>>> would like to what I have to do to my ZF app to get it using APC.
>>>
>>> Cheers,
>>>
>>> - Robert
>>> 
>>>  This email has been scanned for all known viruses by the 
>>> MessageLabs Email Security Service and the Macro 4 plc internal 
>>> virus protection system.
>>> 
>>> 
>>
>
>


This email has been scanned for all known viruses by the MessageLabs Email
Security Service and the Macro 4 plc internal virus protection system.




This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.


Re: [fw-general] handle any exception with errorController

2008-11-04 Thread keith Pope
Would adding an exception to the Response work though?

2008/11/4 Matthew Weier O'Phinney <[EMAIL PROTECTED]>:
> -- Waigani <[EMAIL PROTECTED]> wrote
> (on Monday, 03 November 2008, 09:59 PM -0800):
>> Is it possible? I want to throw an exception in the preDispatch of a plugin
>> if you are not allowed to view the page. I then want to handle that
>> exception via the errorController. I can wrap the $front->dispatch() in a
>> try / catch and catch the exception in the bootstrap, but then how do I
>> forward that onto the errorController, as the front controller has not been
>> dispatched? I've read the manual and other posts and have not found an
>> answer nor an alternative method.
>
> Currently, throwing exceptions in plugins is unhandled, and you must
> handle them manually, as you are attempting to do.
>
> Probably the easiest way to re-dispatch in this case is to simply set an
> error message in the session, and then redirect to an error page where
> you display that message.
>
> We *have* noted this issue for a future Zend_Controller improvement.
>
> --
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
>



-- 
--
[MuTe]
--


Re: [fw-general] Zend_Pdf and special character problems

2008-11-04 Thread Martijn Korse

Have a look at the paragraph 35.5.4: Text Drawing
http://framework.zend.com/manual/en/zend.pdf.drawing.html

It takes an optional argument for the character encoding which defaults to
the current locale. I think that is what is causing your problem




Jani Hartikainen wrote:
> 
> Hey all
> 
> I've been using Zend_Pdf to create some stuff, and now I ran into an issue  
> with
> the finnish letters Ä and Ö. On my dev box, which is Win XP in finnish,  
> the characters
> show up just fine in the PDF, but on the *nix server which isn't in  
> finnish,
> when the pdf generation encounters the letters, it just scraps the rest of  
> the
> text.
> 
> So I was wondering if anyone here has any ideas on what I could do to make  
> these
> letters work correctly on the server?
> 
> I've tried copying over a font from my dev box to the server and using  
> that, but
> that didn't help at all.
> 
> 
> 
> Thanks
> 
> 


-
http://devshed.excudo.net http://devshed.excudo.net 
-- 
View this message in context: 
http://www.nabble.com/Zend_Pdf-and-special-character-problems-tp20303842p20321372.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Dojo Email validation, checkbox and Submit dojo form question- please?

2008-11-04 Thread drj201

I confirm this does not work using capture... I have the same problem.

Thanks


gerardroche wrote:
> 
> 
> vladimirn wrote:
>> 
>> Alert you suggested me to make wont work as well :(
>> phtml:
>> dojo()->javascriptCaptureStart() ?>
>> function validateForm() {
>> var form = dijit.byId("signup");
>> if (!form.validate()) {
>> alert("Invalid form");
>> return false;
>> }
>> return true;
>> }
>> dojo()->javascriptCaptureEnd() ?>
>> dojo()->onLoadCaptureStart() ?>
>> function () {
>> dojo.connect(dijit.byId("signup"), "onSubmit", "validateForm");
>> }
>> dojo()->onLoadCaptureEnd() ?>
>> 
>> 
>> form ?>
>> 
>> Thanks,
>> Vladimir
>> 
> 
> 
> Sorry, you're right, this doesn't work.
> 
> 
> The javascript works if you do the following, i.e. paste it in After the
> dojo helper is echoed:
> 
> dojo()->addStylesheetModule('dijit.themes.tundra'); ?>
> 
> 
> // dojo.addOnLoad(function () {
> dojo.connect(dijit.byId("
"), "onSubmit", "validateForm"); > } > ); > function validateForm() { > var form = dijit.byId(""); > if (form.validate()) { > alert("Invalid form"); > return false; > } > return true; > } > //]]> > > > > That'll work, but when you capture it it doesn't. Bug? > > This is the javascript produced if you capture it via the dojo helper: > > > > // dojo.require("dijit.form.ValidationTextBox"); > dojo.require("dijit.form.Button"); > dojo.require("dijit.form.Form"); > dojo.require("dojo.parser"); > dojo.addOnLoad(function () { > dojo.connect(dijit.byId(""), "onSubmit", "validateForm");} > ); > > dojo.addOnLoad(function() { > dojo.forEach(zendDijits, function(info) { > var n = dojo.byId(info.id); > if (null != n) { > dojo.attr(n, dojo.mixin({ id: info.id }, info.params)); > } > }); > dojo.parser.parse(); > }); > function validateForm() { > var form = dijit.byId(""); > if (!form.validate()) { > alert("Invalid form"); > return false; > } > return true; > } > var zendDijits = > [{"id":"name","params":{"invalidMessage":"Required","trim":"true","required":"true","dojoType":"dijit.form.ValidationTextBox"}},{"id":"submit","params":{"label":"Save","dojoType":"dijit.form.Button"}},{"id":"clubForm","params":{"dojoType":"dijit.form.Form"}}]; > //]]> > > > > > > -- View this message in context: http://www.nabble.com/Zend_Dojo-Email-validation%2C-checkbox-and-Submit-dojo-form-question--please--tp19441003p20321068.html Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Matthew Weier O'Phinney
-- Waigani <[EMAIL PROTECTED]> wrote
(on Monday, 03 November 2008, 09:59 PM -0800):
> Is it possible? I want to throw an exception in the preDispatch of a plugin
> if you are not allowed to view the page. I then want to handle that
> exception via the errorController. I can wrap the $front->dispatch() in a
> try / catch and catch the exception in the bootstrap, but then how do I
> forward that onto the errorController, as the front controller has not been
> dispatched? I've read the manual and other posts and have not found an
> answer nor an alternative method.

Currently, throwing exceptions in plugins is unhandled, and you must
handle them manually, as you are attempting to do.

Probably the easiest way to re-dispatch in this case is to simply set an
error message in the session, and then redirect to an error page where
you display that message.

We *have* noted this issue for a future Zend_Controller improvement.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] ImageSize Validator

2008-11-04 Thread Matthew Lurz

Thank you and sorry for wasting your time Thomas. While I feel badly for not
catching this, one of the reasons I love working with the ZF is when
something doesn't work I can almost always count on the issue being related
to some stage of deterioration in my mind instead of a limitation of or
issue with the ZF. Thank you!


thomasW wrote:
> 
> And what's the reason why you supressed the second parameter for the 
> ImageSize validator ?
> 
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
> 
> - Original Message - 
> From: "Matthew Lurz" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, November 04, 2008 12:13 AM
> Subject: Re: [fw-general] ImageSize Validator
> 
> 
>>
>> No, I just did that to shorten the message. The actual values are coming 
>> from
>> a config file but either way the validator doesn't seem to fire.
>>
>>
>> thomasW wrote:
>>>
>>> Stupid question:
>>> Do you really want to accept ONLY images which have exactly one pixel
>>> height
>>> and width ?
>>>
>>> I would think that only one picture will be accepted by this settings... 
>>> a
>>> placeholder 1x1 picture. :-)
>>>
>>> Greetings
>>> Thomas Weidner, I18N Team Leader, Zend Framework
>>> http://www.thomasweidner.com
>>>
>>> - Original Message - 
>>> From: "Matthew Lurz" <[EMAIL PROTECTED]>
>>> To: 
>>> Sent: Monday, November 03, 2008 9:13 PM
>>> Subject: [fw-general] ImageSize Validator
>>>
>>>

 Other validators are working, but ImageSize is not for some reason.
 I've
 attempted to add the validator to both the form and the transfer
 adapter
 using trunk and 1.7. Is this known not to work yet or am I doing
 something
 wrong? In a form, I've tried something akin to:

 $image = new Zend_Form_Element_File('image');
 $image->addValidator('Count', false, 1)
->addValidator('Extension', false, 'jpg')
->addValidator('Size', false, '1MB')
->addValidator('ImageSize', array(1,1,1,1));

 In the action method I've tried:

 $adapter = $form->image->getTransferAdapter();
 $adapter->addValidator('ImageSize', array(1,1,1,1));
 $adapter->addFilter(new Zend_Filter_File_Rename($newHeaderPath,
 false));

 The filter and other validators work, just not the ImageSize validator.
 Any
 ideas? Thank you.
 -- 
 View this message in context:
 http://www.nabble.com/ImageSize-Validator-tp20309905p20309905.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/ImageSize-Validator-tp20309905p20313020.html
>> Sent from the Zend Framework mailing list archive at Nabble.com. 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ImageSize-Validator-tp20309905p20320959.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] APC and ZF tutorial

2008-11-04 Thread till
Robert,

read the following:
http://docs.php.net/manual/en/apc.configuration.php

IMHO, I think there is no one way to run APC. It all depends on your
traffic/needs (size of application), etc.. There are a couple
different option (not too many), so just make sure you read all of the
above to make sure you run with the correct ones.

I'd also suggest benchmarking each of the changes when you implement
them. Helps you figure out what has the greatest impact on your setup.

Till


On Tue, Nov 4, 2008 at 12:22 PM, Tobias Gies <[EMAIL PROTECTED]> wrote:
> indeed :-)
>
> 2008/11/4 Jan Pieper <[EMAIL PROTECTED]>
>>
>> I think you mean "extension=php_apc.dll" and not "extension=php_apc.so" on
>> Windows systems :-)
>>
>>
>> 
>> Von: Tobias Gies [mailto:[EMAIL PROTECTED]
>> Gesendet: Dienstag, 4. November 2008 12:18
>> An: Robert Castley
>> Cc: fw-general@lists.zend.com
>> Betreff: Re: [fw-general] APC and ZF tutorial
>>
>> Hi Robert,
>>
>> it's really simple: APC is a PHP extension that will work out of the box
>> when installed.
>>
>> On Unixoid systems, simply run pecl install apc and add "extension=apc.so"
>> to your php.ini.
>> On Windows systems, download php_apc.dll from pecl4win, drop it in your
>> PHP extension directory and add "extension=php_apc.so" to your php.ini.
>>
>> Best regards,
>> Tobias
>>
>> 2008/11/4 Robert Castley <[EMAIL PROTECTED]>
>>>
>>> Hi
>>>
>>> I see APC mentioned a lot on this list and I was wondering if anyone has
>>> a tutorial for configuring APC for use with ZF?
>>>
>>> I have a default PHP and Apache install on Windows XP/Ubuntu/Mac and
>>> would like to what I have to do to my ZF app to get it using APC.
>>>
>>> Cheers,
>>>
>>> - Robert
>>> 
>>> This email has been scanned for all known viruses by the MessageLabs
>>> Email Security Service and the Macro 4 plc internal virus protection system.
>>> 
>>
>
>


Re: [fw-general] APC and ZF tutorial

2008-11-04 Thread Tobias Gies
indeed :-)

2008/11/4 Jan Pieper <[EMAIL PROTECTED]>

>  I think you mean "extension=php_apc.dll" and not "extension=php_apc.so"
> on Windows systems :-)
>
>
>  --
> *Von:* Tobias Gies [mailto:[EMAIL PROTECTED]
> *Gesendet:* Dienstag, 4. November 2008 12:18
> *An:* Robert Castley
> *Cc:* fw-general@lists.zend.com
> *Betreff:* Re: [fw-general] APC and ZF tutorial
>
> Hi Robert,
>
> it's really simple: APC is a PHP extension that will work out of the box
> when installed.
>
> On Unixoid systems, simply run pecl install apc and add "extension=apc.so"
> to your php.ini.
> On Windows systems, download php_apc.dll from pecl4win, drop it in your PHP
> extension directory and add "extension=php_apc.so" to your php.ini.
>
> Best regards,
> Tobias
>
> 2008/11/4 Robert Castley <[EMAIL PROTECTED]>
>
>>  Hi
>>
>> I see APC mentioned a lot on this list and I was wondering if anyone has a
>> tutorial for configuring APC for use with ZF?
>>
>> I have a default PHP and Apache install on Windows XP/Ubuntu/Mac and would
>> like to what I have to do to my ZF app to get it using APC.
>>
>> Cheers,
>>
>> - Robert
>>
>> 
>> This email has been scanned for all known viruses by the MessageLabs Email
>> Security Service and the Macro 4 plc internal virus protection system.
>> 
>>
>
>


AW: [fw-general] APC and ZF tutorial

2008-11-04 Thread Jan Pieper
I think you mean "extension=php_apc.dll" and not "extension=php_apc.so" on 
Windows systems :-)
 




Von: Tobias Gies [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 4. November 2008 12:18
An: Robert Castley
Cc: fw-general@lists.zend.com
Betreff: Re: [fw-general] APC and ZF tutorial


Hi Robert,

it's really simple: APC is a PHP extension that will work out of the 
box when installed.

On Unixoid systems, simply run pecl install apc and add 
"extension=apc.so" to your php.ini.
On Windows systems, download php_apc.dll from pecl4win, drop it in your 
PHP extension directory and add "extension=php_apc.so" to your php.ini.

Best regards,
Tobias


2008/11/4 Robert Castley <[EMAIL PROTECTED]>


Hi
 
I see APC mentioned a lot on this list and I was wondering if 
anyone has a tutorial for configuring APC for use with ZF?
 
I have a default PHP and Apache install on Windows 
XP/Ubuntu/Mac and would like to what I have to do to my ZF app to get it using 
APC.
 
Cheers,
 
- Robert



This email has been scanned for all known viruses by the 
MessageLabs Email Security Service and the Macro 4 plc internal virus 
protection system.







Re: [fw-general] APC and ZF tutorial

2008-11-04 Thread Tobias Gies
Hi Robert,

it's really simple: APC is a PHP extension that will work out of the box
when installed.

On Unixoid systems, simply run pecl install apc and add "extension=apc.so"
to your php.ini.
On Windows systems, download php_apc.dll from pecl4win, drop it in your PHP
extension directory and add "extension=php_apc.so" to your php.ini.

Best regards,
Tobias

2008/11/4 Robert Castley <[EMAIL PROTECTED]>

>  Hi
>
> I see APC mentioned a lot on this list and I was wondering if anyone has a
> tutorial for configuring APC for use with ZF?
>
> I have a default PHP and Apache install on Windows XP/Ubuntu/Mac and would
> like to what I have to do to my ZF app to get it using APC.
>
> Cheers,
>
> - Robert
>
> 
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> 
>


[fw-general] APC and ZF tutorial

2008-11-04 Thread Robert Castley
Hi
 
I see APC mentioned a lot on this list and I was wondering if anyone has a
tutorial for configuring APC for use with ZF?
 
I have a default PHP and Apache install on Windows XP/Ubuntu/Mac and would
like to what I have to do to my ZF app to get it using APC.
 
Cheers,
 
- Robert



This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.


Re: [fw-general] Controller Speed

2008-11-04 Thread till
On Tue, Nov 4, 2008 at 10:47 AM, monk.e.boy <[EMAIL PROTECTED]> wrote:
>
>
>
> Matthew Weier O'Phinney-3 wrote:
>>
>> -- Matthew Ratzloff <[EMAIL PROTECTED]> wrote
>>
>> I'm going to have to agree here. The rule of thumb I use -- based back
>> on my CGI::Application days -- is that an action/page controller should
>> only have around 7 actions, maximum; more than that, and it should be
>> broken apart into more discrete controllers. The rationale is that the
>> more actions you add, the less likely that they are all related, and you
>> can likely create sub-groups of actions.
>>
>
>
> Seven?! I have a DB with tons of data, this part of the site shows the
> reports. There are hundreds of different reports.
>
>
>
> Matthew Weier O'Phinney-3 wrote:
>>
>> Additionally, as someone else noted, if you have 3000 lines, chances are
>> that you're probably doing a lot of business logic in your controller -
>> and you should move that logic into model classes.
>> --
>> Matthew Weier O'Phinney
>> Software Architect   | [EMAIL PROTECTED]
>> Zend Framework   | http://framework.zend.com/
>>
>>
>
>
> Each action is only a few lines long.
> At the moment my URLs look like ths:
>
> http://site.com/reports/report-1/
> http://site.com/reports/report-2/
>
> obviously my reports have nice names. Some reports are kinda related so I
> could possibly group them:
>
> http://site.com/reports/about-people/tall-people/
> http://site.com/reports/about-people/people-with-long-hair/
>
> http://site.com/reports/about-buildings/report-3/
> http://site.com/reports/about-buildings/with-illegal-doors/
> http://site.com/reports/about-buildings/with-boilers/
> http://site.com/reports/about-buildings/with-no-windows/
>
> http://site.com/reports/other/buildings-owned-by-x-with-people-from-company-z/
>
> ...they don't really fall into nice groups like this. Also I guess my URLs
> wouldn't be able to have that nice tree structure? Any advice? How do I get
> down to seven actions?! hlpz plz!!

You could make a report module and group the reports into different controllers.

Or you refactor the "few lines" in each action into a model and use
/reports/show/FOO (ReportsController::showAction()) where FOO is an ID
or string to lookup which report to build. Which leaves you with one
action. ;-)

Till


Re: [fw-general] Zend_Capcha

2008-11-04 Thread dele454

Any one out there with help? Please!!

dele454 wrote:
> 
> hi,
> 
> i am trying to verify the text submitted to match that of the captcha. If
> valid(same) echo 'validated'.
> 
> class JoinController extends Zend_Controller_Action
> {
> 
>   public function indexAction(){
>   
>   $this->_helper->layout->setLayout('layout-site');
>   $view = new Zend_View();
>   // Originating request:
>   $captcha = new Zend_Captcha_Image(array(
>   'name' => 'foo',
>   'height' => 100,
>   'width' => 202,
>   'wordLen'=> '6',
>   'expiration' => '300',
>   'font' =>
> 'C:/xampp/htdocs/xampp/mainevent/public_html/img/font/ravie.ttf',
>   
> 'imgDir'=>'C:/xampp/htdocs/xampp/mainevent/public_html/img/captcha',
>   'imgUrl' => '../img/captcha',
>   'fontSize' => '24',
>   
>   
>   
>   ));
>   $id = $captcha->generate();
>   $this->view->showCaptcha = $captcha->render($view);
>   
>   
>   
>   if ($captcha->isValid($_POST['captcha'])) {
>echo "Validated!";
> 
>  }
>else{ echo "no";
>print_r($captcha->getMessages());}
>   }   
>
>   
> 
> }
> 
> When i submit the form it always echos 'no'!. Printing the error message i
> get this
> 
> Array ( [missingValue] => Empty captcha value ) 
> 
> How can i sort this out. I am thinking the captcha will always have a
> different value on post when compared to the text field. How can i resolve
> this.
> 


-
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Capcha-tp20300142p20319514.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Controller Speed

2008-11-04 Thread monk.e.boy



Matthew Weier O'Phinney-3 wrote:
> 
> -- Matthew Ratzloff <[EMAIL PROTECTED]> wrote
> 
> I'm going to have to agree here. The rule of thumb I use -- based back
> on my CGI::Application days -- is that an action/page controller should
> only have around 7 actions, maximum; more than that, and it should be
> broken apart into more discrete controllers. The rationale is that the
> more actions you add, the less likely that they are all related, and you
> can likely create sub-groups of actions.
> 


Seven?! I have a DB with tons of data, this part of the site shows the
reports. There are hundreds of different reports.



Matthew Weier O'Phinney-3 wrote:
> 
> Additionally, as someone else noted, if you have 3000 lines, chances are
> that you're probably doing a lot of business logic in your controller -
> and you should move that logic into model classes. 
> -- 
> Matthew Weier O'Phinney
> Software Architect   | [EMAIL PROTECTED]
> Zend Framework   | http://framework.zend.com/
> 
> 


Each action is only a few lines long.
At the moment my URLs look like ths:

http://site.com/reports/report-1/
http://site.com/reports/report-2/

obviously my reports have nice names. Some reports are kinda related so I
could possibly group them:

http://site.com/reports/about-people/tall-people/
http://site.com/reports/about-people/people-with-long-hair/

http://site.com/reports/about-buildings/report-3/
http://site.com/reports/about-buildings/with-illegal-doors/
http://site.com/reports/about-buildings/with-boilers/
http://site.com/reports/about-buildings/with-no-windows/

http://site.com/reports/other/buildings-owned-by-x-with-people-from-company-z/

...they don't really fall into nice groups like this. Also I guess my URLs
wouldn't be able to have that nice tree structure? Any advice? How do I get
down to seven actions?! hlpz plz!!

monk.e.boy
-- 
View this message in context: 
http://www.nabble.com/Controller-Speed-tp20303550p20319090.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Tags for the memcached and APC backends for Zend_Cache - new approach

2008-11-04 Thread Jan Pieper

Oh sorry, my fault. I used Memcached as slow backend :-)


Fabien MARTY wrote:
> 
> Hi,
> 
> Jan Pieper a écrit :
>> Can you please show us an example how to realize tagged-memcache-caching
>> with
>> this new two-level backend?
>>   
> 
> something like that (not tested) :
> 
>  
> $slowBackend = 'File';
> $fastBackend = 'Memcached';
> $slowBackendOptions = array(
> 'cache_dir' => '/tmp/'
> );
> $fastBackendOptions = array|(
> 'servers' => ||array(array('host' => 'localhost','port' => 11211, 
> 'persistent' => true))|
> );
> 
> $backendOptions = array(
> 'fast_backend' => $fastBackend,
> 'slow_backend' => $slowBackend,
> 'fast_backend_options' => $fastBackendOptions,
> 'slow_backend_options' => $slowBackendOptions
> );
> 
> $frontendOptions = array(|
> 'lifetime' => 7200|
> );
> 
> $instance = Zend_Cache::factory('Core','Two Levels', $frontendOptions, 
> $backendOptions);
> 
> // [...] use $instance normaly
> 
> ?>
> 
> - tags will be supported throw the "slow" backend
> - there is a (simple) algorithm to store cache records into the fast 
> backend or into the slow backend depending on the remaining space on the 
> fast one and the cache priority (new option you can set when you save 
> the cache)
> 
> I'm very interested in feedbacks for this new special backend.
> 
> Regards
> 
> Fabien
> 
>>
>> Fabien MARTY wrote:
>>   
>>> Hi,
>>>
>>> Please have a look at the "TwoLevels" backend in 1.7 trunk (or in 1.7
>>> PR), it's want you want.
>>>
>>> It does exactly this.
>>>
>>> Feedback welcome
>>>
>>> Regards,
>>>
>>> Fabien
>>>
>>>
>>>
>>>
>>> On Wed, Oct 22, 2008 at 5:34 PM, Diabl0 <[EMAIL PROTECTED]> wrote:
>>> 
 Colin Guthrie pisze:
   
> Diabl0 wrote:
> 
>> Hi
>>
>> As i seen this topic was discussed later, but i have new idea that
>> IMHO
>> can throw new light.
>>
>> What about combining memory cache backends with file cache fallback
>> for
>> tags? Ofcorse optional if someone wants this.
>>
>> This should give us benefits from fast memory cache and tagging
>> system
>> with only small drawback on performance needed to update (or
>> retreive)
>> tags
>> cache from filesystem.
>>
>> And what you think about this idea?
>>   
> It's interesting but why use the filesystem? Why not use the cache
> itself
> but use a different key structure to track this (e.g. cache an array
> of
> keys
> that match the tag "wibble" under the key name
> "Zend_Cache-keymap-wibble"?
> This approach could be implemented in a base class and those backends
> not
> supporting tags could simple extend it. I've not looked at the
> intricacies
> of this from a data integrity point of view so there could be several
> reasons why this wouldn't work :)
> 
 Filesystem was my first idea, but db and any other "solid" backend is
 good.
 Memcached and other memory based backends aren't good because it's
 content
 can be deleted in any time.

   
> Also as a related issue, would it be possible to implement a cache
> invalidation queue system backed by a database? The reason I say this
> is
> when considering multi-server environments (let's assume there is one
> database for all servers).
> 
   See my post with Mao_Cache. I didn't tested it with DB yet, but i was
 also
 thinking about clustered enviroments.

 --
 K.


   
>>>
>>> -- 
>>> Fabien MARTY
>>> [EMAIL PROTECTED]
>>>
>>>
>>> 
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tags-for-the-memcached-and-APC-backends-for-Zend_Cache---new-approach-tp20109068p20319029.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Waigani

When I throw an exception from dispatchLoopStartup I get the following
output:
___
Application Error
this is index view

This is error view

The following error occurred:
exception 'Zend_Exception' with message 'test' 
___

So its catching the exception but both the index action from the index
controller and error action from the error controller are called, both views
are rendered also. This is all looking very similar to the following logged
bug (marked as resolved): http://framework.zend.com/issues/browse/ZF-2461




Waigani wrote:
> 
> correction, it is catching the exception when thrown from
> dispatchLoopStartup from my plugin, but not whe it is thrown from
> preDispatch. Is this the expected behaviour?
> 
> 
> 
> Waigani wrote:
>> 
>> throw exceptions is not on and I've also tested the dispatchLoopStartup
>> in the plugins broker. It is not catching the exception.
>> 
>> 
>> 
>> Waigani wrote:
>>> 
>>> The code
>>> 
>>> throw new Zend_Exception('test'); 
>>> 
>>> in the predispatch hook of a plugin returns
>>> 
>>> Fatal error: Uncaught exception 'Zend_Exception' with message 'test'  …
>>> 
>>> I am registering my plugins via $frontController->registerPlugin()
>>> method.
>>> 
>>> Is this not the expected behaviour?
>>> 
>>> 
>>> 
>>> Jason Webster wrote:
 
 The Plugin Broker (Zend_Controller_Plugin_Broker) _should_ catch any 
 exceptions thrown by controller plugins. Well, not should, it does. 
 Perhaps this is an issue with how you're instantiating your plugins??
 
 Waigani wrote:
> Thanks for the run down. Is it possible to throw an error in a plugin
> though?
> So far the errorController has missed it.
>
>
>
> Jason Webster wrote:
>   
>> Waigani wrote:
>> 
>>> Is it possible? I want to throw an exception in the preDispatch of a
>>> plugin
>>> if you are not allowed to view the page. I then want to handle that
>>> exception via the errorController. I can wrap the $front->dispatch()
>>> in a
>>> try / catch and catch the exception in the bootstrap, but then how
>>> do I
>>> forward that onto the errorController, as the front controller has
>>> not
>>> been
>>> dispatched? I've read the manual and other posts and have not found
>>> an
>>> answer nor an alternative method.
>>>   
>>>   
>> I think you may be misunderstanding the dispatching process of the
>> front 
>> controller. Here's a run down:
>>
>> 1.  Request/Response/Router/Dispatcher initialization
>> 2.  routeStartup()
>> * call plugins registered with this hook
>> 3.  Routing
>> * Updates Request object based on matched information from
>>   routing
>> 4.  routeShutdown()
>> * call plugins registered with this hook
>> 5.  dispatchLoopStartup()
>> * call plugins registered with this hook
>> 6.  preDispatch()
>> * call plugins registered with this hook
>> 7.  Dispatch action
>> 8.  action helper preDispatch()
>> 9.  action controller preDispatch()
>> 10. action method
>> * UNLESS a _forward() or redirect has occurred
>> 11. action controller postDispatch()
>> 12. action helper postDispatch()
>> 13. postDispatch()
>> * call plugins registered with this hook
>> /* repeat 6 - 13 as necessary */
>> 14. dispatchLoopShutdown()
>> * call plugins registered with this hook
>> 15. send response
>>
>> The preDispatch hooks of action helpers and action controllers ad re 
>> steps 8 and 9, respectively. The ErrorHandler front controller plugin
>> is 
>> registered basically right away.
>>
>> In short, if you throw an exception in the preDispatch of a 
>> controller/action it _will_ be caught by the ErrorHandler plugin, and 
>> thus forwarded to the error controller.
>>
>>
>> 
>
>   
 
 
 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/handle-any-exception-with-errorController-tp20316623p20319028.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Waigani

correction, it is catching the exception when thrown from dispatchLoopStartup
from my plugin, but not whe it is thrown from preDispatch. Is this the
expected behaviour?



Waigani wrote:
> 
> throw exceptions is not on and I've also tested the dispatchLoopStartup in
> the plugins broker. It is not catching the exception.
> 
> 
> 
> Waigani wrote:
>> 
>> The code
>> 
>> throw new Zend_Exception('test'); 
>> 
>> in the predispatch hook of a plugin returns
>> 
>> Fatal error: Uncaught exception 'Zend_Exception' with message 'test'  …
>> 
>> I am registering my plugins via $frontController->registerPlugin()
>> method.
>> 
>> Is this not the expected behaviour?
>> 
>> 
>> 
>> Jason Webster wrote:
>>> 
>>> The Plugin Broker (Zend_Controller_Plugin_Broker) _should_ catch any 
>>> exceptions thrown by controller plugins. Well, not should, it does. 
>>> Perhaps this is an issue with how you're instantiating your plugins??
>>> 
>>> Waigani wrote:
 Thanks for the run down. Is it possible to throw an error in a plugin
 though?
 So far the errorController has missed it.



 Jason Webster wrote:
   
> Waigani wrote:
> 
>> Is it possible? I want to throw an exception in the preDispatch of a
>> plugin
>> if you are not allowed to view the page. I then want to handle that
>> exception via the errorController. I can wrap the $front->dispatch()
>> in a
>> try / catch and catch the exception in the bootstrap, but then how do
>> I
>> forward that onto the errorController, as the front controller has
>> not
>> been
>> dispatched? I've read the manual and other posts and have not found
>> an
>> answer nor an alternative method.
>>   
>>   
> I think you may be misunderstanding the dispatching process of the
> front 
> controller. Here's a run down:
>
> 1.  Request/Response/Router/Dispatcher initialization
> 2.  routeStartup()
> * call plugins registered with this hook
> 3.  Routing
> * Updates Request object based on matched information from
>   routing
> 4.  routeShutdown()
> * call plugins registered with this hook
> 5.  dispatchLoopStartup()
> * call plugins registered with this hook
> 6.  preDispatch()
> * call plugins registered with this hook
> 7.  Dispatch action
> 8.  action helper preDispatch()
> 9.  action controller preDispatch()
> 10. action method
> * UNLESS a _forward() or redirect has occurred
> 11. action controller postDispatch()
> 12. action helper postDispatch()
> 13. postDispatch()
> * call plugins registered with this hook
> /* repeat 6 - 13 as necessary */
> 14. dispatchLoopShutdown()
> * call plugins registered with this hook
> 15. send response
>
> The preDispatch hooks of action helpers and action controllers ad re 
> steps 8 and 9, respectively. The ErrorHandler front controller plugin
> is 
> registered basically right away.
>
> In short, if you throw an exception in the preDispatch of a 
> controller/action it _will_ be caught by the ErrorHandler plugin, and 
> thus forwarded to the error controller.
>
>
> 

   
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/handle-any-exception-with-errorController-tp20316623p20318547.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] JSON format for ComboBox / FilteringSelect

2008-11-04 Thread Cameron
Thanks for that, I've managed to get it working now with the rewritten
autoCompleteDojo at
http://www.makina-corpus.org/2008/10/26/autocomplete-ajax-search-with-dojo-and-zend-framework/,
and I've got dropdown dependencies working with a bit of javascript, but now
I have one last little problem!

It works perfectly on the New form, but when you try to $form->populate in
your Edit controller, the autocomplete fields aren't filled in on the form
for editing. How has everyone else solved this one?

On Mon, Nov 3, 2008 at 9:15 PM, lupusBE <[EMAIL PROTECTED]> wrote:

>
> http://framework.zend.com/issues/browse/ZF-4494
>
>
> Themselves wrote:
> >
> > Hi guys,
> >
> > I'm trying to build some autocomplete dropdowns using Zend + Dojo, but I
> > can't seem to work out how to get the select to submit the id and display
> > the name. As per the documentation, a ComboBox submits the value of the
> > label, so I've tried passing through JSON like this:
> >
> > {"identifier":"label","items":[
> > {"label":"1","name":"aaa"},
> > {"label":"435","name":"bb"},
> > {"label":"209","name":"ccc"},
> > {"label":"3","name":"d"},
> > {"label":"2","name":"e"}
> > ]}
> >
> > Which displays the correct name in the drop down, but when you submit the
> > form, it submits the name, not the contents of the label field. What is
> > the
> > correct JSON format for my autoComplete action helper to return to get
> > this
> > to work correctly? And once I have got this working correctly, I'm going
> > to
> > need to access the label value through javascript - Can I assume I'll be
> > able to get it via comboBox.label in much the same way as I can get
> > comboBox.value now?
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/JSON-format-for-ComboBox---FilteringSelect-tp20295920p20301734.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] handle any exception with errorController

2008-11-04 Thread Waigani

throw exceptions is not on and I've also tested the dispatchLoopStartup in
the plugins broker. It is not catching the exception.



Waigani wrote:
> 
> The code
> 
> throw new Zend_Exception('test'); 
> 
> in the predispatch hook of a plugin returns
> 
> Fatal error: Uncaught exception 'Zend_Exception' with message 'test'  …
> 
> I am registering my plugins via $frontController->registerPlugin() method.
> 
> Is this not the expected behaviour?
> 
> 
> 
> Jason Webster wrote:
>> 
>> The Plugin Broker (Zend_Controller_Plugin_Broker) _should_ catch any 
>> exceptions thrown by controller plugins. Well, not should, it does. 
>> Perhaps this is an issue with how you're instantiating your plugins??
>> 
>> Waigani wrote:
>>> Thanks for the run down. Is it possible to throw an error in a plugin
>>> though?
>>> So far the errorController has missed it.
>>>
>>>
>>>
>>> Jason Webster wrote:
>>>   
 Waigani wrote:
 
> Is it possible? I want to throw an exception in the preDispatch of a
> plugin
> if you are not allowed to view the page. I then want to handle that
> exception via the errorController. I can wrap the $front->dispatch()
> in a
> try / catch and catch the exception in the bootstrap, but then how do
> I
> forward that onto the errorController, as the front controller has not
> been
> dispatched? I've read the manual and other posts and have not found an
> answer nor an alternative method.
>   
>   
 I think you may be misunderstanding the dispatching process of the
 front 
 controller. Here's a run down:

 1.  Request/Response/Router/Dispatcher initialization
 2.  routeStartup()
 * call plugins registered with this hook
 3.  Routing
 * Updates Request object based on matched information from
   routing
 4.  routeShutdown()
 * call plugins registered with this hook
 5.  dispatchLoopStartup()
 * call plugins registered with this hook
 6.  preDispatch()
 * call plugins registered with this hook
 7.  Dispatch action
 8.  action helper preDispatch()
 9.  action controller preDispatch()
 10. action method
 * UNLESS a _forward() or redirect has occurred
 11. action controller postDispatch()
 12. action helper postDispatch()
 13. postDispatch()
 * call plugins registered with this hook
 /* repeat 6 - 13 as necessary */
 14. dispatchLoopShutdown()
 * call plugins registered with this hook
 15. send response

 The preDispatch hooks of action helpers and action controllers ad re 
 steps 8 and 9, respectively. The ErrorHandler front controller plugin
 is 
 registered basically right away.

 In short, if you throw an exception in the preDispatch of a 
 controller/action it _will_ be caught by the ErrorHandler plugin, and 
 thus forwarded to the error controller.


 
>>>
>>>   
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/handle-any-exception-with-errorController-tp20316623p20317954.html
Sent from the Zend Framework mailing list archive at Nabble.com.