2009年5月31日星期日

Re: [fw-mvc] Preserve Session Across Controllers?

I hadn't tried that and now I'm getting somewhere. Thanks for pointing me in
the right direction. Now my application returns an error from the controller
I'm trying to target which says: "the session has already been started".
Which is definitely a good sign.

Ed Lazor-3 wrote:
>
> Have you tried using ZF's redirector helper?
>
> $this->_redirect()
>
> or
>
> $this->_helper->redirector('target', 'example');
>
>
> I'm not certain, but I think the first one is just an alias to the
> other - could someone confirm this?
>
> -Ed
>
>
>
> On Sun, May 31, 2009 at 3:28 AM, swidnikk<da.webs@gmail.com> wrote:
>>
>> In a solution I'm working on, I have two controllers,
>> + admin controller
>> + my controller
>>
>> In short, I need to authenticate a user from 'my controller' and then
>> pass
>> on the request to the admin controller. Authentication currently works
>> with
>> a session variable which has a method 'isLoggedOn()'.
>>
>> My issue is that the session which I create in 'my controller' does not
>> persist when I redirect to the 'admin controller'. Any thoughts on this?
>>
>> Here is how I redirect:
>>
>> $request->setRouteName('adminhtml')
>>                                        ->setControllerName('adminhtml')
>>                                        ->setActionName('index')
>>                                        ->setModuleName('admin')
>>                                        ->setDispatched(false);
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Preserve-Session-Across-Controllers--tp23801799p23801799.html
>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Preserve-Session-Across-Controllers--tp23801799p23809085.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-db] Tito y Jolín quieren un hogar

Muchachonas y muchachones,



Este correo es para pedirles su apoyo en localizar un hogar para Tito y Jolín. Son dos gatitos machos (Tito es güerito y Jolín es prietín jajaja) de menos de 2 meses de nacidos que están buscando nuevo hogar para vivir. No son nada uraños, son muy cariñosos y ya comen croquetas. Ojo no los estoy vendiendo y de preferencia me gustaría que quedaran juntos (si esto no es posible no hay problema). La idea es que se queden con alguien que les vaya a dar de su tiempo y los cuide. Ambos estan muuuy bonitos. Les anexo fotos de ellos dos así como de sus papás. Les agradezco su apoyo y cualquier duda háganmelo saber por este medio. Saludos!


Re: [fw-mvc] Preserve Session Across Controllers?

Have you tried using ZF's redirector helper?

$this->_redirect()

or

$this->_helper->redirector('target', 'example');


I'm not certain, but I think the first one is just an alias to the
other - could someone confirm this?

-Ed

On Sun, May 31, 2009 at 3:28 AM, swidnikk<da.webs@gmail.com> wrote:
>
> In a solution I'm working on, I have two controllers,
> + admin controller
> + my controller
>
> In short, I need to authenticate a user from 'my controller' and then pass
> on the request to the admin controller. Authentication currently works with
> a session variable which has a method 'isLoggedOn()'.
>
> My issue is that the session which I create in 'my controller' does not
> persist when I redirect to the 'admin controller'. Any thoughts on this?
>
> Here is how I redirect:
>
> $request->setRouteName('adminhtml')
>                                        ->setControllerName('adminhtml')
>                                        ->setActionName('index')
>                                        ->setModuleName('admin')
>                                        ->setDispatched(false);
>
>
> --
> View this message in context: http://www.nabble.com/Preserve-Session-Across-Controllers--tp23801799p23801799.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>
>

Re: [fw-core] RPM available for Zend Framework?

On Friday 29 May 2009 18:19:24 Hector Virgen wrote:
>Hello,
>Is there an RPM available for Zend Framework, preferably 1.8+? I've searched
>the site and google and didn't find one. Thanks!
>
>-Hector

There are repositories for both openSUSE/SLES and Fedora providing RPM's for
zend framework. I'm unsure about the status and/or availability for Red Hat,
centOS or other RPM based distros.

I maintain the packages in the openSUSE build service, this has the capability
of building packages for all the other leading distros so if there's nothing
provided for your current distro I'd be happy to investigate building the
packages for your distro also. (it also supports building deb packages).

openSUSE/SLES
-------------
http://framework.zend.com/wiki/display/ZFDEV/Unix+and+Linux+Distribution+Packages

Fedora
------
https://admin.fedoraproject.org/pkgdb/packages/name/php-ZendFramework

[fw-mvc] Preserve Session Across Controllers?

In a solution I'm working on, I have two controllers,
+ admin controller
+ my controller

In short, I need to authenticate a user from 'my controller' and then pass
on the request to the admin controller. Authentication currently works with
a session variable which has a method 'isLoggedOn()'.

My issue is that the session which I create in 'my controller' does not
persist when I redirect to the 'admin controller'. Any thoughts on this?

Here is how I redirect:

$request->setRouteName('adminhtml')
->setControllerName('adminhtml')
->setActionName('index')
->setModuleName('admin')
->setDispatched(false);


--
View this message in context: http://www.nabble.com/Preserve-Session-Across-Controllers--tp23801799p23801799.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2009年5月30日星期六

Re: [fw-webservices] Please Test: Considerable Internal Changes to Zend_Soap_AutoDiscover for WS Compliance

I forgot to add the jira issues:

http://framework.zend.com/issues/browse/ZF-6348
http://framework.zend.com/issues/browse/ZF-6349

On Sunday 31 May 2009 01:26:10 am Benjamin Eberlei wrote:
> Hello everyone,
>
> I have committed a large patch provided by Fabien Crespel into
> Zend_Soap_AutoDiscover that adds compliance for integration with Java, .NET
> and other SOAP Client generation tools.
>
> For this internally many changes had to be made to the WSDL generation. All
> tests still pass, but since SOAP/WSDL is such a tricky technology I urge
> you to test the changes with your production Zend_Soap code and give lots
> of feedback on compability or not.
>
> The changes will only make it into 1.9 because they cannot be really
> considered as a bug only but as a new feature.
>
> greetings,
> Benjamin


--
Benjamin Eberlei
http://www.beberlei.de

[fw-webservices] Please Test: Considerable Internal Changes to Zend_Soap_AutoDiscover for WS Compliance

Hello everyone,

I have committed a large patch provided by Fabien Crespel into
Zend_Soap_AutoDiscover that adds compliance for integration with Java, .NET
and other SOAP Client generation tools.

For this internally many changes had to be made to the WSDL generation. All
tests still pass, but since SOAP/WSDL is such a tricky technology I urge you
to test the changes with your production Zend_Soap code and give lots of
feedback on compability or not.

The changes will only make it into 1.9 because they cannot be really
considered as a bug only but as a new feature.

greetings,
Benjamin
--
Benjamin Eberlei
http://www.beberlei.de

[fw-mvc] Redirect to Zend_Navigation_Page_Mvc object

Hello!

Wondering about best practices again…this morning, I ran into a use
case where, in my controller, I needed to redirect to a specific page,
and I already had access to a Zend_Navigation_Page_Mvc instance
containing all the necessary routing parameters. So far, I've found
one decent approach to this:

$this->_helper->Redirector->gotoUrlAndExit($page->getHref(),
array('prependBase' => false));

I found I had to add the "prependBase" option due to the way things
are handled in the redirector; try it without it and you'll see what I
mean. I don't think this was a bug by any means, but just something
that gave me a little headache for awhile :)

I was thinking, however, that it might be useful to have a couple more
methods in the redirect helper to support Zend_Navigation_Page objects
directly, like this:

$this->_helper->Redirector->gotoPageAndExit($page);

Lots cleaner, no need to remember the prependBase option, and doesn't
seem like it would take a lot of code. If everyone thinks this is a
good idea, I'd be happy to submit both an issue and a patch. Kind of
a small improvement, but I thought it might be nice; let me know what
you think!

Thanks!
Adam

Re: [fw-core] Re: Re[fw-core] [2]: RPM available for Zend Framework?

Hello Julian,

i'm not really into the packaging of PEAR-packages, but as far as i
know, you can add files to the folder "scripts" which are installed into
the $PATH of the system. This would be the zf.sh or zf.bat (depends on
the OS).

