2009年7月31日星期五

Re: [fw-auth] Zend_Auth_Adapter_Cas

I added another use case for people not using the MVC aspect of Zend.


gammamatrix wrote:
>
> There have been a couple of other developers who have successfully got
> this to work with their authentication system.
>
> I have moved the site to the Ready for Recommendation category.
>
> Jeremy
>
>
> gammamatrix wrote:
>>
>> I have put in a working class for Zend_Auth_Adapter_Cas.
>>
>> It is fully functional and in use at UC Davis http://ucdavis.edu/
>>
>> Please review so we can get this in the code base.
>>
>> This is much simpler to use than the older code base provided at:
>>
>> http://www.ja-sig.org/wiki/display/CASC/phpCAS+examples
>>
>> Thanks for your input!
>>
>> Jeremy
>>
>>
>> gammamatrix wrote:
>>>
>>> Thanks!
>>>
>>>
>>> Matthew Weier O'Phinney-3 wrote:
>>>>
>>>> -- gammamatrix <jeremy.postlethwaite@gmail.com> wrote
>>>> (on Tuesday, 28 April 2009, 12:18 PM -0700):
>>>>> I see that the Zend_Auth_Adapter_Cas proposal has stalled:
>>>>>
>>>>> http://framework.zend.com/wiki/pages/viewpage.action?pageId=43342
>>>>>
>>>>> I have created my own version of this class which is in use at UC
>>>>> Davis:
>>>>> http://ucdavis.edu/
>>>>>
>>>>> The class is fully functioning with an example. It should be
>>>>> compatible with
>>>>> CAS 1, 2, and 3.
>>>>>
>>>>> I have submitted a CLA so I can post proposals, so I need to wait
>>>>> until I
>>>>> get approved before I can contribute.
>>>>
>>>> Ask for community review of your proposal. You can do that on this
>>>> list,
>>>> the more popular fw-general list, or on the zf-contributors list. Be
>>>> persistent, and try and get people to read the proposal and provide
>>>> feedback.
>>>>
>>>> Once you have done so, and incorporated any pertinent feedback,
>>>> re-parent the proposal as "ready for recommendation". At that time, the
>>>> internal team will evaluate the proposal for inclusion within the
>>>> framework.
>>>>
>>>> --
>>>> Matthew Weier O'Phinney
>>>> Project Lead | matthew@zend.com
>>>> Zend Framework | http://framework.zend.com/
>>>>
>>>>
>>>
>>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Zend_Auth_Adapter_Cas-tp23284242p24763566.html
Sent from the Zend Auth mailing list archive at Nabble.com.

[fw-auth] Re: [fw-general] Re: [fw-auth] Zend_Acl fixes in trunk for assertions ZF-1721 & ZF-1722

Awesome!

Well, I plan to close these issues by the end of the day (or weekend)
assuming no one else pipes up about how well the solution works :)

-Ralph

Abraham Block wrote:
> Seems to work like a champ, Ralph!
>
> On Fri, Jul 31, 2009 at 11:06 AM, Ralph Schindler
> <ralph.schindler@zend.com <mailto:ralph.schindler@zend.com>> wrote:
>
> Hi all,
>
> I have supplied a fix in trunk for issues ZF-1721 and ZF-1722. This
> is a long standing issue that affects developers who wish to write
> non-trivial assertions. If anyone is interested, here is a similar
> use case that describes part of the issue I think a lot of
> developers have run into.
>
> http://pastebin.com/f328e03ff
>
> Please test out Zend_Acl from trunk and let me know if it fixes your
> issues. The issues described in the issue tracker the fix affects are:
>
> * Zend_Acl::isAllowed does not support Role/Resource
> Inheritance down to Assertions
> http://framework.zend.com/issues/browse/ZF-1721
>
> * Zend_Acl assertions broken when inheritance is required
> (ie DepthFirstSearch)
> http://framework.zend.com/issues/browse/ZF-1722
>
> * Resource objects passed in to ACL query methods are not
> passed through to registered assert()'s
> http://framework.zend.com/issues/browse/ZF-4460
>
> * Assertion implementation does not receive ACL query
> parameters.
> http://framework.zend.com/issues/browse/ZF-5425
>
> * Inheritage of roles: rules are checked by parent roles
> http://framework.zend.com/issues/browse/ZF-3390
>
> Thanks!
> Ralph Schindler
>
>

Re: [fw-auth] Zend_Acl fixes in trunk for assertions ZF-1721 & ZF-1722

Seems to work like a champ, Ralph!

On Fri, Jul 31, 2009 at 11:06 AM, Ralph Schindler <ralph.schindler@zend.com> wrote:
Hi all,

I have supplied a fix in trunk for issues ZF-1721 and ZF-1722.  This is a long standing issue that affects developers who wish to write non-trivial assertions.  If anyone is interested, here is a similar use case that describes part of the issue I think a lot of developers have run into.

http://pastebin.com/f328e03ff

Please test out Zend_Acl from trunk and let me know if it fixes your issues.  The issues described in the issue tracker the fix affects are:

* Zend_Acl::isAllowed does not support Role/Resource
 Inheritance down to Assertions
 http://framework.zend.com/issues/browse/ZF-1721

* Zend_Acl assertions broken when inheritance is required
 (ie DepthFirstSearch)
 http://framework.zend.com/issues/browse/ZF-1722

* Resource objects passed in to ACL query methods are not
 passed through to registered assert()'s
 http://framework.zend.com/issues/browse/ZF-4460

* Assertion implementation does not receive ACL query
 parameters.
 http://framework.zend.com/issues/browse/ZF-5425

* Inheritage of roles: rules are checked by parent roles
 http://framework.zend.com/issues/browse/ZF-3390

Thanks!
Ralph Schindler


[fw-auth] Zend_Acl fixes in trunk for assertions ZF-1721 & ZF-1722

Hi all,

I have supplied a fix in trunk for issues ZF-1721 and ZF-1722. This is
a long standing issue that affects developers who wish to write
non-trivial assertions. If anyone is interested, here is a similar use
case that describes part of the issue I think a lot of developers have
run into.

http://pastebin.com/f328e03ff

Please test out Zend_Acl from trunk and let me know if it fixes your
issues. The issues described in the issue tracker the fix affects are:

* Zend_Acl::isAllowed does not support Role/Resource
Inheritance down to Assertions
http://framework.zend.com/issues/browse/ZF-1721

* Zend_Acl assertions broken when inheritance is required
(ie DepthFirstSearch)
http://framework.zend.com/issues/browse/ZF-1722

* Resource objects passed in to ACL query methods are not
passed through to registered assert()'s
http://framework.zend.com/issues/browse/ZF-4460

* Assertion implementation does not receive ACL query
parameters.
http://framework.zend.com/issues/browse/ZF-5425

* Inheritage of roles: rules are checked by parent roles
http://framework.zend.com/issues/browse/ZF-3390

