[fw-general] ZF-2900

2008-08-14 Thread Marco
Hi All

We have just come up against the issue as found in
http://framework.zend.com/issues/browse/ZF-2900 whilst using 1.6.0 RC2 and
the Zend_Rest_Client

What is the recommended way to approach this? I can see 2 possible solutions
currently

1. Create a validator for all TLD's (.com / .net / .org etc)
2. Allow an optional parameter to be passed to Zend_Uri::factory which
allows the ability to disable validation

What are the thoughts here?

Regards

Marco


Re: [fw-general] Status of Zend_Build / scaffolding

2008-08-14 Thread Ralf Eggert
Hi Keith,

thanks for the links. I was looking at Zend_Tool the other day and got
lost somehow while reading it. So I will need to take a much closer look
soon. I will also keep an eye on the development list.

Thanks and best regards,

Ralf



Re: [fw-general] Zend_Filter_Input and Arrays

2008-08-14 Thread cvogt

I was a little to quick with my idea of wrapping $value into an array.
Apparently it is not that easy :). But still overwriting _validateRule and
_filterRule is the right way to solve it in a custom solution.

The permanently best thing however would be to write a patch that factors
out array handling into a Strategy and propose it to the Zend Framework
developers. Let's see if I find the time to do this.

Christopher
-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input-and-Arrays-tp17131495p18992433.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Filter_Input and Arrays

2008-08-14 Thread cvogt


Kevin McArthur-2 wrote:
> 
> Is there a way to validate array inputs with Zend_Filter_Input?
> [...]
> This info might be in the manual, but I can't seem to locate it.
> 

Hej Kevin,

if it's not in the Manual, read the code :). I also wanted to validate and
filter arrays and I found that the way Zend_Filter_Input handles arrays is
determined in the methods _validateRule and_filterRule. I have to mention
that these investigations are based on SVN Revision 6309, 2007-09-11
20:38:27Z.

In _validateRule you can find is_array($field) and in _filterRule you can
find is_array($this->_data[$field]). This is the point where
Zend_Filter_Input distinguishes normal values and arrays.

The way Zend_Filter_Input actually handles arrays is that it applies the
validation or filter to every element of the array. However it only handles
1-dimensional arrays. In case of multidimensional arrays it passes the
arrays of the second dimension to the validators and filters. This can lead
to some nasty bugs if you are not perfectly aware of this. For example
Zend_Validate_Alpha casts the value it is supposed to validate to a string.
If the value is an array it is cast to the string 'Array' which of course
passes the alpha validation eventhough an array is not clearly alpha,
especially if it contains numbers like array(5).

I plan to extend Zend_Filter_Input in order to enable array validation and
filtering. My idea is to overwrite the methods _validateRule and _filterRule
in a subclass. The simplest way to allow array validation and filtering
would be if the methods just wrap the value into an additional array like
array( $value ) and pass it to the parent method. This way Zend_Filter_Input
would always pass the real value to validators and filter, since it only
recurses the first dimension.

However this leaves the bug described above which makes some validators
falsely accept arrays as valid. This could be countered by making the new
methods _validateRule and _filterRule distinguish filters and validators,
which can handle arrays from those which cannot and then react in some way
in case of a problem. The distinction could for example be done by making
array-aware validators and filters implement a certain interface. I haven't
yet thought this through completely.

I hope this helps :).

Best regards

Christopher

-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input-and-Arrays-tp17131495p18992326.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] ZF-3946 Zend_Form_Element_Submit ignores setValue()

2008-08-14 Thread Micah Gersten
In Jira, it says that 1.6.0RC2 is affected.  I'm using 1.5.3 and I am
affected by it as well.

-- 


Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Re: [fw-general] Zend Db Table Relation on Oracle database

2008-08-14 Thread Bill Karwin



dying.angel wrote:
> 
> is there a setting in the Zend DB initialization or somewhere that can
> convert the "?" To the oracle binding form (":bindName").
> 

No, sorry, the ? placeholder is hard-coded and it is not configurable.  This
is a design oversight.