Then add a section to the package.xml (just did a quick search on
PEAR.net and adopted the examples, you probably know a lot more about
that stuff):

<dir name="scripts">
<file name="pecl.bat" role="script">
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
<tasks:windowseol/>
</file>
<file name="pear.sh" role="script">
<tasks:replace from="@php_bin@" to="php_bin" type="pear-config" />
<tasks:replace from="@php_dir@" to="php_dir" type="pear-config" />
<tasks:unixeol/>
</file>
</dir>

zf.php needs to be installed to "PEAR" then and not to "PEAR/Zend/bin/"

Perhaps this helps a little :)

Uli


Julian wrote:
> Hello Uli,
>
> I am not sure where to add that /bin folder.
> Actual structure is
> PEAR/Zend/Acl
> /Amf
> and so on
>
> I cannot change directory structure into:
> PEAR/Zend/library/Acl
> /bin
> as the backward include paths will be broken .
>
> Probably will be:
> PEAR/Zend/bin
> /Acl
> /Amf
> ....
>
> Not sure about that yet, still thinking...
>
> Saturday, May 30, 2009, 11:47:26 AM, you wrote:
>> Hello Julian,
>
>> thanks for this information, i'm looking forward to the next releases
>> then :) Would help a lot as this functionality is really nice :)
>
>> Thanks for your work!
>
>> Uli
>
>> Julian wrote:
>>> Hello Uli,
>>>
>>> Indeed.
>>> But we are taking this in consideration and probably in next versions
>>> will be added.
>>>
>>> Friday, May 29, 2009, 8:59:57 PM, you wrote:
>>>
>>>> Unfortunately this channel doesn't install the bin-folder, thus there is no
>>>> integration of Zend_Tool into the system. zfcampus provides this kind of
>>>> functionality...
>>>> Regards,
>>>> Uli
>>>
>>>> Julian-68 wrote:
>>>>> Hello Uli,
>>>>>
>>>>> The up-to-date PEAR channel is
>>>>> http://code.google.com/p/zend/
>>>>>
>>>>> Updated few hours after a new version is released
>>>>>
>>>>> --
>>>>> Julian
>>>>> Zend Certified Engineer
>>>>> ****************************
>>>>>
>>>
>>>
>>>
>
>
>
>

Re[2]: [fw-core] Re: Re[fw-core] [2]: RPM available for Zend Framework?

Hello Uli,

I am not sure where to add that /bin folder.
Actual structure is
PEAR/Zend/Acl
/Amf
and so on

I cannot change directory structure into:
PEAR/Zend/library/Acl
/bin
as the backward include paths will be broken .

Probably will be:
PEAR/Zend/bin
/Acl
/Amf
....

Not sure about that yet, still thinking...

Saturday, May 30, 2009, 11:47:26 AM, you wrote:
> Hello Julian,

> thanks for this information, i'm looking forward to the next releases
> then :) Would help a lot as this functionality is really nice :)

> Thanks for your work!

> Uli

> Julian wrote:
>> Hello Uli,
>>
>> Indeed.
>> But we are taking this in consideration and probably in next versions
>> will be added.
>>
>> Friday, May 29, 2009, 8:59:57 PM, you wrote:
>>
>>> Unfortunately this channel doesn't install the bin-folder, thus there is no
>>> integration of Zend_Tool into the system. zfcampus provides this kind of
>>> functionality...
>>
>>> Regards,
>>> Uli
>>
>>
>>> Julian-68 wrote:
>>>> Hello Uli,
>>>>
>>>> The up-to-date PEAR channel is
>>>> http://code.google.com/p/zend/
>>>>
>>>> Updated few hours after a new version is released
>>>>
>>>> --
>>>> Julian
>>>> Zend Certified Engineer
>>>> ****************************
>>>>
>>
>>
>>
>>


--
Julian
Zend Certified Engineer
****************************

Re: [fw-core] Re: Re[fw-core] [2]: RPM available for Zend Framework?

Hello Julian,

thanks for this information, i'm looking forward to the next releases
then :) Would help a lot as this functionality is really nice :)

Thanks for your work!

Uli

Julian wrote:
> Hello Uli,
>
> Indeed.
> But we are taking this in consideration and probably in next versions
> will be added.
>
> Friday, May 29, 2009, 8:59:57 PM, you wrote:
>
>> Unfortunately this channel doesn't install the bin-folder, thus there is no
>> integration of Zend_Tool into the system. zfcampus provides this kind of
>> functionality...
>
>> Regards,
>> Uli
>
>
>> Julian-68 wrote:
>>> Hello Uli,
>>>
>>> The up-to-date PEAR channel is
>>> http://code.google.com/p/zend/
>>>
>>> Updated few hours after a new version is released
>>>
>>> --
>>> Julian
>>> Zend Certified Engineer
>>> ****************************
>>>
>
>
>
>

2009年5月29日星期五

[fw-mvc] Zend_Form_Select array notation ...

hello,


How can I setup Zend_Form_Select from array notation ?
I'm using ZF 1.8

I need this because I generate my form from database metas.

Using the code below but unfortunately it doesn't works. It consider
'options' as items of the list ...

...

$formConfig['elements']['list'] = array(
'type' => 'select',
'options' => array(
'multiOptions' => $options,
'label' => $columnName
)
);
...

new Zend_Form($formConfig);

thank you for your help
regards

Re: [fw-mvc] get and set accessors

> All of this said... when possible, and where it makes sense, I like to
> use direct property access. You just have to test carefully to ensure
> that common use cases will not break the functionality of the class.

What happens later on when you need to add business logic to something
you've been accessing directly? Do you end up having to refactor a
lot of code?

Our team ended up using this:

class SourceRow extends Zend_Db_Table_Row_Abstract {
public function __get($key) {
if(method_exists($this, $key)) {
return $this->$key();
}
return parent::__get($key);
}
}

It saves having to prepend everything with get.

All of our models extend SourceRow. We end up creating a method with
a name matching that of the property, if we want to override the
property and introduce business logic. Of course, then the question
is, how do you access the value of the property? Our solution, so
far:

public function isComplete() {
// insert business logic here
return Zend_Db_Table_Row_Abstract::__get("IsComplete");
}

Is that a very good solution though? Does this cause problems
anywhere? It seems like this wouldn't even be an issue if we were
using accessors.

It seems, IMHO, that we should just always use accessors. We could
use magic methods to save having to actually create the methods unless
we add one to insert business logic. It creates a common interface -
so we don't have to try and figure out which approach you're supposed
to use when working with models created by someone else on your team.
Plus, it would save having to rewrite code if you change something.

If I do that though... I end up promoting the idea that accessors
should always be used - sounds like this isn't what everyone else is
doing.

Thoughts?

-Ed

Re: [fw-mvc] create custom default route

If instead I just create a "default" route in the routes.ini, it almost
works but fails to load the default view helpers.

Yi Tang wrote:
> by the way that line was commented out in previous email by mistake.
> it doesn't work when it's not commented.
>
> Yi Tang wrote:
>> All,
>>
>> I've created a custom default route:
>>
>> <?php
>> class My_Controller_Router_Route_Invalid implements
>> Zend_Controller_Router_Route_Interface
>> {
>> public $defaults = array(
>> 'module' => 'default',
>> 'controller' => 'error',
>> 'action' => 'error',
>> );
>>
>> public function match($path)
>> {
>> return $this->defaults;
>> }
>>
>> public function assemble($data = array())
>> {
>> return '';
>> }
>>
>> public static function getInstance(Zend_Config $config)
>> {
>> return new self();
>> }
>> }
>>
>>
>> And added it as such:
>> $router = $front->getRouter();
>> //$router->addRoute('default', new
>> My_Controller_Router_Route_Invalid());
>> $routesConfig = new Zend_Config_Ini('routes.ini');
>> $router->addConfig($routesConfig);
>>
>> But it just doesn't work, it gives a blank page when i go to any url
>> after this, any clue what's wrong?
>>
>> thanks!
>>
>> Yi
>>
>

Re: [fw-mvc] get and set accessors

