[fw-general] Zend_XmlRpc and exception handling

2007-10-22 Thread Andries Seutens


Dear all,

I am trying to throw an exception in one of my service objects (XmlRpc), 
but for some reason, I always get an unknown error, instead of the one 
that I have provided in my exception:


Zend_XmlRpc_Client_FaultException: Unknown error in 
\libs\Zend\XmlRpc\Client.php on line 261


Here's the exception I am trying to throw in the service object:

require_once 'Sanmax/Webservice/Exception.php';
throw new Sanmax_Webservice_Exception('[USER-EXCEPTION] ' .
   'Customer does not exist, and not all required fields are given');

I have also attached the fault exception to the XmlRpc server, like so:

$server = new Zend_XmlRpc_Server();
Zend_XmlRpc_Server_Fault::attachFaultException('Sanmax_Webservice_Exception');

Best,


--
Andries Seutens
http://andries.systray.be

Gecontroleerd op virussen door de JOJO Secure Gateway.


Re: [fw-general] Problem searching low rank words with zend lucene

2007-10-22 Thread gustavoh10

I was using the 0.8.0 version of the Zend Framework.
I download the version 1.0.2 and the problem solve.
Thanks
Gustavo
-- 
View this message in context: 
http://www.nabble.com/Problem-searching-low-rank-words-with-zend-lucene-tf4627557s16154.html#a13351531
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Db_Table_Ralationships and select()

2007-10-22 Thread Matthew Weier O'Phinney
-- ViShap <[EMAIL PROTECTED]> wrote
(on Monday, 22 October 2007, 08:34 PM +0200):
> I have the following Problem:
> 
> How can I write this statement using $db->select() ?
> 
>  
> 
> UPDATE `register`,`users`

You can't. Zend_Db_Select only does SELECT statements, not UPDATE or
DELETE.

Now, that said, there are ways to make this easier. Take a look at the
Zend_Db_Adapter_Abstract::insert() and update() methods, as well as the
related methods in Zend_Db_Table_Abstract.



> Another thing:  Today I looked at Zend_Db_Table and 
> Zend_Db_Table_Relationships
> 
> But there I had the same question. Can I achieve this Query using the
> Zend_Db_able_Relationships – without using multiple querys?

You *can* do it with Zend_Db_Table. Again, look at the update() method;
the 'where' clause can refer to another table.

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


[fw-general] Zend_Db_Table_Ralationships and select()

2007-10-22 Thread ViShap
Hi all!

 

I have the following Problem:

How can I write this statement using $db->select() ?

 

UPDATE `register`,`users` 

SET `register`.`register_step` = 2,

`register`.`validmail` = NULL, 

`register`.`resendmail` = 1 

WHERE (

register.users_ID = users.ID 

AND '. $db->quoteInto('users.nick = ?', $validNick)

)

 

Can´t find a way  :/

 

 

Another thing:  Today I looked at Zend_Db_Table and
Zend_Db_Table_Relationships

 

But there I had the same question. Can I achieve this Query using the
Zend_Db_able_Relationships – without using multiple querys?

 

Hopefully

ViShap



Re: [fw-general] Models with Oberserver Pattern

2007-10-22 Thread Julien Pauli
Hi Tony.
You can find a good example of the Observer pattern into the Zend_Framework
Front Controller file,as it notifies plugins etc...


2007/10/21, tony stamp <[EMAIL PROTECTED]>:
>
>
> As far as i'm aware, the model is usually implemented with an observer in
> mvc
> type 1 - mostly desktop apps that have state. Web apps are mostly written
> in
> mvc type 2, which have a slighlty different focus due to the lack of
> persistence, although i have read in the past of people applying a mvc
> type
> 1 design to web apps.
>
> http://msdn2.microsoft.com/en-us/library/ms978748.aspx msdn explanation
> (read around figure 4)
>
>
>
>
>
>
> dinok wrote:
> >
> > Hi guys,
> >
> > as I think, the model part in the framework isn't really given and there
> > aren't any standards.
> > So I often heard something about the Observer Pattern, in common... Not
> > only for php.
> > But I don't find any good articles on this pattern. In the SPL library
> > exists a Component for the Observer Pattern, but without any examples.
> > So what I want to know:
> > 1. Is there already a good implenentation for the framework
> > 2. Any good articles (no books if it's possible :-) ) known?
> > 3. Or something else where I can get some good informations and examples
> > relating Observer Patterns
> >
> > Best regards
> >
>
> --
> View this message in context:
> http://www.nabble.com/Models-with-Oberserver-Pattern-tf4666720s16154.html#a13332811
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] Writing ActionHelper: Undefined property: $_actionController