Thanks!
Ralph Schindler

Re: [fw-mvc] Using Ajax with Zend

Naimesh.Trivedi (Gmail) ha scritto:


Dear Simone,

 

Hello ! Thanks for the prompt response.

 

I am also trying with Zend_Form_Dojo. The example you gave is not full, I am new to Zend so don’t know which code to write where, I meant in controller, model or view and where to add the mentioned java script code with some example validation.

 

Can you please give more details as mentioned above or link where I can read and use.

 

Also I have seen $this->dojo()->setLocalPath(’http://localhost/Zend/js/dojo/dojo/dojo.js’) in some examples, but I could not find dojo.js in Zend framework 1.8.4 library, how to find and keep it.

 

Thanks in Advance !

Dear Naimesh,
I think it's better if you start with the "Quick Start" from here 
http://framework.zend.com/docs/quickstart
then read all the manual
http://framework.zend.com/manual/en/
make your first forms using the standard Zend_Form and when you have learn all the flow
then you can start using Zend_Dojo_Forms with ajax requests.
if you need some help we all share our experiences on #zftalk irc channel on freenode.net

bye
--
fsockopen
ZF n00b

RE: [fw-mvc] Using Ajax with Zend

 

Dear Simone,

 

Hello ! Thanks for the prompt response.

 

I am also trying with Zend_Form_Dojo. The example you gave is not full, I am new to Zend so don’t know which code to write where, I meant in controller, model or view and where to add the mentioned java script code with some example validation.

 

Can you please give more details as mentioned above or link where I can read and use.

 

Also I have seen $this->dojo()->setLocalPath(’http://localhost/Zend/js/dojo/dojo/dojo.js’) in some examples, but I could not find dojo.js in Zend framework 1.8.4 library, how to find and keep it.

 

Thanks in Advance !

 

Naimesh

From: Simone Cosci [mailto:s.cosci@nextidea.it]
Sent: Friday, July 31, 2009 7:16 PM
To: fw-general@lists.zend.com
Cc: fw-mvc@lists.zend.com
Subject: Re: [fw-mvc] Using Ajax with Zend

 

Naimesh.Trivedi (Gmail) ha scritto:

Hello !

 

I want to use Ajax in my Zend based input forms, should I used Zend_Form or Zend_Dojo_Form ?

Can anybody help me showing a link of example of ajax enabled form using above ?

 

Thanks in Advance !

 

Naimesh

 

 

I think you can choose the one you prefere ...
I use dojo only to XmlHttpRequest
in my case important is:

$form->setAttrib('onsubmit', 'sendAjaxForm(this)');

then a JS to handle the post and the server response:
eg.

function sendAjaxForm(frm)
{
    var kw = {
            url: frm.action,
            handleAs: "text",
            load: function(response){
                dojo.byId('mainPane').innerHTML =  response;
            },
//            postprocess: doSomethingElseAfterPost,
            error: function(data){
                alert("sendAjaxForm() timed out: " + data);
            },
            timeout: 2000,
            form: frm.id
        };
    dojo.xhrPost(kw);
    return false;
}

bye

--
fsockopen
ZF n00b


Re: [fw-mvc] Using Ajax with Zend

Naimesh.Trivedi (Gmail) ha scritto:

Hello !

 

I want to use Ajax in my Zend based input forms, should I used Zend_Form or Zend_Dojo_Form ?

Can anybody help me showing a link of example of ajax enabled form using above ?

 

Thanks in Advance !

 

Naimesh

 

 

I think you can choose the one you prefere ...
I use dojo only to XmlHttpRequest
in my case important is:

$form->setAttrib('onsubmit', 'sendAjaxForm(this)');

then a JS to handle the post and the server response:
eg.

function sendAjaxForm(frm)
{
    var kw = {
            url: frm.action,
            handleAs: "text",
            load: function(response){
                dojo.byId('mainPane').innerHTML =  response;
            },
//            postprocess: doSomethingElseAfterPost,
            error: function(data){
                alert("sendAjaxForm() timed out: " + data);
            },
            timeout: 2000,
            form: frm.id
        };
    dojo.xhrPost(kw);
    return false;
}

bye

--
fsockopen
ZF n00b



[fw-mvc] Using Ajax with Zend

Hello !

 

I want to use Ajax in my Zend based input forms, should I used Zend_Form or Zend_Dojo_Form ?

Can anybody help me showing a link of example of ajax enabled form using above ?

 

Thanks in Advance !

 

Naimesh

 

 

Re: [fw-mvc] Autoloader and main file

-- Jules Piccotti <jules@piccotti.it> wrote
(on Friday, 31 July 2009, 09:02 AM +0200):
> Hi everyone, I have a recurring issue with the autoloader which can be
> easily addressed by using the Fallback AutoLoader, thing I would like
> to avoid.
>
> Many external libraries like Doctrine have a main file with the same
> name of the class, following this structure
>
> /Doctrine.php -> class Doctrine
> /Doctrine/Access.php -> class Doctrine_Access
> /Doctrine/Adapter.php -> class Doctrine_Adapter
> ...and so on.

You can do this with a combination of two things. First, add "Doctrine"
as an autoloader namespace, and second, add the Doctrine autoloader to
Zend_Loader_Autoloader.

The first is sipmly adding a line to your config file:

autoloaderNamespaces[] = "Doctrine"

Note the absence of a trailing '_' -- this is how it can match the
initial "Doctrine" class.

The second is pushing the Doctrine autoloader into
Zend_Loader_Autoloader during your Doctrine initialization. The
following is from an application bootstrap I have used successfully with
Doctrine already:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initDoctrine()
{
$this->getApplication()
->getAutoloader()
->pushAutoloader(array('Doctrine', 'autoload'));

$manager = Doctrine_Manager::getInstance();
}
}

Doing this, you no longer need to use the fallback autoloader
functionality.

> This is a recurring issue, since several framework and libraries have
> the same folder structure of Doctrine, is there a good practice to let
> the default autoloader manage them correctly?

PEAR is the library most problematic here, due to the fact that there is
no common vendor namespace. However, if you know that you are using
specific PEAR libraries, you can simply add their component namespaces
to the autoloader, as I did with the initial Doctrine setup, but using
the trailing '_'.

For libraries that *are* vendor namespaced, simply add their vendor
prefix to the autoloader namespaces, with the trailing '_'. This will
work with Solar, my own libraries (Phly_), etc.

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

[fw-mvc] FW: Using Dojo with Zend

Please let me refresh my 3rd point be more informative.

 

3) In my Zend Form class .php for example prjhead.php which I stored in /application/forms directory
Now in prjhead.php, the the class extending Zend_Form has to have name Default_Form_prjhead to work.
If I change the name of that class to Prjhead_Form or something different, it does not work.