More generally, he's arguing for proper encapsulation, which I think Zend Framework does a pretty good job with.  Even if PHP had something like Ruby's attr shortcuts*, much of his argument would still apply.  It's silly (read: intentionally provocative) to say that accessors are "evil", however.

-Matt

* Which it really could use, by the way.  Shortcuts like those are really useful for making API changes after the fact without encountering BC issues.

On Fri, May 29, 2009 at 1:25 PM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Ed Lazor <edlazor@internetarchitects.biz> wrote
(on Friday, 29 May 2009, 01:12 PM -0700):
> Probably more of a general coding debate, but...
>
> What's your opinion on the pros and cons of using get and set
> accessors?  What's the Zend Framework strategy on this?  Do you have a
> preference one way or the other?
>
> Any examples you can give that support your opinion would be great.
>
> Here's one article suggesting that "getter and setter methods are
> evil".  It's written toward Java, but it seems like the debate easily
> applies to PHP / ZF.
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
> Do you agree with what the author says?

Actually, many of the arguments he makes against them are valid for
Java, but invalid for PHP.

In the case of Java, you have strong typing, so in many cases getters
and setters are overkill; you can alter the type of a member simply by
changing its definition in the class. In PHP, since we have loose
typing, the only way to enforce typing is to restrict access to members
via getters and setters. Using getters and setters also future-proofs
your code in the event that you need to add some business logic
surrounding setting or retrieving a property value.

One place where this is especially important is for offering lazy
loading of objects. In many caes, ZF getters will check to see if an
object is registered, and, if not, register a default case with it. This
moves object instantiation to the last possible moment -- the moment
when it is first used. (Actually, I think this is a use case the author
supports.)

All of this said... when possible, and where it makes sense, I like to
use direct property access. You just have to test carefully to ensure
that common use cases will not break the functionality of the class.

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

Re: [fw-mvc] create custom default route

by the way that line was commented out in previous email by mistake.
it doesn't work when it's not commented.

Yi Tang wrote:
> All,
>
> I've created a custom default route:
>
> <?php
> class My_Controller_Router_Route_Invalid implements
> Zend_Controller_Router_Route_Interface
> {
> public $defaults = array(
> 'module' => 'default',
> 'controller' => 'error',
> 'action' => 'error',
> );
>
> public function match($path)
> {
> return $this->defaults;
> }
>
> public function assemble($data = array())
> {
> return '';
> }
>
> public static function getInstance(Zend_Config $config)
> {
> return new self();
> }
> }
>
>
> And added it as such:
> $router = $front->getRouter();
> //$router->addRoute('default', new
> My_Controller_Router_Route_Invalid());
> $routesConfig = new Zend_Config_Ini('routes.ini');
> $router->addConfig($routesConfig);
>
> But it just doesn't work, it gives a blank page when i go to any url
> after this, any clue what's wrong?
>
> thanks!
>
> Yi
>

[fw-mvc] create custom default route

All,

I've created a custom default route:

<?php
class My_Controller_Router_Route_Invalid implements
Zend_Controller_Router_Route_Interface
{
public $defaults = array(
'module' => 'default',
'controller' => 'error',
'action' => 'error',
);

public function match($path)
{
return $this->defaults;
}

public function assemble($data = array())
{
return '';
}

public static function getInstance(Zend_Config $config)
{
return new self();
}
}


And added it as such:
$router = $front->getRouter();
//$router->addRoute('default', new
My_Controller_Router_Route_Invalid());
$routesConfig = new Zend_Config_Ini('routes.ini');
$router->addConfig($routesConfig);

But it just doesn't work, it gives a blank page when i go to any url
after this, any clue what's wrong?

thanks!

Yi

Re: [fw-mvc] get and set accessors

-- Hector Virgen <djvirgen@gmail.com> wrote
(on Friday, 29 May 2009, 01:30 PM -0700):
> Ha, I was in the middle of writing some getter/setter methods when I saw your
> message :)
>
> I'm reading the article now, but from what I am gathering it seems that the
> author is afraid that programmers use the getter/setter methods to override or
> hijack the implementation details of a class.
>
> Like take Zend_Db_Table, for instance. I could write something like this:
>
> $table->getAdapter()->query($myCustomSql);
>
> Generally, I think using getters in this fashion can lead to problems down the
> road.

Actually, in PHP, *not* adding getters/setters for items like this lead
to problems. Due to PHP not having strong typing, there's no way to
ensure that the adapter is a valid adapter without using a setter.
Additionally, due to how Zend_Db_Table works, getAdapter() allows the
table class to access the default db adapter instance when one is not
yet set. I'd argue that that particular example is a *perfect* example
of when to use getters and setters.

> But there are also valid uses for getter methods, like if you need to
> quote a string:
>
> $table->getAdapter()->quote('foo');

This isn't a getter at all -- it's a method providing a discrete
behavior. It's not setting object state whatsoever.

> Also, getters/setters are great for unit testing, as you can inject mock
> objects into your classes.

Exactly. I think this part was very much overlooked in the article.


> On Fri, May 29, 2009 at 1:12 PM, Ed Lazor <edlazor@internetarchitects.biz>
> wrote:
>
> Probably more of a general coding debate, but...
>
> What's your opinion on the pros and cons of using get and set
> accessors? What's the Zend Framework strategy on this? Do you have a
> preference one way or the other?
>
> Any examples you can give that support your opinion would be great.
>
> Here's one article suggesting that "getter and setter methods are
> evil". It's written toward Java, but it seems like the debate easily
> applies to PHP / ZF.
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
> Do you agree with what the author says?
>
> -Ed
>
>
>

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

Re: [fw-mvc] get and set accessors

Ha, I was in the middle of writing some getter/setter methods when I saw your message :)

I'm reading the article now, but from what I am gathering it seems that the author is afraid that programmers use the getter/setter methods to override or hijack the implementation details of a class.

Like take Zend_Db_Table, for instance. I could write something like this:

$table->getAdapter()->query($myCustomSql);

Generally, I think using getters in this fashion can lead to problems down the road. But there are also valid uses for getter methods, like if you need to quote a string:

$table->getAdapter()->quote('foo');

Also, getters/setters are great for unit testing, as you can inject mock objects into your classes.

-Hector


On Fri, May 29, 2009 at 1:12 PM, Ed Lazor <edlazor@internetarchitects.biz> wrote:
Probably more of a general coding debate, but...

What's your opinion on the pros and cons of using get and set
accessors?  What's the Zend Framework strategy on this?  Do you have a
preference one way or the other?

Any examples you can give that support your opinion would be great.

Here's one article suggesting that "getter and setter methods are
evil".  It's written toward Java, but it seems like the debate easily
applies to PHP / ZF.
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
Do you agree with what the author says?

-Ed


Re: [fw-mvc] get and set accessors

-- Ed Lazor <edlazor@internetarchitects.biz> wrote
(on Friday, 29 May 2009, 01:12 PM -0700):
> Probably more of a general coding debate, but...
>
> What's your opinion on the pros and cons of using get and set
> accessors? What's the Zend Framework strategy on this? Do you have a
> preference one way or the other?
>
> Any examples you can give that support your opinion would be great.
>
> Here's one article suggesting that "getter and setter methods are
> evil". It's written toward Java, but it seems like the debate easily
> applies to PHP / ZF.
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
> Do you agree with what the author says?

Actually, many of the arguments he makes against them are valid for
Java, but invalid for PHP.

In the case of Java, you have strong typing, so in many cases getters
and setters are overkill; you can alter the type of a member simply by
changing its definition in the class. In PHP, since we have loose
typing, the only way to enforce typing is to restrict access to members
via getters and setters. Using getters and setters also future-proofs
your code in the event that you need to add some business logic
surrounding setting or retrieving a property value.

One place where this is especially important is for offering lazy
loading of objects. In many caes, ZF getters will check to see if an
object is registered, and, if not, register a default case with it. This
moves object instantiation to the last possible moment -- the moment
when it is first used. (Actually, I think this is a use case the author
supports.)

All of this said... when possible, and where it makes sense, I like to
use direct property access. You just have to test carefully to ensure
that common use cases will not break the functionality of the class.

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

