2010年12月31日星期五

Re: [fw-db] Zend_DB and RLIKE

On Dec 31, 2010, at 5:11 AM, Robert Stoll wrote:

> Is there any method which provide a mapping for RLIKE -> something
> like:
> $query->where("URL ".$query->rlike('^/[^/]+/?$'));
> which results for mysql in ...WHERE URL RLIKE '^/[^/]+/?$'
> and for oracle in ...WHERE URL REGEXP_LIKE '^/[^/]+/?$'

No, there is no such method in current versions of Zend_Db.

In fact, there are no subclasses for Zend_Db_Select that would
generate different SQL for each respective brand of RDBMS. There has
been some talk about this from time to time but so far, no one has
developed the code for it.

Regards,
Bill Karwin

[fw-mvc] Re: Left-Right form layout--what is the easiest way to do this?

jbeall wrote:
>
> The simplest way to do this in HTML is with a table with two columns.
>
Hi Josh,

Actually, it is even easier if you simply use CSS to move things around.
I've found that I rarely need to play with decorators when I have CSS on my
side. There are some situations where you'll need to add/remove decorators
but this isn't one of them.

Here are your options:

1 - CSS
2 - Custom Decorators
3 - View Script Decorator (where you will render the form decorators
individually -- you can google for this)

http://framework.zend.com/manual/en/zend.form.standardDecorators.html#zend.form.standardDecorators.viewScript

-----
--
Wil Moore III

Why is Bottom-posting better than Top-posting:
http://www.caliburn.nl/topposting.html

DO NOT TOP-POST and DO trim your replies:
http://linux.sgms-centre.com/misc/netiquette.php#toppost
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Left-Right-form-layout-what-is-the-easiest-way-to-do-this-tp3168519p3169933.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Re: Best way to do nested layouts?

jbeall wrote:
>
> Then have "section" layouts that specify the elements specific to only
> those sections.
>

Use a view partial (via $this->render or $this->partial if you need the
partial to have it's own variable scope). You may also choose to create view
helpers (NOTE: view helpers can call partials as well).


jbeall wrote:
>
> For example, the Master Layout might have a link to a CSS file that all
> pages use, and a footer with links to "contact us" and "terms of service"
> pages.
>

Zend Layout is what you want.
http://framework.zend.com/manual/en/zend.layout.html

NOTE: a layout is simply a view script that acts like a master page -- it
wraps your inner content. It can also call partials (via $this->render or
$this->partial)


jbeall wrote:
>
> But the different sections might use additional CSS files specific to that
> section, reference additional JS libraries, and additional navigation
> options specific to that section.
>

By using the HeadScript placeholder view helper, you can add scripts to a
stack:
$this->headScript()->appendFile('/assets/js/page.js');

The following in your layout:
<?php echo $this->headScript() ?>

will allow your stack of scripts to be output to a location of your choice
(and potentially in the order of your choice). You will need to decide on
prepending vs appending the scripts or giving them a specific stack order.

See:
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headscript


Use HeadStyle for CSS:
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headstyle

-----
--
Wil Moore III

Why is Bottom-posting better than Top-posting:
http://www.caliburn.nl/topposting.html

DO NOT TOP-POST and DO trim your replies:
http://linux.sgms-centre.com/misc/netiquette.php#toppost
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Best-way-to-do-nested-layouts-tp3168376p3169931.html
Sent from the Zend MVC mailing list archive at Nabble.com.

RE: [fw-webservices] Zend_Service_Chargify proposal

I recently proposed a component for Zend Framework (Zend_Ming)
http://framework.zend.com/wiki/display/ZFPROP/Zend_Ming+-+Jimmy+Sole

Has anyone had time to review it and offer any suggestions?

Thanks

Jimmy Sole

-----Original Message-----
From: Matthew Weier O'Phinney [mailto:matthew@zend.com]
Sent: Friday, December 31, 2010 10:32 AM
To: fw-webservices@lists.zend.com
Subject: Re: [fw-webservices] Zend_Service_Chargify proposal

-- Dan Bowen <dan@crucialwebstudio.com> wrote
(on Thursday, 30 December 2010, 07:36 PM -0600):
> I just submitted a proposal for Zend_Service_Chargify and wanted to
> get some feedback from the community.
>
>
http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Chargify+-+Dan+Bo
wen
>
> Is this a component ZF users would be interested in? Does the
> proposal provide enough detail? Please let me know what you think.
>
> This is my fist official contribution to open source. I'm really
> looking forward to making it a successful one.

This looks quite interesting. :)

A couple of notes:

* I think a standalone service component makes sense. However, you
should also contact the author of the Zend_Payment proposal
(http://bit.ly/f9SBnG -- sponsored by Varien/Magento) to offer to
write an adapter for that component.
* As noted by others, ZF1 is in feature freeze, so target ZF2 for this
component. The easiest way to do so is to fork the ZF2 git repo,
and create a branch for development of the feature. That will allow
you to collaborate with others, as well as provide code for the
Community Review Team to review.
* Also, move your component to the "Ready for Review" section of the
proposals, so that folks know you've completed the proposal and want
comments.

The initial glance I had looks promising!

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

Re: [fw-webservices] Zend_Service_Chargify proposal

-- Dan Bowen <dan@crucialwebstudio.com> wrote
(on Thursday, 30 December 2010, 07:36 PM -0600):
> I just submitted a proposal for Zend_Service_Chargify and wanted to
> get some feedback from the community.
>
> http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Chargify+-+Dan+Bowen
>
> Is this a component ZF users would be interested in? Does the
> proposal provide enough detail? Please let me know what you think.
>
> This is my fist official contribution to open source. I'm really
> looking forward to making it a successful one.

This looks quite interesting. :)

A couple of notes:

* I think a standalone service component makes sense. However, you
should also contact the author of the Zend_Payment proposal
(http://bit.ly/f9SBnG -- sponsored by Varien/Magento) to offer to
write an adapter for that component.
* As noted by others, ZF1 is in feature freeze, so target ZF2 for this
component. The easiest way to do so is to fork the ZF2 git repo,
and create a branch for development of the feature. That will allow
you to collaborate with others, as well as provide code for the
Community Review Team to review.
* Also, move your component to the "Ready for Review" section of the
proposals, so that folks know you've completed the proposal and want
comments.

The initial glance I had looks promising!

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

[fw-db] Zend_DB and RLIKE

Hello

I use Zend_Db because I wish, that my PHP-application is compatible with
many database systems.
But I encounter a problem when I want to use RLIKE (MySQL) or REGEXP_LIKE
(oracle) in the WHERE-clause
Is there any method which provide a mapping for RLIKE -> something like:
$query->where("URL ".$query->rlike('^/[^/]+/?$'));
which results for mysql in ...WHERE URL RLIKE '^/[^/]+/?$'
and for oracle in ...WHERE URL REGEXP_LIKE '^/[^/]+/?$'

Thank's
Robert
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

2010年12月30日星期四

Re: [fw-db] Zend_Db and Postgres sequence - lots of queries

On Dec 30, 2010, at 2:49 AM, Vincio wrote:

> I saw using Zend_Db_Profiler_Firebug that Zend does a lot of queries
> just to
> know the sequenceid, I guess.

It's not related to the sequenceid. This query is in the Db Adapter's
describeTable() method, querying metadata about your table. This is
run typically during initialization of any of your classes that extend
Zend_Db_Table_Abstract. That is, when you do:

$mytable = new MyTable();

The base Table class tries to discover metadata about the database
table that your MyTable class is defined for. The benefit of this is
that you *don't* have to write a bunch of tedious XML config files
before you can get your tables to run, as you would have to in many
other types of ORM products.

> I thought that this could become to be a big problem. For example if
> I got
> about 200 hundred queries more than half are queries like that one.

Naturally, you want to create object instances frequently in your
application. Generating that big query against system views 100 times
per request seems kind of expensive. Especially since the table
structure is not likely to change during that time. There is a
solution! Read on...

> Is it normal? Is there a way to limit these queries?

Yes, you can assign a Zend_Cache object to keep the metadata alive and
reuse it for multiple instances of your Table class(es), even across
multiple PHP requests. It doesn't define a metadata cache by default
because you have to choose what cache implementation you want to use.
For details about using metadata caching, read:

http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.metadata.caching

Regards,
Bill Karwin

Re: [fw-webservices] Zend_Service_Chargify proposal

Hey Dan,

afaik is ZF 1.x feature freeze, so new components will only be available in ZF2.
See more information about ZF2 Development here: http://framework.zend.com/wiki/display/ZFDEV2/Home

Cheers,
Dennis

Am 31.12.2010 um 02:36 schrieb Dan Bowen:

> Hey all,
>
> I just submitted a proposal for Zend_Service_Chargify and wanted to get some feedback from the community.
>
> http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Chargify+-+Dan+Bowen
>
> Is this a component ZF users would be interested in? Does the proposal provide enough detail? Please let me know what you think.
>
> This is my fist official contribution to open source. I'm really looking forward to making it a successful one.
>
> Thanks in advance.
>
> -Dan Bowen

[fw-webservices] Zend_Service_Chargify proposal

Hey all,

I just submitted a proposal for Zend_Service_Chargify and wanted to get
some feedback from the community.

http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Chargify+-+Dan+Bowen

Is this a component ZF users would be interested in? Does the proposal
provide enough detail? Please let me know what you think.

This is my fist official contribution to open source. I'm really looking
forward to making it a successful one.

Thanks in advance.

-Dan Bowen

Re: [fw-mvc] Zend_Db quote backslashes issue

On Fri, Dec 31, 2010 at 7:33 AM, Viktor Grandgeorg <info@intelligibel.de> wrote:
>> The query Zend generates looks right to me. What makes you think it
>> should be producing something with groups of four slashes?
>
> it might look right to you, but is definitely wrong, as you can see in the Note in the MySQL Reference Manual
> under:
> http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html
>
> It's what it says, that makes me think it should be producing something with groups of four slashes:

Your original post neglected to mention the DB you were using.

I am not sure it makes sense for Zend DB to try and meet your
requirements there.
The escaping the Zend DB is responsible for is that required to ensure
data gets through properly in the general case without SQL injection,
not format strings to the requirements of specific functions.

I'm not sure it can reasonably be expected to do what your ask because
I don't think it is in a position to guess the users intent.

For example think it would be perfectly reasonable for someone to do
something like:

$match='\t'
$this->fetchAll(
   $this->select()->where('string LIKE ?', $match));

if they wanted to match on a tab.

Thus I think it makes sense for the user to ensure the $match is
appropriately formatted as a pattern the LIKE function understands
while allowing Zend DB to take care of the second (or first) iteration
of escaping.

Paul


>
> Because MySQL uses C escape syntax in strings (for example, "\n" to represent a newline character), you must double any "\" that you
> use in LIKE strings. For example, to search for "\n", specify it as "\\n". To search for "\", specify it as "\\\\"; this is because
> the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched
> against.
>
> So there it is:
> To search for "\", specify it as "\\\\";
>
>
>> What does the data actually look like when you select it out of the
>> DB? It should have only one slash (without you needing to do
>> stripslashes).
>
> Of course it is coming out of the db like:
> C:\some\path\with\backslahes
>
> Regards
> Viktor
>
>
>
>> -----Original Message-----
>> From: Paul McGarry [mailto:paul@paulmcgarry.com]
>> Sent: Wednesday, December 29, 2010 10:24 PM
>> To: info@intelligibel.de
>> Cc: fw-mvc@lists.zend.com
>> Subject: Re: [fw-mvc] Zend_Db quote backslashes issue
>>
>> On Thu, Dec 30, 2010 at 2:27 AM, Viktor Grandgeorg
>> <info@intelligibel.de> wrote:
>> > Hello,
>> >
>> > it seems that Zend_Db does not escape backslashes right -
>> or I'm doing something wrong:
>> >
>> > in my db table "dir" I have a column named "path" with the
>> folowing entry:
>> >
>> > C:\some\path\with\backslahes
>> >
>> > In my DbTable class I'm doing something like:
>> >
>> > $path = "C:\some\path\with\backslahes"; // in reality the
>> value comes from a config.ini
>> > $this->fetchAll(
>> >    $this->select()->where('path LIKE ?', $path));
>> >
>> > Now Zend_Db generates the following query:
>> >
>> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
>> 'C:\\some\\path\\with\\backslahes')
>> >
>> > This is wrong and the corresponding row never gets matched.
>> > It must be the following SQL query to match the right row(s):
>> >
>> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
>> 'C:\\\\some\\\\path\\\\with\\\\backslahes')
>> >
>> > Can somebody confirm this issue?
>>
>> The query Zend generates looks right to me. What makes you think it
>> should be producing something with groups of four slashes?
>>
>> What does the data actually look like when you select it out of the
>> DB? It should have only one slash (without you needing to do
>> stripslashes).
>> If it is coming out of the db like:
>>   C:\\some\\path\\with\\backslahes
>> then it has been escaped too many times when you inserted it.
>>
>>
>> Paul
>>
>
>

Re: [fw-mvc] Re: 'Route not defined' exception

"rent" is your hostname route.

"rent-default" is the name of the chained route.


On Dec 30, 2010, at 8:04 AM, Derk wrote:

> I tried it, but it doesn't help
>
> -----Oorspronkelijk bericht----- From: damir.mitrovic
> Sent: Wednesday, December 29, 2010 5:14 PM
> To: fw-mvc@lists.zend.com
> Subject: [fw-mvc] Re: 'Route not defined' exception
>
>
> Hi,
>
> perhaps you are missing:
>
> resources.router.routes.rent.chains.index.type = "Zend_Controller_Router_Route"
>
> Regards,
> Damir
>
>
>> Hello,
>>
>> The code I have is exactly like this:
>> application.ini
>>
>> resources.router.routes.rent.type = "Zend_Controller_Router_Route_Hostname"
>> resources.router.routes.rent.route = "rent.example.com"
>> resources.router.routes.rent.defaults.module = "rent"
>> resources.router.routes.rent.chains.default.route = ":controller/:action/*"
>> resources.router.routes.rent.chains.default.defaults.controller = "index"
>> resources.router.routes.rent.chains.default.defaults.action = "index"
>>
>> And in a controller to test
>> echo $this->view->url(array(
>> 'controller' => 'user',
>> 'action' => 'activate',
>> 'email' => '[hidden email]',
>> 'key' => 'somekey'
>> ), 'rent');
>> exit;
>>
>> But it raises an exception with message 'Route rent is not defined'
>>
>> All other routes in my application.ini are working fine.
>>
>> What could be the problem?
>>
>> Regards,
>> Derk
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Route-not-defined-exception-tp3167278p3167304.html
> Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Zend_Db quote backslashes issue

Viktor,

It appears that it's likely incorrect only in the case of LIKE comparisons
due to MySQL treating LIKE differently than other operations. Changing it
(Zend Framework) to double escape in any circumstance would likely break it
for everything but LIKE comparisons.

Could you do something like:

$path = "C:\some\path\with\backslahes"
; // in reality the value comes from a config.ini
$this->fetchAll($this->select()->where('path LIKE ?', addslashes($path)));

as a work around? I think the fix would involve ZF inspecting the first
parameter to where() to determine if a like was being used and then doing
the escaping differently, or requiring a different way of handling likes
outside of the normal where() flow.

I verified running a query with = against paths and indeed, if = is used and
the backslashes are double escaped, it will not work, but single escaped
(ie, c:\\) does work.

David

On Thu, Dec 30, 2010 at 1:33 PM, Viktor Grandgeorg <info@intelligibel.de>wrote:

>
> Hello,
>
> > The query Zend generates looks right to me. What makes you think it
> > should be producing something with groups of four slashes?
>
> it might look right to you, but is definitely wrong, as you can see in the
> Note in the MySQL Reference Manual
> under:
> http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html
>
> It's what it says, that makes me think it should be producing something
> with groups of four slashes:
>
> Because MySQL uses C escape syntax in strings (for example, "\n" to
> represent a newline character), you must double any "\" that you
> use in LIKE strings. For example, to search for "\n", specify it as "\\n".
> To search for "\", specify it as "\\\\"; this is because
> the backslashes are stripped once by the parser and again when the pattern
> match is made, leaving a single backslash to be matched
> against.
>
> So there it is:
> To search for "\", specify it as "\\\\";
>
>
> > What does the data actually look like when you select it out of the
> > DB? It should have only one slash (without you needing to do
> > stripslashes).
>
> Of course it is coming out of the db like:
> C:\some\path\with\backslahes
>
> Regards
> Viktor
>
>
>
> > -----Original Message-----
> > From: Paul McGarry [mailto:paul@paulmcgarry.com]
> > Sent: Wednesday, December 29, 2010 10:24 PM
> > To: info@intelligibel.de
> > Cc: fw-mvc@lists.zend.com
> > Subject: Re: [fw-mvc] Zend_Db quote backslashes issue
> >
> > On Thu, Dec 30, 2010 at 2:27 AM, Viktor Grandgeorg
> > <info@intelligibel.de> wrote:
> > > Hello,
> > >
> > > it seems that Zend_Db does not escape backslashes right -
> > or I'm doing something wrong:
> > >
> > > in my db table "dir" I have a column named "path" with the
> > folowing entry:
> > >
> > > C:\some\path\with\backslahes
> > >
> > > In my DbTable class I'm doing something like:
> > >
> > > $path = "C:\some\path\with\backslahes"; // in reality the
> > value comes from a config.ini
> > > $this->fetchAll(
> > > $this->select()->where('path LIKE ?', $path));
> > >
> > > Now Zend_Db generates the following query:
> > >
> > > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> > 'C:\\some\\path\\with\\backslahes')
> > >
> > > This is wrong and the corresponding row never gets matched.
> > > It must be the following SQL query to match the right row(s):
> > >
> > > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> > 'C:\\\\some\\\\path\\\\with\\\\backslahes')
> > >
> > > Can somebody confirm this issue?
> >
> > The query Zend generates looks right to me. What makes you think it
> > should be producing something with groups of four slashes?
> >
> > What does the data actually look like when you select it out of the
> > DB? It should have only one slash (without you needing to do
> > stripslashes).
> > If it is coming out of the db like:
> > C:\\some\\path\\with\\backslahes
> > then it has been escaped too many times when you inserted it.
> >
> >
> > Paul
> >
>
>