In my controller I wrote like $form = new Default_Form_prjhead(); which gives error when the name is changed to prjhead_Form, I did also change the
calling $form= new Prjhead_Form(). The error is not able to find the form.

 

Thanks & Regards,

 

Naimesh Trivedi

 

From: Naimesh.Trivedi (Gmail) [mailto:naimesh.trivedi@gmail.com]
Sent: Thursday, July 30, 2009 5:25 PM
To: fw-general@lists.zend.com
Cc: 'fw-mvc@lists.zend.com'
Subject: Using Dojo with Zend

 

Hello !

 

I have started exploring zend framework 1.8.4 to port new applications to Zend.

 

Can you please guide me knowing following to start with :

 

1)    How do I use Ajax enabled to Zend_Form elements and validate my form elements ?

2)  To use Dojo and Zend_Dojo_Form, do I need to put dojo.js, I could not find it in Zend Framework 1.8.4, please guide me on this as following code I found on manual calls it.
  <?php if ($this->dojo()->isEnabled()){

    $this->dojo()->setLocalPath('/js/dojo/dojo.js')

                 ->addStyleSheetModule('dijit.themes.tundra');

    echo $this->dojo();

   }?>

      What other settings are required to use Dojo helpers and layouts. 

3)    The name of the Zend has to include prefix Default_Form_XXXX where Default_Form is prefix and keep XXXX.php having zend_form_xxxx class  extending Zend_Form_xxxx as not doing this gives error not able to find it from view.

4)    How do I know all resource.xxx attributes list

 

Please guide me on this.

 

Thanks & Regards,

 

Nbt

 

 

[fw-mvc] Re: Autoloader and main file

Of course when I wrote "the namespacing parameter should be
'Doctrine/' " I meant "Doctrine_".

Jules

[fw-mvc] Autoloader and main file

Hi everyone, I have a recurring issue with the autoloader which can be
easily addressed by using the Fallback AutoLoader, thing I would like
to avoid.

Many external libraries like Doctrine have a main file with the same
name of the class, following this structure

/Doctrine.php -> class Doctrine
/Doctrine/Access.php -> class Doctrine_Access
/Doctrine/Adapter.php -> class Doctrine_Adapter
...and so on.

originally, even Zend Framework followed this, quite common, design.


Now, after I setup the autoloader correctly, I'm getting the following
error: Fatal error: Class 'Doctrine' not found in
/Users/jules/Sviluppo/fresh-cms/library/Doctrine/Manager.php on line
95

As you may notice the autoloader manages to load any class of the
Doctrine library but the main one.


Here's my Bootstrap.php file:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initGenericAutoloader()
{
$loader = Zend_Loader_Autoloader::getInstance();
return $loader;
}

protected function _initDoctrine()
{
$config = $this->getOption('doctrine');
$doctrine = Doctrine_Manager::getInstance();
$doctrine->openConnection($config['connection']);
Zend_Registry::set('doctrine_config', $config);
return $doctrine;
}
}


I can easily fix it through one of the following workarounds, but I
dislike both:
- add a require_once 'Doctrine.php' statemente in the _initDoctrine() method
- adding the Doctrine namespace to the autoloader like that:
Zend_Loader_Autoloader::getInstance()->registerNamespace('Doctrine');
which is bad either because it's too loosy but makes it pick the
Doctrine.php file; the namespacing parameter should be 'Doctrine/' to
make it stick to the desired framework as by the ZF documentation.
- using the FallBackAutoLoader which I'd like to avoid.


This is a recurring issue, since several framework and libraries have
the same folder structure of Doctrine, is there a good practice to let
the default autoloader manage them correctly?

Thanks,
Jules Piccotti

2009年7月30日星期四

Re: [fw-db] view complete sql statement on error

Wow, good to know that is now possible to do it on config level, that was not the case in previous versions.

A lot of config options are available now, is there any place where they are all documented?

Regards,
Saša Stamenković


On Fri, Jul 31, 2009 at 8:12 AM, Ari Awan <ariawan.jp@gmail.com> wrote:
I can see it now! with firebug! Thanks a lot Saša!

I just put this : 
resources.db.params.profiler.enabled    = true
resources.db.params.profiler.class      = Zend_Db_Profiler_Firebug

in app.ini

and turns out that i forgot to enable Net panel on firebug.


On Jul 31, 2009, at 3:06 PM, Саша Стаменковић wrote:

Can you give us the source code so we can see where are you getting it wrong?

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 4:53 PM, Ari Awan <ariawan.jp@gmail.com> wrote:
I have tried using ZFdebug and zend.db.profiler via firebug .. but nothing seem to work .. I couldnt see anything.

I manage to see the complete query for select statement by using this

$select = $this->getDbTable()->select()->where('id = ?', $id);
Zend_Debug::Dump($select->assemble());
exit;

but for :
insert ($this->getDbTable()->insert($data);) and 
update ($this->getDbTable()->update($data, $where);).. 
i couldnt see it ..

I am using zf 1.8.4 and Zend_Db_Table for the database query.

Any help is appreciated.

Thank you,
Ari




On Jul 30, 2009, at 6:19 PM, Саша Стаменковић wrote:

You can use profiler http://framework.zend.com/manual/en/zend.db.profiler.html, it's handy to print them to firebug when in test env. Or use Scienta ZF Debug Bar. Or simply echo your statement.

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 10:49 AM, Ari Awan <ariawan.jp@gmail.com> wrote:
Hi all,

Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?

This is what it currently displays

#3 ... /library/Zend/Db/Adapter/Abstract.php(542):
Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `us...', Array)
#4 ... /library/Zend/Db/Table/Abstract.php(955):
Zend_Db_Adapter_Abstract->insert('user', Array)

..and I would like to see the whole update statement before sent to the db to track what is wrong with it.

Thanks for the help!

Ari





Re: [fw-db] view complete sql statement on error

I can see it now! with firebug! Thanks a lot Saša!

I just put this : 
resources.db.params.profiler.enabled    = true
resources.db.params.profiler.class      = Zend_Db_Profiler_Firebug

in app.ini

and turns out that i forgot to enable Net panel on firebug.


On Jul 31, 2009, at 3:06 PM, Саша Стаменковић wrote:

Can you give us the source code so we can see where are you getting it wrong?

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 4:53 PM, Ari Awan <ariawan.jp@gmail.com> wrote:
I have tried using ZFdebug and zend.db.profiler via firebug .. but nothing seem to work .. I couldnt see anything.

I manage to see the complete query for select statement by using this

$select = $this->getDbTable()->select()->where('id = ?', $id);
Zend_Debug::Dump($select->assemble());
exit;

but for :
insert ($this->getDbTable()->insert($data);) and 
update ($this->getDbTable()->update($data, $where);).. 
i couldnt see it ..

I am using zf 1.8.4 and Zend_Db_Table for the database query.

Any help is appreciated.

Thank you,
Ari




On Jul 30, 2009, at 6:19 PM, Саша Стаменковић wrote:

You can use profiler http://framework.zend.com/manual/en/zend.db.profiler.html, it's handy to print them to firebug when in test env. Or use Scienta ZF Debug Bar. Or simply echo your statement.

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 10:49 AM, Ari Awan <ariawan.jp@gmail.com> wrote:
Hi all,

Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?

This is what it currently displays

#3 ... /library/Zend/Db/Adapter/Abstract.php(542):
Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `us...', Array)
#4 ... /library/Zend/Db/Table/Abstract.php(955):
Zend_Db_Adapter_Abstract->insert('user', Array)