[fw-mvc] get and set accessors

Probably more of a general coding debate, but...

What's your opinion on the pros and cons of using get and set
accessors? What's the Zend Framework strategy on this? Do you have a
preference one way or the other?

Any examples you can give that support your opinion would be great.

Here's one article suggesting that "getter and setter methods are
evil". It's written toward Java, but it seems like the debate easily
applies to PHP / ZF.
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
Do you agree with what the author says?

-Ed

Re: [fw-core] Re: Re[fw-core] [2]: RPM available for Zend Framework?

Hello Uli,

Indeed.
But we are taking this in consideration and probably in next versions
will be added.

Friday, May 29, 2009, 8:59:57 PM, you wrote:

> Unfortunately this channel doesn't install the bin-folder, thus there is no
> integration of Zend_Tool into the system. zfcampus provides this kind of
> functionality...

> Regards,
> Uli


> Julian-68 wrote:
>>
>> Hello Uli,
>>
>> The up-to-date PEAR channel is
>> http://code.google.com/p/zend/
>>
>> Updated few hours after a new version is released
>>
>> --
>> Julian
>> Zend Certified Engineer
>> ****************************
>>


--
Julian
Zend Certified Engineer
****************************

[fw-core] Re: Re[fw-core] [2]: RPM available for Zend Framework?

Unfortunately this channel doesn't install the bin-folder, thus there is no
integration of Zend_Tool into the system. zfcampus provides this kind of
functionality...

Regards,
Uli


Julian-68 wrote:
>
> Hello Uli,
>
> The up-to-date PEAR channel is
> http://code.google.com/p/zend/
>
> Updated few hours after a new version is released
>
> --
> Julian
> Zend Certified Engineer
> ****************************
>

--
View this message in context: http://www.nabble.com/RPM-available-for-Zend-Framework--tp23782912p23784559.html
Sent from the Zend Core mailing list archive at Nabble.com.

Re: [fw-core] RPM available for Zend Framework?

Hello Julian

thanks, i didn't know about this channel ;)

Will try that one ;)

Regards,
Uli

Julian wrote:
> Hello Uli,
>
> The up-to-date PEAR channel is
> http://code.google.com/p/zend/
>
> Updated few hours after a new version is released
>
> Friday, May 29, 2009, 7:22:20 PM, you wrote:
>> Hi Hector,
>
>> there is a inofficial PEAR-Channel available, but it's still on 1.8.0:
>
>> http://pear.zfcampus.org/
>
>> Regards,
>> Uli
>
>
>> Hector Virgen wrote:
>>> Hello,
>>>
>>> Is there an RPM available for Zend Framework, preferably 1.8+? I've
>>> searched the site and google and didn't find one. Thanks!
>>>
>>> -Hector
>
>
>
>

Re: [fw-core] RPM available for Zend Framework?

Hi!

> Is there an RPM available for Zend Framework, preferably 1.8+? I've
> searched the site and google and didn't find one. Thanks!

Zend Server CE includes RPM of ZF -
http://www.zend.com/en/products/server/downloads-all
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com

Re[2]: [fw-core] RPM available for Zend Framework?

Hello Uli,

The up-to-date PEAR channel is
http://code.google.com/p/zend/

Updated few hours after a new version is released

Friday, May 29, 2009, 7:22:20 PM, you wrote:
> Hi Hector,

> there is a inofficial PEAR-Channel available, but it's still on 1.8.0:

> http://pear.zfcampus.org/

> Regards,
> Uli


> Hector Virgen wrote:
>> Hello,
>>
>> Is there an RPM available for Zend Framework, preferably 1.8+? I've
>> searched the site and google and didn't find one. Thanks!
>>
>> -Hector


--
Julian
Zend Certified Engineer
****************************

Re: [fw-core] RPM available for Zend Framework?

Thanks! :)

-Hector


On Fri, May 29, 2009 at 9:22 AM, Uli Wolf <ml@wolf-u.li> wrote:
Hi Hector,

there is a inofficial PEAR-Channel available, but it's still on 1.8.0:

http://pear.zfcampus.org/

Regards,
Uli



Hector Virgen wrote:
Hello,

Is there an RPM available for Zend Framework, preferably 1.8+? I've searched the site and google and didn't find one. Thanks!

-Hector

Re: [fw-core] RPM available for Zend Framework?

Hi Hector,

there is a inofficial PEAR-Channel available, but it's still on 1.8.0:

http://pear.zfcampus.org/

Regards,
Uli


Hector Virgen wrote:
> Hello,
>
> Is there an RPM available for Zend Framework, preferably 1.8+? I've
> searched the site and google and didn't find one. Thanks!
>
> -Hector

[fw-core] RPM available for Zend Framework?

Hello,

Is there an RPM available for Zend Framework, preferably 1.8+? I've searched the site and google and didn't find one. Thanks!

-Hector

Re: [fw-mvc] When using Zend_Layout requests seem to run twice

Hi,

There is only one alternative i can think of but it's a very bad practice one. You can use the old .htaccess rules that redirects the request to the MVC not unless the resource exists in the server but explicitly specifies which resources should not be redirected. So if you have lots of resources files added and you can't keep track of which ones actually exists then that rule will probably serve you better.

On Thu, May 28, 2009 at 10:38 PM, GJ Bogaerts <gj@zigg.nl> wrote:

Hi all

I run into the same problem, but I cannot actually implement Matthew's
solution. I'm developing a site that is almost exclusively filled with user
generated content, and there is no way for me to guarantee that everything
every user does, always goes according to this plan.

So is there any alternative?

Thanks in advance?


Matthew Weier O'Phinney-3 wrote:
>
> -- thepearson <thepearson@gmail.com> wrote
> (on Wednesday, 13 May 2009, 04:14 AM -0700):
>> Peculiar issue/feature, can't seem to find anyone else with any info
>> about
>> it.
>>
>> Everytime a request is made to the site when using Zend_Layout, it
>> appears
>> that the request is run twice. I noticed this when using sessions to
>> store
>> response messages to the user that are removed from the session once they
>> are displayed. I could never get these messages to display, but after
>> some
>> investigation and logging to file found out that the request is run
>> twice.
>> Putting a simple log message in the a bootstrap file will log the message
>> twice, with every request made to the framework. I confirmed this by
>> profiling the database queries also.
>
> Traditionally when I've seen people complain of this, one of two things
> are happening (and they're, in the end, the same thing):
>
>  * They don't have a favicon.ico for the site.
>  * There is a reference to an image, CSS file, or JS file that does
>    not actually exist on the site.
>
> In both situations, the browser requests the page, and then requests the
> given resource. Since the resource was not found, it falls back to your
> MVC application -- and hence the apparent "second request".
>
> The solution? Make sure you have a favicon.ico file, even if it's empty,
> and that any resource your layout or application defines in the markup
> actually exists on the server.
>
>> I thought that perhaps this was something I had done so did a fresh
>> install
>> as per instructions here: http://framework.zend.com/docs/quickstart and
>> the
>> boot strap file is still being called twice.
>>
>> This is a bit concerning as every request to the server seems to be
>> processed by the server twice before returning a response. You should be
>> able to replicate this by following the instructions in the quickstart
>> tutorial, stop once you've added the layout, then add a
>> put_file_contents("/tmp/file", "Message\n", FILE_APPEND) in the
>> _initDocType() method in the bootstrap class. One browser request will
>> result in two lines in the file /tmp/file ???
>>
>> Can someone tell me why this is and if there is anyway to prevent this
>> from
>> happening? It seems a little crazy that by adding a layout we need to
>> process everything twice.
>>
>> Running:
>> PHP 5.2.6
>> Apache 2.2.9
>> Zend Framework 1.8
>> Only modifications to the Quickstart tutorial is added a line to log to
>> file
>> each request.
>
> --
> Matthew Weier O'Phinney
> Project Lead            | matthew@zend.com
> Zend Framework          | http://framework.zend.com/
>
>

--
View this message in context: http://www.nabble.com/When-using-Zend_Layout-requests-seem-to-run-twice-tp23519804p23768613.html
Sent from the Zend MVC mailing list archive at Nabble.com.




--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/



2009年5月28日星期四

Re: [fw-mvc] Zend_Session & expiration hops & .htaccess default file

Below is .htaccess file I use, basically I've just added the following line to prevent everything that's expected to be a file (images, js files, css) based on filename extension:
RewriteCond %{REQUEST_FILENAME} \.(js|ico|gif|jpg|png|css|pdf)$ [OR]
**** .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} \.(js|ico|gif|jpg|png|css|pdf)$ [OR]
RewriteCond %{REQUEST_FILENAME} favicon.ico$ [OR]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