If you use PDO adapters (Zend_Db_Adapter_Pdo_Oci), it should support both ?
and :bindName parameters for Oracle.

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/Zend-Db-Table-Relation-on-Oracle-database-tp18987000p18987759.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Test and dispatching

2008-08-14 Thread Jani Hartikainen

Thanks, this will give me something to look at to make it
work like I want.

On Thu, 14 Aug 2008 21:24:54 +0300, Matthew Weier O'Phinney  
<[EMAIL PROTECTED]> wrote:



Zend_Test still uses the entire dispatch sequence, which includes
routing. Currently, the router overwrites the request with what it
discovers in the environment -- using defaults if nothing is found.

So, this is why your experiment didn't work. This tells me that we need
to perhaps make one or more changes:

 * router and/or routes should not overwrite the
   module/controller/action unless
   actually found

 * modify Zend_Test's dispatch() method to use a null router when no URL
   is provided

These changes should be discussed, however; each has benefits and each
has problems.






[fw-general] Clear out a session from Zend_Session?

2008-08-14 Thread Philip G
How would I go about clearing out a session within Zend_Session? I don't
want to completely destroy it. I want to empty it out. A $_SESSION=null
correlation with Zend_Session.

The reason is, I have a site that we're debugging and QA'ing. I use
Zend_Session to store user based information that is held based on incoming
parameters. I would like to be able to clear a session out every time the
script makes a query for a user's data (thus clearing out any old
information from a past user).

>From my understanding of Zend_Session::destroy() it renders the current
session unsuable afterwards. I want to say Zend_Session::clear() and then
keep using $this->session->myData

---
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/


Re: [fw-general] Zend_Test and dispatching

2008-08-14 Thread Matthew Weier O'Phinney
-- Jani Hartikainen <[EMAIL PROTECTED]> wrote
(on Thursday, 14 August 2008, 09:05 PM +0300):
> Is it possible to use the request parameters to dispatch
> to a specific controller with Zend_Test? For some reason it
> wouldn't work for me unless I provided an url.
>
> For example:
>
> $this->request->setModuleName('foo');
> $this->request->setControllerName('foo');
> $this->request->setActionName('foo');
> $this->dispatch();
>
> would not work. However, the following:
>
> $this->dispatch('/foo/foo/foo');
>
> worked just fine.
>
> I was wondering if there's something I was doing
> wrong or what could possibly affect the dispatching,
> if it should work with the above set*Name methods too.
>
>
> The reason I wanted to test without the exact url
> is because the url could change depending on the routing,
> but the modules etc. should always stay the same.

Zend_Test still uses the entire dispatch sequence, which includes
routing. Currently, the router overwrites the request with what it
discovers in the environment -- using defaults if nothing is found.

So, this is why your experiment didn't work. This tells me that we need
to perhaps make one or more changes:

 * router and/or routes should not overwrite the
   module/controller/action unless
   actually found

 * modify Zend_Test's dispatch() method to use a null router when no URL
   is provided

These changes should be discussed, however; each has benefits and each
has problems.

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


[fw-general] Zend Db Table Relation on Oracle database

2008-08-14 Thread dying . angel
Hello All,
First of all, I'm sorry for my english :)
I don't know if this question is already questioned or not, if it is please 
kindly point me the direction.

I'm building my app with ZF 1.5, and trying to adopt the Table Gateway Pattern 
that ZF provide with the Model / Zend DB Table Relation. But I can't applly the 
findParentRow functions to the oracle, because the bind parameter is always 
question mark / "?", is there a setting in the Zend DB initialization or 
somewhere that can convert the "?" To the oracle binding form (":bindName").

Thanks.
Wishnu

--
(;^o^)-~ o O 0


[fw-general] Zend_Test and dispatching

2008-08-14 Thread Jani Hartikainen

Is it possible to use the request parameters to dispatch
to a specific controller with Zend_Test? For some reason it
wouldn't work for me unless I provided an url.

For example:

$this->request->setModuleName('foo');
$this->request->setControllerName('foo');
$this->request->setActionName('foo');
$this->dispatch();

would not work. However, the following:

$this->dispatch('/foo/foo/foo');

worked just fine.


I was wondering if there's something I was doing
wrong or what could possibly affect the dispatching,
if it should work with the above set*Name methods too.


The reason I wanted to test without the exact url
is because the url could change depending on the routing,
but the modules etc. should always stay the same.

--
Jani Hartikainen
http://codeutopia.net/


Re: [fw-general] Modules and Shared functionality

2008-08-14 Thread Nino Martincevic

Hi Simon,

SiCo007 schrieb:

I am kind of in the same boat here, I find it frustrating that ZF doesn't
handle or suggest a use of models. I fully understand why mind you now I
have investigated, a model is essentially what anyone wants it to be!!


Well, that's a very differently handled issue.
Most PHP programmers treat models like the connection of a db to 
controllers. But from a design view they could be virtually anything, 
indeed they are a *Model* of your requirements. And for that how you 
would integrate a model of everything into a general framework like ZF?

You can't.


It seems to me that a lot is put into the controller in the docs and the
framework as a whole but that most of the actual work should actually happen
in the model!


It should, yes. A controller is best viewed as an application that uses 
stuff from the model. If you create another client beside HTTP, like a 
CLI it should use the same functionality out of the model.
That's the easiest way to see a model and a controller: the model is the 
core of your application, the controller is just your application layer, 
your API to the core.



I would like to see a base class and maybe a best practice / example in the
docs as a getting started, it's been my biggest hurdle choosing what
metodology (read opinion) to follow over model useage!!


Like I said before: there a billion different applications and many 
thousand clients possible.

So how you could make a base class for every one of it?
You easily can't.

Google for stuff like modelling domains, layered architectures and 
application design.


A three-layer application could be seen as:

Top: UI, Webpage, CLI, API, Whatever client
Middle (Core): your concrete application
Bottom: Infrastructure (DB, Filesystem, Mails, XML,...)

That's a minimum layered application.
If you want to know where a specific method or class belongs in, you 
could ask yourself: "Do all clients have to use this method?". If the 
answer is yes, it is a core functionality and belons to the middle layer.
If there are differences betweens clients (e.g. a CLI can't use web 
forms) it belongs to the top layer. That's the responsibility of a 
controller (or helper classes) of MVC then, and to delegate the work and 
make calls to the core.










[fw-general] Building a MVC-based Soap server

2008-08-14 Thread Luiz Vitor
Hi there

I´m trying to build a soap server using the ZF MVC architeture, but I can´t
get it to work.

I have a Service model used as a gateway between the soap server and the
application logic.

class Services
{
/**
 * Verify user credentials
 *
 * @param string $username
 * @param string $password
 * @return bool
 */
public function authenticate($username, $password)
{
// code to authenticate
}
}


On the other part, I have a ServiceController which I setup the wsdl
autodiscover and server

class ServiceController extends Zend_Controller_Action
{
public function wsdlAction()
{
$wsdl = new Zend_Soap_Wsdl();
$wsdl->setClass('Services');
$wsdl->handle();
exit;
}


public function serverAction()
{
$server = new Zend_Soap_Server('http://myhost.com/service/wsdl/');
$server->setClass('Services');
$server->handle();
exit;
}
}

Up to now everything works as expected, when I access
http://myhost.com/service/wsdl/ I get the XML describing the Service class.

Now comes the problem: I can´t make any requests to the server. Here´s what
I´m trying:

$client = new Zend_Soap_Client('http://myhost.com/service/server'); //
tryied http://myhost.com/service/wsdl/ too with no success
Zend_Debug::dump($client->authenticate('user', 'pass');

But the service is never called.

What I´m doing wrong?

Thank you


Re: [fw-general] Modules and Shared functionality

2008-08-14 Thread Matthew Weier O'Phinney
-- SiCo007 <[EMAIL PROTECTED]> wrote
(on Thursday, 14 August 2008, 02:50 AM -0700):
> I am kind of in the same boat here, I find it frustrating that ZF doesn't
> handle or suggest a use of models. I fully understand why mind you now I
> have investigated, a model is essentially what anyone wants it to be!!
> 
> I do think though as I progress that a model base class should be made with
> a way to add helpers much like action helpers. 

Please note that there _is_ a proposal in the works for models:

http://framework.zend.com/wiki/pages/viewpage.action?pageId=41564

I would suggest that you make your comments there for now.

> I am going to do this now, using much of the action helper code as
> guidance so that it should work in the ZF way. I've done the action
> helper to load the models that's easy enough it's everything that goes
> with it that seems to duplicate things already done for the action.
> 
> It seems to me that a lot is put into the controller in the docs and the
> framework as a whole but that most of the actual work should actually happen
> in the model!

It should -- and you could also claim that everything but
Zend_Controller, Zend_Layout, and Zend_View can be used to support the
Model. ;)

> I would like to see a base class and maybe a best practice / example in the
> docs as a getting started, it's been my biggest hurdle choosing what
> metodology (read opinion) to follow over model useage!!

Trust me, we plan on doing this. Please review the proposal linked
above, and comment from there. Regardless of whether or not we adopt the
proposal, we _will_ be documenting best practices in coming months.

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


Re: [fw-general] Modules and Shared functionality

2008-08-14 Thread SiCo007

I am kind of in the same boat here, I find it frustrating that ZF doesn't
handle or suggest a use of models. I fully understand why mind you now I
have investigated, a model is essentially what anyone wants it to be!!

I do think though as I progress that a model base class should be made with
a way to add helpers much like action helpers. I am going to do this now,
using much of the action helper code as guidance so that it should work in
the ZF way. I've done the action helper to load the models that's easy
enough it's everything that goes with it that seems to duplicate things
already done for the action.

It seems to me that a lot is put into the controller in the docs and the
framework as a whole but that most of the actual work should actually happen
in the model!

I would like to see a base class and maybe a best practice / example in the
docs as a getting started, it's been my biggest hurdle choosing what
metodology (read opinion) to follow over model useage!!

-
Simon

http://www.ajb007.co.uk/
-- 
View this message in context: 
http://www.nabble.com/Modules-and-Shared-functionality-tp18952739p18978746.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] Status of Zend_Build / scaffolding

2008-08-14 Thread Keith Pope
 
I think those proposals may have been superseded by the new Zend_Tool_*, 
someone correct me if I am wrong. 

http://framework.zend.com/wiki/display/ZFPROP/Zend_Tool+-+General

There is a separate development list here:

http://tech.groups.yahoo.com/group/zf-tool/

Check it out, there is currently a push to get feedback on the 
proposals.


Keith Pope
Web Developer

-Original Message-
From: Ralf Eggert [mailto:[EMAIL PROTECTED] 
Sent: 14 August 2008 08:51
To: fw-general@lists.zend.com
Subject: [fw-general] Status of Zend_Build / scaffolding

Hi,

just a quick question. What is the current status of Zend_Build or any 
other initiative to get some scaffolding facilities for the Zend 
Framework?

http://framework.zend.com/wiki/display/ZFPROP/Zend_Build+-+Wil+Sinclair

http://framework.zend.com/wiki/display/ZFPROP/Zend_Controller_Front_Scaffold

Thanks and best regards,

Ralf



--

allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, 
Hereford, HR1 3SE.

Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88.



Telephone: 0870 243 3434, Fax: 0870 243 6041.

Website: www.allpay.net

Email: [EMAIL PROTECTED]



This email, and any files transmitted with it, is confidential and intended 
solely for the use of the individual or entity to whom it is addressed. If you 
have received this email in error please notify the allpay.net Information 
Security Manager at the number above.


[fw-general] Status of Zend_Build / scaffolding

2008-08-14 Thread Ralf Eggert
Hi,

just a quick question. What is the current status of Zend_Build or any
other initiative to get some scaffolding facilities for the Zend Framework?

http://framework.zend.com/wiki/display/ZFPROP/Zend_Build+-+Wil+Sinclair

http://framework.zend.com/wiki/display/ZFPROP/Zend_Controller_Front_Scaffold

Thanks and best regards,

Ralf