..and I would like to see the whole update statement before sent to the db to track what is wrong with it.

Thanks for the help!

Ari




Re: [fw-db] view complete sql statement on error

Can you give us the source code so we can see where are you getting it wrong?

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 4:53 PM, Ari Awan <ariawan.jp@gmail.com> wrote:
I have tried using ZFdebug and zend.db.profiler via firebug .. but nothing seem to work .. I couldnt see anything.

I manage to see the complete query for select statement by using this

$select = $this->getDbTable()->select()->where('id = ?', $id);
Zend_Debug::Dump($select->assemble());
exit;

but for :
insert ($this->getDbTable()->insert($data);) and 
update ($this->getDbTable()->update($data, $where);).. 
i couldnt see it ..

I am using zf 1.8.4 and Zend_Db_Table for the database query.

Any help is appreciated.

Thank you,
Ari




On Jul 30, 2009, at 6:19 PM, Саша Стаменковић wrote:

You can use profiler http://framework.zend.com/manual/en/zend.db.profiler.html, it's handy to print them to firebug when in test env. Or use Scienta ZF Debug Bar. Or simply echo your statement.

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 10:49 AM, Ari Awan <ariawan.jp@gmail.com> wrote:
Hi all,

Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?

This is what it currently displays

#3 ... /library/Zend/Db/Adapter/Abstract.php(542):
Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `us...', Array)
#4 ... /library/Zend/Db/Table/Abstract.php(955):
Zend_Db_Adapter_Abstract->insert('user', Array)

..and I would like to see the whole update statement before sent to the db to track what is wrong with it.

Thanks for the help!

Ari



Re: [fw-auth] Zend_Auth_Adapter_Cas

There have been a couple of other developers who have successfully got this
to work with their authentication system.

I have moved the site to the Ready for Recommendation category.

Jeremy


gammamatrix wrote:
>
> I have put in a working class for Zend_Auth_Adapter_Cas.
>
> It is fully functional and in use at UC Davis http://ucdavis.edu/
>
> Please review so we can get this in the code base.
>
> This is much simpler to use than the older code base provided at:
>
> http://www.ja-sig.org/wiki/display/CASC/phpCAS+examples
>
> Thanks for your input!
>
> Jeremy
>
>
> gammamatrix wrote:
>>
>> Thanks!
>>
>>
>> Matthew Weier O'Phinney-3 wrote:
>>>
>>> -- gammamatrix <jeremy.postlethwaite@gmail.com> wrote
>>> (on Tuesday, 28 April 2009, 12:18 PM -0700):
>>>> I see that the Zend_Auth_Adapter_Cas proposal has stalled:
>>>>
>>>> http://framework.zend.com/wiki/pages/viewpage.action?pageId=43342
>>>>
>>>> I have created my own version of this class which is in use at UC
>>>> Davis:
>>>> http://ucdavis.edu/
>>>>
>>>> The class is fully functioning with an example. It should be compatible
>>>> with
>>>> CAS 1, 2, and 3.
>>>>
>>>> I have submitted a CLA so I can post proposals, so I need to wait until
>>>> I
>>>> get approved before I can contribute.
>>>
>>> Ask for community review of your proposal. You can do that on this list,
>>> the more popular fw-general list, or on the zf-contributors list. Be
>>> persistent, and try and get people to read the proposal and provide
>>> feedback.
>>>
>>> Once you have done so, and incorporated any pertinent feedback,
>>> re-parent the proposal as "ready for recommendation". At that time, the
>>> internal team will evaluate the proposal for inclusion within the
>>> framework.
>>>
>>> --
>>> Matthew Weier O'Phinney
>>> Project Lead | matthew@zend.com
>>> Zend Framework | http://framework.zend.com/
>>>
>>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Zend_Auth_Adapter_Cas-tp23284242p24750498.html
Sent from the Zend Auth mailing list archive at Nabble.com.

Re: [fw-db] ZFDebug



On Thu, Jul 30, 2009 at 11:44 AM, Steve Rayner <srayner@williams-refrigeration.co.uk> wrote:

The offending line in my bootstrap file is;

 

if ($this-hasPluginResource('db')) {

Missing a right angle bracket. It should be $this->has...

"Call to undefined function" usually indicates you are missing "new", or quotes around strings, or in this case, you are trying to subtract the return value of hasPluginResource from the variable $this. - pw
 

 

Re: [fw-db] How to test the success of Db_Table::insert()?

Am Donnerstag 30 Juli 2009 schrieb Hector Virgen:
> If it fails, wouldn't an exception be thrown?

Ok, you are right.
I wrote a little test script and get an exception if some constraint check
fails:
Zend_Db_Statement_Exception' with message 'SQLSTATE[23505]: Unique violation:.

Seems this thing got lost somewhere in my application.
Thanks for your hints.


--
MfG, Christian Welzel

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

[fw-db] ZFDebug

Why would i be getting this error?

 

Fatal error: Call to undefined function hasPluginResource() in C:\www\Titanium\application\Bootstrap.php on line 40

 

The offending line in my bootstrap file is;

 

if ($this-hasPluginResource('db')) {

            $this->bootstrap('db');

            $db = $this->getPluginResource('db')->getDbAdapter();

            $options['plugins']['Database']['adapter'] = $db;

      }

 

As far as i can see hasPluginResource is a function if the class Zend_Application_Bootstrap_BootstrpAbstract.

 

Also i am very new to Zend framework. I am used to seeing $this->somefunction. This is the firsttime i have seen $this-somefunction. What is the difference between – and ->    ?

 

 

Williams Refrigeration is a trading name of AFE Group Limited.
Registered in England & Wales under Registered Number 3872673. Registered
Office Address - Bryggen Road, North Lynn, Industrial Estate, Kings Lynn, Norfolk, PE30 2HZ

Williams Refrigeration reserves the right to block any email attachment we deem inappropriate and to also reject any inbound connections from Blacklisted servers. Any email meeting the above criteria will be automatically rejected without notification given to the original sender.

NOTE: In accordance with the Data Protection Act compliance, all Bulk sends should use the BCC field as much as possible.

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error or are having trouble sending email to Williams please notify the system administrator - postmaster@williams-refrigeration.co.uk

Any views or opinions expressed in this e-mail are those of the sender and do not necessarily coincide with those of Williams Refrigeration or the AFE Group.

Re: [fw-db] How to test the success of Db_Table::insert()?

On Thu, Jul 30, 2009 at 8:38 PM, Hector Virgen<djvirgen@gmail.com> wrote:
> If it fails, wouldn't an exception be thrown?

Yeah, I guess that would be enough since you don't have extended
inserts or something like that where an affected number of rows would
be useful.

> On Thu, Jul 30, 2009 at 11:36 AM, Christian Welzel <gawain@camlann.de>
> wrote:
>>
>> Am Donnerstag 30 Juli 2009 schrieb till:
>> >
>> > I thought I just read that it returns the affected rows.
>>
>> Zend_Db_Adapter::insert() does.
>> But not Zend_Db_Table::insert().
>>
>> So i wonder how i'm supposed to check on Zend_Db_Table whether
>> the insert() succeeded or not...

Correct. I had just looked at the Adapter. Sorry about that!

Till

Re: [fw-db] How to test the success of Db_Table::insert()?

If it fails, wouldn't an exception be thrown?

--
Hector


On Thu, Jul 30, 2009 at 11:36 AM, Christian Welzel <gawain@camlann.de> wrote:
Am Donnerstag 30 Juli 2009 schrieb till:
>
> I thought I just read that it returns the affected rows.

Zend_Db_Adapter::insert() does.
But not Zend_Db_Table::insert().

So i wonder how i'm supposed to check on Zend_Db_Table whether
the insert() succeeded or not...


--
 MfG, Christian Welzel

 GPG-Key:     http://www.camlann.de/key.asc
 Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15


Re: [fw-db] How to test the success of Db_Table::insert()?

Am Donnerstag 30 Juli 2009 schrieb till:
>
> I thought I just read that it returns the affected rows.

Zend_Db_Adapter::insert() does.
But not Zend_Db_Table::insert().

So i wonder how i'm supposed to check on Zend_Db_Table whether
the insert() succeeded or not...


--
MfG, Christian Welzel

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

Re: [fw-db] How to test the success of Db_Table::insert()?

On Thu, Jul 30, 2009 at 8:17 PM, Christian Welzel<gawain@camlann.de> wrote:
> Hi there,
>
> what is the recommended way to test if an insert action of
> Zend_Db_Table::insert() succeeded?
> The return value of the Adapter::insert() is discarded, and
> the returned pk is only usable if it is a autoincrementing
> column and the value was not given...
>

I thought I just read that it returns the affected rows.

Till

[fw-db] How to test the success of Db_Table::insert()?

Hi there,

what is the recommended way to test if an insert action of
Zend_Db_Table::insert() succeeded?
The return value of the Adapter::insert() is discarded, and
the returned pk is only usable if it is a autoincrementing
column and the value was not given...

--
MfG, Christian Welzel

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

Re: [fw-db] DISTINCT SQL Statement

Dear Andrew,

Thank you for the tip. It works like a charm.

Thanks a lot

2009/7/30 Andrew Ballard <aballard@gmail.com>


CEHTURK wrote:
>
> Hello all
>
> How can I run this query? I have been struggeling for hours.
>
> SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as
> NumberOfCase  FROM material
>
>

It needs a GROUP BY clause in any case, but how are you trying to run it?
Using Zend_Db_Select?

       $select = $db->select()
           ->from('material',
                array(
                    'NumberOfCases' => new Zend_Db_Expr('COUNT(DISTINCT
CIN_Number)'),
                    'MMT_Number'
                ))
           ->group('MMT_Number');


Andrew
--
View this message in context: http://www.nabble.com/DISTINCT-SQL-Statement-tp24738814p24739770.html
Sent from the Zend DB mailing list archive at Nabble.com.




--

Erdal YAZICIOGLU
System & Network Engineer
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

Re: [fw-db] DISTINCT SQL Statement

CEHTURK wrote:
>
> Hello all
>
> How can I run this query? I have been struggeling for hours.
>
> SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as
> NumberOfCase FROM material
>
>

It needs a GROUP BY clause in any case, but how are you trying to run it?
Using Zend_Db_Select?

$select = $db->select()
->from('material',
array(
'NumberOfCases' => new Zend_Db_Expr('COUNT(DISTINCT
CIN_Number)'),
'MMT_Number'
))
->group('MMT_Number');


Andrew
--
View this message in context: http://www.nabble.com/DISTINCT-SQL-Statement-tp24738814p24739770.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-db] view complete sql statement on error

I have tried using ZFdebug and zend.db.profiler via firebug .. but nothing seem to work .. I couldnt see anything.

I manage to see the complete query for select statement by using this

$select = $this->getDbTable()->select()->where('id = ?', $id);
Zend_Debug::Dump($select->assemble());
exit;

but for :
insert ($this->getDbTable()->insert($data);) and 
update ($this->getDbTable()->update($data, $where);).. 
i couldnt see it ..

I am using zf 1.8.4 and Zend_Db_Table for the database query.

Any help is appreciated.

Thank you,
Ari



On Jul 30, 2009, at 6:19 PM, Саша Стаменковић wrote:

You can use profiler http://framework.zend.com/manual/en/zend.db.profiler.html, it's handy to print them to firebug when in test env. Or use Scienta ZF Debug Bar. Or simply echo your statement.

Regards,
Saša Stamenković


On Thu, Jul 30, 2009 at 10:49 AM, Ari Awan <ariawan.jp@gmail.com> wrote:
Hi all,

Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?

This is what it currently displays

#3 ... /library/Zend/Db/Adapter/Abstract.php(542):
Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `us...', Array)
#4 ... /library/Zend/Db/Table/Abstract.php(955):
Zend_Db_Adapter_Abstract->insert('user', Array)