2007-10-22 Thread Matthew Weier O'Phinney
-- Ralf Kramer <[EMAIL PROTECTED]> wrote
(on Monday, 22 October 2007, 05:40 AM +0200):
> now it complains about:
> 
> Fatal error: Call to protected method Zend_Controller_Action::_forward()
> from context 'Quasda_User_Helpers_UserHelper'
> in /www/quasda/library/Quasda/User/Helpers/UserHelper.php on line 8

That's because _forward() is a protected method in
Zend_Controller_Action; you can't call it from a public instance of the
object. 

The equivalent code is pretty simple:

$this->getRequest()
 ->setModuleName($module)
 ->setControllerName($controller)
 ->setActionName($action)
 ->setParams($params)
 ->setDispatched(false);

The last line is the most important of them, as it sets the flag that
the dispatch loop looks at in determining whether or not to iterate
again.

> Am Sonntag, den 21.10.2007, 21:38 -0500 schrieb Ralph Schindler:
> > Ralf Kramer wrote:
> > 
> > > 
> > > public function init()
> > > {
> > > Zend_Controller_Action_HelperBroker::addPrefix('Quasda_User_Helpers');
> > > $helper = Zend_Controller_Action_HelperBroker::getHelper("User_Helper");
> > > $helper->doSmth();
> > > }
> > > 
> > 
> > 
> > Try this:
> > 
> > public function init()
> > {
> >Zend_Controller_Action_HelperBroker::addPrefix('Quasda_User_Helpers');
> >$helper = $this->_helper->getHelper('User_Helper');
> >$helper->doSmth();
> > }
> > 
> > Reason being is that you want to use the helper broker that is specific 
> > to the current ActionController.  That way, the helper you are trying to 
> > use will have an instance of the ActionController itself.
> > 
> > -ralph
> 

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


Re: [fw-general] Zend_Filter_Input converting to String

2007-10-22 Thread Eric Alvares
Hi Mathew,

Perhaps it is the default HtmlEntities output filter that is causing your issue.
If so, then the following should show the expected integer value.

var_dump ($input->getUnescaped('field'));

Hope this helps.

Best regards,
Eric

- Original Message - 
  From: Mathew Byrne 
  To: fw-general@lists.zend.com 
  Sent: Monday, October 22, 2007 6:31 AM
  Subject: [fw-general] Zend_Filter_Input converting to String


  Why is it that Zend_Filter_Input appears to convert items that have been 
filtered to Int values back into a String?


  For instance:


  $filters = array ('field' => 'Int');
  $validators = array ('field' => 'Digits');
  $data = array ('field' => '1234');


  $input = new Zend_Filter_Input ($filters, $validators, $data);


  var_dump ($input->field);


  The following gives:


  string(4) "1234"


  Is this by design or am I missing something along the line somewhere?


  --
  Mathew Byrne, Lead Developer
  JB Interactive Pty. Ltd.
  222 Latrobe Street, Melbourne Victoria 3000


  1300 724 144
  www.jbinteractive.com.au





Re: [fw-general] Module as Resource

2007-10-22 Thread Xavier Vidal Piera
As a hint, this is what i use:

Each module has his ACL file (being cached to improve performance, of
course).

I have a ACL plugin for the front controller, and, for each request it does:

1) load the roles (from cache or realtime)
2) detect the requested module and load the correspondent ACL module file.

So, the mapping goes as:

resource = controller
privilege = action

my 2 cents

On 10/22/07, Bagus Nugroho <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
> In Zend_Acl, is possible use module as resources, then followed
> by controller as 1st privilege and action as last privilege?
>
> Thanks in advance,
> Regards, bn
>



-- 
Xavier Vidal Piera
Enginyer Tècnic Informàtic de Gestió
Tècnic Especialista Informàtic d'equips
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://web.xaviervidal.net
610.68.41.78