RE: [fw-mvc] Zend_Db quote backslashes issue

Hello,

> The query Zend generates looks right to me. What makes you think it
> should be producing something with groups of four slashes?

it might look right to you, but is definitely wrong, as you can see in the Note in the MySQL Reference Manual
under:
http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html

It's what it says, that makes me think it should be producing something with groups of four slashes:

Because MySQL uses C escape syntax in strings (for example, "\n" to represent a newline character), you must double any "\" that you
use in LIKE strings. For example, to search for "\n", specify it as "\\n". To search for "\", specify it as "\\\\"; this is because
the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched
against.

So there it is:
To search for "\", specify it as "\\\\";


> What does the data actually look like when you select it out of the
> DB? It should have only one slash (without you needing to do
> stripslashes).

Of course it is coming out of the db like:
C:\some\path\with\backslahes

Regards
Viktor

> -----Original Message-----
> From: Paul McGarry [mailto:paul@paulmcgarry.com]
> Sent: Wednesday, December 29, 2010 10:24 PM
> To: info@intelligibel.de
> Cc: fw-mvc@lists.zend.com
> Subject: Re: [fw-mvc] Zend_Db quote backslashes issue
>
> On Thu, Dec 30, 2010 at 2:27 AM, Viktor Grandgeorg
> <info@intelligibel.de> wrote:
> > Hello,
> >
> > it seems that Zend_Db does not escape backslashes right -
> or I'm doing something wrong:
> >
> > in my db table "dir" I have a column named "path" with the
> folowing entry:
> >
> > C:\some\path\with\backslahes
> >
> > In my DbTable class I'm doing something like:
> >
> > $path = "C:\some\path\with\backslahes"; // in reality the
> value comes from a config.ini
> > $this->fetchAll(
> >    $this->select()->where('path LIKE ?', $path));
> >
> > Now Zend_Db generates the following query:
> >
> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> 'C:\\some\\path\\with\\backslahes')
> >
> > This is wrong and the corresponding row never gets matched.
> > It must be the following SQL query to match the right row(s):
> >
> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> 'C:\\\\some\\\\path\\\\with\\\\backslahes')
> >
> > Can somebody confirm this issue?
>
> The query Zend generates looks right to me. What makes you think it
> should be producing something with groups of four slashes?
>
> What does the data actually look like when you select it out of the
> DB? It should have only one slash (without you needing to do
> stripslashes).
> If it is coming out of the db like:
> C:\\some\\path\\with\\backslahes
> then it has been escaped too many times when you inserted it.
>
>
> Paul
>

Re: [fw-mvc] Re: 'Route not defined' exception

I tried it, but it doesn't help

-----Oorspronkelijk bericht-----
From: damir.mitrovic
Sent: Wednesday, December 29, 2010 5:14 PM
To: fw-mvc@lists.zend.com
Subject: [fw-mvc] Re: 'Route not defined' exception


Hi,

perhaps you are missing:

resources.router.routes.rent.chains.index.type =
"Zend_Controller_Router_Route"

Regards,
Damir


> Hello,
>
> The code I have is exactly like this:
> application.ini
>
> resources.router.routes.rent.type =
> "Zend_Controller_Router_Route_Hostname"
> resources.router.routes.rent.route = "rent.example.com"
> resources.router.routes.rent.defaults.module = "rent"
> resources.router.routes.rent.chains.default.route =
> ":controller/:action/*"
> resources.router.routes.rent.chains.default.defaults.controller = "index"
> resources.router.routes.rent.chains.default.defaults.action = "index"
>
> And in a controller to test
> echo $this->view->url(array(
> 'controller' => 'user',
> 'action' => 'activate',
> 'email' => '[hidden email]',
> 'key' => 'somekey'
> ), 'rent');
> exit;
>
> But it raises an exception with message 'Route rent is not defined'
>
> All other routes in my application.ini are working fine.
>
> What could be the problem?
>
> Regards,
> Derk

--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Route-not-defined-exception-tp3167278p3167304.html
Sent from the Zend MVC mailing list archive at Nabble.com.

RE: [fw-mvc] Zend_Db quote backslashes issue

Hello,

you know wrong, like it clearly says in the note in chapter
11.5.1. "String Comparison Functions" in the MySQL Reference Manual
under:
http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html

Because MySQL uses C escape syntax in strings (for example, "\n" to represent a newline character), you must double any "\" that you
use in LIKE strings. For example, to search for "\n", specify it as "\\n". To search for "\", specify it as "\\\\"; this is because
the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched
against.

This is the same for MySQL versions < 5.5

So this must be a bug in Zend_Db's quote mechanism.

Regards
Viktor

> -----Original Message-----
> From: Hector Virgen [mailto:djvirgen@gmail.com]
> Sent: Thursday, December 30, 2010 1:59 AM
> To: info@intelligibel.de
> Cc: fw-mvc@lists.zend.com
> Subject: Re: [fw-mvc] Zend_Db quote backslashes issue
>
> AFAIK the backslash character is not considered special in "like"
> comparisons, so you don't need to double-escape it. Only
> underscores and
> question marks need additional escaping.
>
> --
> Hector Virgen
> Sent from my Droid X
> On Dec 29, 2010 7:27 AM, "Viktor Grandgeorg"
> <info@intelligibel.de> wrote:
> > Hello,
> >
> > it seems that Zend_Db does not escape backslashes right -
> or I'm doing
> something wrong:
> >
> > in my db table "dir" I have a column named "path" with the
> folowing entry:
> >
> > C:\some\path\with\backslahes
> >
> > In my DbTable class I'm doing something like:
> >
> > $path = "C:\some\path\with\backslahes"; // in reality the
> value comes from
> a config.ini
> > $this->fetchAll(
> > $this->select()->where('path LIKE ?', $path));
> >
> > Now Zend_Db generates the following query:
> >
> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> 'C:\\some\\path\\with\\backslahes')
> >
> > This is wrong and the corresponding row never gets matched.
> > It must be the following SQL query to match the right row(s):
> >
> > SELECT `dir`.* FROM `dir` WHERE (path LIKE
> 'C:\\\\some\\\\path\\\\with\\\\backslahes')
> >
> > Can somebody confirm this issue?
> >
> > Regards
> > Viktor
> >
>

[fw-db] Zend_Db and Postgres sequence - lots of queries

Hi,

I'm using as DB Postgres, just becouse I work every day with Oracle, I
worked with MySql, and so I just want start using a new DB.
I saw using Zend_Db_Profiler_Firebug that Zend does a lot of queries just to
know the sequenceid, I guess.
After I do a select query, I saw query like this:


SELECT a.attnum, n.nspname, c.relname, a.attname AS colname, t.typname AS
type, a.atttypmod,
FORMAT_TYPE(a.atttypid, a.atttypmod) AS complete_type, d.adsrc AS
default_value, a.attnotnull AS notnull, a.attlen AS length,
co.contype, ARRAY_TO_STRING(co.conkey, ',') AS conkey FROM pg_attribute AS a
JOIN pg_class AS c ON a.attrelid = c.oid
JOIN pg_namespace AS n ON c.relnamespace = n.oid JOIN pg_type AS t ON
a.atttypid = t.oid LEFT OUTER JOIN pg_constraint
AS co ON (co.conrelid = c.oid AND a.attnum = ANY(co.conkey) AND co.contype =
'p') LEFT OUTER JOIN pg_attrdef AS d ON
d.adrelid = c.oid AND d.adnum = a.attnum WHERE a.attnum > 0 AND c.relname =
'TABLE_NAME' ORDER BY a.attnum


I thought that this could become to be a big problem. For example if I got
about 200 hundred queries more than half are queries like that one.

Is it normal? Is there a way to limit these queries? I'm making some mistake
or what? I have never work with Zend and other DB, so I don't know if it is
so with them too. But maybe it's becouse of the use of sequence instead of
auto-increment columns.

Thanks in advice,
Vincenzo
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Db-and-Postgres-sequence-lots-of-queries-tp3168142p3168142.html
Sent from the Zend DB mailing list archive at Nabble.com.

2010年12月29日星期三

Re: [fw-mvc] Zend_Db quote backslashes issue

AFAIK the backslash character is not considered special in "like"
comparisons, so you don't need to double-escape it. Only underscores and
question marks need additional escaping.