..and I would like to see the whole update statement before sent to the db to track what is wrong with it.

Thanks for the help!

Ari


RE: [fw-db] DISTINCT SQL Statement

Hi,

 

In case you don’t need to build your query dynamically (for. ex. for pagination) you can write SQL manually inside your model.

 

So within model class:

 

 

public function getCinCount()

{

 

--  your code ---

 

$this->_db->runQuery(“SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as NumberOfCase  FROM material”);

 

--  your code ---

 

return $result;

}

 

 

 

 

 

From: Erdal YAZICIOGLU [mailto:erdal.yazicioglu@gmail.com]
Sent: Thursday, July 30, 2009 4:49 PM
To: fw-db@lists.zend.com
Subj
ect: [fw-db] DISTINCT SQL Statement

 

Hello all

How can I run this query? I have been struggeling for hours.

SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as NumberOfCase  FROM material

Thanks a lot



Erdal YAZICIOGLU
System & Network Engineer
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

Re: [fw-db] Comments on Zend_Db_Adapter_Sqlsrv

Juozas wrote:
>
> initially I used Oracle adapter/statement code as a framework to create
> sql
> functionality, so 1.) might be true. I/Ralph will fix it.
>

I figured. I did the same, although I found myself scanning for differences
between the Oracle, MySQL, and MSSQL adapters in many cases to figure out
how to handle some of these things.