XSendFile On
XSendFileAllowAbove On


On Thu, May 28, 2009 at 9:44 PM, GJ Bogaerts <gj@zigg.nl> wrote:

Hi,

I'm running into the same problem, could you please share your .htaccess
file with us?

Thanks!

GJ



Remy Damour-2 wrote:
>
> Hi all,
> This is not a question but simply to share what I've just painfully learnt
> trying to figure out why Zend_Session_Namespace failed to serve back data
> on
> which a 1-hop expiration was set.
> It took me 2 hours to find it, I hope it will save time to some people out
> there.
> Situation is the following:
> I used Zend_Session_Namespace subclasses to handle session data, with
> expiration hop of 1 (expiration set on global namespace, not on specific
> var
> (ENGH for the purists)).
> Problem is that apparently, when running the app, session data was not
> recovered on next page load and disappeared.
> Reason for this is not a ZF bug and is pretty straight-forward, once you
> know it...
> I had a non-existing image inserted in my html code.
> New .htaccess/httpd.conf rule for ZF is solely based on whether queried
> file
> exists or not, since this image did not exist
>  => it was forwarded to my ZF app => generating an invisbile 404 error
> (not
> rendered within   tag) => burning out my 1-hop lifetime limit => what
> seemed to be my next page call was in fact my third page call, hence the
> reason for disappearing session data.
> Conclusion: check apache query log when not in prod || modify .htaccess
> rule
> to skip all unlikely script urls (.png, .jpeg, .pdf...)
> Cheers,
> Remy
>
>

--
View this message in context: http://www.nabble.com/Zend_Session---expiration-hops---.htaccess-default-file-tp23417452p23768719.html
Sent from the Zend MVC mailing list archive at Nabble.com.


Re: [fw-mvc] Zend_Session & expiration hops & .htaccess default file

Hi,

I'm running into the same problem, could you please share your .htaccess
file with us?

Thanks!

GJ

Remy Damour-2 wrote:
>
> Hi all,
> This is not a question but simply to share what I've just painfully learnt
> trying to figure out why Zend_Session_Namespace failed to serve back data
> on
> which a 1-hop expiration was set.
> It took me 2 hours to find it, I hope it will save time to some people out
> there.
> Situation is the following:
> I used Zend_Session_Namespace subclasses to handle session data, with
> expiration hop of 1 (expiration set on global namespace, not on specific
> var
> (ENGH for the purists)).
> Problem is that apparently, when running the app, session data was not
> recovered on next page load and disappeared.
> Reason for this is not a ZF bug and is pretty straight-forward, once you
> know it...
> I had a non-existing image inserted in my html code.
> New .htaccess/httpd.conf rule for ZF is solely based on whether queried
> file
> exists or not, since this image did not exist
> => it was forwarded to my ZF app => generating an invisbile 404 error
> (not
> rendered within tag) => burning out my 1-hop lifetime limit => what
> seemed to be my next page call was in fact my third page call, hence the
> reason for disappearing session data.
> Conclusion: check apache query log when not in prod || modify .htaccess
> rule
> to skip all unlikely script urls (.png, .jpeg, .pdf...)
> Cheers,
> Remy
>
>

--
View this message in context: http://www.nabble.com/Zend_Session---expiration-hops---.htaccess-default-file-tp23417452p23768719.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] When using Zend_Layout requests seem to run twice

Hi all

I run into the same problem, but I cannot actually implement Matthew's
solution. I'm developing a site that is almost exclusively filled with user
generated content, and there is no way for me to guarantee that everything
every user does, always goes according to this plan.

So is there any alternative?

Thanks in advance?