--
Hector Virgen
Sent from my Droid X
On Dec 29, 2010 7:27 AM, "Viktor Grandgeorg" <info@intelligibel.de> wrote:
> Hello,
>
> it seems that Zend_Db does not escape backslashes right - or I'm doing
something wrong:
>
> in my db table "dir" I have a column named "path" with the folowing entry:
>
> C:\some\path\with\backslahes
>
> In my DbTable class I'm doing something like:
>
> $path = "C:\some\path\with\backslahes"; // in reality the value comes from
a config.ini
> $this->fetchAll(
> $this->select()->where('path LIKE ?', $path));
>
> Now Zend_Db generates the following query:
>
> SELECT `dir`.* FROM `dir` WHERE (path LIKE
'C:\\some\\path\\with\\backslahes')
>
> This is wrong and the corresponding row never gets matched.
> It must be the following SQL query to match the right row(s):
>
> SELECT `dir`.* FROM `dir` WHERE (path LIKE
'C:\\\\some\\\\path\\\\with\\\\backslahes')
>
> Can somebody confirm this issue?
>
> Regards
> Viktor
>

Re: [fw-mvc] Zend_Db quote backslashes issue

On Thu, Dec 30, 2010 at 2:27 AM, Viktor Grandgeorg <info@intelligibel.de> wrote:
> Hello,
>
> it seems that Zend_Db does not escape backslashes right - or I'm doing something wrong:
>
> in my db table "dir" I have a column named "path" with the folowing entry:
>
> C:\some\path\with\backslahes
>
> In my DbTable class I'm doing something like:
>
> $path = "C:\some\path\with\backslahes"; // in reality the value comes from a config.ini
> $this->fetchAll(
>    $this->select()->where('path LIKE ?', $path));
>
> Now Zend_Db generates the following query:
>
> SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\some\\path\\with\\backslahes')
>
> This is wrong and the corresponding row never gets matched.
> It must be the following SQL query to match the right row(s):
>
> SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\\\some\\\\path\\\\with\\\\backslahes')
>
> Can somebody confirm this issue?

The query Zend generates looks right to me. What makes you think it
should be producing something with groups of four slashes?

What does the data actually look like when you select it out of the
DB? It should have only one slash (without you needing to do
stripslashes).
If it is coming out of the db like:
C:\\some\\path\\with\\backslahes
then it has been escaped too many times when you inserted it.


Paul

[fw-mvc] Re: 'Route not defined' exception

Hi,

perhaps you are missing:

resources.router.routes.rent.chains.index.type = "Zend_Controller_Router_Route"

Regards,
Damir


> Hello,
>
> The code I have is exactly like this:
> application.ini
>
> resources.router.routes.rent.type = "Zend_Controller_Router_Route_Hostname"
> resources.router.routes.rent.route = "rent.example.com"
> resources.router.routes.rent.defaults.module = "rent"
> resources.router.routes.rent.chains.default.route = ":controller/:action/*"
> resources.router.routes.rent.chains.default.defaults.controller = "index"
> resources.router.routes.rent.chains.default.defaults.action = "index"
>
> And in a controller to test
> echo $this->view->url(array(
>         'controller' => 'user',
>         'action' => 'activate',
>         'email' => '[hidden email]',
>         'key' => 'somekey'
>     ), 'rent');
> exit;
>
> But it raises an exception with message 'Route rent is not defined'
>
> All other routes in my application.ini are working fine.
>
> What could be the problem?
>
> Regards,
> Derk

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Route-not-defined-exception-tp3167278p3167304.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] 'Route not defined' exception

Hello,

The code I have is exactly like this:
application.ini

resources.router.routes.rent.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.rent.route = "rent.example.com"
resources.router.routes.rent.defaults.module = "rent"
resources.router.routes.rent.chains.default.route = ":controller/:action/*"
resources.router.routes.rent.chains.default.defaults.controller = "index"
resources.router.routes.rent.chains.default.defaults.action = "index"

And in a controller to test
echo $this->view->url(array(
'controller' => 'user',
'action' => 'activate',
'email' => 'email@example.com',
'key' => 'somekey'
), 'rent');
exit;

But it raises an exception with message 'Route rent is not defined'

All other routes in my application.ini are working fine.

What could be the problem?

Regards,
Derk

[fw-mvc] Zend_Db quote backslashes issue

Hello,

it seems that Zend_Db does not escape backslashes right - or I'm doing something wrong:

in my db table "dir" I have a column named "path" with the folowing entry:

C:\some\path\with\backslahes

In my DbTable class I'm doing something like:

$path = "C:\some\path\with\backslahes"; // in reality the value comes from a config.ini
$this->fetchAll(
$this->select()->where('path LIKE ?', $path));

Now Zend_Db generates the following query:

SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\some\\path\\with\\backslahes')

This is wrong and the corresponding row never gets matched.
It must be the following SQL query to match the right row(s):

SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\\\some\\\\path\\\\with\\\\backslahes')

Can somebody confirm this issue?

Regards
Viktor

2010年12月28日星期二

RE: [fw-db] Db Select prints wrong info

Bill

Thank you for your suggestion. Actually after examining the query, I foung
that there are 2 "approved" colums in the query result. One in articles
table and the other one was in user table. After executing the query code
was picking up the one in the user table which was "1". I changed the name
of the column in users table and now query working fine.

Sometimes long time coding, you can even see a simple point. I am copying
what I was facing. As you can see last approved column which one was 1, was
printed on the screen.

Thanks again...

articleID userID categoryID articleTitle articleHeader
articleBody articleDate approved categoryID categoryName
userID userName userPassword firstName lastName
email approved accessLevel
3 1 1 Test Test Test 28.12.2010 14:59 0
1 PHP 1 erdal.yazicioglu erdaly Erdal YAZICIOGLU
erdal.yazicioglu@gmail.com 1 0


-----Original Message-----
From: Bill Karwin [mailto:bill@karwin.com]
Sent: Tuesday, December 28, 2010 2:54 PM
To: fw-db@lists.zend.com
Subject: Re: [fw-db] Db Select prints wrong info


On Dec 28, 2010, at 5:27 AM, Erdal YAZICIOGLU wrote:
> It prints 1 instead of 0s for the pending articles.

Suggestions:

If you have more than one copy of Application_Model_DbTable_Articles
in your include path, make sure you're running the one you think you
are. Add a diagnostic print statement inside your pendingArticles()
method, to output __FILE__.

Use the Zend_Db_Profiler to examine the exact SQL you're executing.
Alternatively, look in the database query log to see the statement it
executed. It's easier to debug SQL by looking at SQL, not code that
constructs SQL.

Try the same SQL in your database query tool (e.g. MySQL Workbench or
the mysql CLI). What data does the query return?

Regards,
Bill Karwin

[fw-db] Db Select prints wrong info

Good day all

I have a model called articles where I try to pull all pending ones