Juozas wrote:
>
> Checking options in 2.) might be possible, but not necessary needed :) I
> mean current approach will work with future sqlsrv_* improvements also,
> because we relay on that driver to check if options exist.
>

Perhaps not necessary, but could be beneficial. I just figured it would
improve performance since the adapter could either raise exceptions without
trying to connect to the server and waiting for an error response or else
simply ignore unsupported driver options preventing the error altogether. I
think I'd prefer the latter, simply because it would make it easier to
switch adapters.

Juozas wrote:
>
> Transactions functions throws exceptions because it seemed for me that
> errors in sql transactions are more dangerous than in other drivers
> (maybe).
> Returning false/true is different from abstract adapter so probably not
> good
> idea to use and user code shouldn't handle return in sqlsrv-specific way.
> That was my idea, but I might be wrong :)
>

I agree that this is consistent with the current implementation of the base
adapter class. When I coded my class, those functions returned a boolean, so
I just passed back the return values of the inner function call. I wouldn't
change anything; it's just a difference I noted.


Juozas wrote:
>
> Limit stuff is wid in sql server it self :) I have seen ways to do it in
> 2008-only (which are more elegant), but since this driver focuses on
> general
> case I chose to use good-old approach :) For a possible bug maybe you can
> create full test-case? That would be really helpful.
>

As I already replied to Ralph, the only variable here would be a SQL table
itself. (While trying this test case, I also discovered that limit() has no
effect unless you also explicitly apply an order. I don't know if that is a
caveat or a bug.)

Here is a "simple" test case.

SQL:
================
CREATE TABLE small_numbers (
N tinyint NOT NULL PRIMARY KEY CLUSTERED
)
GO

DECLARE @COUNTER tinyint

SET @COUNTER = 1

WHILE @COUNTER < 58 BEGIN
INSERT INTO small_numbers VALUES(@COUNTER)
SET @COUNTER = @COUNTER + 1
END
GO

GRANT SELECT ON small_numbers TO username
GO


INI:
===================
[LIMIT_TEST]
resources.db.adapter = "sqlsrv"
resources.db.params.host = "hostname"
resources.db.params.dbname = "database"
resources.db.params.username = "username"
resources.db.params.password = "password"


PHP:
===================
TestController.php
<?php

class TestController extends Zend_Controller_Action
{
public function limitAction()
{

$current_page = (int) $this->getRequest()->getUserParam('page', 1);

$config = new Zend_Config_Ini(APPLICATION_PATH .
'/configs/testconfig.ini');
$db = Zend_Db::factory($config->LIMIT_TEST->resources->db);


$select = $db->select()
->from('small_numbers')
->order('N');

$paginator = Zend_Paginator::factory($select);
$paginator->setItemCountPerPage(10);
$paginator->setCurrentPageNumber($current_page);

$this->view->paginator = $paginator;

}

}


limit.phtml
<html>
<body>
<h1>Example</h1>
<?php if (count($this->paginator)): ?>
<?php echo $this->paginationControl($this->paginator,
'All',
'test/my_pagination_control.phtml'); ?>

<ul>
<?php foreach ($this->paginator as $item): ?>
<li><?php echo $item['N']; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

<?php echo $this->paginationControl($this->paginator,
'All',
'test/my_pagination_control.phtml'); ?>
</body>
</html>


my_pagination_control.phtml
<!--
See
http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination
-->

<?php if ($this->pageCount): ?>
<div class="paginationControl">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
"<?php echo $this- url(array('page' => $this->previous)); ?>">
&lt; Previous
|
<?php else: ?>
&lt; Previous |
<?php endif; ?>

<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
"<?php echo $this- url(array('page' => $page)); ?>">
<?php echo $page; ?>
|
<?php else: ?>
<?php echo $page; ?> |
<?php endif; ?>
<?php endforeach; ?>

<!-- Next page link -->
<?php if (isset($this->next)): ?>
"<?php echo $this- url(array('page' => $this->next)); ?>">
Next &gt;

<?php else: ?>
Next &gt;
<?php endif; ?>
</div>
<?php endif; ?>


Juozas wrote:
>
> Lastinsertid was made with intention (again) to not to break abstract
> adapter. It works in all general cases and will only break in some "crazy"
> cases :) However, adapter can't decide tha and developer should know, that
> in complex queries it might break. As I said - it works in all normal
> cases
> and is tested with unit-tests :)
>

I'm not knocking it. The major differences in what you've done involve
caching the value in a protected member variable when applicable, and
allowing the method to query for the id for a specific table. Both of those
look useful.


Juozas wrote:
>
> Server version is a little bit tricky. We use
> http://msdn.microsoft.com/en-us/library/cc296165%28SQL.90%29.aspx to get
> version and we don't know actual server version - only client info is
> available. Are there sql queries to get actual server version and do we
> want
> to use it? It seemed for me that getServerVersion is used to check for
> driver/server version specific cases so driver version in this case is not
> a
> full bug :)
>

Actually there are, but there is also a native function in the driver itself
that returns an array containing that information: sqlsrv_server_info().
http://msdn.microsoft.com/en-us/library/cc296204%28SQL.90%29.aspx

I believe SQL 2000 returns 8.x, 2005 returns 9.x, and 2008 returns 10.x.

public function getServerVersion()
{
$this->_connect();
$info = sqlsrv_server_info($this->_connection);
if ($info) {
$version = $info['SQLServerVersion'];
}
return $version;
}

If it doesn't break compatibility too much, it would be nice to add a couple
methods like these:

/**
* Returns information about the connection and client stack. A
connection
* must be established before calling this function.
*
* @param string $key Optional.
* @return string|array
*/
public function getClientInfo($key = null)
{
if ($key !== null && !in_array($key, array('DriverDllName',
'DriverODBCVer', 'DriverVer', 'ExtensionVer'))) {
throw new Zend_Db_Adapter_Sqlsrv_Exception('Invalid key');
}

$this->_connect();
$info = sqlsrv_client_info($this->_connection);

if ($key !== null) {
return $info[$key];
}

return $info;
}

/**
* Returns information about the server. A connection must be
established
* before calling this function.
*
* @param string $key Optional
* @return string|array
*/
public function getServerInfo($key = null)
{
if ($key !== null && !in_array($key, array('CurrentDatabase',
'SQLServerVersion', 'SQLServerName'))) {
throw new Zend_Db_Adapter_Sqlsrv_Exception('Invalid key');
}

$this->_connect();
$info = sqlsrv_server_info($this->_connection);

if ($key !== null) {
return $info[$key];
}

return $info;
}