Matthew Weier O'Phinney-3 wrote:
>
> -- thepearson <thepearson@gmail.com> wrote
> (on Wednesday, 13 May 2009, 04:14 AM -0700):
>> Peculiar issue/feature, can't seem to find anyone else with any info
>> about
>> it.
>>
>> Everytime a request is made to the site when using Zend_Layout, it
>> appears
>> that the request is run twice. I noticed this when using sessions to
>> store
>> response messages to the user that are removed from the session once they
>> are displayed. I could never get these messages to display, but after
>> some
>> investigation and logging to file found out that the request is run
>> twice.
>> Putting a simple log message in the a bootstrap file will log the message
>> twice, with every request made to the framework. I confirmed this by
>> profiling the database queries also.
>
> Traditionally when I've seen people complain of this, one of two things
> are happening (and they're, in the end, the same thing):
>
> * They don't have a favicon.ico for the site.
> * There is a reference to an image, CSS file, or JS file that does
> not actually exist on the site.
>
> In both situations, the browser requests the page, and then requests the
> given resource. Since the resource was not found, it falls back to your
> MVC application -- and hence the apparent "second request".
>
> The solution? Make sure you have a favicon.ico file, even if it's empty,
> and that any resource your layout or application defines in the markup
> actually exists on the server.
>
>> I thought that perhaps this was something I had done so did a fresh
>> install
>> as per instructions here: http://framework.zend.com/docs/quickstart and
>> the
>> boot strap file is still being called twice.
>>
>> This is a bit concerning as every request to the server seems to be
>> processed by the server twice before returning a response. You should be
>> able to replicate this by following the instructions in the quickstart
>> tutorial, stop once you've added the layout, then add a
>> put_file_contents("/tmp/file", "Message\n", FILE_APPEND) in the
>> _initDocType() method in the bootstrap class. One browser request will
>> result in two lines in the file /tmp/file ???
>>
>> Can someone tell me why this is and if there is anyway to prevent this
>> from
>> happening? It seems a little crazy that by adding a layout we need to
>> process everything twice.
>>
>> Running:
>> PHP 5.2.6
>> Apache 2.2.9
>> Zend Framework 1.8
>> Only modifications to the Quickstart tutorial is added a line to log to
>> file
>> each request.
>
> --
> Matthew Weier O'Phinney
> Project Lead | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
>

--
View this message in context: http://www.nabble.com/When-using-Zend_Layout-requests-seem-to-run-twice-tp23519804p23768613.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-db] [ZF 1.8.1] findManyToManyRowset

Hello all!

Currently trying to setup a many to many relationship without success. Tried
googling it but havent found anything, so im turning to you!

I'm using a modular structure which looks like this:

-application
-modules
-admin
-views
-models
-DbTable
-forms
-...

in the models directory i have DAOs and in the DbTable directory the
Zend_Db_Table classes (pretty basic).

I have 3 table classes:

class Admin_Model_DbTable_News extends Zend_Db_Table_Abstract
{
protected $_name = 'news';
protected $_primary = 'id_news';
protected $_sequence = true;

protected $_dependentTables = array('Admin_Model_DbTable_ListChroniques');
}

class Admin_Model_DbTable_Chronique extends Zend_Db_Table_Abstract
{

protected $_name = 'chronique';
protected $_primary = 'id_chronique';
protected $_sequence = true;

protected $_dependentTables = array('Admin_Model_DbTable_ListChroniques');
}

class Admin_Model_DbTable_ListChroniques extends Zend_Db_Table_Abstract{

protected $_name = 'listchroniques';

protected $_primary = array('id_chronique_fk', 'id_news_fk');

protected $_referenceMap = array(
'Chronique' => array(
'columns' => array('id_chronique_fk'),
'refTableClass' => 'Admin_Model_DbTable_Chronique',
'refColumns' => array('id_chronique')
),
'News' => array(
'columns' => array('id_news_fk'),
'refTableClass' => 'Admin_Model_DbTable_News',
'refColumns' => array('id_news')
)
);
}


In my DAO class I do this:


class Admin_Model_NewsDao{
public function getListChroniques($newsId){
$table= new Admin_Model_DbTable_News;
$news= $table->find($newsId);
$news= $news->current();

$chroniquesRowset=
$news->findManyToManyRowset('Admin_Model_DbTable_Chronique','Admin_Model_DbTable_ListChroniques');
return $chroniqueRowset;
}
}

When i try to use the getListChroniques($newsId) method, i get:

Zend_Db_Table_Exception: No reference from table Admin_Model_DbTable_Editeur
to table Admin_Model_DbTable_Chronique


Any help would be appreciated! Hope my question isnt too stupid :drunk:

Cheers
--
View this message in context: http://www.nabble.com/-ZF-1.8.1--findManyToManyRowset-tp23763243p23763243.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-gdata] How get connect to youtube account with zend framework and youtube api?



On Thu, May 28, 2009 at 12:51 AM, gerritku <gstore@gmx.com> wrote:

for authentic coding is now already no error
i still confuse, how to get inbox information like :
x Personal Messages
x Shared with you
x Comments
x Friend Invites
x Video Responses
with php code?

anybody ever implemented it or have idea ?

Not all of that information is available, but the info which is available (and the corresponding php code for getting at it) is all documented in the YouTube Developer's Guide for PHP at: http://code.google.com/apis/youtube/2.0/developers_guide_php.html

Cheers,
-Ryan
 


Thanks
Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23756871.html
Sent from the Zend gdata mailing list archive at Nabble.com.


Re: [fw-gdata] How get connect to youtube account with zend framework and youtube api?

for authentic coding is now already no error
i still confuse, how to get inbox information like :
x Personal Messages
x Shared with you
x Comments
x Friend Invites
x Video Responses
with php code?

anybody ever implemented it or have idea ?

Thanks
Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23756871.html
Sent from the Zend gdata mailing list archive at Nabble.com.

2009年5月27日星期三

Re: [fw-db] Zend_Db_Table_Abstract delete IN

Hector Virgen wrote:
>
> That's because you're quoting the result of implode(). You can pass in an
> array to quote() and it will automatically quote each item in the array
> for
> you and separate them with commas.
> Try this:
>
> public function deleteBulk($feedId, array $contentIds) {
> return $this->delete(
> $this->getAdapter()->quoteInto('FeedId = ?',
> $feedId)
> .
> ' AND ContentId IN (' .
> $this->getAdapter()->quote($contentIds) . ')');
> }
>
> Basically just remove the implode and it should work.
>
> -Hector
>
>
> On Wed, May 27, 2009 at 9:11 AM, umpirsky <umpirsky@gmail.com> wrote:
>
>>
>> Hi people.
>>
>> I have this method in my model, it receives an id and array of integers
>> contentIds
>>
>>
>> /**
>> * Delete contents by FeedId and content ids.
>> *
>> * @param int $feedId
>> * @param arrat $contentIds
>> * @return int number of deleted rows
>> */
>> public function deleteBulk($feedId, array $contentIds) {
>> return $this->delete(
>> $this->getAdapter()->quoteInto('FeedId = ?',
>> $feedId) .
>> ' AND ContentId IN (' . implode(',', $contentIds)
>> .
>> ')');
>> }
>>
>> gives
>>
>> DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
>> (179218,179217,179216,179215))
>>
>> This works ok, but is not safe. When I do
>>
>> /**
>> * Delete contents by FeedId and content ids.
>> *
>> * @param int $feedId
>> * @param arrat $contentIds
>> * @return int number of deleted rows
>> */
>> public function deleteBulk($feedId, array $contentIds) {
>> return $this->delete(
>> $this->getAdapter()->quoteInto('FeedId = ?',
>> $feedId) .
>> ' AND ContentId IN (' .
>> $this->getAdapter()->quote(implode(',',
>> $contentIds)) . ')');
>> }
>>
>> or something similar, instead getting
>>
>> DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
>> ('179218,179217,179216,179215'))
>>
>> and delete nothing from table.
>>
>> Where am I doing it wrong.
>>
>> Regards,
>> Sasa Stamenkovic
>> --
>> View this message in context:
>> http://www.nabble.com/Zend_Db_Table_Abstract-delete-IN-tp23745710p23745710.html
>> Sent from the Zend DB mailing list archive at Nabble.com.
>>
>>
>
>

Worked like a butterfly, thanks :)

Regards,
Sasa Stamenkovic.
--
View this message in context: http://www.nabble.com/Zend_Db_Table_Abstract-delete-IN-tp23745710p23746552.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-db] Zend_Db_Table_Abstract delete IN

That's because you're quoting the result of implode(). You can pass in an array to quote() and it will automatically quote each item in the array for you and separate them with commas.

Try this:

        public function deleteBulk($feedId, array $contentIds) {
               return $this->delete(
                       $this->getAdapter()->quoteInto('FeedId = ?', $feedId) .
                       ' AND ContentId IN (' . $this->getAdapter()->quote($contentIds) . ')');
        }

Basically just remove the implode and it should work.

-Hector


On Wed, May 27, 2009 at 9:11 AM, umpirsky <umpirsky@gmail.com> wrote:

Hi people.

I have this method in my model, it receives an id and array of integers
contentIds


 /**
         * Delete contents by FeedId and content ids.
         *
         * @param int $feedId
         * @param arrat $contentIds
         * @return int number of deleted rows
         */
        public function deleteBulk($feedId, array $contentIds) {
               return $this->delete(
                       $this->getAdapter()->quoteInto('FeedId = ?', $feedId) .
                       ' AND ContentId IN (' . implode(',', $contentIds) . ')');
        }

gives

DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
(179218,179217,179216,179215))

This works ok, but is not safe. When I do

/**
         * Delete contents by FeedId and content ids.
         *
         * @param int $feedId
         * @param arrat $contentIds
         * @return int number of deleted rows
         */
        public function deleteBulk($feedId, array $contentIds) {
               return $this->delete(
                       $this->getAdapter()->quoteInto('FeedId = ?', $feedId) .
                       ' AND ContentId IN (' . $this->getAdapter()->quote(implode(',',
$contentIds)) . ')');
        }

or something similar, instead getting

DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
('179218,179217,179216,179215'))

and delete nothing from table.

Where am I doing it wrong.

Regards,
Sasa Stamenkovic
--
View this message in context: http://www.nabble.com/Zend_Db_Table_Abstract-delete-IN-tp23745710p23745710.html
Sent from the Zend DB mailing list archive at Nabble.com.


[fw-db] Zend_Db_Table_Abstract delete IN

Hi people.

I have this method in my model, it receives an id and array of integers
contentIds


/**
* Delete contents by FeedId and content ids.
*
* @param int $feedId
* @param arrat $contentIds
* @return int number of deleted rows
*/
public function deleteBulk($feedId, array $contentIds) {
return $this->delete(
$this->getAdapter()->quoteInto('FeedId = ?', $feedId) .
' AND ContentId IN (' . implode(',', $contentIds) . ')');
}

gives

DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
(179218,179217,179216,179215))

This works ok, but is not safe. When I do

/**
* Delete contents by FeedId and content ids.
*
* @param int $feedId
* @param arrat $contentIds
* @return int number of deleted rows
*/
public function deleteBulk($feedId, array $contentIds) {
return $this->delete(
$this->getAdapter()->quoteInto('FeedId = ?', $feedId) .
' AND ContentId IN (' . $this->getAdapter()->quote(implode(',',
$contentIds)) . ')');
}

or something similar, instead getting

DELETE FROM `Content` WHERE (FeedId = 1 AND ContentId IN
('179218,179217,179216,179215'))

and delete nothing from table.

Where am I doing it wrong.

Regards,
Sasa Stamenkovic
--
View this message in context: http://www.nabble.com/Zend_Db_Table_Abstract-delete-IN-tp23745710p23745710.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-gdata] How get connect to youtube account with zend framework and youtube api?



On Wed, May 27, 2009 at 6:50 AM, gerritku <gstore@gmx.com> wrote:

For now i see problem there double initial. When fix initial now i get error
:


Fatal error: Uncaught exception 'Zend_Gdata_App_AuthException' with message
'Authentication with Google failed. Reason: NoLinkedYouTubeAccount' in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php:174
Stack trace: #0 /var/www/virtual/lohaa.de/htdocs/youtube/index.php(19):
Zend_Gdata_ClientLogin::getHttpClient('gerrit.bagus@gm...', 'gerrit78',
'youtube', NULL, 'MySource', NULL, NULL, 'https://www.goo...') #1 {main}
thrown in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php on line
174

That error simply means that you are trying to login with Google credentials that don't have an associated YouTube account.  Head over to youtube.com and login with the same credentials and you should be able to link the Google account up to an existing YouTube account or create a new YouTube username/profile.

Cheers,
-Ryan
 


Any solution?


Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23742926.html
Sent from the Zend gdata mailing list archive at Nabble.com.


AW: [fw-gdata] How get connect to youtube account with zend framework and youtube api?

> Fatal error: Uncaught exception 'Zend_Gdata_App_AuthException' with
message 'Authentication with Google failed. Reason: NoLinkedYouTubeAccount'

There is your answer. Link your google account with an youtube-account, then
it should work. Look here

http://www.google.com/support/youtube/bin/answer.py?hl=en&answer=69964


Regards,
Uli

PS: You are always sending your mails twice...

Re: [fw-gdata] How get connect to youtube account with zend framework and youtube api?

For now i see problem there double initial. When fix initial now i get error
:


Fatal error: Uncaught exception 'Zend_Gdata_App_AuthException' with message
'Authentication with Google failed. Reason: NoLinkedYouTubeAccount' in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php:174
Stack trace: #0 /var/www/virtual/lohaa.de/htdocs/youtube/index.php(19):
Zend_Gdata_ClientLogin::getHttpClient('gerrit.bagus@gm...', '******',
'youtube', NULL, 'MySource', NULL, NULL, 'https://www.goo...') #1 {main}
thrown in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php on line
174

Any solution?


Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23743018.html
Sent from the Zend gdata mailing list archive at Nabble.com.

Re: [fw-gdata] How get connect to youtube account with zend framework and youtube api?

For now i see problem there double initial. When fix initial now i get error
:


Fatal error: Uncaught exception 'Zend_Gdata_App_AuthException' with message
'Authentication with Google failed. Reason: NoLinkedYouTubeAccount' in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php:174
Stack trace: #0 /var/www/virtual/lohaa.de/htdocs/youtube/index.php(19):
Zend_Gdata_ClientLogin::getHttpClient('gerrit.bagus@gm...', 'gerrit78',
'youtube', NULL, 'MySource', NULL, NULL, 'https://www.goo...') #1 {main}
thrown in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Gdata/ClientLogin.php on line
174

Any solution?


Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23742926.html
Sent from the Zend gdata mailing list archive at Nabble.com.

[fw-gdata] How get connect to youtube account with zend framework and youtube api?

I need connect to youtube account with zend framework and youtube api 2.0.
My referenece
http://code.google.com/intl/en/apis/youtube/2.0/developers_guide_php.html
but i now get error message :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}' in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Loader.php on line 52

Anybody have solution to get connect to youtube account?

Gerrit
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739835p23739835.html
Sent from the Zend gdata mailing list archive at Nabble.com.

[fw-gdata] How get connect to youtube account with zend framework and youtube api?

I need connect to youtube account with zend framework and youtube api 2.0.
My referenece
http://code.google.com/intl/en/apis/youtube/2.0/developers_guide_php.html
but i now get error message :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or
T_FUNCTION or T_VAR or '}' in
/var/www/virtual/lohaa.de/htdocs/youtube/Zend/Loader.php on line 52

Anybody have solution to get connect to youtube account?
--
View this message in context: http://www.nabble.com/How-get-connect-to-youtube-account-with-zend-framework-and-youtube-api--tp23739833p23739833.html
Sent from the Zend gdata mailing list archive at Nabble.com.

Re: [fw-db] Nested sets and Zend_Db_Select

For testing I created the statement for Oracle manually:

SELECT COUNT(parent.NESTEDID) - 1 as depth, node.NESTEDID
FROM NESTED node, NESTED parent
WHERE node.LEFT
BETWEEN parent.LEFT
AND parent.RIGHT
GROUP BY node.NESTEDID
ORDER BY node.LEFT

Now I get the following error:

Fatal error: Uncaught exception 'Zend_Db_Statement_Oracle_Exception' with
message '979 ORA-00979: not a GROUP BY expression SELECT
COUNT(parent.NESTEDID) - 1 as depth, node.NESTEDID FROM NESTED node, NESTED
parent WHERE node.LEFT BETWEEN parent.LEFT AND parent.RIGHT GROUP BY
node.NESTEDID ORDER BY *node.LEFT '

Someone knows why this error occurs?

Matthias W. wrote:
>
> Hi,
>
> I just want to use nested sets in my Zend Framework app.
> I found this tutorial: http://dev.iordanov.net/archives/8
> http://dev.iordanov.net/archives/8
>
> My app can be used with MySql or Oracle DB -> and there's my problem:
> The statements in this tutorial are written by hand and so they aren't
> Oracle conform. I don't want to create different SQL-Strings for Mysql and
> Oracle DB so I have to use the Zend_Db_Select to create the selects. But
> my question is how to create statements like this:
>
> SELECT COUNT(parent.{$this->_primary[1]}) - 1 as depth,
> node.{$this->_toString}
> FROM {$this->_name} AS node, {$this->_name} AS parent
> WHERE node.{$this->_left}
> BETWEEN parent.{$this->_left}
> AND parent.{$this->_right}
> GROUP BY node.{$this->_primary[1]}
> ORDER BY node.{$this->_left}
>
> Is it possible to create this statement using Zend_Db_Select??
> I didn't found anything like this in the reference guide.
>

--
View this message in context: http://www.nabble.com/Nested-sets-and-Zend_Db_Select-tp23738200p23739029.html
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-db] Nested sets and Zend_Db_Select

Hi,

I just want to use nested sets in my Zend Framework app.
I found this tutorial: http://dev.iordanov.net/archives/8
http://dev.iordanov.net/archives/8

My app can be used with MySql or Oracle DB -> and there's my problem:
The statements in this tutorial are written by hand and so they aren't
Oracle conform. I don't want to create different SQL-Strings for Mysql and
Oracle DB so I have to use the Zend_Db_Select to create the selects. But my
question is how to create statements like this:

SELECT COUNT(parent.{$this->_primary[1]}) - 1 as depth,
node.{$this->_toString}
FROM {$this->_name} AS node, {$this->_name} AS parent
WHERE node.{$this->_left}
BETWEEN parent.{$this->_left}
AND parent.{$this->_right}
GROUP BY node.{$this->_primary[1]}
ORDER BY node.{$this->_left}

Is it possible to create this statement using Zend_Db_Select??
I didn't found anything like this in the reference guide.
--
View this message in context: http://www.nabble.com/Nested-sets-and-Zend_Db_Select-tp23738200p23738200.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-mvc] urgent please.. bootstrap fopr 1.8.1

On Wednesday 27 May 2009 04:51:45 kimho wrote:
> Miguel Vieira Dr. (e-mail pessoal) wrote:
> > Nobody can tell me an example of a bootstrap to the new version of
> > Zend Framework, I wanted an example for multiple modules (Admin, Auth
> > and default) ... and multiple layouts ... my problem is
> > application.ini ..
> >
> > Saudações Cordiais,
> > Miguel Vieira
> > IT ANALYST
>
> I think what this post I wrote just now will really fit your need :
>
> http://kimbs.info/blog/list/post/8/title/implement-multi-modules-and-multi-
>templates-in-Zend-Framework

If I'm reading the problem right (layout per module), you can set it in
application.ini, as per the doc (news is the module name):

[production]
news.resources.layout.layout = "news"

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

--
Dado

2009年5月26日星期二

Re: [fw-mvc] ZF 1.8.1 MVC configuration

I tried that and it didn't work.. (I was getting some other error)

I recreated the project from scratch without changing the folder
structure anymore and this time your solution worked, thank you very
much.