public function pendingArticles(){
$approved='0';
$select = $this->select()
->setIntegrityCheck(false)
->from(array('a' => 'dict_articles'))
->join(array('b' => 'dict_categories'),'a.categoryID =
b.categoryID')
->join(array('c' => 'dict_users'),'a.userID = c.userID')
->where('a.approved=?',$approved);
return $this->fetchAll($select);

}

In the controller I call this method as follows.

public function pendingArticleAction(){
$articles = new Application_Model_DbTable_Articles();
$this->view->articles = $articles->pendingArticles();
}

In the view as usual I put the articles in foreach loop and try to print
articles where approval status is 0.

<?php
foreach ($this->articles as $articles):
echo $articles->approved;
endforeach;
?>

It prints 1 instead of 0s for the pending articles.

I am using ZF 1.11

Any hints..?

Best Regards
E

Re: [fw-db] Db Select prints wrong info

On Dec 28, 2010, at 5:27 AM, Erdal YAZICIOGLU wrote:
> It prints 1 instead of 0s for the pending articles.

Suggestions:

If you have more than one copy of Application_Model_DbTable_Articles
in your include path, make sure you're running the one you think you
are. Add a diagnostic print statement inside your pendingArticles()
method, to output __FILE__.

Use the Zend_Db_Profiler to examine the exact SQL you're executing.
Alternatively, look in the database query log to see the statement it
executed. It's easier to debug SQL by looking at SQL, not code that
constructs SQL.

Try the same SQL in your database query tool (e.g. MySQL Workbench or
the mysql CLI). What data does the query return?

Regards,
Bill Karwin

Re: [fw-db] Db Select prints wrong info

$approved='0';
not the same
$approved=0;
Nikita Groshin

28.12.10, 16:27, "Erdal YAZICIOGLU" <erdal.yazicioglu@gmail.com>:

> Good day all
>
> I have a model called articles where I try to pull all pending ones
>
> public function pendingArticles(){
>        $approved='0';
>        $select = $this->select()
>         ->setIntegrityCheck(false)
>                ->from(array('a' => 'dict_articles'))
>                ->join(array('b' => 'dict_categories'),'a.categoryID =
> b.categoryID')
>                ->join(array('c' => 'dict_users'),'a.userID = c.userID')
>                 ->where('a.approved=?',$approved);
>        return $this->fetchAll($select);
>
>    }
>
> In the controller I call this method as follows.
>
> public function pendingArticleAction(){
>           $articles = new Application_Model_DbTable_Articles();
>           $this->view->articles = $articles->pendingArticles();
>       }
>
> In the view as usual I put the articles in foreach loop and try to print
> articles where approval status is 0.
>
> <?php
> foreach ($this->articles as $articles):
> echo $articles->approved;
> endforeach;
> ?>
>
> It prints 1 instead of 0s for the pending articles.
>
> I am using ZF 1.11
>
> Any hints..?
>
> Best Regards
> E
>
>
>

Re: [fw-mvc] Zend_Currency Displaying Extra Character

Hey Jurian,

Thanks for the info. The problem is solved. I'm changing the char encoding
of all files to UTF-8. Again very thanks for the fast and accurate reply.

Midhun Girish


On Tue, Dec 28, 2010 at 3:33 PM, Jurian Sluiman
<subscribe@juriansluiman.nl>wrote:

> On Tuesday 28 Dec 2010 10:49:07 Midhun Girish wrote:
> > Dear all,
> >
> > I was trying to use Zend_Currency to format my currency outputs and i
> face
> > this queer problem. An illegal character(Â) gets displayed along with the
> > output of the currency data. The code i used is:
> >
> > $currency = new Zend_Currency('en_IN');
> >
> > > echo $currency->toCurrency(100);
> >
> > And the output is:
> >
> > Rs 100.00
> >
> > I dont know from where the "Â" comes up. I found out that this problem
> > occurs for certain locales only. It is working fine for en_US and some
> > others but output this extra char  in many other. Some one please help.
> >
> > Midhun Girish
>
> Hi Midhun,
>
> This problem is related to your character encoding. To show the characters
> properly, it's the best to work with UTF-8. Your php files, html files and
> output from Apache should be UTF-8 and it should be fine.
>
> I have had the same problem with the nl_NL locale in Zend_Mail, which is
> filed
> under issue no. 5440 in Jira:
> http://framework.zend.com/issues/browse/ZF-5440.
> Converting the mail into UTF-8 and use 8-bit encoding solved the problem in
> Zend_Mail too.
>
> Regards, Jurian
> --
> Jurian Sluiman
> Soflomo - http://soflomo.com
>
>

Re: [fw-mvc] Zend_Currency Displaying Extra Character

On Tuesday 28 Dec 2010 10:49:07 Midhun Girish wrote:
> Dear all,
>
> I was trying to use Zend_Currency to format my currency outputs and i face
> this queer problem. An illegal character(Â) gets displayed along with the
> output of the currency data. The code i used is:
>
> $currency = new Zend_Currency('en_IN');
>
> > echo $currency->toCurrency(100);
>
> And the output is:
>
> Rs 100.00
>
> I dont know from where the "Â" comes up. I found out that this problem
> occurs for certain locales only. It is working fine for en_US and some
> others but output this extra char  in many other. Some one please help.
>
> Midhun Girish

Hi Midhun,

This problem is related to your character encoding. To show the characters
properly, it's the best to work with UTF-8. Your php files, html files and
output from Apache should be UTF-8 and it should be fine.

I have had the same problem with the nl_NL locale in Zend_Mail, which is filed
under issue no. 5440 in Jira: http://framework.zend.com/issues/browse/ZF-5440.
Converting the mail into UTF-8 and use 8-bit encoding solved the problem in
Zend_Mail too.

Regards, Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com

[fw-mvc] Zend_Currency Displaying Extra Character

Dear all,

I was trying to use Zend_Currency to format my currency outputs and i face
this queer problem. An illegal character(Â) gets displayed along with the
output of the currency data. The code i used is:

$currency = new Zend_Currency('en_IN');
> echo $currency->toCurrency(100);


And the output is:

Rs 100.00

I dont know from where the "Â" comes up. I found out that this problem
occurs for certain locales only. It is working fine for en_US and some
others but output this extra char  in many other. Some one please help.

Midhun Girish

2010年12月27日星期一

Re: [fw-mvc] Translated segments

Hello,

Thank you for your sample code. It was really helpful and i was finally able to get it working here.

Best Regards,

Fernando Morgenstern
contato@fernandomarcelo.com

Em 21/12/2010, às 11:25, Kaj Ström escreveu:

> Hello!
>
> I have made one project with URL -translation and I have to agree that it was quite difficult to find information.
>
> I´m by no means an expert in the matter.
>
> In my project i have a _initLanguage bootstrap function, which resets the default routes. This project has no modules btw.
>
> Code:
>
> $ctrl = $this->getResource("FrontController");
>
> $router = $ctrl->getRouter();
> $router->setGlobalParam("lang", "en");
>
>
> $route = new Zend_Controller_Router_Route(
> ':lang/:@controller/:@action/*',
> array(
> 'lang' => ":lang",
> 'controller' => 'index',
> 'action' => 'index'
> )
> );
>
> $router->addRoute("default", $route);
>
> Code end.
>
> So i override the default route with my new route that has translation. This sets up the needed route.
>
> In addition i have a front controller plugin that loads the actual translated texts in its routeStartUp() method.
>
> Code:
>
> $frontController = Zend_Controller_Front::getInstance();
> $router = $frontController->getRouter();
>
> $router->setGlobalParam("lang", $activeLang);
>
>
> if($urlLangExists){
> $urlTranslate = new Zend_Translate(
> "array",
> APPLICATION_PATH."/languages/url_". $activeLang .".php", $activeLang
> );
>
> foreach($langs as $lang){
> $lang = trim($lang);
> $urlTranslate->addTranslation(APPLICATION_PATH."/languages/url_$lang.php", "$lang");
> }
> }
> else{
> $urlTranslate = new Zend_Translate(
> "array",
> array(), $activeLang);
> }
>
> $urlTranslate->setLocale($activeLang);
>
> Zend_Controller_Router_Route::setDefaultTranslator($urlTranslate);
>
> Code end.
>
> So the actual translations are held in arrays that the Zend_Translate handles loads.
>
> As I said earlier i have no module part in the URL, but i presume you can handle it similarly to the :lang my version uses to change the language of the site and URL.
>
> Hope this helps!
>
> Regards,
> Kaj Ström
>
> 21.12.2010 9:16, Саша Стаменковић kirjoitti:
>> Looks like nobody knows the answer :(
>>
>> Regards,
>> Saša Stamenković
>>
>>
>> On Sun, Dec 19, 2010 at 1:05 AM, Саша Стаменковић<umpirsky@gmail.com>wrote:
>>
>>> Never managed to do this, waiting for the answer.
>>>
>>> Regards,
>>> Saša Stamenković
>>>
>>>
>>>
>>> On Sat, Dec 18, 2010 at 8:36 PM, Fernando Morgenstern<
>>> contato@fernandomarcelo.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I am trying to get my urls translated but unfortunately the examples at
>>>> the manual are not working to me.
>>>>
>>>> I was wondering if anyone here knows how to translate all urls, except the
>>>> module part? Adding routes for each controller is not an option to me,
>>>> because of the high number of routes.
>>>>
>>>> From what i understood, i have to remove the default route and add a new
>>>> one, with translation support ( @ ), is that correct?
>>>>
>>>> Please, if you have any examples that works, could you point out an url
>>>> where i can check?
>>>>
>>>> Regards,
>>>>
>>>> Fernando Morgenstern
>>>> contato@fernandomarcelo.com

[fw-gdata] retrieve all calender entries

Hello,

I'm trying to retrieve all events from non-default calendar feed and
getting exception:

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with
message ' in C:\wamp\bin\php\php5.3.1\PEAR\Zend\Gdata\App.php on line
709

Zend_Gdata_App_HttpException: Expected response code 200, got 400
The &#39;max-results&#39; parameter is not supported on this resource
in C:\wamp\bin\php\php5.3.1\PEAR\Zend\Gdata\App.php on line 709


My code


       /* @var $query \Zend_Gdata_Calendar_EventQuery */
       $link = $customCalender->getSelfLink()->getHref();
       $query = $this->service->newEventQuery($link);
       $query->setUser('default');
       $query->setVisibility('private');
       $query->setProjection('full');
       $query->setOrderby('starttime');
       $query->setMaxResults(200);
       return $this->service->getCalendarEventFeed($query);


Thanks for any help!

Fred

2010年12月26日星期日

[fw-mvc] Returning content from action helpers?

Hi,

What is the the clean, proper way of return content from an action
helper? I'm trying create a login action helper that can be placed
within pages and process login requests in an ajax type of fashion. It
needs to return json. I swear I saw an article on this or a mention of
this by Matthew Weier O`Phinney in an article somewhere.

Jamie

2010年12月25日星期六

[fw-mvc] Re: View Scripts

weierophinney wrote:
>
>> I am creating a controller, Mainewap...
>

I notice you named the controller "Mainewap" which leads me to believe that
you know the difference between naming the controller:

"Mainewap" vs
"MaineWap".

The difference is that the second variation is "inflected" to/from
"maine-wap" where the first stays as "Mainewap".


weierophinney wrote:
>
> ...when I append "wap" to the end of the state name, Zend decides to split
> it up randomly with a dash, so it may come out as main-ewap, and won't
> find the directory.
>

This leads me to believe that the string you are ending up with looks
something like "MainEwap". If you want to reference a directory of
"maine-wap" you likely need to ensure that you have "MaineWap" or you should
just build the directory name without handing it to the inflector.

Of course, I'm taking a shot in the dark as you didn't exactly spell-out
your entire workflow so it really is difficult to know for sure what the
correct solution should be.

If you have more information to add, that would be great.

Is there any way to
> ensure that when I create the state's second view script of
> information, it doesn't put a random dash in the name?

How exactly are you appending? And what exactly are you appending?

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


-----
--
Wil Moore III

Why is Bottom-posting better than Top-posting:
http://www.caliburn.nl/topposting.html

DO NOT TOP-POST and DO trim your replies:
http://linux.sgms-centre.com/misc/netiquette.php#toppost
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/View-Scripts-tp3159765p3164026.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年12月23日星期四

Re: [fw-mvc] Best practices to organize Models/Controllers

Hello Fernando,

You might want to read up on how to implement a service layer. Here are few
links to get you pointed in the right direction:

http://www.rvdavid.net/my-zend-framework-model-layer-part-service-part-orm/
http://zend-framework-community.634137.n4.nabble.com/Model-data-source-data-mapper-and-service-layer-td1885770.html

http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html

It is advisable that your entity objects, subscriber, for example, only know
what they absolutely need to. They should be clueless to how they are persisted
and have a simple api to modify their properties. Service classes can be used
for code that doesn't seem to fit in any model entity.

Regards,

David

________________________________
From: Fernando Morgenstern <contato@fernandomarcelo.com>
To: Zend MVC <fw-mvc@lists.zend.com>
Sent: Thu, December 23, 2010 7:29:57 AM
Subject: [fw-mvc] Best practices to organize Models/Controllers

Hello,

I am looking for some input about best practices in models/controllers.

The application is still pretty simple, but i would like to make it right from
the beginning. I have two actions:

1) I have to select a specified subscriber that is active ( active = 1 in
database )
2) I have to select a specified subscriber, it does not matter if active or not.

My initial approach was this in controller:

$model = new Model_Subscriber();
$model->fetchAll(array(
'email = ?' => $email,
'active = 1'
));

I soon realized that this is bad since i am writing SQL and business logic in
controller. So i created two functions in model:

1) getActiveSubscriberQuery($email)
2) getSubscriberQuery($email)

Both return a Zend_Db_Select, which i can use in fetchAll().

My question: Is this the best way to do things? I mean, yhe application might
get complex and i am worried about having lots and lots of functions for each
type of query in model.

Regards,

Fernando Morgenstern
contato@fernandomarcelo.com

Re: [fw-mvc] Best practices to organize Models/Controllers

You are already on a good way there. You return a Db Select though,
why not just the data? Also your case specifies (as far as I
understand) a single person you want returned, so you really just want
a single entry, or a failure handling (null return is popular for
that).

Then you create two functions where one would do (you duplicate code).
class Model_Subscriber {

public function getSubscriber($email, $active = false) {
// your logic to make the query here
// query the db
// get the result
// if something is wrong, return null, otherwise return the values
}

}


Now this is just written from the top of my head. There is more to
this, like a gateway class you could also use, and tons of varying
preferences on how to handle models. You can find tons of blog posts
about this and application layers everywhere on the net (not only
about PHP).

Good luck :)

On Thu, Dec 23, 2010 at 2:29 PM, Fernando Morgenstern
<contato@fernandomarcelo.com> wrote:
> Hello,
>
> I am looking for some input about best practices in models/controllers.
>
> The application is still pretty simple, but i would like to make it right from the beginning. I have two actions:
>
> 1) I have to select a specified subscriber that is active ( active = 1 in database )
> 2) I have to select a specified subscriber, it does not matter if active or not.
>
> My initial approach was this in controller:
>
> $model = new Model_Subscriber();
> $model->fetchAll(array(
>     'email = ?' => $email,
>     'active = 1'
> ));
>
> I soon realized that this is bad since i am writing SQL and business logic in controller. So i created two functions in model:
>
> 1) getActiveSubscriberQuery($email)
> 2) getSubscriberQuery($email)
>
> Both return a Zend_Db_Select, which i can use in fetchAll().
>
> My question: Is this the best way to do things? I mean, yhe application might get complex and i am worried about having lots and lots of functions for each type of query in model.
>
> Regards,
>
> Fernando Morgenstern
> contato@fernandomarcelo.com
>
>
>
>

[fw-mvc] Best practices to organize Models/Controllers

Hello,

I am looking for some input about best practices in models/controllers.

The application is still pretty simple, but i would like to make it right from the beginning. I have two actions:

1) I have to select a specified subscriber that is active ( active = 1 in database )
2) I have to select a specified subscriber, it does not matter if active or not.

My initial approach was this in controller:

$model = new Model_Subscriber();
$model->fetchAll(array(
'email = ?' => $email,
'active = 1'
));

I soon realized that this is bad since i am writing SQL and business logic in controller. So i created two functions in model:

1) getActiveSubscriberQuery($email)
2) getSubscriberQuery($email)

Both return a Zend_Db_Select, which i can use in fetchAll().

My question: Is this the best way to do things? I mean, yhe application might get complex and i am worried about having lots and lots of functions for each type of query in model.

Regards,

Fernando Morgenstern
contato@fernandomarcelo.com

2010年12月22日星期三

Re: [fw-mvc] View Scripts

-- Thomas List <thomaslist@hotmail.com> wrote
(on Tuesday, 21 December 2010, 04:58 PM -0500):
> I am creating a controller, Mainewap, in Zend and it is creating the
> view script directory and index as it should. However, in another
> controller, I am getting the state, Maine, and trying to append 'wap'
> to the end of the name, to handle information specific to low income
> programs. However, when I append "wap" to the end of the state name,
> Zend decides to split it up randomly with a dash, so it may come out
> as main-ewap, and won't find the directory. Is there any way to
> ensure that when I create the state's second view script of
> information, it doesn't put a random dash in the name?

How exactly are you appending? And what exactly are you appending?

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

[fw-mvc] Zend Navigation Page Resource, ACL and MCV

In order to *show to a role ONLY ALLOWED PAGES* I need to build ACL first
So first I search for user role and role parents and add all roles found to
ACL

$roles = $aclModel->getUserRoles();

Then I search the model for all roles active Rules

$rules = $aclModel->getRolesRules($roles);

And add every rule to the ACL.
How can I tell the Page that a Controller ineriths from is Module?
Assuming I've

$resource = 'admin/users';

$rules = array(

[0] => array(5) {
["id"] => string(2) "0"
["resource_id"] => string(4) "NULL"
["role_id"] => string(5) "guest"
["privilege"] => string(4) "NULL"
["allowed"] => string(1) "0"
},

[1] => array(5) {
["id"] => string(2) "1"
["resource_id"] => string(4) "admin/users"
["role_id"] => string(5) "editor"
["privilege"] => string(4) "NULL"
["allowed"] => string(1) "1"
}

);

The first rule deny access to all resources,
The second rule allow for admin/users
But in my pages I've:

array(
'label' => 'Admin',
'module' => 'admin',
'resource' => 'admin',
'pages' => array(
array(
'label' => 'Users',
'module' => 'admin',
'controller' => 'users',
'resource' => 'admin/users'
)
)
);

So Admin Pages never shows to Editors

2010年12月21日星期二

[fw-mvc] View Scripts

Hello,

I am creating a controller, Mainewap, in Zend and it is creating the view script directory and index as it should. However, in another controller, I am getting the state, Maine, and trying to append 'wap' to the end of the name, to handle information specific to low income programs. However, when I append "wap" to the end of the state name, Zend decides to split it up randomly with a dash, so it may come out as main-ewap, and won't find the directory. Is there any way to ensure that when I create the state's second view script of information, it doesn't put a random dash in the name?

I'm not sure if I explained the problem well enough, but i basically want to create the name of an existing controller in another file, and redirect to the properly named view script directory associated with the controller. No random dashes. Is this possible?

Regards,
Thomas

Re: [fw-db] PDO_MYSQL Alternative connection on failure

Hello Ron,
I would place database servers access information in the config file then I would call the config from bootstrap or plugin (Zend_Controller_Plugin_Abstract) class. Then you check whether the primary database server is up. If the primary is down you can set to use alternative database server. ;-)

As a reference, take a look at:

http://jaybill.com/2007/09/12/using-the-zend-framework-with-multiple-databases/
http://ingol.nl/blog/2010/08/23/adding-multiple-databases-to-the-application-ini-in-zend-framework/


---
Wishing luck,
Enkhbilguun Erdenetsogt
   
On 10.12.21 23:25, goosta wrote:
 Hi,  I am using PDO_MYSQL to connect to our MySQL server. We are looking at setting up a MySQL cluster and I'm trying to figure out if I can have an alternate server specified if connection to the first server fails. So if a connection to the first server cannot be made, it would move on and try the second server.  If anyone can point me in the right direction, I'd really appreciate it.  Thanks, Ron 

[fw-db] PDO_MYSQL Alternative connection on failure

Hi,

I am using PDO_MYSQL to connect to our MySQL server. We are looking at
setting up a MySQL cluster and I'm trying to figure out if I can have an
alternate server specified if connection to the first server fails. So if a
connection to the first server cannot be made, it would move on and try the
second server.

If anyone can point me in the right direction, I'd really appreciate it.

Thanks,
Ron
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/PDO-MYSQL-Alternative-connection-on-failure-tp3154921p3154921.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-mvc] Translated segments

Hello!

I have made one project with URL -translation and I have to agree that
it was quite difficult to find information.

I´m by no means an expert in the matter.

In my project i have a _initLanguage bootstrap function, which resets
the default routes. This project has no modules btw.

Code:

$ctrl = $this->getResource("FrontController");

$router = $ctrl->getRouter();
$router->setGlobalParam("lang", "en");


$route = new Zend_Controller_Router_Route(
':lang/:@controller/:@action/*',
array(
'lang' => ":lang",
'controller' => 'index',
'action' => 'index'
)
);

$router->addRoute("default", $route);

Code end.

So i override the default route with my new route that has translation.
This sets up the needed route.

In addition i have a front controller plugin that loads the actual
translated texts in its routeStartUp() method.

Code:

$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();

$router->setGlobalParam("lang", $activeLang);


if($urlLangExists){
$urlTranslate = new Zend_Translate(
"array",
APPLICATION_PATH."/languages/url_". $activeLang
.".php", $activeLang
);

foreach($langs as $lang){
$lang = trim($lang);

$urlTranslate->addTranslation(APPLICATION_PATH."/languages/url_$lang.php",
"$lang");
}
}
else{
$urlTranslate = new Zend_Translate(
"array",
array(), $activeLang);
}

$urlTranslate->setLocale($activeLang);


Zend_Controller_Router_Route::setDefaultTranslator($urlTranslate);

Code end.

So the actual translations are held in arrays that the Zend_Translate
handles loads.

As I said earlier i have no module part in the URL, but i presume you
can handle it similarly to the :lang my version uses to change the
language of the site and URL.

Hope this helps!

Regards,
Kaj Ström

21.12.2010 9:16, Саша Стаменковић kirjoitti:
> Looks like nobody knows the answer :(
>
> Regards,
> Saša Stamenković
>
>
> On Sun, Dec 19, 2010 at 1:05 AM, Саша Стаменковић<umpirsky@gmail.com>wrote:
>
>> Never managed to do this, waiting for the answer.
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Sat, Dec 18, 2010 at 8:36 PM, Fernando Morgenstern<
>> contato@fernandomarcelo.com> wrote:
>>
>>> Hello,
>>>
>>> I am trying to get my urls translated but unfortunately the examples at
>>> the manual are not working to me.
>>>
>>> I was wondering if anyone here knows how to translate all urls, except the
>>> module part? Adding routes for each controller is not an option to me,
>>> because of the high number of routes.
>>>
>>> From what i understood, i have to remove the default route and add a new
>>> one, with translation support ( @ ), is that correct?
>>>
>>> Please, if you have any examples that works, could you point out an url
>>> where i can check?
>>>
>>> Regards,
>>>
>>> Fernando Morgenstern
>>> contato@fernandomarcelo.com

Re: [fw-mvc] Translated segments

Yes, another example of a ZF feature that people don't use because the documentation is bad :)

Well, as i did so many times with ZF, will have to dig into the code and try to find how it works.

I will post here if i find anything about it.

Regards,

Fernando Morgenstern
contato@fernandomarcelo.com

Em 21/12/2010, às 05:16, Саша Стаменковић escreveu:

> Looks like nobody knows the answer :(
>
> Regards,
> Saša Stamenković
>
>
> On Sun, Dec 19, 2010 at 1:05 AM, Саша Стаменковић <umpirsky@gmail.com> wrote:
> Never managed to do this, waiting for the answer.
>
> Regards,
> Saša Stamenković
>
>
>
> On Sat, Dec 18, 2010 at 8:36 PM, Fernando Morgenstern <contato@fernandomarcelo.com> wrote:
> Hello,
>
> I am trying to get my urls translated but unfortunately the examples at the manual are not working to me.
>
> I was wondering if anyone here knows how to translate all urls, except the module part? Adding routes for each controller is not an option to me, because of the high number of routes.
>
> From what i understood, i have to remove the default route and add a new one, with translation support ( @ ), is that correct?
>
> Please, if you have any examples that works, could you point out an url where i can check?
>
> Regards,
>
> Fernando Morgenstern
> contato@fernandomarcelo.com
>
>
>
>
>

2010年12月20日星期一

Re: [fw-mvc] Translated segments

Looks like nobody knows the answer :(

Regards,
Saša Stamenković


On Sun, Dec 19, 2010 at 1:05 AM, Саша Стаменковић <umpirsky@gmail.com>wrote:

> Never managed to do this, waiting for the answer.
>
> Regards,
> Saša Stamenković
>
>
>
> On Sat, Dec 18, 2010 at 8:36 PM, Fernando Morgenstern <
> contato@fernandomarcelo.com> wrote:
>
>> Hello,
>>
>> I am trying to get my urls translated but unfortunately the examples at
>> the manual are not working to me.
>>
>> I was wondering if anyone here knows how to translate all urls, except the
>> module part? Adding routes for each controller is not an option to me,
>> because of the high number of routes.
>>
>> From what i understood, i have to remove the default route and add a new
>> one, with translation support ( @ ), is that correct?
>>
>> Please, if you have any examples that works, could you point out an url
>> where i can check?
>>
>> Regards,
>>
>> Fernando Morgenstern
>> contato@fernandomarcelo.com
>>
>>
>>
>>
>

2010年12月19日星期日

Re: [fw-mvc] RE : [fw-mvc] Multiple layouts

On Sunday 19 Dec 2010 17:01:44 ROZE Samuel wrote:
> That's for include a view in another, but it's not what I want.
>
> See: I've a module named "User" with a layout. Then I have a controller
> "Index" that just print informations about the user. Now, I want to have a
> controller "Account" with some views but also with common html parts. I
> can use a specific layout for the Account controller BUT I'll have the
> header and the footer in the both layouts: if I want to change one, I'll
> have to change it into the both, that isn't really good...
>
> So, is it possible to have two layouts:
> - The first principal layout ("layout1.phml")
> - Then, at the place of the view in "layout1.phtml" the layout
> "layout2.phtml" - At the place of the view in "layout2", the view.
>
> Regards,
> Samuel.

By default the layout is a layout.phtml. Use in this layout the partial view
helper to call a header.phtml and footer.phtml view script.

Then for the account controller you can assign the account.phtml layout inside
your view by using this in your account view script:

$this->layout()->setLayout('account');
(more info: [1])

Then your account.phtml is used as layout script and you can include again the
header.phtml and footer.phtml to have consistency in those segments.

Regards, Jurian

[1]http://framework.zend.com/manual/en/zend.layout.quickstart.html#zend.layout.quickstart.mvc
--
Jurian Sluiman
Soflomo - http://soflomo.com

[fw-mvc] RE : [fw-mvc] Multiple layouts

That's for include a view in another, but it's not what I want.

See: I've a module named "User" with a layout. Then I have a controller "Index" that just print informations about the user.
Now, I want to have a controller "Account" with some views but also with common html parts. I can use a specific layout for the Account controller BUT I'll have the header and the footer in the both layouts: if I want to change one, I'll have to change it into the both, that isn't really good...

So, is it possible to have two layouts:
- The first principal layout ("layout1.phml")
- Then, at the place of the view in "layout1.phtml" the layout "layout2.phtml"
- At the place of the view in "layout2", the view.

Regards,
Samuel.
________________________________________
De : Marek Jarosz [marjarosz@gmail.com]
Date d'envoi : dimanche 19 décembre 2010 16:04
À : ROZE Samuel
Objet : Re: [fw-mvc] Multiple layouts

W dniu 2010-12-19 14:50, ROZE Samuel pisze:

Hello,

I'm using Zend Framework 1.11 and I've a little question.

I have a layout named "layout.phtml" that contains my header/footer and head-menu. The view is included into.
It's perfect but now I've an "Account" controller that requires another layout (vertical menu, ...).

Is it possible to include an other layout at the place of the view in the first layout and then include the view in the 2nd layout? Or have I to create an other layout with header/footer and the account menu?

Thanks in advance!
Regards,
Samuel ROZE.

<?php echo<http://www.php.net/echo> $this->partial('partial.phtml', array<http://www.php.net/array>('params'=>'params')); ?>

[fw-mvc] Multiple layouts

Hello,

I'm using Zend Framework 1.11 and I've a little question.

I have a layout named "layout.phtml" that contains my header/footer and head-menu. The view is included into.
It's perfect but now I've an "Account" controller that requires another layout (vertical menu, ...).

Is it possible to include an other layout at the place of the view in the first layout and then include the view in the 2nd layout? Or have I to create an other layout with header/footer and the account menu?

Thanks in advance!
Regards,
Samuel ROZE.

2010年12月18日星期六

Re: [fw-mvc] Translated segments

Never managed to do this, waiting for the answer.

Regards,
Saša Stamenković


On Sat, Dec 18, 2010 at 8:36 PM, Fernando Morgenstern <
contato@fernandomarcelo.com> wrote:

> Hello,
>
> I am trying to get my urls translated but unfortunately the examples at the
> manual are not working to me.
>
> I was wondering if anyone here knows how to translate all urls, except the
> module part? Adding routes for each controller is not an option to me,
> because of the high number of routes.
>
> From what i understood, i have to remove the default route and add a new
> one, with translation support ( @ ), is that correct?
>
> Please, if you have any examples that works, could you point out an url
> where i can check?
>
> Regards,
>
> Fernando Morgenstern
> contato@fernandomarcelo.com
>
>
>
>

[fw-mvc] Translated segments

Hello,

I am trying to get my urls translated but unfortunately the examples at the manual are not working to me.

I was wondering if anyone here knows how to translate all urls, except the module part? Adding routes for each controller is not an option to me, because of the high number of routes.

From what i understood, i have to remove the default route and add a new one, with translation support ( @ ), is that correct?

Please, if you have any examples that works, could you point out an url where i can check?

Regards,

Fernando Morgenstern
contato@fernandomarcelo.com

2010年12月17日星期五

Re: [fw-mvc] problem in Zend_Auth_HTTP

It looks like you're authenticating, but not storing the results of that
authentication anywhere. I'm not sure if the HTTP authentication is any
different from the others, but I believe you need to use Zend_Auth's
authenticate method instead of calling it on the adapter directly:

$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('somenamespace'));
$result = $auth->authenticate($adapter);

Internally, Zend_Auth will call the authenticate() method on your adapter,
and if successful store the results in the storage adapter. This will allow
you to check for authentication on the next request without having to set up
your HTTP adapter all over again:

// next request
$auth = Zend_Auth::getInstance();
$auth->setStorage(new Zend_Auth_Storage_Session('somenamespace'));
if ($auth->hasIdentity()) {
// logged in
$identity = $auth->getIdentity();
} else {
// not logged in
}

I hope this helps.

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com

On Thu, Dec 16, 2010 at 11:45 PM, sina miandashti <miandashti@gmail.com>wrote:

> hey alll :)
>
> i want to use this on my AdminController.php
> so in public init() i wrote this :
>
> $config = array(
> 'accept_schemes' => 'basic digest',
> 'realm' => 'My Web Site',
> 'digest_domains' => '/members_only /my_account',
> 'nonce_timeout' => 3600,
> );
> $adapter = new Zend_Auth_Adapter_Http($config);
>
> $basicResolver = new Zend_Auth_Adapter_Http_Resolver_File();
>
> $basicResolver->setFile(APPLICATION_PATH.'\basicPasswd.txt');
>
>
> $adapter->setBasicResolver($basicResolver);
>
>
>
> $adapter->setRequest($this->_request);
>
> $adapter->setResponse($this->_response);
>
> $result = $adapter->authenticate();
>
> if (!$result->isValid()) {
> throw new Zend_Exception("You Dont have access to admin area");
> } else {
> die('u have access');
> }
>
>
>
> *and in my password file :
> admin:827ccb0eea8a706c4c34a16891f84e7b
>
> *the above pass is md5 of '12345'
>
>
>
> the problem is it request for password again and again also when u type
> the correct user password.
> :(
>
> i think it cannot match the userpass from password file
> how to fix it?
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin
>

[fw-mvc] Re: Redirector helper bypasses postDispatch?

Found the solution and posted about it: http://bit.ly/gvL3Pl

-----
Kyle Spraggs
www.blitzaroo.com
blogs @ www.spiffyjr.me
follow me @ www.twitter.com/kspraggs
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Redirector-helper-bypasses-postDispatch-tp3092123p3092606.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年12月16日星期四

[fw-mvc] problem in Zend_Auth_HTTP

hey alll :)

i want to use this on my AdminController.php
so in public init() i wrote this :

$config = array(
'accept_schemes' => 'basic digest',
'realm' => 'My Web Site',
'digest_domains' => '/members_only /my_account',
'nonce_timeout' => 3600,
);
$adapter = new Zend_Auth_Adapter_Http($config);

$basicResolver = new Zend_Auth_Adapter_Http_Resolver_File();

$basicResolver->setFile(APPLICATION_PATH.'\basicPasswd.txt');


$adapter->setBasicResolver($basicResolver);

$adapter->setRequest($this->_request);

$adapter->setResponse($this->_response);

$result = $adapter->authenticate();

if (!$result->isValid()) {
throw new Zend_Exception("You Dont have access to admin area");
} else {
die('u have access');
}

*and in my password file :
admin:827ccb0eea8a706c4c34a16891f84e7b

*the above pass is md5 of '12345'

the problem is it request for password again and again also when u type
the correct user password.
:(

i think it cannot match the userpass from password file
how to fix it?

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin

[fw-mvc] Re: Table query error: the pk exists but query errors...

UPDATE: very sorry! I WAS using the wrong database! Eeesh, I need to
look more carefully next time. Apologies to anyone who looked at this
for me!

--regards,
nathan

On Thu, Dec 16, 2010 at 12:33 PM, Nathan Garlington <garlinto@gmail.com> wrote:
> I was wondering if any of you have encountered an error similar to the
> one I have been experiencing. I am using ZF-1.11.1 and the pdo_pgsql
> driver to connect to a postgresql-9.0.1 database.
> The error:
>
> "Primary key column(s) (author_id) are not columns in this table ()"
>
> I have checked to make sure that I am on the right database. The table
> is the 'authors' table and looks like this:
>
> CREATE TABLE authors (
>    author_id integer NOT NULL,
>    display_name text NOT NULL,
>    name text NOT NULL
> );
>
> CREATE SEQUENCE authors_author_id_seq
>    START WITH 1
>    INCREMENT BY 1
>    NO MINVALUE
>    NO MAXVALUE
>    CACHE 1;
>
> ALTER TABLE ONLY authors
>    ADD CONSTRAINT authors_pkey PRIMARY KEY (author_id);
>
> The permissions have been setup correctly. I don't understand why the
> $this->_table->fetchAll(); errors out on this. I can manually run the
> SQL from the command line against the table successfully:
>
>     'select authors.* from public.authors;'
>
> And no problems, lists all 4 tuples from the table. Is there something
> wrong with the way I am trying to run the "fetchAll" method? I have
> this same problem on a categories table as well. Very confounding.
>
> --regards,
> nathan
>

[fw-mvc] Table query error: the pk exists but query errors...

I was wondering if any of you have encountered an error similar to the
one I have been experiencing. I am using ZF-1.11.1 and the pdo_pgsql
driver to connect to a postgresql-9.0.1 database.
The error:

"Primary key column(s) (author_id) are not columns in this table ()"

I have checked to make sure that I am on the right database. The table
is the 'authors' table and looks like this:

CREATE TABLE authors (
author_id integer NOT NULL,
display_name text NOT NULL,
name text NOT NULL
);

CREATE SEQUENCE authors_author_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER TABLE ONLY authors
ADD CONSTRAINT authors_pkey PRIMARY KEY (author_id);

The permissions have been setup correctly. I don't understand why the
$this->_table->fetchAll(); errors out on this. I can manually run the
SQL from the command line against the table successfully:

'select authors.* from public.authors;'

And no problems, lists all 4 tuples from the table. Is there something
wrong with the way I am trying to run the "fetchAll" method? I have
this same problem on a categories table as well. Very confounding.

--regards,
nathan

[fw-gdata] Re: Zend_GData_Docs support of pdf content-type

Hi Ryan,
Thanks for your reply.
For fix it, first i've added the line 'PDF' => 'application/pdf' to the
static property $SUPPORTED_FILETYPES.
But, the pdf file format could be upload only with the gdata Version 3.0.
That's why I asked for an official solution, and not a patch made by myself
:D

I've found a rebuild of the Zend_GData_Docs on the net, which implements the
protocol version to use when calling google document api.
That's why I was surprise that the last version of GData didn't implement
it.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-GData-Docs-support-of-pdf-content-type-tp3090977p3091262.html
Sent from the Zend gdata mailing list archive at Nabble.com.

Re: [fw-gdata] Zend_GData_Docs support of pdf content-type

Hi Benoit,

I'm not aware of any development going on in this area. You're welcome to
contribute via:
http://framework.zend.com/community/contribute

I believe you should be able to use Zend_Gdata_Docs::uploadFile, passing the
appropriate mime type and URL to upload to, though I haven't tried so
myself.

Cheers,
-Ryan

On Thu, Dec 16, 2010 at 6:34 AM, benoit <benoit.delporte@gmail.com> wrote:

>
> Hi all,
>
> I download the latest version of gdata, and the pdf content type is not
> support to upload. But, on the google documentation, the type is supported
> (and other that gdata doesn't support).
>
> So i found a Zend_Gdata_Docs that implement it, but i would like to know
> when it will be implemented in the official release.
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Zend-GData-Docs-support-of-pdf-content-type-tp3090977p3090977.html
> Sent from the Zend gdata mailing list archive at Nabble.com.
>