Juozas wrote:
>
> fetchArray is again work-around for abstract cases. Adapter wants to have
> ability to make columns lowercase,uppercase,default hence we need to loop
> through all keys and do it. Although keys are generated once per statement
> and this operation is not expensive so I don't think that is a problem.
> Correct me if I'm wrong :)
>

I don't know that it's a problem. As for case, I expect the case to match
that of the query. The only reason I asked was that I used the corresponding
native methods in my class whereas I noticed that this version did not.


Juozas wrote:
>
> Very good point about error messages ;) I'm definitely going to look at it
> and will probably change exception to store all errors and give access to
> first one/all/etc. It won't break anything just give addition options.
>

I'll admit even in my own implementation I didn't do this very well. I only
point this out because I have learned from experience that I could have done
it better and therefore would like to see a better implementation when this
is released.


Juozas wrote:
>
> This driver was created with an intention to have (as much as possible)
> transparent adapter - only a few unit-tests from abstract suite are marked
> as skipped (bind by name etc.) and all others work just fine.
>

I understand. The underlying driver does things differently than most of the
other drivers, and while I think those changes are particularly useful for
developing with SQL Server, they do present issues with providing a standard
API that allows easy switching from one adapter to another.

Andrew

--
View this message in context: http://www.nabble.com/Comments-on-Zend_Db_Adapter_Sqlsrv-tp24725644p24739585.html
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-db] DISTINCT SQL Statement

Hello all

How can I run this query? I have been struggeling for hours.

SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as NumberOfCase  FROM material

Thanks a lot



Erdal YAZICIOGLU
System & Network Engineer
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

Re: [fw-db] Comments on Zend_Db_Adapter_Sqlsrv

Ralph Schindler-2 wrote:
>
> Andrew, thanks for the detailed input!
>
>
>> Zend_Db_Adapter_Sqlsrv
>> 1) I see some references to Oracle and things like tnsnames.ora still in
>> the
>> comments.
>
> I will remove these pronto. Sounds like I need to really read the
> comments that are in there instead of speed-reading them :)
>

I'll admit I spotted them pretty quickly simply because the differences were
highlighted when I ran WinMerge to compare this class to my own. :-)


Ralph Schindler-2 wrote:
>
>> 2) In _connect(), I think it would be more efficient for the adapter to
>> throw an exception on any driver options that are not supported by the
>> DLL
>> rather than passing them off to sqlsrv_connect() and letting it return an
>> error.
>
> Well, the issue here is that we cant know what constants are valid as
> driver options (I guess we could make a list, but then the adapter would
> have to maintain that list).
>
> The issue is that if we wanted to throw an exception, we'd have to
> supress any errors coming out of sqlsrv_connect() function. Considering
> we dont fully know ALL of the different errors that could be thrown out
> of that function, its probably best to not supress them.
>
> Ideally, if you were using Zend_Config, you would be able to have a
> section such that only the specific driver options for SQL Server
> extension are passed to sqlsrv_connect().
>
> Does that make sense?
>

I just made a coded the options listed here into an array:
http://msdn.microsoft.com/en-us/library/cc296161%28SQL.90%29.aspx

Personally, to maintain portability I think I'd prefer simply ignoring
values other than these over raising exceptions. I realize this would mean
that the code would have to be updated every time the list was updated by
Microsoft, but I imagine the current options would be pretty stable over
future releases.

Ralph Schindler-2 wrote:
>
>> 4) The implementation of limit() looks like it uses a pretty common
>> technique I have seen in other algorithms, but I think it contains a
>> slight
>> flaw regarding the last "page" in the result set.
>> ...
>> with CTEs, etc. On large tables, it can be the difference between queries
>> that finish in seconds and queries that finish in hours.)
>
> I guess this is two part. One is that if you think the behavior of
> limit() is wrong, lets try and get a test script going that will produce
> the bad behavior, that way i can unit test it, and also see if we have
> bad logic inside other adapters as well.
>

Really, the only test variable for this issue is the data itself. I guess I
could script out a very simple table that could be used to test against.


Ralph Schindler-2 wrote:
>
> Secondly though, I dont know nearly enough about 2005 and 2008
> differences to be able to say that one method is better than another
> with regards to who limit() works. Perhaps you have a proposal here?
>

I don't from first-hand experience yet either. (We're still using 2000 at
work.) I just offered this based on several discussions I have followed on
the concept of paging recordsets at http://www.sqlservercentral.com.

Ralph Schindler-2 wrote:
>
>> Zend_Db_Statement_Sqlsrv
>> 1) I like the addition of the class constants for the parameter
>> directions.
>> Perhaps the other constants should be added as well? A couple of them
>> probably have to be implemented as static functions, rather than members
>> of
>> that enumeration array though. :-\
>
> Hmm, could you explain a little more here?
>

This page has an enumeration of all the constants provided by the library.
http://msdn.microsoft.com/en-us/library/cc296183%28SQL.90%29.aspx

Whereas all the other db adapters in ZF only accept a 1-dimensional array of
parameters, the Sqlsrv driver accepts an array where any or all of those
parameters can be expanded from a single scalar value to an array of up to 4
elements that describe not only the parameter's value and direction, but
also the PHP datatype, and the SQL Server datatype. It's somewhat
troublesome in that using these pretty much breaks the ability to easily
switch to a different adapter for a different database, but I've had cases
where queries would generate errors if I did not use them.

These are already defined as constants in PHP, but since it's not a core PHP
library they are not included in code completion for editors like Zend
Studio. This is solved by the inclusion of the parameter direction constants
that are already defined in this class, so defining the rest seems
beneficial to me.

Andrew
--
View this message in context: http://www.nabble.com/Comments-on-Zend_Db_Adapter_Sqlsrv-tp24725644p24738002.html
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-mvc] Using Dojo with Zend

Hello !

 

I have started exploring zend framework 1.8.4 to port new applications to Zend.

 

Can you please guide me knowing following to start with :

 

1)    How do I use Ajax enabled to Zend_Form elements and validate my form elements ?

2)  To use Dojo and Zend_Dojo_Form, do I need to put dojo.js, I could not find it in Zend Framework 1.8.4, please guide me on this as following code I found on manual calls it.
  <?php if ($this->dojo()->isEnabled()){

    $this->dojo()->setLocalPath('/js/dojo/dojo.js')

                 ->addStyleSheetModule('dijit.themes.tundra');

    echo $this->dojo();

   }?>

      What other settings are required to use Dojo helpers and layouts. 

3)    The name of the Zend has to include prefix Default_Form_XXXX where Default_Form is prefix and keep XXXX.php having zend_form_xxxx class  extending Zend_Form_xxxx as not doing this gives error not able to find it from view.

4)    How do I know all resource.xxx attributes list

 

Please guide me on this.

 

Thanks & Regards,

 

Nbt

 

 