On Wed, May 27, 2009 at 05:45, kimho <xqpmxqpm@126.com> wrote:
>
>
>
> Emanuel-20 wrote:
>>
>> Greetings,
>>
>> Has anyone a simple working example using 2 modules in ZF 1.8.1 ?
>> I'm stuck not knowing what I need to set to make it work.
>>
>> My application folder looks like this:
>>
>> application
>> |   Bootstrap.php
>> |
>> +---configs
>> |       application.ini
>> |
>> \---modules
>>     +---admin
>>     |   +---controllers
>>     |   |       IndexController.php
>>     |   |
>>     |   +---models
>>     |   \---views
>>     |       +---filters
>>     |       +---helpers
>>     |       \---scripts
>>     |           \---index
>>     |                   index.phtml
>>     |
>>     \---default
>>         +---controllers
>>         |       ErrorController.php
>>         |       IndexController.php
>>         |
>>         +---models
>>         \---views
>>             +---filters
>>             +---helpers
>>             \---scripts
>>                 +---error
>>                 |       error.phtml
>>                 |
>>                 \---index
>>                         index.phtml
>>
>> The content of application.ini is:
>>
>> [production]
>> phpSettings.display_startup_errors = 0
>> phpSettings.display_errors = 0
>> includePaths.library = APPLICATION_PATH "/../library"
>> bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
>> bootstrap.class = "Bootstrap"
>> resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
>> resources.frontController.defaultModule = "default"
>> ;resources.frontController.controllerDirectory = APPLICATION_PATH
>> "/controllers"
>>
>> [staging : production]
>>
>> [testing : production]
>> phpSettings.display_startup_errors = 1
>> phpSettings.display_errors = 1
>>
>> [development : production]
>> phpSettings.display_startup_errors = 1
>> phpSettings.display_errors = 1
>>
>> and the rest of the files contents are the same as generated by Zend
>> Tool command line.
>>
>> I changed the folder structure a bit, hopping that it may work, but
>> seems that I cannot access any other module except the default one.
>>
>> When I try to access:
>> http://localhost/dragos/public/admin
>>
>> I get the following error:
>>
>> An error occurred
>> Page not found
>> Exception information:
>>
>> Message: Invalid controller class ("Admin_IndexController")
>> Stack trace:
>>
>> #0
>> C:\xampp\htdocs\dragos\library\Zend\Controller\Dispatcher\Standard.php(255):
>> Zend_Controller_Dispatcher_Standard->loadClass('IndexController')
>> #1 C:\xampp\htdocs\dragos\library\Zend\Controller\Front.php(936):
>> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
>> Object(Zend_Controller_Response_Http))
>> #2
>> C:\xampp\htdocs\dragos\library\Zend\Application\Bootstrap\Bootstrap.php(77):
>> Zend_Controller_Front->dispatch()
>> #3 C:\xampp\htdocs\dragos\library\Zend\Application.php(328):
>> Zend_Application_Bootstrap_Bootstrap->run()
>> #4 C:\xampp\htdocs\dragos\public\index.php(26): Zend_Application->run()
>> #5 {main}
>>
>>
>> Request Parameters:
>>
>> array(3) {
>>   ["module"]=>
>>   string(5) "admin"
>>   ["controller"]=>
>>   string(5) "index"
>>   ["action"]=>
>>   string(5) "index"
>> }
>>
>>
>
>
> I think you should and must give a namespace to IndexController for module
> admin :
>
> class Admin_IndexController extends Zend_Controller_Action
> {
>    ......
> }
>
> -----
> kim ho from china
>
> http://kimbs.info/ http://kimbs.info
>
> http://zend.com/zce.php?c=ZEND005888&r=229591104 Zend Certificated Engineer
>
> Zend Framework Certificated Engineer
> --
> View this message in context: http://www.nabble.com/ZF-1.8.1-MVC-configuration-tp23724306p23735118.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>
>

Re: [fw-mvc] urgent please.. bootstrap fopr 1.8.1

Miguel Vieira Dr. (e-mail pessoal) wrote:
>
> Nobody can tell me an example of a bootstrap to the new version of
> Zend Framework, I wanted an example for multiple modules (Admin, Auth
> and default) ... and multiple layouts ... my problem is
> application.ini ..
>
> Saudações Cordiais,
> Miguel Vieira
> IT ANALYST
>
>
>
>
>
>

I think what this post I wrote just now will really fit your need :

http://kimbs.info/blog/list/post/8/title/implement-multi-modules-and-multi-templates-in-Zend-Framework

-----
kim ho from china

http://kimbs.info/ http://kimbs.info

http://zend.com/zce.php?c=ZEND005888&r=229591104 Zend Certificated Engineer

Zend Framework Certificated Engineer
--
View this message in context: http://www.nabble.com/urgent-please..-bootstrap-fopr-1.8.1-tp23685588p23735161.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] ZF 1.8.1 MVC configuration

Emanuel-20 wrote:
>
> Greetings,
>
> Has anyone a simple working example using 2 modules in ZF 1.8.1 ?
> I'm stuck not knowing what I need to set to make it work.
>
> My application folder looks like this:
>
> application
> | Bootstrap.php
> |
> +---configs
> | application.ini
> |
> \---modules
> +---admin
> | +---controllers
> | | IndexController.php
> | |
> | +---models
> | \---views
> | +---filters
> | +---helpers
> | \---scripts
> | \---index
> | index.phtml
> |
> \---default
> +---controllers
> | ErrorController.php
> | IndexController.php
> |
> +---models
> \---views
> +---filters
> +---helpers
> \---scripts
> +---error
> | error.phtml
> |
> \---index
> index.phtml
>
> The content of application.ini is:
>
> [production]
> phpSettings.display_startup_errors = 0
> phpSettings.display_errors = 0
> includePaths.library = APPLICATION_PATH "/../library"
> bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
> bootstrap.class = "Bootstrap"
> resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
> resources.frontController.defaultModule = "default"
> ;resources.frontController.controllerDirectory = APPLICATION_PATH
> "/controllers"
>
> [staging : production]
>
> [testing : production]
> phpSettings.display_startup_errors = 1
> phpSettings.display_errors = 1
>
> [development : production]
> phpSettings.display_startup_errors = 1
> phpSettings.display_errors = 1
>
> and the rest of the files contents are the same as generated by Zend
> Tool command line.
>
> I changed the folder structure a bit, hopping that it may work, but
> seems that I cannot access any other module except the default one.
>
> When I try to access:
> http://localhost/dragos/public/admin
>
> I get the following error:
>
> An error occurred
> Page not found
> Exception information:
>
> Message: Invalid controller class ("Admin_IndexController")
> Stack trace:
>
> #0
> C:\xampp\htdocs\dragos\library\Zend\Controller\Dispatcher\Standard.php(255):
> Zend_Controller_Dispatcher_Standard->loadClass('IndexController')
> #1 C:\xampp\htdocs\dragos\library\Zend\Controller\Front.php(936):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http))
> #2
> C:\xampp\htdocs\dragos\library\Zend\Application\Bootstrap\Bootstrap.php(77):
> Zend_Controller_Front->dispatch()
> #3 C:\xampp\htdocs\dragos\library\Zend\Application.php(328):
> Zend_Application_Bootstrap_Bootstrap->run()
> #4 C:\xampp\htdocs\dragos\public\index.php(26): Zend_Application->run()
> #5 {main}
>
>
> Request Parameters:
>
> array(3) {
> ["module"]=>
> string(5) "admin"
> ["controller"]=>
> string(5) "index"
> ["action"]=>
> string(5) "index"
> }
>
>


I think you should and must give a namespace to IndexController for module
admin :

class Admin_IndexController extends Zend_Controller_Action
{
......
}

-----
kim ho from china

http://kimbs.info/ http://kimbs.info

http://zend.com/zce.php?c=ZEND005888&r=229591104 Zend Certificated Engineer

Zend Framework Certificated Engineer
--
View this message in context: http://www.nabble.com/ZF-1.8.1-MVC-configuration-tp23724306p23735118.html
Sent from the Zend MVC mailing list archive at Nabble.com.