Re: [fw-db] Comments on Zend_Db_Adapter_Sqlsrv

Hi,

I added getServerVersion for all adapters
(http://framework.zend.com/issues/browse/ZF-5099).
Initially it was for Oracle specific SQL statement (difference between
8i and more recent versions:
http://framework.zend.com/issues/browse/ZF-5082).
Most of drivers offer a function like get_server_version or
get_client_version but they don't return this version in PHP style to be
able to use version_compare().
With pdo_mssql, I used the return of: "SELECT
SERVERPROPERTY('productversion')"

Mickael.

Juozas a écrit :
> Hi,
>
> initially I used Oracle adapter/statement code as a framework to
> create sql functionality, so 1.) might be true. I/Ralph will fix it.
>
> Checking options in 2.) might be possible, but not necessary needed :)
> I mean current approach will work with future sqlsrv_* improvements
> also, because we relay on that driver to check if options exist.
>
> Transactions functions throws exceptions because it seemed for me that
> errors in sql transactions are more dangerous than in other drivers
> (maybe). Returning false/true is different from abstract adapter so
> probably not good idea to use and user code shouldn't handle return in
> sqlsrv-specific way. That was my idea, but I might be wrong :)
>
> Limit stuff is wid in sql server it self :) I have seen ways to do it
> in 2008-only (which are more elegant), but since this driver focuses
> on general case I chose to use good-old approach :) For a possible bug
> maybe you can create full test-case? That would be really helpful.
>
> Lastinsertid was made with intention (again) to not to break abstract
> adapter. It works in all general cases and will only break in some
> "crazy" cases :) However, adapter can't decide tha and developer
> should know, that in complex queries it might break. As I said - it
> works in all normal cases and is tested with unit-tests :)
>
> Server version is a little bit tricky. We use
> http://msdn.microsoft.com/en-us/library/cc296165%28SQL.90%29.aspx to
> get version and we don't know actual server version - only client info
> is available. Are there sql queries to get actual server version and
> do we want to use it? It seemed for me that getServerVersion is used
> to check for driver/server version specific cases so driver version in
> this case is not a full bug :)
>
> Statement first point - can't understand :)
>
> fetchArray is again work-around for abstract cases. Adapter wants to
> have ability to make columns lowercase,uppercase,default hence we need
> to loop through all keys and do it. Although keys are generated once
> per statement and this operation is not expensive so I don't think
> that is a problem. Correct me if I'm wrong :)
>
> Very good point about error messages ;) I'm definitely going to look
> at it and will probably change exception to store all errors and give
> access to first one/all/etc. It won't break anything just give
> addition options.
>
> This driver was created with an intention to have (as much as
> possible) transparent adapter - only a few unit-tests from abstract
> suite are marked as skipped (bind by name etc.) and all others work
> just fine.
>
> Thanks a lot for these comments!
>
> Juozas
>
> On Wed, Jul 29, 2009 at 8:09 PM, Andrew Ballard <aballard@gmail.com
> <mailto:aballard@gmail.com>> wrote:
>
>
> I'm glad to see an adapter for the SQL Server Driver for PHP
> (Sqlsrv) being
> added to Zend_Framework with the upcoming 1.9 release. Overall
> they look
> similar to what I have been using, so it will be good to see them
> become
> part of the core. After looking at RC1, I have a few observations:
>
>
> Zend_Db_Adapter_Sqlsrv
> 1) I see some references to Oracle and things like tnsnames.ora
> still in the
> comments.
>
> 2) In _connect(), I think it would be more efficient for the
> adapter to
> throw an exception on any driver options that are not supported by
> the DLL
> rather than passing them off to sqlsrv_connect() and letting it
> return an
> error.
>
> 3) I see that the transaction handlers (_beginTransaction, _commit
> and
> _rollback) now return void and raise exceptions on failure. I
> simply had
> them pass back the return value of the corresponding sqlsrv_
> function, but
> it appears that Zend_Db_Adapter_Abstract now returns a self
> reference to
> provide a fluent interface. I guess this implementation is
> consistent with
> the change in the abstract base class.
>
> 4) The implementation of limit() looks like it uses a pretty common
> technique I have seen in other algorithms, but I think it contains
> a slight
> flaw regarding the last "page" in the result set.
>
> For example if the total rows matching the WHERE clause is 55, the
> value of
> rows-per-page is 10, and selected page number is 6, the inner
> query would
> request the top 60 (offset + rows = 50 + 10) rows. Since there are
> only 55
> total rows, the inner query will return all 55 rows. The outer
> query then
> takes the bottom 10 of the set returned by the inner query. In
> this case,
> that would be rows 46-55 rather than just 51-55.
>
> In my class, I started with this approach, but I modified it to add an
> additional WHERE condition so that it would only grab the rows in
> the bottom
> 10 that were not also part of the top 50. Due to its complexity I
> left room
> for the adapter to select alternate algorithms [yet to be added]
> for queries
> against newer versions since there are now better ways to
> implement this in
> 2005 and 2008. (The trouble is, depending on the tables you may
> get better
> or worse performance by using either row_number() or by various
> approaches
> with CTEs, etc. On large tables, it can be the difference between
> queries
> that finish in seconds and queries that finish in hours.)
>
> 5) lastInsertId can be tricky because of scope, but it looks like what
> you've done here is better than what I used. :-)
>
>
> 6) getServerVersion is returning the driver version, not the
> database server
> version.
>
>
>
> Zend_Db_Statement_Sqlsrv
> 1) I like the addition of the class constants for the parameter
> directions.
> Perhaps the other constants should be added as well? A couple of them
> probably have to be implemented as static functions, rather than
> members of
> that enumeration array though. :-\
>
> 2) I'm curious why internally fetch() always fetches a row as two
> separate
> arrays (keys and values) and then uses the fetch-mode to determine
> whether
> to discard one and return the other, or merge them together (and
> optionally
> cast the combined array to an object). Is that faster than calling
> either
> sqlsrv_fetch_array with the appropriate 2nd parameter or
> sqlsrv_fetch_object?
>
>
> Error handling:
> I am glad to see the full array returned by sqlsrv_errors() being
> passed to
> the exception constructors. A single query could return multiple error
> messages, especially from stored procedures, and often the last error
> message returned is simply "Statement failed." I wish there was a
> good way
> to be able to access either the full array of messages and codes
> or specific
> items in the errors array rather than just getting the first/last code
> returned.
>
> I'm not sure either of these are good ideas, but what about either
> having
> getMessage() return each() on the message array or else providing
> getMessages() and getCodes() as additional methods on those classes?
>
> Thoughts?
>
> Andrew
> --
> View this message in context:
> http://www.nabble.com/Comments-on-Zend_Db_Adapter_Sqlsrv-tp24725644p24725644.html
> Sent from the Zend DB mailing list archive at Nabble.com.
>
>