[fw-general] Re: [zf-contributors] ZF2 EventManager now in ZF1 trunk

2012-03-21 Thread Pádraic Brady
On Tue, Mar 20, 2012 at 2:29 PM, Greg  wrote:
> On Tue, Mar 20, 2012 at 8:48 AM, Matthew Weier O'Phinney
>  wrote:
>> I've fielded a large number of requests
>> from ZF1 users who would like the functionality for their ZF1
>> applications -- no more, no less.
>
> I appreciate that, but I'm still concerned that significant changes to
> the Event system will cause disruptions to the ZF1 implementation. The
> late pull request for the SharedEventManager could be one such
> example.
>
> Anyhow I realize its also about choice.

There's probably no harm in clarifying this issue up front. If ZF2
discovers a need to change the implementation of EventManager, will
such changes be allowed even where they would not be backwards
compatible with ZF1's parallel implementation? I would have thought
the answer to be an emphatic yes since ZF2 is not bound to preserving
BC with ZF1.

Paddy


-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Backporting ZF1 eventmanager - question about compat

2012-03-15 Thread Pádraic Brady
I'll go with door number 2 - if we're going to backport it we should
try to support PHP 5.2 even if there is a performance cost. It can
easily be documented that using 5.3 will offer far better performance.

Paddy

On Thu, Mar 15, 2012 at 9:22 PM, Wil Moore III  wrote:
>>  * Or do I create a userland implementation of SplPriorityQueue in PHP
>>   5.2, and consume this if 5.3 is unavailable? (note: introduces new
>>   code, and will also be less performant)
>
>
> +1 -- rationale is that if you are on 5.2, you are likely familiar with the
> notion that there are performance benefits to 5.3 / 5.4. Those
> unwilling/unable to upgrade know the drill but at least they are being
> supplied with a useable implementation.
>



-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll

2012-02-02 Thread Pádraic Brady
> Suffixing there and prefixing here doesn't improve readability whatsoever.

There's no need to be absolutist - several people have already stated
it improves readability for them.

Paddy

On Thu, Feb 2, 2012 at 8:51 PM, Andreas Möller  wrote:
>> I'd argue that's unreadable. :)
>>
>> I understand the consistency argument, but I also am a proponent of
>> natural language constructs in programming, as I feel they make code
>> easier to read and understand. I'm okay with a little inconsistency if
>> it enables readability.
>
> But does it?
>
>
> You may have a long list of files in a directory where at the
> beginning you could have
>
> AbstractZonk.php
>
> and after a number of files
>
> ZonkInterface.php
> ZonkTrait.php
>
> Also, think about auto-completion in IDEs.
>
> Suffixing there and prefixing here doesn't improve readability whatsoever.
>
>
> Andreas
>
> --
> List: zf-contribut...@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: zf-contributors-unsubscr...@lists.zend.com
>
>



-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll

2012-02-02 Thread Pádraic Brady
Perhaps for you, for me it looks and sounds awkward ;).

2012/2/2 Tomáš Fejfar :
> Well in this case:
>
> I could have an
> AHtmlSanitiser implementing IFilter making use of
> several THtmlMarkups.
>
> Works for me fine :D
>
> On Thu, Feb 2, 2012 at 7:02 PM, Matthew Weier O'Phinney 
> wrote:
>
>> -- Pádraic Brady  wrote
>> (on Thursday, 02 February 2012, 05:49 PM +):
>> > I really don't follow the grouping argument - not all Abstracts,
>> > Interfaces and Traits would share the same Noun. I could have an
>> > AbstractHtmlSanitiser implementing a FilterInterface making use of
>> > several HtmlMarkupTraits. Actually that whole last sentence just shows
>> > why English ordered terminology works. If you want to enforce
>> > grouping, you'll also need to enforce the Nouns that follow the
>> > suffixes to be suitably similar and alphabetical.
>>
>> That's an argument I've been meaning to make as well -- thanks for
>> verbalizing it so well, Paddy.
>>
>>
>> > On Thu, Feb 2, 2012 at 3:28 PM, Andreas Möller  wrote:
>> > >>> Using suffixes also takes into account the naming style in ZF1 with
>> PHP < 5.3:
>> > >>>
>> > >>> Foo_Bar_Baz_Abstract
>> > >>> Foo_Bar_Baz_Interface
>> > >>
>> > >> I think this is a red herring. The above doesn't map the same at all,
>> as
>> > >> in ZF1 we were able to group them in a directory together:
>> > >>
>> > >>    Foo/
>> > >>        Bar/
>> > >>            Baz/
>> > >>                Abstract.php
>> > >>                Interface.php
>> > >>
>> > >> We can't do likewise in ZF2 as we can't have classes/interfaces named
>> > >> "Abstract" or "Interface" -- and hence the need for new naming
>> > >> conventions.
>> > >
>> > > Indeed, but why should we do it totally different?
>> > >
>> > > The argument with the grouping holds, as suffixing class names would
>> > > allow for grouping, too.
>> > >
>> > > This argument weighs in a lot more than the grammatical argument.
>> > >
>> > > And again, it's consistent. You commented on the RFC likewise.
>> > >
>> > >
>> > >>
>> > >
>> > > Andreas
>> > >
>> >
>> >
>> > --
>> > Pádraic Brady
>> >
>> > http://blog.astrumfutura.com
>> > http://www.survivethedeepend.com
>> > Zend Framework Community Review Team
>> >
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead            | matt...@zend.com
>> Zend Framework          | http://framework.zend.com/
>> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>>
>> --
>> List: zf-contribut...@lists.zend.com
>> Info: http://framework.zend.com/archives
>> Unsubscribe: zf-contributors-unsubscr...@lists.zend.com
>>
>>
>>



-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll

2012-02-02 Thread Pádraic Brady
Hmm, or rather the Nouns that precede the suffixes :P. Sorry, brain is
still asleep today.

On Thu, Feb 2, 2012 at 5:49 PM, Pádraic Brady  wrote:
> I really don't follow the grouping argument - not all Abstracts,
> Interfaces and Traits would share the same Noun. I could have an
> AbstractHtmlSanitiser implementing a FilterInterface making use of
> several HtmlMarkupTraits. Actually that whole last sentence just shows
> why English ordered terminology works. If you want to enforce
> grouping, you'll also need to enforce the Nouns that follow the
> suffixes to be suitably similar and alphabetical.
>
> Paddy
>
> On Thu, Feb 2, 2012 at 3:28 PM, Andreas Möller  wrote:
>>>> Using suffixes also takes into account the naming style in ZF1 with PHP < 
>>>> 5.3:
>>>>
>>>> Foo_Bar_Baz_Abstract
>>>> Foo_Bar_Baz_Interface
>>>
>>> I think this is a red herring. The above doesn't map the same at all, as
>>> in ZF1 we were able to group them in a directory together:
>>>
>>>    Foo/
>>>        Bar/
>>>            Baz/
>>>                Abstract.php
>>>                Interface.php
>>>
>>> We can't do likewise in ZF2 as we can't have classes/interfaces named
>>> "Abstract" or "Interface" -- and hence the need for new naming
>>> conventions.
>>
>> Indeed, but why should we do it totally different?
>>
>> The argument with the grouping holds, as suffixing class names would
>> allow for grouping, too.
>>
>> This argument weighs in a lot more than the grammatical argument.
>>
>> And again, it's consistent. You commented on the RFC likewise.
>>
>>
>>>
>>
>> Andreas
>>
>
>
> --
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> Zend Framework Community Review Team



-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll

2012-02-02 Thread Pádraic Brady
I really don't follow the grouping argument - not all Abstracts,
Interfaces and Traits would share the same Noun. I could have an
AbstractHtmlSanitiser implementing a FilterInterface making use of
several HtmlMarkupTraits. Actually that whole last sentence just shows
why English ordered terminology works. If you want to enforce
grouping, you'll also need to enforce the Nouns that follow the
suffixes to be suitably similar and alphabetical.

Paddy

On Thu, Feb 2, 2012 at 3:28 PM, Andreas Möller  wrote:
>>> Using suffixes also takes into account the naming style in ZF1 with PHP < 
>>> 5.3:
>>>
>>> Foo_Bar_Baz_Abstract
>>> Foo_Bar_Baz_Interface
>>
>> I think this is a red herring. The above doesn't map the same at all, as
>> in ZF1 we were able to group them in a directory together:
>>
>>    Foo/
>>        Bar/
>>            Baz/
>>                Abstract.php
>>                Interface.php
>>
>> We can't do likewise in ZF2 as we can't have classes/interfaces named
>> "Abstract" or "Interface" -- and hence the need for new naming
>> conventions.
>
> Indeed, but why should we do it totally different?
>
> The argument with the grouping holds, as suffixing class names would
> allow for grouping, too.
>
> This argument weighs in a lot more than the grammatical argument.
>
> And again, it's consistent. You commented on the RFC likewise.
>
>
>>
>
> Andreas
>


-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll

2012-02-02 Thread Pádraic Brady
Hi Sascha,

The problem with Countable/Serializable and others is that you need an
obvious verb to append "able" to. Unfortunately, English is not the
most consistent of languages.

Here's a simple example - what would you call the interface shared by
a collection of Filters? You could try Filterable but actually, the
item that's filterable, is the input of a Filter and not the Filter
itself.

The result is a mix of interface naming standards. Some will be
verb+"able", some will be nouns "interface Filter" etc. Throw in
Abstracts and Traits - telling one type from another will be very hard
and you'll need a postgraduate degree in grammer analysis to even
figure out what to call things too often ;).

Paddy

On Thu, Feb 2, 2012 at 11:06 AM, Sascha-Oliver Prolic
 wrote:
> I would like to keep interface names like serializable, countable,
> etc. Is this proposal also about getting rid of them?
>
> Regards
>
> Sascha-Oliver Prolic
>
> --
> List: zf-contribut...@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: zf-contributors-unsubscr...@lists.zend.com
>
>



-- 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Lazy Loading Resources

2010-10-15 Thread Pádraic Brady
The Manager's primary advantage is to hold multiple configurations on tap in an 
easily accessible way. It's a middle road of sorts since caches are heavily 
context based.

It's easily adapted to lazy loading but then are we not entering DI territory 
anyway?

Paddy

Sent from my iPhone

On 15 Oct 2010, at 15:26, Jurian Sluiman  wrote:

> On Friday 15 Oct 2010 12:45:12 Matthew Weier O'Phinney wrote:
>> The design of Zend_Application was to initialize resources needed on
>> each request, plain and simple.
>> 
>> What you describe is more of a Service Container and/or DI Container.
>> You can actually use these _with_ Zend_Application to augment it -- a
>> number of folks have injected the Symfony DI Container into
>> Zend_Application in order to achieve similar results:
> 
> This is not completely true in the case of Zend_Cache_Manager. The manger is 
> accompanied by Zend_Application_Resource_Cachemanger and the behaviour could 
> also be copied to other resources.
> 
> Although the first advantage of the cache manager is not the lazy loading, it 
> is mentioned in the proposal as "second advantage". This principle could be 
> used for other resources like database and logs.
> 
> Regards, Jurian
> -- 
> Jurian Sluiman
> CTO Soflomo V.O.F.
> http://soflomo.com


[fw-general] Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

2010-08-13 Thread Pádraic Brady
Presumably the poll was held was to gauge support among framework users and not 
just members of the contributor mailing list. That the poll is blocked in your 
country may be either the poll host or the URL shortener service. Doubt it was 
intentional! ;)

Paddy

On 13 Aug 2010, at 16:11, "D. J."  wrote:

I only for myself:
I was the first one replying your email of "General inclinations
regarding prefixing non-public members?" with "No underscore".
But I did not participate your poll for I really don't understand your
intention of creating a poll after you had that email and so many
people already responded.


On Fri, Aug 13, 2010 at 8:45 PM, Matthew Weier O'Phinney
 wrote:

-- Саша Стаменковић  wrote
(on Friday, 13 August 2010, 10:14 AM +0200):
Can you tell us current score? :)

There are currently 381 responses:

 * 57% vote "Yes" (to remove the underscores)
 * 38% vote "No" (to retain underscores)
 * 4%  vote "No opinion"

What has been interesting is that the percentages have remained
consistent from the outset -- I expected more deviation. What is also
interesting is that there is no real clear majority. Typically, I like
to see a 2/3 vote to feel comfortable that the change is widely
accepted, but that is not the case at this time.


On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney 
wrote:

ZF Coding Standards are based on PEAR's CS. That standard was developed
first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
had no concept of visibility in its object model; to provide some
pseudo-visibility, PEAR CS mandated that members considered non-public
should be prefixed with an underscore.

With the advent of PHP 5, PHP's object model received visibility
operators in the form of private, protected, and public. Applying PEAR
CS to PHP 5 code meant that if you marked a member as private or
protected, you would also prefix with the underscore. Many have felt
this is redundant, and also that it makes refactoring more difficult
(changes in visibility often mean renaming the members). Proponents of
the standard, however, argue that the leading underscore leads to easier
maintenance of the code -- you know immediately what the visibility of
the member you're dealing with is just by looking at it.

PEAR2 has decided to eschew the underscore prefix:

   http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
Underscore_prefix_on_private_.28protected.3F.29

Basically, this rule is no longer required (as it was in PEAR1), though
developers may choose to use them.

What is YOUR opinion? Should the underscore be dropped in ZF2?
Please vote!

   http://is.gd/eeA6f

Please do _not_ reply to this thread -- the arguments for and against
are well known at this time -- we're simply trying to decide on whether
or not to amend the coding standards for ZF2.

Thanks!

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



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



--
Dev Lead for Xoops Engine
Internet Application R&D @PerfectWorld



Re: [fw-general] Zend_Filter_StripTags question

2010-06-30 Thread Pádraic Brady
GET parameters and POST parameters should be treated the same. Becomes 
important 
depending on how apps operate. A common example are apps relying on $_REQUEST 
(this can contain GET or POST parameters) which is why it's really poor to use 
generic accessors that are not specific to the request type. So if it's worth 
doing for POST, it's worth doing for GET - no reason to assume either is safer 
than the other.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: debussy007 
To: fw-general@lists.zend.com
Sent: Wed, June 30, 2010 10:15:09 AM
Subject: [fw-general] Zend_Filter_StripTags question


Hi,

I've always used Zend_Filter_StripTags to get the POST values from a form.
I was just wondering if it makes any sense to use it to get params (from the
url).
e.g. $lang = $this->_getParam('lang');
Could someone stick html or php code in a URL ...

Thank you!
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Zend-Filter-StripTags-question-tp2272694p2272694.html

Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Re: Zend_Service_Twitter not working

2010-06-28 Thread Pádraic Brady
Yes, they are ;). Will have that rectified for the next release.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: robert mena 
To: Pádraic Brady ; Justin Hart ; 
Zend Framework General 
Sent: Mon, June 28, 2010 5:01:27 PM
Subject: [fw-general] Re: Zend_Service_Twitter not working

Hi,

Well is seems that the docs are out of sync :)

I'll have a look at the oauth component.

On 6/28/10, Pádraic Brady  wrote:
> Just to clarify the change in 1.10.6, Twitter originally planned to disable
> password access during June. The Zend_Service_Twitter component was
> updated to meet this original deadline. However, Twitter then changed the
> deadline to August (they like torturing us ;)). From August password access
> to
> Twitter will be disabled and all client must use OAuth. The current version
> of
> Zend_Service_Twitter is capable of this but ergo had it's password
> functionality removed.
>
> If you must use password access, please revert to Zend_Service_Twitter as of
> ZF
> 1.10.5.
>
> Paddy
>  Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
>
>
>
>
>
> 
> From: Justin Hart 
> To: Shaun Farrell 
> Cc: Jack Houghton ; robert mena ;
> Zend
> Framework 
> Sent: Mon, June 28, 2010 5:26:40 AM
> Subject: Re: [fw-general] Zend_Service_Twitter not working
>
> This is correct.
>
> I personally had to delay upgrading the Twitter component on Twitgoo until
> later
> because I still have clients logging in with username/password credentials -
> so
> a oauth-only solution was not feasible. This will be forced to change in a
> few
> weeks (http://dev.twitter.com/pages/oauth_faq says Aug16).
>
> You can find my interim twitter oauth extension
> here http://bitbucket.org/onyxraven/zend-contrib/src/tip/zs-Twitter-Oauth/ -
> I'll be moving that to git this week with an updated version, and will link
> back
> there as well..
>
>
> On Sun, Jun 27, 2010 at 8:26 PM, Shaun Farrell  wrote:
>
> Zend_Service_Twitter as of 1.10.6 requires oauth for logging in.
>>
>>
>>
>>Shaun J. Farrell
>>Washington, DC
>>
>>
>>
>>
>>On Sun, Jun 27, 2010 at 10:10 PM, Jack Houghton  wrote:
>>
>>Robert,
>>>
>>>Unfortunately, I may not be of that much help. I ran into the same issue
>>> and
>>>switched to using cURL for my twitter feed (without OAuth). I posted this
>>> to the
>>>list a month back and came away with the realization that
>>> Zend_Service_Twitter
>>>was simply broken and based on cURL working with the user/pass
>>> authorization I
>>>can confirm that OAuth is not yet required.
>>>
>>>Please let me know if you get anywhere with this.
>>>
>>>-Jack-
>>>
>>>
> 
>
>>>From:robert mena [mailto:robert.m...@gmail.com]
>>>Sent: Sunday, June 27, 2010 7:32 PM
>>>To: Zend Framework
>>>Subject: [fw-general] Zend_Service_Twitter not working
>>>
>>>Hi,
>>>
>>>I am trying to use Zend_Service_Twitter (ZF10.6.5 / PHP 5.3.2) but it
>>> always
>>>complains about the credentials even tough I've tested the
>>> username/password. I
>>>found a post somewhere that Twitter will/was no longer accept this and
>>> I'll be
>>>'forced' to use Oauth.
>>>
>>>Is this true?  In that case does anybody have a quickstart?  The manual of
>>>
>>>Zend_Service_Twitter does not cover that and I am unsure of how to add the
>>>
>>>capability for my app to post stuff automatically
>>>No virus found in this incoming message.
>>>Checked by AVG - www.avg.com
>>>Version: 9.0.830 / Virus Database: 271.1.1/2966 - Release Date: 06/27/10
>>>14:35:00
>>
>

-- 
Sent from my mobile device


Re: [fw-general] Zend_Service_Twitter not working

2010-06-28 Thread Pádraic Brady
Just to clarify the change in 1.10.6, Twitter originally planned to disable 
password access during June. The Zend_Service_Twitter component was 
updated to meet this original deadline. However, Twitter then changed the 
deadline to August (they like torturing us ;)). From August password access to 
Twitter will be disabled and all client must use OAuth. The current version of 
Zend_Service_Twitter is capable of this but ergo had it's password 
functionality removed.

If you must use password access, please revert to Zend_Service_Twitter as of ZF 
1.10.5.

Paddy
 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Justin Hart 
To: Shaun Farrell 
Cc: Jack Houghton ; robert mena ; Zend 
Framework 
Sent: Mon, June 28, 2010 5:26:40 AM
Subject: Re: [fw-general] Zend_Service_Twitter not working

This is correct. 

I personally had to delay upgrading the Twitter component on Twitgoo until 
later 
because I still have clients logging in with username/password credentials - so 
a oauth-only solution was not feasible. This will be forced to change in a few 
weeks (http://dev.twitter.com/pages/oauth_faq says Aug16).

You can find my interim twitter oauth extension 
here http://bitbucket.org/onyxraven/zend-contrib/src/tip/zs-Twitter-Oauth/ - 
I'll be moving that to git this week with an updated version, and will link 
back 
there as well..


On Sun, Jun 27, 2010 at 8:26 PM, Shaun Farrell  wrote:

Zend_Service_Twitter as of 1.10.6 requires oauth for logging in.  
>
>
>
>Shaun J. Farrell
>Washington, DC 
>
>
>
>
>On Sun, Jun 27, 2010 at 10:10 PM, Jack Houghton  wrote:
>
>Robert,
>> 
>>Unfortunately, I may not be of that much help. I ran into the same issue and 
>>switched to using cURL for my twitter feed (without OAuth). I posted this to 
>>the 
>>list a month back and came away with the realization that 
>>Zend_Service_Twitter 
>>was simply broken and based on cURL working with the user/pass authorization 
>>I 
>>can confirm that OAuth is not yet required.
>> 
>>Please let me know if you get anywhere with this.
>> 
>>-Jack-
>> 
>>


>>From:robert mena [mailto:robert.m...@gmail.com] 
>>Sent: Sunday, June 27, 2010 7:32 PM
>>To: Zend Framework
>>Subject: [fw-general] Zend_Service_Twitter not working
>> 
>>Hi,
>> 
>>I am trying to use Zend_Service_Twitter (ZF10.6.5 / PHP 5.3.2) but it always 
>>complains about the credentials even tough I've tested the username/password. 
>>I 
>>found a post somewhere that Twitter will/was no longer accept this and I'll 
>>be 
>>'forced' to use Oauth.
>> 
>>Is this true?  In that case does anybody have a quickstart?  The manual of 
>>Zend_Service_Twitter does not cover that and I am unsure of how to add the 
>>capability for my app to post stuff automatically
>>No virus found in this incoming message.
>>Checked by AVG - www.avg.com
>>Version: 9.0.830 / Virus Database: 271.1.1/2966 - Release Date: 06/27/10 
>>14:35:00
>


Re: [fw-general] Zend_Service_Twitter: Cannot update status using Zend_Oauth_Token_Access

2010-06-24 Thread Pádraic Brady
Marcus,

Your problem is that you are only setting an access token. You should also set 
your application's consumerKey, consumerSecret and callbackUrl values so they 
can be passed into the access token object to create a valid signature (the key 
names for the options are identical to those in Zend_Oauth_Consumer).

I just performed a quick smoketest myself to double-check there's nothing else 
causing a problem and it works fine ;). Just bear in mind that the access 
tokens only carry the token data - the rest must be configured in addition and 
is passed to the HTTP Client generated by the access token for signature 
generation.

Best regards,
Paddy

P.S. Will update the documentation in the next day or two showing the workflow 
more clearly.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Justin Hart 
To: Marcus Stöhr 
Cc: fw-general@lists.zend.com
Sent: Thu, June 24, 2010 5:47:47 PM
Subject: Re: [fw-general] Zend_Service_Twitter: Cannot update status using  
Zend_Oauth_Token_Access

if you print_r the whole twitter object, do you see your Oauth_Token_Access in 
the structure?


On Thu, Jun 24, 2010 at 3:58 AM, Marcus Stöhr  
wrote:

Hi there.
>
>>I'm using Zend_Oauth_Consumer to retrieve an access token from Twitter which 
>>is working fine. I instatiate Zend_Service_Twitter using the access token 
>>like this:
>
>>$options = array(
>>'accessToken' => unserialize($userConnection->getAccessToken()),
>>'username'=> $userConnection->getId()
>>);
>
>>$twitter = new Zend_Service_Twitter($options);
>
>>No exceptions are being thrown or such and when I try to update the status, I 
>>get the following response:
>
>>object(Zend_Rest_Client_Result)[131
>>]
>>protected '_sxml' =>
>>object(SimpleXMLElement)[136
>>]
>>public 'request' => string '/1/statuses/update.xml' (length=22)
>>public 'error' => string 'Incorrect signature' (length=19)
>>protected '_errstr' => null
>
>>The isAuthorised()-method gives me true, so I assume everything worked fine.
>
>>Any suggestions were the problems lies?
>
>>- Marcus


Re: [fw-general] Zend_Service_Twitter - Notice: Undefined offset: 0 in \library\Zend\Rest\Client\Result.php on line 232

2010-06-14 Thread Pádraic Brady
Which version are you using? Thanks.

Paddy

Sent from my iPhone

On 15 Jun 2010, at 02:50, "Jack Houghton"  wrote:

I am receiving the following error when trying to authenticate to twitter using 
Zend_Service_Twitter:

 

Notice: Undefined offset: 0 in \library\Zend\Rest\Client\Result.php on line 232

 

I am using the Zend Framework 1.10.

 

The following is the code snippet:

 

try

{

$this->twitter = new Zend_Service_Twitter( 'notbaggage', '' 
);

}

catch(Exception  $e)

{

echo "" . $e . "";

}

 

Any help is appreciated

Jack

 


Re: [fw-general] Zend_Controller_Action_Helper_Cache

2010-05-29 Thread Pádraic Brady
Page and Static caching each have an additional requirement that output 
buffering is disabled in the Controller stack. It interferes with what we're 
trying to do (capture output). I'm clueless as to why the Controller even has 
output buffering (maybe someone could explain?) but it needs to be disabled for 
the static cache to operate properly. The Reference Guide for both the static 
and page caches contains a note explaining which setting to change. It's the 
most common error leading to empty cache files.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: krl 
To: fw-general@lists.zend.com
Sent: Sat, May 29, 2010 1:24:03 PM
Subject: [fw-general] Zend_Controller_Action_Helper_Cache


Hi

I have difficulties in making the Zend_Controller_Action_Helper_Cache
function as it should.
I created an example project using zf.sh script and then did the necessary
modifications as described here:
http://framework.zend.com/issues/browse/ZF-9148?focusedCommentId=38409&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38409

I also changed the owner of the cache directories.

Here's what my IndexController.php looks like:

class IndexController extends Zend_Controller_Action
{

public function init()
{
/* Initialize action controller here */
$this->_helper->cache(array('index'), array('all'));

}

public function indexAction()
{
// action body
}

public function removeAction()
{
$this->_helper->getHelper('Cache')->removePagesTagged(array('all'));
}

}

The problem is that public/cached/index.html file is created but it's empty.
I also tried the Zfplanet project where Zend_Controller_Action_Helper_Cache
is used as well and there it worked fine, the cache file was not empty.

What might be wrong or missing in my project?

Best regards and thank you in advance
KRL
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Zend-Controller-Action-Helper-Cache-tp2235633p2235633.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Feeds

2010-05-28 Thread Pádraic Brady
Google doesn't receive instant updates from BBC - it just retrieves the feed 
every few minutes. There's a difference between frequent polling and real-time 
updates. The first can be done with any platform - just use a GET request. The 
second requires active pings from a Publisher so a Hub can notify Subscribers. 
What you're describing is subtly different, that BBC feeds are updated after 
Google is notified? This could be a simple case of highly focused optimisation 
- allow Google access to fresh feed generation (filter by Google's domain) 
while the general public get a cached feed updated every 10-15 minutes. Would 
be simple to architect and ensures Google always get the fresh content ASAP for 
indexing.

The only proactive instant update mechanisms getting wider usage are 
Pubsubhubbub and RSS Cloud. BBC implement neither at the moment, so you are 
stuck with polling for now, or using an offsite service (e.g. Superfeedr) which 
does 10 minute polling and updates via PuSH.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Daniel Latter 
To: Bradley Holt 
Cc: Zend Framework General 
Sent: Fri, May 28, 2010 12:47:12 PM
Subject: Re: [fw-general] Feeds

Maybe I am misunderstanding but how can I use PuSH for a BBC feed if they don't 
support it? because doesn't a publisher ping the hub to notify of an update?

So saying that, I am wondering how Google Reader gets instant updates from a 
BBC feed? 


On 28 May 2010 01:21, Bradley Holt  wrote:

>
>On Thu, May 27, 2010 at 7:42 PM, Daniel Latter  wrote:
>
>>
>>>Hi all,
>>
>>>>I'm processing feeds with Zend_Feed and I am wondering how to get instant 
>>>>feed updates like Google reader?
>>
>>>>For example, I consume a feed from bbc.co.uk and get a pubDate for each 
>>>>item, but if I look in Google reader at same feed I can see that it has 
>>>>been/gets updated almost instantly with new items? But the propoagtion to 
>>>>the feed takes much longer?
>>
>>>>Now I know about the pubsubhubbub class that ZF provides that enables "real 
>>>>time web" but that is still relatively new.
>>
>>
>
>Why is its "newness" a reason not to use it?
> 
>>>
>>
>>
>>So I guess my question is how can I architect real time feed updates like 
>>Google Reader.?
>>
>>
>
>I'd just use PubSubHubbub and not reinvent the wheel :-)
> 
>>>
>>
>>
>>Thanks
>>>>Dan
>


Re: Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-27 Thread Pádraic Brady
Have you tried using Zend_Feed_Reader? If it has the same problem, create an 
issue for it and I'll look into it before the weekend.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Stefan Sturm 
To: fw-general@lists.zend.com
Sent: Wed, May 26, 2010 8:23:37 AM
Subject: Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a  
page

Hello,

> OK, the first 2 are being found because of the 'ö' entity in the title
> attribute.

this is the html entity code for a german umlaut(
http://en.wikipedia.org/wiki/Umlaut_(diacritic)#HTML ).

> This throws the following error: Entity 'ouml' not defined in 

does this mean, that I can't find feeds containing a german umlaut?

Greetings,
Stefan Sturm


> Dan.
>
> On 25 May 2010 15:48, Stefan Sturm  wrote:
>>
>> Hallo Daniel,
>>
>> thanks for your answer. I allready did this, but I can't find anything.
>> Here is the code from the page( www.torfabrik.de ):
>>
>> 
>> > href="http://torfabrik.de/profis/rss.xml"; />
>> > href="http://torfabrik.de/nachwuchs/rss.xml"; />
>> > href="http://torfabrik.de/einwurf/rss.xml"; />
>> > href="http://torfabrik.de/querpass/rss.xml"; />
>> > href="http://torfabrik.de/kurzpass/rss.xml"; />
>> 
>> He finds only the last 3 feeds, not the first 2...
>>
>> And here from another page( www.mactechnews.de ):
>> > type="application/rss+xml" title="News" />
>> > type="application/rss+xml" title="Journals" />
>> > type="application/rss+xml" title="Forum" />
>> Here he only finds the first feed and not the last two...
>>
>> Perhaps somebody can find a difference...
>>
>> Thanks and greetings,
>> Stefan Sturm
>>
>> 2010/5/25 Daniel Latter :
>> >
>> >
>> > -- Forwarded message --
>> > From: Daniel Latter 
>> > Date: 25 May 2010 15:25
>> > Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds
>> > on a
>> > page
>> > To: Stefan Sturm 
>> >
>> >
>> > Look at the 2 feeds it doesnt find and see if you can spot a pattern.
>> >
>> > What the difference between the feeds it finds and the feeds it doesnt.
>> >
>> > Maybe these will give you more answers.
>> >
>> >
>> > On 25 May 2010 15:08, Stefan Sturm 
>> > wrote:
>> >>
>> >> Hallo,
>> >>
>> >> no one with an Idea on this?
>> >>
>> >> Greetings,
>> >> Stefan Sturm
>> >>
>> >> 2010/5/20 Stefan Sturm :
>> >> > Hello,
>> >> >
>> >> > I try to find all feeds of a page using Zend_Feed::findFeeds().
>> >> > But it does not find all feeds from a page. Take this example:
>> >> > http://www.torfabrik.de
>> >> >
>> >> > findFeed shows me 3 feeds, but there are 5 feeds on ths site...
>> >> >
>> >> > What can be the problem here?
>> >> >
>> >> > Thanks and greetings,
>> >> > Stefan Sturm
>> >> >
>> >
>> >
>> >
>
>


Re: [fw-general] Warning in Zend\Feed\Reader\Entry\Rss.php with windows-1250 charset

2010-05-11 Thread Pádraic Brady
It's a known error - I have an email with Matthew awaiting permission to fix it 
since it introduces some minor backwards incompatible changes. The quick 
solution is to delete all references to html_entity_decode() in 
Zend_Feed_Reader (just assign the base string without decoding). The intention 
is to eliminate all decoding (outside of the usual XML DOM basics) and let the 
user handle the character set issues on their end. This will avoid similar 
warnings and is mostly being done because we cannot enforce character set safe 
decoding (as the warning says, we can't decode win-1250 for example).

When Matthew gets back to me, I'll be committing the permanent fix to trunk.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Саша Стаменковић 
To: Nabble Zend Framework General 
Sent: Tue, May 11, 2010 7:37:31 AM
Subject: [fw-general] Warning in Zend\Feed\Reader\Entry\Rss.php with 
windows-1250 charset

When importing RSS feed with windows-1250 charset, I get 

WARN (4): html_entity_decode() [function.html-entity-decode]: charset 
`windows-1250' not supported, assuming iso-8859-1 in 
Zend\Feed\Reader\Entry\Rss.php #339.

Any idea?

Regards,
Saša Stamenković


Re: [fw-general] Zend_Service_Delicious_Exception: Http client reported an error: 'Unauthorized'

2010-05-08 Thread Pádraic Brady
Depends on how you're trying to reset it? It must be an original non-Yahoo 
account to work - there's no other account type that can access the v1.0 API.

If you're really stuck, and what you're doing isn't overly complex you could 
use the component flow (if not the component) to simulate raw HTTP transactions 
using the Zend_Oauth http client (it's a simple subclass of Zend_Http_Client). 
You can use a simple PHP session to store a temporary OAuth access token (or a 
database/filestore if it's in continual use). There's an example of using 
Zend_Oauth's raw HTTP client to interact with Twitter's API in the reference 
guide.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative





________
From: Саша Стаменковић 
To: Pádraic Brady 
Cc: Zend Framework General 
Sent: Sat, May 8, 2010 12:31:28 PM
Subject: Re: [fw-general] Zend_Service_Delicious_Exception: Http client  
reported an error: 'Unauthorized'

I can fill an issue. 

But still, I can't find the way to set delicous to use old way password?

Regards,
Saša Stamenković



On Fri, May 7, 2010 at 10:43 PM, Pádraic Brady  wrote:

>
>Yeah, you can change to a non-Yahoo account - the v1 password based auth 
>you're trying will work on it fine. Can you create an issue for this problem 
>regardless? I'm integrating Twitter and OAuth during the upcoming week, so I 
>could add Delicious to that list also and spruce up the component with any 
>fixes up on the issue tracker while I'm at it.
>
>Paddy
>
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish Representative
>
>
>
>
>
>>

From: Саша Стаменковић 
>To: Pádraic Brady 
>Cc: Zend Framework General 
>Sent: Fri, May 7, 2010 8:22:54 PM
>Subject: Re: [fw-general] Zend_Service_Delicious_Exception:
> Http client  reported an error: 'Unauthorized'
>
>
>>Yes, yahoo based. Can I  change account so it can work with this code?
>
>Regards,
>Saša Stamenković
>
>
>
>On Fri, May 7, 2010 at 7:44 PM, Pádraic Brady  wrote:
>
>>>
>>You're not using a Yahoo based account, are you? Yahoo ID access is only via 
>>the v2 API and OAuth. Can't think of anything else outside of a bug in the 
>>component.
>>
>> Pádraic Brady
>>
>>http://blog.astrumfutura.com
>>>>http://www.survivethedeepend.com
>>OpenID Europe Foundation Irish
>> Representative
>>
>>
>>
>>
>>
>>

 >>
>>
>>From: Саша Стаменковић 
>>To: Nabble Zend Framework General 
>>Sent: Fri, May 7, 2010 2:42:20 PM
>>Subject: [fw-general] Zend_Service_Delicious_Exception: Http client reported 
>>an error:  'Unauthorized'
>>
>>
>>
>>I get 
>>Zend_Service_Delicious_Exception: Http client reported an error: 
>>'Unauthorized'
>>thrown in Zend\Service\Delicious.php on line 501
>>Code:
>>
>>
>>$delicious = new Zend_Service_Delicious($credentials['username'], 
>>$credentials['password']);
>>$delicious->createNewPost($this->getShortDescription(), 
>> $this->getUrl(false))
>>->setNotes($this->comment)
>>->setTags(array('lol', 'sasa'))
>>->save();
>>
>>
>>Any idea?
>>Regards,
>>Saša Stamenković
>>
>


Re: [fw-general] Zend_Service_Delicious_Exception: Http client reported an error: 'Unauthorized'

2010-05-07 Thread Pádraic Brady
Yeah, you can change to a non-Yahoo account - the v1 password based auth you're 
trying will work on it fine. Can you create an issue for this problem 
regardless? I'm integrating Twitter and OAuth during the upcoming week, so I 
could add Delicious to that list also and spruce up the component with any 
fixes up on the issue tracker while I'm at it.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Саша Стаменковић 
To: Pádraic Brady 
Cc: Zend Framework General 
Sent: Fri, May 7, 2010 8:22:54 PM
Subject: Re: [fw-general] Zend_Service_Delicious_Exception: Http client  
reported an error: 'Unauthorized'

Yes, yahoo based. Can I  change account so it can work with this code?

Regards,
Saša Stamenković



On Fri, May 7, 2010 at 7:44 PM, Pádraic Brady  wrote:

>
>You're not using a Yahoo based account, are you? Yahoo ID access is only via 
>the v2 API and OAuth. Can't think of anything else outside of a bug in the 
>component.
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish
> Representative
>
>
>
>
>
>

 >From: Саша Стаменковић 
>To: Nabble Zend Framework General 
>Sent: Fri, May 7, 2010 2:42:20 PM
>Subject: [fw-general] Zend_Service_Delicious_Exception: Http client reported 
>an error:  'Unauthorized'
>
>
>
>I get 
>Zend_Service_Delicious_Exception: Http client reported an error: 
>'Unauthorized'
>thrown in Zend\Service\Delicious.php on line 501
>Code:
>
>
>$delicious = new Zend_Service_Delicious($credentials['username'], 
>$credentials['password']);
>$delicious->createNewPost($this->getShortDescription(), 
> $this->getUrl(false))
>->setNotes($this->comment)
>->setTags(array('lol', 'sasa'))
>->save();
>
>
>Any idea?
>Regards,
>Saša Stamenković
>


Re: [fw-general] Zend_Service_Delicious_Exception: Http client reported an error: 'Unauthorized'

2010-05-07 Thread Pádraic Brady
You're not using a Yahoo based account, are you? Yahoo ID access is only via 
the v2 API and OAuth. Can't think of anything else outside of a bug in the 
component.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Саша Стаменковић 
To: Nabble Zend Framework General 
Sent: Fri, May 7, 2010 2:42:20 PM
Subject: [fw-general] Zend_Service_Delicious_Exception: Http client reported an 
error:  'Unauthorized'


I get 
Zend_Service_Delicious_Exception: Http client reported an error: 
'Unauthorized'
thrown in Zend\Service\Delicious.php on line 501
Code:

$delicious = new Zend_Service_Delicious($credentials['username'], 
$credentials['password']);
$delicious->createNewPost($this->getShortDescription(), 
$this->getUrl(false))
->setNotes($this->comment)
->setTags(array('lol', 'sasa'))
->save();

Any idea?
Regards,
Saša Stamenković


Re: [fw-general] Twitter Launches Countdown to OAuthcalypse

2010-05-06 Thread Pádraic Brady
For those wondering, I'll be reworking Zend_Service_Twitter over the weekend. 
Don't worry, the gate on this component will not be closing in June ;). 
Unfortunately, for obvious reasons, you should all expect to make code changes 
after this is released (except for Streams which are still password access 
enabled after the deadline).

I'll reply again to this topic when something concrete is in trunk for those 
interested.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Rob Allen 
To: Nabble Zend Framework General 
Sent: Mon, April 26, 2010 8:43:22 AM
Subject: Re: [fw-general] Twitter Launches Countdown to OAuthcalypse



On 25 Apr 2010, at 19:40, Саша Стаменковић wrote:

Twitter Launches Countdown to OAuthcalypse 
http://mashable.com/2010/04/24/twitter-oauthcalypse/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Mashable+%28Mashable%29.
>>
>
>Does this means Zend_Service_Twitter will stop working?
>
>

Hi,

Nope - because you can plug Zend_Oauth_Consumer into Zend_Service_Twitter. 

Padraic wrote up an example of how to do it here: 
http://blog.astrumfutura.com/archives/411-Writing-A-Simple-Twitter-Client-Using-the-PHP-Zend-Frameworks-OAuth-Library-Zend_Oauth.html


I've also written a simple Twitter app that uses OAuth here: 
http://tweetgt.funkymongoose.com/. The source is at 
http://github.com/akrabat/TweetGT. The OAuth integration is in this plugin: 
http://github.com/akrabat/TweetGT/blob/master/library/App/Controller/Plugin/InitOAuth.php



Regards,

Rob...


-- 
Rob Allen : http://akrabat.com
Zend Framework Tutorial: http://akrabat.com/zft
Author of Zend Framework in Action: http://www.zendframeworkinaction.com 


Re: [fw-general] Zend_Feed_Writer and activitystrea.ms

2010-05-06 Thread Pádraic Brady
Hi Jean-Michel,

You should find me on IRC some day ;).

The Writer component also has Extensions much like Readers. In the case of the 
Writer each Extension is sub-divided into Data Containers (holding the relevant 
feed agnostic data) and Renderers (which push the data into one of Atom 1.0 or 
RSS 2.0 formats). You can find examples of these such as the Writer's iTunes 
extension.

For an extension comprising both feed and entry level items, you can expect to 
end up with several classes including (for example):

Zend_Feed_Writer_Extension_ActivityStreams_Feed
Zend_Feed_Writer_Extension_ActivityStreams_Entry
Zend_Feed_Writer_Extension_ActivityStreams_Renderer_Feed
Zend_Feed_Writer_Extension_ActivityStreams_Renderer_Entry

Taking a look at the form of the iTunes extension should give you more insight 
into how each works. As with Reader, there are methods allowing you to 
dynamically register extensions quite easily at runtime (see Zend_Feed_Writer).

Just a note on Activity Streams, I'm not sure if you have any interest in 
contributing source code you come up with (client work and such can make it 
difficult) but we are looking into Activity Streams for a near future proposal. 
We also have existing proposals to support some of the optional dependencies 
like MediaRSS (see the proposals wiki - might save you a bit of effort) and 
Atom Media. These proposals will all end up (in time) with relevant Reader 
extensions to complement them. They probably won't see a release any day soon 
with all the ZF 2.0 work ongoing, but we still intend writing all the code even 
if it's unofficially supported on Github and co.

In any case, feel free to hit me up with any questions you may have on the 
extension setup.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Jean-Michel Philippon-Nadeau 
To: fw-general@lists.zend.com
Sent: Thu, May 6, 2010 4:24:38 AM
Subject: [fw-general] Zend_Feed_Writer and activitystrea.ms

Hi list,

I am looking at extending Zend_Feed_Writer so it can easily export
data to the Activitystrea.ms format which is basically an extension to
Atom (http://activitystrea.ms/).

Reading the manual, I've discovered the extensions. Reader extensions
are pretty well documented but, unfortunately, I've been unable to
find enough documentation on the Writer component to be able to write
something working.

Has anyone any ideas on how I could create such an extension?

Thanks,


Jean-Michel


Re: [fw-general] Creating a Zend_Service_* Component

2010-03-16 Thread Pádraic Brady
Hi Shaun,

From the recurring API endpoint names, I'd suggest breaking the API across a 
series of categorised classes. It's the simplest means of dissecting the API, 
building concrete implementations, and testing them. From there, with a few of 
these, you can build up some picture of what the parent class for all of these 
would look like. At a glance it would handle authentication (if needed) and API 
keys to start with. It would likely also handle the HTTP transport.

In place of a giant class, you could also implement a front class which 
lazy-loads each API specific class as needed.

E.g.

$api = new Flickr();
$contactList = $api->contacts()->getList(); (could be a property either)

I'd suggest starting with some idea of what style of API you want to see at the 
end of the day. It'll help frame all your unit tests when implementing it.

Only item I'd be somewhat careful with is authentication. It shouldn't be tied 
into a hierarchy (as an example see Zend_Service_Twitter where this lead to all 
sorts of re-authentication issues because the design made is difficult to reuse 
just one auth transaction and result).

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Shaun Farrell 
To: Zend Framework General 
Sent: Tue, March 16, 2010 8:56:00 PM
Subject: [fw-general] Creating a Zend_Service_* Component

I have been working on creating some Zend_Service components and I am trying to 
figure out the best way to break out my methods. 

Do I write one long class or do I break out the sections of the API into 
multiple classes.

Take flickr for an example.  There are a lot of API calls.  flickr has them 
grouped very well, you can see them here http://www.flickr.com/services/api/  
If I was going to create a flickr component would I throw all those API calls 
in one class called flickr.php or would you suggest creating the flickr.php to 
have the photo methods and then in the Zend_Service_Flickr folder create 
stats.php for the stats methods, people.php for the people methods, etc.  All 
these classes would extend the main class (flickr.php)

I'm sort of confused right now on what route to go with.  

Suggestions and comments would be great!

Thanks!

Shaun J. Farrell
Washington, DC

Re: [fw-general] **call for votes** issues with Zend_View_Helper_Url

2010-03-05 Thread Pádraic Brady
Issue numbers/links would be handy ;). I'm lazy and searching by component is a 
pain in JIRA without getting the component through a search. (Is there a JIRA 
component list to select from somewhere?).

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Bart McLeod 
To: fw-general ; "umpir...@gmail.com >> Саша 
Стаменковић" 
Sent: Fri, March 5, 2010 9:21:23 AM
Subject: [fw-general] **call for votes** issues with Zend_View_Helper_Url

 Hi all,

Because of an issue with get parameters from the query string that do
not get reproduced by  Zend_View_Helper_Url I looked in our very slow
issue browser to see what issues are already here for this class.

There are quite a few unresolved issues. While I only came to add the
issue about the get parameters, I thought it would be a could idea to
try and fix a few of the issues at the same time, because tackling a
few issues in the same run might save some time if the same code needs
to be touched.

So I would like to ask all of you who use this class to vote for the
issues that are yet unresolved and that you think particularly
important. Your participation is very much appreciated.

Please note that I did not yet add the issue with the get parameters to
the issue tracker, feel free to do so if you get there before me.

This will give me a priority list when I starting building unit tests
to confirm the issues.

Regards,

Bart McLeod



-- 

Bart McLeod
Space Web
Middenlaan 47
6865 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ i...@spaceweb.nl
www.spaceweb.nl
Bart McLeod is a Zend Certified Engineer. 
Click
to verify!   

Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Pádraic Brady
With which component? Zend_Feed or Zend_Feed_Writer?

With the writer you can either a) add a custom extension (see Zend_Feed_Writer 
extensions for examples) or b) get the Entry/Feed's DOMElement with 
getElement() and add it programatically using PHP's DOM methods. The second 
works fine for minor additions. The first exists to offer a more friendly API 
for longer extensions or RSS/Atom modules.

With Zend_Feed I'm less sure since I haven't used it in a while.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Frank Habermann 
To: fw-general@lists.zend.com
Cc: Pádraic Brady 
Sent: Mon, March 1, 2010 7:11:11 PM
Subject: Re: [fw-general] zend_feed_writer with own namespace

Hi,

> $feed = new Zend_Feed_Writer_Feed;
> // add feed info
> $entry = $feed->createEntry();
> // add entry info
> $feed->addEntry($entry);
> $feedXml = $feed->render('atom');
>
> Anything to do with Zend_Feed_Writer is under that namespace - everything
> else is the older Zend_Feed.
Ok. Thanks for this first. But the question is now: How could i create my own 
tags in my entry with own xml namespace?

regards,
Frank


Re: [fw-general] Redundant include paths in Zend_Tool-generated projects?

2010-03-01 Thread Pádraic Brady
Looks redundant from your description. I can guess at the cause, however. 
Zend_App actually prepends instead of appending entries to the include_path, so 
presumably adding the library path in application.ini ensures (depending on 
order of any other includes) it's at the front of the include_path for 
performance. Haven't checked so please take that with a a pinch of salt.

In any case, depending on how or where you want the library path, doing from 
the config file is more flexible.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Ryan Lange 
To: fw-general@lists.zend.com
Sent: Mon, March 1, 2010 4:07:45 PM
Subject: [fw-general] Redundant include paths in Zend_Tool-generated projects?

When you create a project with Zend_Tool, it appears to add library/ to the 
include path twice; once in application/configs/application.ini and again in 
public/index.php.

==
application/configs/application.ini
==
includePaths[] = APPLICATION_PATH "/../library"


==
public/index.php
==
set_include_path( implode( PATH_SEPARATOR, array(
realpath( APPLICATION_PATH . '/../library' ),
get_include_path(),
) ) );


Am I correct in assuming that this is simply redundant?


Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Pádraic Brady
Looks like you're trying to mix Zend_Feed and Zend_Feed_Writer - they are 
separate components as confusing as it looks ;).

Using Zend_Feed_Writer a new entry is created with:

$feed = new Zend_Feed_Writer_Feed;
// add feed info
$entry = $feed->createEntry();
// add entry info
$feed->addEntry($entry);
$feedXml = $feed->render('atom');

Anything to do with Zend_Feed_Writer is under that namespace - everything else 
is the older Zend_Feed.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Frank Habermann 
To: fw-general@lists.zend.com
Sent: Mon, March 1, 2010 1:58:38 PM
Subject: [fw-general] zend_feed_writer with own namespace

Hi,

i want to create an atom feed with some own tags in it.

So i read the doku on:
http://framework.zend.com/manual/en/zend.feed.modifying-feed.html

So i see example2 is good for me. I have an atom entry with own tags.

My problem is now: How could i create a complete feed with zend_feed?

I tried with:
$writer = new Zend_Feed_Writer_Feed();
$entry = new Zend_Feed_Entry_Atom();
$writer->addEntry($entry);

That bring me up an error:
"Catchable fatal error: Argument 1 passed to Zend_Feed_Writer_Feed::addEntry() 
must be an instance of Zend_Feed_Writer_Entry, instance of Zend_Feed_Entry_Atom 
given"

So, how could i create a complete atom feed with own tags?

regards,
Frank


Re: [fw-general] How to control 'displayExceptions' in a controller?

2010-02-28 Thread Pádraic Brady
You might mean the throwExceptions option if you are trying to selectively 
enable/disable the ErrorController. The displayExceptions only controls whether 
an Exception stack is shown by the ErrorController or not.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Dasn 
To: fw-general@lists.zend.com
Sent: Sun, February 28, 2010 11:18:07 PM
Subject: [fw-general] How to control 'displayExceptions' in a controller?

Hi guys, I'm trying to control the ErrorController via turning
on/off the 'displayExceptions' in a controller, for example:

class ViewController extends Zend_Controller_Action
{

public function init()
{
/* Initialize action controller here */
$front=$this->getFrontController();
$front->setParam('displayExceptions', 0);
}
}

I found the value of 'displayExceptions' was changed, but did not
have any effects. Any idea to archive this?

Thanks.

Re: [fw-general] Re: Escape, stripslashes and html entities

2010-02-25 Thread Pádraic Brady
You may need to explain more clearly what exactly is happening. From the 
previous report (before yours), it sounds like data was double escaped before 
insertion into a database. Meanwhile, you seem to be saying its not but it only 
has double-escaping when used outside of Zend_Form which is different.

Either way, it makes no sense!

Is the data retrieved from the database slashed or not slashed? If it is, 
that's a database problem - not the View. If it's not - then why would anything 
between the DB and View be adding extra slashes you say need to be stripped? 
There's nothing in Zend_View or Zend_Form that I am aware of that adds slashes.

Just to be clear, the way things should work is that data is escaping going 
into the database, and unescaped upon retrieval. The data itself therefore 
remains consistent and there should be no extra slashes anywhere unless added 
by some external process (e.g. addslashes, mysql_real_escape_string, magic 
quotes, etc).

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Keyne 
To: fw-general@lists.zend.com
Sent: Thu, February 25, 2010 2:35:56 AM
Subject: [fw-general] Re: Escape, stripslashes and html entities

 

Look, when I populate this data into my form
for an edit option I don't need to strip the slashes. But in my list
action, that catch the data in the same way of my edit option I have to
use stripslashes. So, my form do this to me, but not my view without
form.

My data is escaped as expected when inserting, and when editing the
slashes are striped as expected. Like I said, I don't have double
slashes. The issue is in my view list.phtml or in my view.phtml.

Do I have to use stripslashes in such case?

If not, where in Zend_Db_Table_Row_Abstract have an action to strip
slashes? I can't see it.


Hector Virgen [via Zend Framework Community] escreveu: 
Normally you shouldn't have to strip slashes on data
>coming out of the database. I think you'd be better off finding out why
>the data is being escaped twice than trying to undo something that
>shouldn't have been done in the first place (double-escaping).
> 
>
>
>Does the problem exist with code-created data, too, such as in
>my example?
>
>>--
>>Hector
>
>
>
>On Wed, Feb 24, 2010 at 6:08 PM, Keyne <[hidden email]> wrote:
>
>
>>>>I don't need to use addslashes, just stripslashes in my view.
>>
>>>>   public function insert($data)
>>>>   {
>>>>   $data = array(
>>>>   'nome' => $data['nome'],
>>>>   'email' => $data['email'],
>>>>   'sobre' => $data['sobre']
>>>>   );
>>
>>>>   return parent::insert($data);
>>>>   }
>>
>>>>But, there is a way to turn this task (stripslashes) automatic?
>>
>>
>>
>>
>>>>Hector Virgen wrote:
>>>>>
>>>>> How are you inserting that into the database? Here's one way to do
>>it that
>>>>> should work:
>>>>>
>>>>> $id = $db->insert('mytable', array(
>>>>> 'theString' => "I'm both entrepeneaur and..."
>>>>> ));
>>>>>
>>>>> Note that this method automatically builds the SQL and escapes the
>>values
>>>>> for me -- no need to use addslashes() or
>>mysql_real_escape_string().
>>>>>
>>>>> Also, have you verified that magic quotes is off? You can run this
>>code to
>>>>> check:
>>>>>
>>>>> Zend_Debug::dump(get_magic_quotes_gpc());
>>>>>
>>>>> --
>>>>> Hector
>>>>>
>>>>>
>>>>> On Wed, Feb 24, 2010 at 5:34 PM, Keyne <[hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> I have the same issue. Magic quotes is off.
>>>>>>
>>>>>> My result looks like: "I\'m both entrepreneur and..."
>>>>>> The database row looks like this too: "I\'m both entrepreneur
>>and..."
>>>>>>
>>>>>> And to get the data I use $this->fetchAll()->toArray();
>>>>>>
>>>>>> Then I need to use stripslashes.
>>>>>>
>>>>>> What I need to do to avoid this?
>>>>>>
>>>>>>
>>>>>> Mark Steudel wrote:
>>>>>> >

Re: [fw-general] Zend_Cache_Page problem

2010-02-25 Thread Pádraic Brady
When using Zend_Cache for page caching, you must set output buffering in the 
dispatcher to false. I recently updated the docs which have omitted that step.

The second issue is more problematic. I'd double check the controller or view 
are not calling exit() anywhere. I'd also double check layouts are enabled for 
that action.

Is the layout rendered when the caching is disabled?

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: theduke 
To: fw-general@lists.zend.com
Sent: Thu, February 25, 2010 11:05:55 AM
Subject: [fw-general] Zend_Cache_Page problem


Hello.

I've stumbled upon a problem with Zend_Cache_Page.

With most of my actions it works just fine, but with one action, which is
rendered just fine without the cache, I got an empty page.

After checking the manual I set
resources.frontcontroller.params.disableOutputBuffering=true in my config.
All other pages still work fine, but my problem action will show just the
actions view, but not the contents of my layout!

Any idea what my problem might be?


with regards,
theduke
-- 
View this message in context: 
http://n4.nabble.com/Zend-Cache-Page-problem-tp1568839p1568839.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Escape, stripslashes and html entities

2010-02-20 Thread Pádraic Brady
Red flag induced heart attack averted ;).

Primarily I was just concerned that you might be following some of the 
excellent (not) advice out there:
http://www.zfforums.com/zend-framework-components-13/databases-20/stripslashes-zend_db_table_row-object-2128.html

I've actually seen this in real life - I almost did have a heart attack then 
;). Note to self - kick someone into setting a limit on View escape settings...

>If I look into my db, there's only one slash added to a certain quote 
>character. If you fetch the data from the db the string isn't removed, and 
>after your and Hector's reply I'm sure that should be done by the system 
>itself.

Sounds like a bug somewhere. If the database adapter were working correctly, 
input would be escaped going in and unescaped coming out without any other 
external steps needed. I'd say to copy this to the DB mailing list and give as 
much detail as possible about your setup, i.e. DBMS, adapter used, character 
encoding of DB (can check via phpmyadmin or its equivalent), settings/options 
passed to adapter, etc.

I'd also verify this is occurring. A reproducible script goes a long way ;). 
Particularly, check if it's consistent everywhere. There can be cases where 
input is massaged by other factors (jQuery can add slashes when submitting 
data, for example, depending on how things flow). A reproducible script would 
also eliminate these and any other potential side effects making the problem a 
bit narrowed in scope and hopefully therefore simpler to figure out.

Paddy

P.S. Sorry for the overkill reply last time around :P.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Jurian Sluiman 
To: fw-general@lists.zend.com
Sent: Sat, February 20, 2010 9:04:26 AM
Subject: Re: [fw-general] Escape, stripslashes and html entities

On Saturday 20 Feb 2010 03:35:23 Pádraic Brady wrote:
> I'm going to assume you just worded that badly because otherwise there are
> red flags exploding in my head. To clarify (if even needed), there are
> three strategies for escaping output. Strategy 1 is no escaping. This WILL
> result in XSS vulnerabilities. Strategy 2 is htmlspecialchars(). This
> escapes characters potentially interpreted as HTML (e.g. angle brackets,
> ampersands, etc.). If left intact these are what can be manipulated via
> input tampering to create XSS exploits (and we just got over fixing
> misuses of this across the framework in the last 1.9 release). Strategy 3
> is htmlentities(). This should be used sparingly, and is typical of
> English oriented output (non-UTF8) in order to enable display of
> characters not supported by the current character set encoding. For
> example the UTF-8 á character can be including in non-UTF8 text by
> encoding it as the entity á.
> 
> Since you state your output (and presumably this carries back to input and
> persistence encoding) is UTF-8 the ONLY valid escaping mechanism is
> htmlspecialchars(). The function call MUST include the correct encoding as
> a parameter. htmlentities() on UTF-8 is overkill since UTF-8 natively
> supports almost any imaginable character without needing entities.

Yes, that's what I'm doing :) The words were written down to say in short the 
default escape functions in Zend_View aren't sufficient to remove slashes. Of 
course not using htmlspecialchars() can cause XSS and I'm very aware of that 
fact :)

> It sounds a lot like double escaping, e.g. calling addslashes() before data
> is sent to a database adapter for writing. Can also happen if input is
> auto-slashed, e.g. magic quotes. This should be disabled/reversed before
> the database write - most adapters can natively escape correctly. PDO has
> prepared statements but manually even mysql(i) has its
> mysql(i)_real_escape_string functions. Slashes via a PHP procedure are
> never sufficient for database escaping - so I would recommend checking how
> this is occurring because frankly it's a major red flag for potential SQL
> Injection vulnerabilities if proper escaping is not being employed.

My magic quotes are off, that's for sure. My problem is I never add slashes or 
do mysql_real_escape_string() (alike) functions by hand. I just pass the data 
to Zend_Db and the result is escaped by Zend_Db.

If I look into my db, there's only one slash added to a certain quote 
character. If you fetch the data from the db the string isn't removed, and 
after your and Hector's reply I'm sure that should be done by the system 
itself.

I need to look into the Zend_Db code to find out when and why escaping is 
turned off I assume.

> Almost impossible to avoid with ZF - 2.0 will carry a method for
> automatically escaping output variables, but it's 

Re: [fw-general] Escape, stripslashes and html entities

2010-02-19 Thread Pádraic Brady
>I try to figure out what the best option is to escape my data. I have an UTF-8 
>website so actually it's fine to work with the original 
characters (and no need for htmlentities() or 
>htmlspecialchars()).

I'm going to assume you just worded that badly because otherwise there are red 
flags exploding in my head. To clarify (if even needed), there are three 
strategies for escaping output. Strategy 1 is no escaping. This WILL result in 
XSS vulnerabilities. Strategy 2 is htmlspecialchars(). This escapes characters 
potentially interpreted as HTML (e.g. angle brackets, ampersands, etc.). If 
left intact these are what can be manipulated via input tampering to create XSS 
exploits (and we just got over fixing misuses of this across the framework in 
the last 1.9 release). Strategy 3 is htmlentities(). This should be used 
sparingly, and is typical of English oriented output (non-UTF8) in order to 
enable display of characters not supported by the current character set 
encoding. For example the UTF-8 á character can be including in non-UTF8 text 
by encoding it as the entity á.

Since you state your output (and presumably this carries back to input and 
persistence encoding) is UTF-8 the ONLY valid escaping mechanism is 
htmlspecialchars(). The function call MUST include the correct encoding as a 
parameter. htmlentities() on UTF-8 is overkill since UTF-8 natively supports 
almost any imaginable character without needing entities.

>Nevertheless all my data comes from a database and the data is inserted 
with all quotes escaped. That means by display the texts I need for 
every variable a 
>stripslashes().

It sounds a lot like double escaping, e.g. calling addslashes() before data is 
sent to a database adapter for writing. Can also happen if input is 
auto-slashed, e.g. magic quotes. This should be disabled/reversed before the 
database write - most adapters can natively escape correctly. PDO has prepared 
statements but manually even mysql(i) has its mysql(i)_real_escape_string 
functions. Slashes via a PHP procedure are never sufficient for database 
escaping - so I would recommend checking how this is occurring because frankly 
it's a major red flag for potential SQL Injection vulnerabilities if proper 
escaping is not being employed.

>Stripslashes() everywhere is very ugly and gives cluttered code in all 
my view scripts. What's the best option to strip the slashes 
automatically? Replace the escape function by 
>stripslashes() replaces 
the problem by another: $this->escape() everywhere instead of 
stripslashes(). Is it better to escape the variables automatically by 
overriding the __set() 
>from Zend_View_Abstract? Another (fail prove) 
systems to have a smart system to escape my data?

Almost impossible to avoid with ZF - 2.0 will carry a method for automatically 
escaping output variables, but it's a tricky proposition to implement. If you 
can ascertain the double escaping is innocent in nature, you could work up a 
replacement setter for Zend_View which accepts a context parameter. Still not 
pretty, but would force the repetitive stripslashes back to the controllers (or 
Model accessing helpers) instead of contaminating the View. Remember, valid 
un-slashed data should not be subject to stripslashes(), so adding it to 
Zend_View is more difficult than it appears at first glance.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Jurian Sluiman 
To: fw-general@lists.zend.com
Sent: Fri, February 19, 2010 10:33:06 PM
Subject: [fw-general] Escape, stripslashes and html entities

Hi all,
I try to figure out what the best option is to escape my data. I have an UTF-8 
website so actually it's fine to work with the original characters (and no need 
for htmlentities() or htmlspecialchars()). Nevertheless all my data comes from 
a database and the data is inserted with all quotes escaped. That means by 
display the texts I need for every variable a stripslashes().

Stripslashes() everywhere is very ugly and gives cluttered code in all my view 
scripts. What's the best option to strip the slashes automatically? Replace the 
escape function by stripslashes() replaces the problem by another: 
$this->escape() everywhere instead of stripslashes(). Is it better to escape 
the variables automatically by overriding the __set() from Zend_View_Abstract? 
Another (fail prove) systems to have a smart system to escape my data?

Thanks in advance,
Jurian

Re: [fw-general] Public ZF repository with require_once calls excluded

2010-02-15 Thread Pádraic Brady
I don't know of any. The license is New BSD - relatively few restrictions bar 
the obvious in preserving rights and attribution.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Steven Brown 
To: fw-general@lists.zend.com
Sent: Mon, February 15, 2010 5:25:29 AM
Subject: [fw-general] Public ZF repository with require_once calls excluded

  
Does anyone know of any public ZF repositories that have the
require_once calls commented out or removed?
 
I use these in every project to improve performance by using
lazy loading.
 
Would the ZF team object to me creating one? Would this
violate the license?
 
Cheers,
Steven

Re: [fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Pádraic Brady
The problem is largely that the bootstrap registers itself, acting as a 
Registry (or Service Locator even since it is a dynamic resource loader). If 
you split the bootstrap from the registry role, you'd have something better 
scoped for testing perhaps.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Hector Virgen 
To: Zend Framework General 
Sent: Fri, February 12, 2010 6:23:26 PM
Subject: Re: [fw-general] Hot to get cacheManager resource from anywhere?

One of the problems I've found with pulling the bootstrap from the front 
controller (besides the singleton issue) is that the front controller in my 
test environment didn't have the bootstrap param. I had to manually set it 
within my appBootStrap() for my tests to work:

public function appBootStrap()
{
$this->_application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$this->_application->bootstrap();
$this->frontController->setParam('bootstrap', 
$this->_application->getBootstrap());
}

A better approach would be to inject your model with its dependencies:

// in controller
$model = new MyModel();
$cacheManager = $this->getInvokeArg('bootstrap')->getResource('cachemanager');
$model->setCacheManager($cacheManager);
// do stuff with model

But again, in the testing environment, you'll need to manually inject the 
bootstrap into the front controller.
--
Hector



On Fri, Feb 12, 2010 at 5:17 AM, Pádraic Brady  wrote:

>
>Simplest method from anywhere:
>
>Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager');
>
>It's downfall is it adds a dependency on a singleton, but without knowing how 
>your model works it's difficult to suggest a better alternative without the 
>singleton.
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish Representative
>
>
>
>
>
>

 >From: Marko78 
>To: fw-general@lists.zend.com
>Sent: Fri, February 12, 2010 12:38:11 PM
>Subject: [fw-general] Hot to get cacheManager resource from anywhere?
>
>>
>
>
>Hi,
>
>I have set up cacheManager in my application.ini and I want to get it from
>my Model.
>
>How can I get it?
>
>br, Marko
>-- 
>View this message in context: 
>http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
>>
>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Pádraic Brady
Simplest method from anywhere:

Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager');

It's downfall is it adds a dependency on a singleton, but without knowing how 
your model works it's difficult to suggest a better alternative without the 
singleton.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Marko78 
To: fw-general@lists.zend.com
Sent: Fri, February 12, 2010 12:38:11 PM
Subject: [fw-general] Hot to get cacheManager resource from anywhere?


Hi,

I have set up cacheManager in my application.ini and I want to get it from
my Model.

How can I get it?

br, Marko
-- 
View this message in context: 
http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Zend_Cache_Manager support for 'customBackendNaming'

2010-02-09 Thread Pádraic Brady
If you can file an issue for this improvement, I'll catch up to it at the 
weekend. All that it needs is mapping a configuration option to the Manager's 
factory() call on Zend_Cache.

Thanks,
Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Ian Martin 
To: fw-general@lists.zend.com
Sent: Tue, February 9, 2010 4:43:04 PM
Subject: [fw-general] Zend_Cache_Manager support for 'customBackendNaming'

I've been using Zend_Application_Resource_Cachemanager to create cache objects. 
 When I tried to use the Zend Server (disk or shared memory) back-ends I 
noticed that Zend_Cache_Manager templates do not support the 
'$customBackendNaming' parameter of Zend_Cache::factory() method.  

I'd like to use cache templates rather than simply setting a pre-instantiated 
cache - Is there a better way to accomplish this, or is this a feature that 
should be added to Zend_Cache_Manager class?


Cheers,

Ian Martin


Re: [fw-general] encoding problem in ajax request

2010-02-05 Thread Pádraic Brady
Been developing with UTF-8 and PHP for years - have yet to meet a problem doing 
so... The only let downs tend to be string manipulation (see iconv or mbstring 
to correct). Otherwise - no pain. The main condition to full support is having 
everything ELSE use UTF-8. That's the main mistake devs make - having some 
input or output mishandled as a different encoding, like HTML being served 
wrong, or actual files encoded as as ISO or even Windows encoding (largely an 
issue with Windows editors in general). I'm still surprised at the number of 
large (millions of users), everyday applications which cannot get that much 
right. It's really noticeable given my name has an accented Gaelic character.

Saying PHP has weak UTF-8 support is plain wrong.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Nicolas Grevet 
To: fw-general@lists.zend.com
Sent: Fri, February 5, 2010 3:20:57 PM
Subject: Re: [fw-general] encoding problem in ajax request

If only the world was this beautiful, it would be great. When full UTF-8 
support will be implemented in PHP and that more than a third of the language 
functions will supprot it, then we'll consider switching to UTF-8.

The last project I had to develop with UTF-8, oh god... working with file 
imports, renamings, emails and such was a terrible pain in the back. So yeah, 
we all want to work full-utf-8, me first. But the language support is quite 
weak (until PHP 6).

Besides that, not everyone is allowed to decide wether he wants to work in a 
particular encoding or another... and there's much more to discuss in there.


Matthew Weier O'Phinney a écrit :
> -- i...@antoniocaccese.it  wrote
> (on Friday, 05 February 2010, 08:23 AM +0100):
>> My problem is with ajax requests that must return html and not JSON.
>> So, if i receive a string from POST like "La vita è bella" and save
>> it into DB without apply utf8_decode i'll get a string like "La vita
>> ù bella".
>> 
>> I'm looking for an automatically method or best practise to deal with it.
> 
> Your application should be using UTF-8 throughout -- that means all
> files should be in utf-8, you should be declaring utf-8 as the charset
> in your HTML headers and/or via meta tags, and your _database_ should be
> using UTF-8 as its encoding. This will ensure consistency throughout all
> aspects of your application and prevent exactly the issue you're
> describing.


Re: [fw-general] Unable to set infinite lifetime with cache manager

2010-02-05 Thread Pádraic Brady
Hehe ;)

For everyone else, committed a fix so you can add NULL for infinite lifetime to 
an INI config. Zend_Cache_Core now translates the resulting empty string into a 
NULL literal so there's no confusion. The workaround below works for the moment 
until 1.10.1 is released (it's in release-10 and trunk if pulling from there).

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Саша Стаменковић 
To: Pádraic Brady 
Cc: Vladas Diržys ; Zend Framework General 

Sent: Fri, February 5, 2010 2:38:37 PM
Subject: Re: [fw-general] Unable to set infinite lifetime with cache manager

@Pádraic Brady Thanks for the fix!

Regards,
Saša Stamenković



On Thu, Feb 4, 2010 at 2:46 PM, Pádraic Brady  wrote:

>
>Here's a workaround for getting an infinite lifetime, can be called in any 
>controller:
>
>// workaround since config cannot define a NULL value :(
>>
>$this->_helper->getHelper('Cache')->setTemplateOptions(
>'twitter', // your cache name here
>array('frontend'=>array('options'=>array('lifetime'=>null)))
>>
>);
>
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish Representative
>
>
>
>
>
>>

From: Vladas Diržys 
>To: fw-general@lists.zend.com
>Sent: Wed, February 3, 2010 4:19:54 PM
>Subject: Re: [fw-general] Unable to set infinite lifetime with cache manager
>
>>
>
>
>Zend_Cache_Core::load() Second parameter enables you to ignore validity 
>testing:
>
>$cache->load('my_object', true); //should not test expiration
>>
>
>
>
>More info: 
>http://framework.zend.com/apidoc/1.10/Zend_Cache/Zend_Cache_Core.html#load
>>
>
>--
>>
>Pagarbiai,
>Vladas Diržys
>Tel.: +370 620 69020
>www.dirzys.com
>
>
>
>On Wed, Feb 3, 2010 at 16:02, umpirsky  wrote:
>
>>>
>>
>>
>>>>Hi.
>>
>>>>I have in my config:
>>
>>resources.cachemanager.file.frontend.name = Core
>>>>resources.cachemanager.file.frontend.options.lifetime = null
>>>>resources.cachemanager.file.frontend.options.automatic_serialization = true
>>resources.cachemanager.file.backend.name = File
>>>>resources.cachemanager.file.backend.options.cache_dir = APPLICATION_PATH
>>>>"/../data/cache"
>>
>>>>In order to have default lifetime set to null (forever). But looks like it's
>>>>not possible from config file.
>>
>>>>Am I right?
>>
>>>>Regards,
>>>>Sasa Stamenkovic.
>>--
>>>>View this message in context: 
>>>>http://n4.nabble.com/Unable-to-set-infinite-lifetime-with-cache-manager-tp1461182p1461182.html
>>>>
>>
>>
>>
>>Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>


Re: [fw-general] Re: Getting JSON POST data from Zend?

2010-02-04 Thread Pádraic Brady
Have you looked at opening/reading the php://input stream?

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: OakBehringer 
To: fw-general@lists.zend.com
Sent: Thu, February 4, 2010 1:50:50 AM
Subject: [fw-general] Re: Getting JSON POST data from Zend?


As usual my message wasn't excepted on my first try, but I think it always is
when I reply to it myself... 


OakBehringer wrote:
> 
> Not really sure if I should be posting this in the Zend Framework or Dojo
> mailing list, but here we go...
> 
> How to easily get post data in php/zf if it's json instead of 'normal'
> query string? 
> 
> i.e. an ajax http post is made and in firebug the following is listed
> under the post tab:
> 
> Source
> {"title":"asfdasdfasdfasdfasdf","seo_url":"asfdasdfasdfasdfasdf","author":"asfdasfd","sectionid":"7","summary":"awfawf","has_external_link":false,"external_link":"","body":"awfawfeawefawef","published":"on"}
> 
> screenshot:
>  http://n4.nabble.com/file/n1462014/Capture.png 
> 
> This is the result of calling newItem({...data...}) followed by save()
> from dojox.data.JsonRestStore.
> 
> The data does not show up in the params of the zend framework request
> object or in $_POST.
> 
> Thanks!
> adam
> 

-- 
View this message in context: 
http://n4.nabble.com/Getting-JSON-POST-data-from-Zend-tp1462014p1462075.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Unable to set infinite lifetime with cache manager

2010-02-04 Thread Pádraic Brady
Here's a workaround for getting an infinite lifetime, can be called in any 
controller:

// workaround since config cannot define a NULL value :(
$this->_helper->getHelper('Cache')->setTemplateOptions(
'twitter', // your cache name here
array('frontend'=>array('options'=>array('lifetime'=>null)))
);

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Vladas Diržys 
To: fw-general@lists.zend.com
Sent: Wed, February 3, 2010 4:19:54 PM
Subject: Re: [fw-general] Unable to set infinite lifetime with cache manager


Zend_Cache_Core::load() Second parameter enables you to ignore validity testing:
$cache->load('my_object', true); //should not test expiration

More info: 
http://framework.zend.com/apidoc/1.10/Zend_Cache/Zend_Cache_Core.html#load

--
Pagarbiai,
Vladas Diržys
Tel.: +370 620 69020
www.dirzys.com



On Wed, Feb 3, 2010 at 16:02, umpirsky  wrote:

>
>>Hi.
>
>>I have in my config:
>
>resources.cachemanager.file.frontend.name = Core
>>resources.cachemanager.file.frontend.options.lifetime = null
>>resources.cachemanager.file.frontend.options.automatic_serialization = true
>resources.cachemanager.file.backend.name = File
>>resources.cachemanager.file.backend.options.cache_dir = APPLICATION_PATH
>>"/../data/cache"
>
>>In order to have default lifetime set to null (forever). But looks like it's
>>not possible from config file.
>
>>Am I right?
>
>>Regards,
>>Sasa Stamenkovic.
>--
>>View this message in context: 
>>http://n4.nabble.com/Unable-to-set-infinite-lifetime-with-cache-manager-tp1461182p1461182.html
>>
>
>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Unable to set infinite lifetime with cache manager

2010-02-04 Thread Pádraic Brady
Has anyone reported this to the issue tracker? ;)

There are a few issues getting values from the config files to the end classes 
- they don't work on a 1:1 match and are transparently mutated along the way. 
I'll be reviewing shortly to see if we can introduce some equivelant option 
values both Zend_Config preserves properly, and the classes still understand.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Vladas Diržys 
To: fw-general@lists.zend.com
Sent: Wed, February 3, 2010 4:19:54 PM
Subject: Re: [fw-general] Unable to set infinite lifetime with cache manager


Zend_Cache_Core::load() Second parameter enables you to ignore validity testing:
$cache->load('my_object', true); //should not test expiration

More info: 
http://framework.zend.com/apidoc/1.10/Zend_Cache/Zend_Cache_Core.html#load

--
Pagarbiai,
Vladas Diržys
Tel.: +370 620 69020
www.dirzys.com



On Wed, Feb 3, 2010 at 16:02, umpirsky  wrote:

>
>>Hi.
>
>>I have in my config:
>
>resources.cachemanager.file.frontend.name = Core
>>resources.cachemanager.file.frontend.options.lifetime = null
>>resources.cachemanager.file.frontend.options.automatic_serialization = true
>resources.cachemanager.file.backend.name = File
>>resources.cachemanager.file.backend.options.cache_dir = APPLICATION_PATH
>>"/../data/cache"
>
>>In order to have default lifetime set to null (forever). But looks like it's
>>not possible from config file.
>
>>Am I right?
>
>>Regards,
>>Sasa Stamenkovic.
>--
>>View this message in context: 
>>http://n4.nabble.com/Unable-to-set-infinite-lifetime-with-cache-manager-tp1461182p1461182.html
>>
>
>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: Zend_Session setId

2010-02-02 Thread Pádraic Brady
That's odd - you should be able to regenerate the ID if the session has 
started. How else could you regenerate it? There may, of course, be an issue in 
regenerating an ID so late that the cookie can't be sent, but this should kick 
out an error or something anyway.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Саша Стаменковић 
To: fw-general@lists.zend.com
Sent: Mon, February 1, 2010 2:50:48 PM
Subject: Re: [fw-general] Re: Zend_Session setId

Looking at Zend_SessionTest::testRegenerateId, looks like it's not possible to 
set another session ID if session is already started.

Regards,
Saša Stamenković



On Mon, Feb 1, 2010 at 3:45 PM, umpirsky  wrote:

>
>>I'm integrating uploadify, because of Flash Cookie Bug
>>(http://swfupload.org/forum/generaldiscussion/383) I need to set session ID.
>>So, I have same problem, can anyone help?
>
>>How to restart session with new session ID?
>
>>Regards,
>>Sasa Stamenkovic.
>--
>>View this message in context: 
>>http://n4.nabble.com/Zend-Session-setId-tp643859p1458847.html
>>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Migration to 1.10.0 and setEncoding exception

2010-02-02 Thread Pádraic Brady
Looks like a subtle bug in that we are throwing an Exception for valid data - 
the check should be made case insensitive. Can you file an issue? I'm sure the 
lead dev would also appreciate it if you note any other classes likewise 
impacted.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Lucas CORBEAUX 
To: fw-general@lists.zend.com
Sent: Tue, February 2, 2010 8:57:19 AM
Subject: [fw-general] Migration to 1.10.0 and setEncoding exception

Hello there,

As I'm working on migrating my projects into 1.10.0 I found a breaking
feature in Zend_Filter_StringToUpper (and probably in some others
filters / validators working with mbstring functions) in the setEncoding
method.

Here is the problem : 
$encoding = (string) $encoding;
if (!in_array($encoding, mb_list_encodings())) {
require_once 'Zend/Filter/Exception.php';
throw new Zend_Filter_Exception("The given encoding '$encoding' is
not supported by mbstring");
}

Now the encoding is checked, that's a great thing. But the following
guide : http://framework.zend.com/manual/1.10/en/migration.110.html
doesn't talk about this feature, which can break some project. Ok,
that's not a real problem, because in case of an incorrect encoding
mbstring functions display a warning.

But there is, in my opinion, a real problem. Mbstring functions are case
insensitives with the encoding param, but the following test :

if (!in_array($encoding, mb_list_encodings()))

Is case sensitive.

So the following code will throw an exception :

$filter = new Zend_Filter_StringToUpper();
$filter->setEncoding('utf-8'); // mb_strtoupper($myString, 'utf-8')
seems to work fine...

I'm not sure if it's a desired behavior or if it's an issue, but, at
least, I think one or two words about it in the migration guide should
be really welcome ;)

Lucas

Re: [fw-general] Zend_Cache_Backend_Static missing from reference guide

2010-01-29 Thread Pádraic Brady
Enable or disable file_locking : Can avoid cache 
corruption under
bad circumstances but it doesn't help on 
multithread webservers
or on NFS filesystems...
  
  
  
  read_control
  Boolean
  TRUE
  
Enable / disable read control : if enabled, a 
control key is
embedded in the cache file and this key is compared 
with the
one calculated after the reading.
  
  
  
  read_control_type
  String
  'crc32'
  
Type of read control (only if read control is 
enabled). Available values
are : 'md5' (best but slowest), 'crc32' (lightly 
less safe but faster,
better choice), 'adler32' (new choice, faster than 
crc32),
'strlen' for a length only test (fastest).

  
  
  cache_file_umask
  Integer
  0700
  
  umask for cached files.
  
  
  
  
cache_directory_umask
  Integer
  0700
  
  Umask for directories created within public_dir.

  
  
  
  file_extension
  String
  '.html'
  
  Default file extension for static files created. 
This
  can be configured on the fly, see 
  Zend_Cache_Backend_Static::save() 
though
  generally it's recommended to rely on 
  Zend_Controller_Action_Helper_Cache 
when
  doing so since it's simpler that way than messing 
with
  arrays/serialization manually.
  
  
  
  index_filename
  String
  'index'
  
  If a request URI does not contain sufficient 
information
  to construct a static file (usually this means an 
index
  call, e.g. URI of '/'), the index_filename is 
used instead.
  So '' or '/' would map to 'index.html' (assuming 
the default
  file_extension is '.html').
  
  
  
  tag_cache
  Object
  NULL
  
  Used to set an 'inner' cache utilised to store 
tags
  and file extensions associated with static files. 
This
  MUST be set or the static cache cannot be tracked 
and
  managed.
  
  
  
  disable_caching
  Boolean
  FALSE
  
  If set to TRUE, static files will not be cached. 
This
  will force all requests to be dynamic even if 
marked
  to be cached in Controllers. Useful for debugging.
  
  
  
  
  


 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Matthew Weier O'Phinney 
To: fw-general@lists.zend.com
Sent: Thu, January 28, 2010 9:07:14 PM
Subject: Re: [fw-general] Zend_Cache_Backend_Static missing from reference guide

-- Mark Wright  wrote
(on Thursday, 28 January 2010, 01:38 PM -0700):
> Zend_Cache_Backend_Static is in the api doc but not the reference guide.

I'm thinking Paddy may not have completed the end-user docs for this
prior to tagging... I'm sure he'll chime in to let us know, though. :)

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


Re: [fw-general] Rendering Response when Unit Testing Controllers

2010-01-07 Thread Pádraic Brady
There's a view option to enable the stream conversion ;).

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Vladas Diržys 
To: fw-general@lists.zend.com
Sent: Thu, January 7, 2010 7:49:38 AM
Subject: Re: [fw-general] Rendering Response when Unit Testing Controllers

Iteresting only, why Zend_View_Stream doesn't converts short tags to long 
tags?...

--
Regards,
Vladas Diržys



On Wed, Jan 6, 2010 at 21:32, bparise  wrote:

>
>>I feel like such a noob...
>>Thanks!
>
>
>
>>Vladas Diržys wrote:
>>>
>>> Maybe you have short_open_tag disabled?
>>>
>>> --
>>> Regards,
>>> Vladas Diržys
>>>
>>>
>>> On Wed, Jan 6, 2010 at 21:01, bparise  wrote:
>>>
>>>>
>>>> I have controller testing with PHPUnit setup, but the response is just
>>>> rendering the PHP code(not actually rendering the views).
>>>>
>>>> >>> class SiteControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
>>>> {
>>>>//...
>>>>public function testLoginForm()
>>>>{
>>>>$this->request->setMethod('POST')->setPost(array('username' =>
>>>> 'test', 'password' => 'test'));
>>>>$this->dispatch('/site/login');
>>>>
>>>>// Always results in an error
>>>>$this->assertQuery('form#LoginForm');
>>>>
>>>>// So, I checked the response body, and noticed none of is is
>>>> being
>>>> rendered, its just the PHP code.
>>>>
>>>>print_r($this->getResponse()->getBody());
>>>>/*
>>>>
>>>>...
>>>>layout()->content; ?>
>>>>
>>>>*/
>>>>}
>>>> }
>>>> ?>
>>>>
>>>> Is there a way to get it to render so I can test the existence of the
>>>> login
>>>> form?
>>>> --
>>>> View this message in context:
>>>> http://n4.nabble.com/Rendering-Response-when-Unit-Testing-Controllers-tp1008280p1008280.html
>>
>
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>>
>>>
>>>
>
>--
>>View this message in context: 
>>http://n4.nabble.com/Rendering-Response-when-Unit-Testing-Controllers-tp1008280p1008297.html
>
>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Unit testing over a network

2010-01-03 Thread Pádraic Brady
I'm using whatever the latest PHPUnit is here from the pear.phpunit.de PEAR 
channel.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Mike A 
To: fw-general@lists.zend.com
Sent: Sun, January 3, 2010 12:49:01 PM
Subject: [fw-general] Unit testing over a network

Writing a ZF book here. For it I wondered what was a good way to carry out unit 
testing over 
a development team local network.

Network structure - server: Windows machine with IIS removed and XAMPP 
Apache/MySQL 
install with PEAR, Xdebug and PHPUnit. Client machines can be anything. Access 
to server 
(in this case) is on IP:192.168.1.3.

How to run PHPUnit tests from any client?

Also, I noticed somewhere that the Zend team use PHPUnit2, not PHPUnit. Is this 
so? What 
are the advantages/disadvantages?

In both cases I am trying to explain clearly for novices and experts alike the 
best way to set 
up ZF development systems.

TIA...

Mike A.


Re: [fw-general] Sitemap headers

2010-01-02 Thread Pádraic Brady
Because text/xml has issues as the MIME type. For example, it's default 
encoding is suppossed to be ASCII and it can't use some Unicode encodings 
depending on the protocol. application/xml has fewer restrictions, and in 
addition marks an XML document as being intended as data to be processed by a 
program/app. That's why all feed types, for example, follow the MIME type 
application/rss+xml, marking the type +  format as being a machine processable 
XML document.

application/xml is just the generic equivelant where no specific type for the 
format has been assigned/registered.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: takeshin 
To: fw-general@lists.zend.com
Sent: Sat, January 2, 2010 11:37:59 PM
Subject: RE: [fw-general] Sitemap headers




Razorblade wrote:
> 
> 
> Here it is
>   $response = $this->getResponse();
>   $response->setHeader('Cache-Control', 'public', true)
> ->setHeader('Content-Description', 'File Transfer', true)
> ->setHeader('Content-Type', 'application/xml', true)
> ->setHeader('Content-Transfer-Encoding', 'binary', true)
> ->appendBody($xmlString);
> 
> Sergio 
> 

Thank you.

BTW, why not text/xml ?

-- 
regards
takeshin

-- 
View this message in context: 
http://n4.nabble.com/Sitemap-headers-tp997420p997493.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Wil's bowing out. . .

2010-01-01 Thread Pádraic Brady
Wil,

All the best in the new year! During your time with Zend you did an amazing job 
on the Zend Framework and I'm certain the Lithium guys will benefit from your 
experience.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Wil Sinclair 
To: fw-general@lists.zend.com
Cc: zf-contribut...@lists.zend.com
Sent: Thu, December 31, 2009 7:59:17 PM
Subject: [fw-general] Wil's bowing out. . .

Hi all,

I'm afraid I won't be working at Zend in the coming year. I've had a
great time working with all of you, and I wish you and the ZF project
all the success in the world.

My personal mail is w...@wllm.com. I won't have a lot of time for Zend
Framework in the next few months, but you can find me working with the
guys from CakePHP on a new project called Lithium:
http://li3.rad-dev.org/. Hop on IRC and drop by #li3 if you'd like to
chat.

Happy New Year!
,Wil


Re: [fw-general] invalid id/tag into controller_action_plugin_cache

2009-12-27 Thread Pádraic Brady
Thanks for the issue ;). Yeah, the base64 things works. Originally it was 
designed around a refactoring of Zend_Cache but ZC's unit tests were less than 
complete and the refactoring despite passing all tests actually broke stuff. 
Unfortunate but the lesson is to never trust unit tests you didn't write 
yourself ;). I'll be trying to get that refactoring in for ZF 2.0 because at 
the moment all the restrictions can't be changed by subclassing (all 
private/frontend based instead of backend where they actually apply).

Looks like I survived the turkey ;). Have a happy new year :P.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Renan de Lima 
To: Pádraic Brady 
Cc: Zend Framework General 
Sent: Sun, December 27, 2009 5:32:49 AM
Subject: Re: [fw-general] invalid id/tag into controller_action_plugin_cache

hi,

good, my local fix is exactly a base64 and a replace '=' to '_'
anyway, i've created a issue for that, just to keep tasks organized,
it's already assigned to you:
http://framework.zend.com/issues/browse/ZF-8639

i hope you had a nice turkey this holiday, i am still alive, are you?
have a good new year, don't drink a lot ;-)

2009/12/24 Pádraic Brady :
> Hi Renan,
>
> No, it's a bug in the helper. The class was originally coded for a
> refactoring of Zend_Cache which never materialised. In the timeframe up to
> the alpha release I never got around to my usual review so it slipped past
> me. I'll be fixing it in trunk (using a small base64 encoded workaround to
> outwit that Exception) over the weekend.
>
> This is assuming the quantity of turkey I consume tomorrow does not prove
> fatal ;).
>
> Paddy
>
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
>
>
> 
> From: Renan de Lima 
> To: fw-general@lists.zend.com
> Sent: Thu, December 24, 2009 4:00:37 PM
> Subject: [fw-general] invalid id/tag into controller_action_plugin_cache
>
> I dont know if here is a good place to talk about a problem that i
> have with a new component into zf1.10 functionality
>
> it's about Zend_Controller_Action_Helper_Cache
> once configured cache manager it gives this exception from Zend_Cache_Core:
> "Invalid id or tag '/mycontroller/myaction' : must use only [a-zA-Z0-9_]"
> this helper uses request URI as id for cache, but URI contains invalid
> characters, is there anything i'm doing wrong?
>
> regards,
>
> --
> Renan de Lima Barbosa
> gtalk/msn: renandel...@gmail.com
> skype: renandelima
> +55 61 8166-7755
> renandelima.com
>



-- 
Renan de Lima Barbosa
gtalk/msn: renandel...@gmail.com
skype: renandelima
+55 61 8166-7755
renandelima.com


Re: [fw-general] invalid id/tag into controller_action_plugin_cache

2009-12-24 Thread Pádraic Brady
Hi Renan,

No, it's a bug in the helper. The class was originally coded for a refactoring 
of Zend_Cache which never materialised. In the timeframe up to the alpha 
release I never got around to my usual review so it slipped past me. I'll be 
fixing it in trunk (using a small base64 encoded workaround to outwit that 
Exception) over the weekend.

This is assuming the quantity of turkey I consume tomorrow does not prove fatal 
;).

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Renan de Lima 
To: fw-general@lists.zend.com
Sent: Thu, December 24, 2009 4:00:37 PM
Subject: [fw-general] invalid id/tag into controller_action_plugin_cache

I dont know if here is a good place to talk about a problem that i
have with a new component into zf1.10 functionality

it's about Zend_Controller_Action_Helper_Cache
once configured cache manager it gives this exception from Zend_Cache_Core:
"Invalid id or tag '/mycontroller/myaction' : must use only [a-zA-Z0-9_]"
this helper uses request URI as id for cache, but URI contains invalid
characters, is there anything i'm doing wrong?

regards,

-- 
Renan de Lima Barbosa
gtalk/msn: renandel...@gmail.com
skype: renandelima
+55 61 8166-7755
renandelima.com


Re: [fw-general] Zend_Feed_Writer docs

2009-12-21 Thread Pádraic Brady
Hi takeshin,

It's a separate download on the download page for the alpha version. The ZFW 
docs are not entirely complete but there's an intro and getting started section 
that covers all the basics and some detailed API descriptions for the feed 
level API.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: takeshin 
To: fw-general@lists.zend.com
Sent: Mon, December 21, 2009 10:33:35 PM
Subject: [fw-general] Zend_Feed_Writer docs


Where can I find documentation for new Zend_Feed_Writer?

Is there any pre-built documentation for 1.10 alpha?

-- 
regards
takeshin
-- 
View this message in context: 
http://n4.nabble.com/Zend-Feed-Writer-docs-tp976585p976585.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] version number in Zend_Version

2009-12-18 Thread Pádraic Brady
1.10 is currently in development and being readied for a near future release, 
so the version is accurate for the standard trunk. 1.9 development, as usual, 
would take place also in the standard trunk but would be separately (excluding 
any 1.10 specific changes) merged to the release-1.9 branch. This makes sense - 
the trunk will obviously play host to changes associated with the next minor 
release, not just the next mini release.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Victor Farazdagi 
To: fw-general@lists.zend.com
Sent: Fri, December 18, 2009 1:56:40 PM
Subject: [fw-general] version number in Zend_Version

 Hi!
How come current Zend_Version points to 1.10.0alpha? I noticed that 

zf show version

brings 1.10.0alpha - thought I had some issues with my include path
(probably including some old version of ZF). But nope, I check out from
the trunk, and Zend/Version.php contains exactly "1.10.0alpha".
Probably, I just missed the versioning scheme, but shouldn't it be
something along the lines of 1.9.*dev?

Could somebody elaborate on it?

Thanks,
Victor

Re: [fw-general] problems updating ZF SVN trunk

2009-12-18 Thread Pádraic Brady
Delete the file and re-up if you are on a case insensitive OS.

There is no actual fix without restoring the original filename, and that would 
be a violation of the coding standard. The SVN trunk is NOT broken - it's a 
valid name change. The only thing "broken" is your operating system which can't 
tell the difference between "a" and "A" ;).

Presumably this also affects Windows.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Simon R Jones 
To: Zend Framework General 
Sent: Fri, December 18, 2009 11:41:01 AM
Subject: Re: [fw-general] problems updating ZF SVN trunk

I'm on the command line (Terminal on the mac), and doing the suggestion in 
Tortoise will alter the ZF SVN repository.

I am sure there is someone working on this component so I just wanted to 
highlight the SVN trunk appears to be broken for case-insensitive machines at 
present. Happy to help resolve it, if given permission :-)

best wishes,
Si

> I have same problem with tortoise.
> 
> Regards,
> Saša Stamenković
> 
> 
> On Fri, Dec 18, 2009 at 12:18 PM, Daniel Latter  wrote:
> Hi,
> 
> are you using TortoiseSVN? if so maybe this will help: 
> http://tortoisesvn.net/node/285
> 

Re: [fw-general] Caching translations

2009-12-13 Thread Pádraic Brady
It makes sense to cache. The gettext format in use by Zend_Translate isn't 
simply the typical implementation - it's a PHP implementation with additional 
functionality.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: umpirsky 
To: fw-general@lists.zend.com
Sent: Sun, December 13, 2009 10:32:43 AM
Subject: [fw-general] Caching translations


Hi.

Does it have sense to cache translations with Zend_Cache_File when using
gettext adapter? I mean, gettext is binary, how much can cache speed it up?

I saw performance testings
http://www.zfforums.com/zend-framework-components-13/internationalization-i18n-localization-l10n-15/results-zend_translate-performance-testing-908.html
and looks like it's faster with cache.

What do you think?

Regards,
Saša Stamenković.
-- 
View this message in context: 
http://n4.nabble.com/Caching-translations-tp962904p962904.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Best practice on storing IPs with Zend_DB_Table

2009-12-13 Thread Pádraic Brady
You can handle both directions using MySQL functions, i.e. when writing the 
value and reading it. This allows any PHP code to work solely with IP addresses 
and not worry about the numeric values. So use INET_ATON when storing it (see 
docs on using expressions in Zend_Db queries) and INET_NTOA when retrieving it.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Syncrat 
To: fw-general@lists.zend.com
Sent: Sun, December 13, 2009 9:30:54 AM
Subject: [fw-general] Best practice on storing IPs with Zend_DB_Table


Hi. I was just wondering what people thought was best practice on storing IPs
with Zend_DB_Table. As I understand IPs are best stored in MySQL in an
INT(11) field for faster lookups (rather than a string). If I want
zend_db_table_row to hold the string version of the ip when in memory, at
what point should the PHP ip2long function or MySQL INET_ATON function be
called. What is the best way to make this translation?
-- 
View this message in context: 
http://n4.nabble.com/Best-practice-on-storing-IPs-with-Zend-DB-Table-tp962887p962887.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] cant reset issue tracker password?

2009-12-12 Thread Pádraic Brady
You have to reset your password from a separate location: 
http://framework.zend.com/crowd/ 

The link should be put somewhere obvious at some time ;).

Paddy

Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: "jshp...@gmail.com" 
To: fw-general@lists.zend.com
Sent: Sat, December 12, 2009 2:04:41 AM
Subject: [fw-general] cant reset issue tracker password?

The JIRA email confirmation at signup reads:
"(If you forget your password, you can retrieve it via the "Forgot Password" 
link on the sign up page)"
And I have no forgotten password link, on the signup page or any other page


Re: [fw-general] Zend_Feed - sending proper headers

2009-12-11 Thread Pádraic Brady
Be careful with the logic - the Last-Modified header shouldn't be based on the 
client header (base it on the date the feed was last modifed). You should also 
send a relevant Etag since it's often also expected by clients using a 
conditional GET request.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Hector Virgen 
To: takeshin 
Cc: fw-general@lists.zend.com
Sent: Thu, December 10, 2009 9:24:37 PM
Subject: Re: [fw-general] Zend_Feed - sending proper headers

You'll want to use a mix of server-side caching and client-side caching. The 
server-side caching can be done with Zend_Cache. That way if two separate users 
try to access the feed, your application only needs to build it once.

For client-side caching, you'll need to analyze the request and send the 
correct response headers.

I use something like this:

public function viewAction()
{
$request = $this->getRequest();
$response = $this->getResponse();
// Enable browser caching
$response->setHeader('Cache-Control', 'private, max-age=10800, 
pre-check=10800', true);
$response->setHeader('Pragma', 'private', true);
$response->setHeader('Expires', date(DATE_RFC822, strtotime(' 2 day')), true);
// Check for client cache
if (null !== ($modified = $request->getServer('HTTP_IF_MODIFIED_SINCE'))) {
// User has cached page, send 304 "not modified" header
$response->setHeader('Last-Modified', $modified, true);
$response->setHttpResponseCode(304);
} else {
// User does not have cached page, build response body
/* Your server-side caching code goes here */
$response->setBody($feed);
}
// Send response
$response->sendResponse();
exit;
}

I hope this helps.
--
Hector



On Thu, Dec 10, 2009 at 12:48 PM, takeshin  wrote:

>
>>How to send feeds properly?
>
>>I want browser read whole file, only if it has new entries.
>
>>I read data from the database. Limit result to 15 items.
>>Then create an array and pass it to the Zend_Feed.
>
>>Shall I cache the above steps with Zend_Cache + very long lifetime,
>>and use a cache tag, clean cache entries by tag when new article is posted?
>
>>Then, is it enough to use send() method?
>>Do browsers read last-modified entry from the feed itself,
>>or only from the HTTP headers?
>
>>--
>>regards
>>takeshin
>
>>--
>>View this message in context: 
>>http://n4.nabble.com/Zend-Feed-sending-proper-headers-tp960516p960516.html
>>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] ZF - Where to begin?

2009-11-25 Thread Pádraic Brady
Thanks, Daniel ;)

Survive The Deep End isn't complete but it covers almost anything worth 
mentioning when starting out. I'll be kicking out more chapters pretty soon - 
it's turned into a longer term project since it started.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Daniel Latter 
To: Fozzyuw 
Cc: Zend Framework General 
Sent: Wed, November 25, 2009 4:59:22 PM
Subject: Re: [fw-general] ZF - Where to begin?

http://www.survivethedeepend.com/

Thanks.


2009/11/25 Fozzyuw 

>
>>Hi all,
>
>>I've been watching and playing with ZF for some time now.  Never very deeply
>>at any given time and often putting it down for extended periods of time
>>(version releases).
>
>>One thing that keeps happening is that ZF is growing quickly.  Which is
>>good, but it's also hard to keep up.
>
>>I'm getting to the point where I'm rather quite lost.  The Programmer's
>>Reference Guides (PRG) on the website are good, but often very limited in
>>scope, never offering much of the complete package.
>
>>So, my question is, where does one find a great ZF resource that does a good
>>job introducing ZF and explaining how everything fits together with both
>>independent examples (like PRG offers) and integration into a larger overall
>>project?
>
>>A book I had on ZF a year ago is beyond outdated.  Not even having
>>references to Zend_Layout and now there are some nice tools like
>>Zend_Navigation to learn.  On top of trying to understand the dispatch
>>process and it's relation to helpers and overall MVC best practices.
>
>>So, as an experienced PHP programmer but someone who's looking wanting to
>>get the whole picture on how to best start utilizing ZF, where does one
>>begin?
>
>>Cheers!
>>Fozzy
>--
>>View this message in context: 
>>http://n4.nabble.com/ZF-Where-to-begin-tp787666p787666.html
>>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine integration

2009-11-25 Thread Pádraic Brady
Not knowing about Xyster is called being ignorant, not misinformed ;). I'm not 
misinformed about Xyster - I never even knew it existed until now. The actual 
failure, if there was one, dates back to the beginning of ZF when an ORM was 
not actively pursued. 

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Arié Bénichou 
To: fw-general@lists.zend.com
Sent: Wed, November 25, 2009 12:56:20 PM
Subject: Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine 
integration


Pádraic,

It's quite easy to call someone a 'troll'.
I admit the term 'failure' is probably not fair.
However, that's how your competitors, from the open source world, or not,
(it doesn't matter), could look at it. I sincerely did not mean to hurt or
blame Benjamin who where working on his own. It's a good thing he had the
maturity to 'roll-back'. It's just a pity strategically, that support for
Doctrine was announced after this 'failure'. It would have been a smarter
move to propose a formal Doctrine
integration first, then to launch R&D on Zend_Entity.


Pádraic Brady wrote:
> 
> I also have never heard of Xyster - so it would have been a surprise to
> see it adopted.
> 
I'm the one supposed to be misinformed.

-Arié


Pádraic Brady wrote:
> 
>>SensioLabs is not the devil, obviously, it's simply your main 
> competitor.
>>It's a pity that you decided to reinvent the wheel, met a 'little
blockade',
>>resigned and decided to go for Doctrine on this 
> failure. You could have
>>started by providing integration to the 
> popular Doctrine, then have a look
>>to the Xyster Orm. So, as i said, 
> it's a pity, that you failed this way. If
>>i were SensioLabs, 
>>http://www.doctrine-project.org/documentation/manual/2_0/en/pdf i would
rub
>>my hands.
> 
> Either you're a troll or you're misinformed...
> 
> You keep referring to a "failure" but leave it unspecified - Benjamin made
> a decision that writing Zend_Entity et al. was simply not possible at this
> time. He was the sole developer and had no assistance.
> 
> I also have never heard of Xyster - so it would have been a surprise to
> see it adopted.
> 
> SensioLabs may be rubbing their hands for some reason, but not because our
> adoption of Doctrine assists Symfony. Developers have been using Doctrine
> with the Zend Framework since forever. The only thing that has changed is
> making its integration a formal development goal. In my mind that is a
> success given Doctrine's popularity that will actually do the opposite of
> what you seem to suspect. I could say the same for other forms of
> integration.
> 
> Symfony has an advantage in that it bundles third party libraries while ZF
> reinvents them or misses the features they offer (sometimes not for the
> better). Maybe the integration of Doctrine will prompt a look at what else
> has been missing - YAML, HTML filtering, etc.
> 
> Paddy
> 
>  Pádraic Brady
> 
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
> 
> 
> 
> 
> 
> 
> From: Arié Bénichou 
> To: fw-general@lists.zend.com
> Sent: Wed, November 25, 2009 10:08:39 AM
> Subject: Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine
> integration
> 
> 
> Hi,
> 
> 
> drm-4 wrote:
>>  
>> If you'd like integration for Xyster, write a proposal for it.
>> 
> Please Gerard, don't tell me what i'm supposed to do. You don't get the
> point here, the question is : why did'nt you use Xyster ORM?
> 
> 
> drm-4 wrote:
>>  
>> And Sensio is the devil...? What's your point? Let alone the fact that 
>> Doctrine is simply open source (LGPL) and whatever company would be 
>> behind it wouldn't make any difference? Also, check your facts, because 
>> what you say isn't even true.
>> 
> 
> SensioLabs is not the devil, obviously, it's simply your main competitor.
> It's a pity that you decided to reinvent the wheel, met a 'little
> blockade',
> resigned and decided to go for Doctrine on this failure. You could have
> started by providing integration to the popular Doctrine, then have a look
> to the Xyster Orm. So, as i said, it's a pity, that you failed this way.
> If
> i were SensioLabs, 
> http://www.doctrine-project.org/documentation/manual/2_0/en/pdf i would
> rub
> my hands .
> 
> So, i will ask my question again : why did'nt you use Xyster ORM?
> 
> -Arié
> -- 
> View this message in context:
> http://n4.nabble.com/Discontinuing-Zend-Entity-in-favour-of-Doctrine-integration-tp648011p787423.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 

-- 
View this message in context: 
http://n4.nabble.com/Discontinuing-Zend-Entity-in-favour-of-Doctrine-integration-tp648011p787521.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine integration

2009-11-25 Thread Pádraic Brady
>SensioLabs is not the devil, obviously, it's simply your main 
competitor.
>It's a pity that you decided to reinvent the wheel, met a 'little blockade',
>resigned and decided to go for Doctrine on this 
failure. You could have
>started by providing integration to the 
popular Doctrine, then have a look
>to the Xyster Orm. So, as i said, 
it's a pity, that you failed this way. If
>i were SensioLabs, 
>http://www.doctrine-project.org/documentation/manual/2_0/en/pdf i would rub
>my hands.

Either you're a troll or you're misinformed...

You keep referring to a "failure" but leave it unspecified - Benjamin made a 
decision that writing Zend_Entity et al. was simply not possible at this time. 
He was the sole developer and had no assistance.

I also have never heard of Xyster - so it would have been a surprise to see it 
adopted.

SensioLabs may be rubbing their hands for some reason, but not because our 
adoption of Doctrine assists Symfony. Developers have been using Doctrine with 
the Zend Framework since forever. The only thing that has changed is making its 
integration a formal development goal. In my mind that is a success given 
Doctrine's popularity that will actually do the opposite of what you seem to 
suspect. I could say the same for other forms of integration.

Symfony has an advantage in that it bundles third party libraries while ZF 
reinvents them or misses the features they offer (sometimes not for the 
better). Maybe the integration of Doctrine will prompt a look at what else has 
been missing - YAML, HTML filtering, etc.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Arié Bénichou 
To: fw-general@lists.zend.com
Sent: Wed, November 25, 2009 10:08:39 AM
Subject: Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine 
integration


Hi,


drm-4 wrote:
>  
> If you'd like integration for Xyster, write a proposal for it.
> 
Please Gerard, don't tell me what i'm supposed to do. You don't get the
point here, the question is : why did'nt you use Xyster ORM?


drm-4 wrote:
>  
> And Sensio is the devil...? What's your point? Let alone the fact that 
> Doctrine is simply open source (LGPL) and whatever company would be 
> behind it wouldn't make any difference? Also, check your facts, because 
> what you say isn't even true.
> 

SensioLabs is not the devil, obviously, it's simply your main competitor.
It's a pity that you decided to reinvent the wheel, met a 'little blockade',
resigned and decided to go for Doctrine on this failure. You could have
started by providing integration to the popular Doctrine, then have a look
to the Xyster Orm. So, as i said, it's a pity, that you failed this way. If
i were SensioLabs, 
http://www.doctrine-project.org/documentation/manual/2_0/en/pdf i would rub
my hands .

So, i will ask my question again : why did'nt you use Xyster ORM?

-Arié
-- 
View this message in context: 
http://n4.nabble.com/Discontinuing-Zend-Entity-in-favour-of-Doctrine-integration-tp648011p787423.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Where have all the ZF questions gone?

2009-11-13 Thread Pádraic Brady
Maybe all the new additions are knock outs - easy to pick up, use and forget 
about.

Maybe? ;)

paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: swilhelm 
To: fw-general@lists.zend.com
Sent: Fri, November 13, 2009 6:03:32 PM
Subject: [fw-general] Where have all the ZF questions gone?


It seems like the number of daily ZF questions posted to this forum is
declining; it appears to average less than a dozen per day.  I would have
thought with all the new features added this year, questions would be on the
rise not declining.

Has the ZF development community moved to another forum?

- Steve W.
-- 
View this message in context: 
http://old.nabble.com/Where-have-all-the-ZF-questions-gone--tp26340774p26340774.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Zend_Service_Twitter constructor

2009-11-04 Thread Pádraic Brady
It should be reasonable though it will subtly change the expected behaviour 
(might need to wait for a 1.10 release though it can be fixed in trunk now). 
Can you create an issue for this? If not - just ping me and I'll add an issue 
for you. The next bug hunt is around two weeks away so I'll look at it then if 
not already fixed at that time.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Joe Czhlobatnik 
To: fw-general@lists.zend.com
Sent: Tue, November 3, 2009 6:56:17 PM
Subject: [fw-general] Zend_Service_Twitter constructor

  
There are cases where Zend_Service_Twitter can be used without 
authentication, but the constructor requires $username and $password to 
always be passed. For example, checking if a given username exists or not: 

$tw = new Zend_Service_Twitter(null); 
$exists = $tw->user->show($who)->id() !== null; 

Since the first parameter is required, I can't simply do this: 

$tw = new Zend_Service_Twitter(); 

I'm thinking that both constructor parameters should be optional, in 
order to more cleanly support these anonymous uses. Does this seem 
reasonable? 

Hotmail: Trusted email with powerful SPAM protection. Sign up now.

Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine integration

2009-10-30 Thread Pádraic Brady
I think Matthew is pointing out that there have always been doubts about 
utilising a DI container in light weight languages like PHP, Python, and Ruby. 
In essence, it's remarkably hard to create a valid use case for a DI container. 
You can create any number of artificial examples, but the light weightedness of 
PHP, it's tolerance for loose coupling, and the minimal code it generates (all 
reasons why we use it) make using DI overkill - probably in 95% or more of the 
common uses for PHP.

There are some interesting case studies in Ruby if you go looking where 
individuals have experiemented in writing a DI container/framework for Ruby. 
Ruby has several Di containers/frameworks - nearly all them are classified as 
dormant. Ruby has one very neat thing over PHP - you can overload object 
instantiation.

This is not to say a DI container is useless or meaningless, but the classical 
concept of a DI container from Java or C# is only marginally useful in PHP. In 
most respects all you really need is a little substitution and light mapping. 
If that's the goal of any future DI work in ZF, then please, fire on all 
cylinders. Whether that would qualify as a DI container or not is anyone's 
guess ;). Once you start accumulating more features, more complex mapping, and 
more classical injection methods - then it will bury itself into oblivion as an 
overarchitected mess 99% of PHP developers just do not need.

My 2c :)

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: keith Pope 
To: fw-general@lists.zend.com
Sent: Fri, October 30, 2009 7:19:25 PM
Subject: Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine  
integration

2009/10/30 Matthew Weier O'Phinney :
> -- keith Pope  wrote
> (on Friday, 30 October 2009, 04:43 PM +):
>> 2009/10/30 Matthew Weier O'Phinney :
>> > -- keith Pope  wrote
>> > (on Friday, 30 October 2009, 04:02 PM +):
>> > > 2009/10/30 Ralph Schindler  :
>> > > Also will we be deprecating Zend_Db as if we have tight Doctrine
>> > > integration is there any reason to keep Zend_Db?
>> >
>> > There are plenty of reasons to keep Zend_Db. Not everyone will be using
>> > Doctrine, and for many one-off types of applications (single tables, or
>> > multiple tables with no relations, etc.), having Zend_Db around will
>> > continue to be essential. Additionally, one aspect I'd like to explore
>> > with the Doctrine folks is potentially allowing Zend_Db adapters as
>> > Doctrine RDBMS adapters; this would provide some very interesting
>> > integration points.
>>
>> Sounds interesting I look forward to seeing this initiative develop
>> further, I would be happy to help in any way I can :)
>>
>> Once we have the integration especially with doctrine 2 would there be
>> any further plans to look at things like dependency injection,
>> criteria objects and repositories or any other DDD tools? To me having
>> a full suite of tools like this would be a great long term goal?
>
> DI is something we're already planning for -- you'll note the "unified
> constructor" pattern in all new components. Whether or not we'll have a
> DI _container_ is another question; I'm not entirely convinced DI
> containers have a good place in stateless applications, but I'll let
> Ralph talk more to that point. :)

That is an interesting point, I dont quite understand how state
affects object dependencies or is the container an unnecessary
overhead when you are working in a limited state environment?
Something I may have to ponder

>
> As for criteria objects, we've just approved another of Ben's
> components, some extensions to Zend_Db_Expr. One aspect I particularly
> like with it is that, combined with Zend_Db_Select, we are getting to a
> point where we have an almost complete criteria object for select
> operations. This could certainly be adapted for use with DDD fairly
> easily. Regarding repositories, Zend_Application_Bootstrap actually
> already acts as one in many ways -- though we may do more with this
> and/or service locators for 2.0.
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
>



-- 

http://www.thepopeisdead.com


Re: [fw-general] Zend_View adapters

2009-10-24 Thread Pádraic Brady
There are no plans that I'm aware of since there are something like a billion 
template engines, well, maybe less than that ;). I'm not sure if anyone has 
actually tried a formal proposal under the ZendX namespace however. Might be 
worth a short - maybe ask around on the #zftalk.dev channel on Freenode IRC 
sometime.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Ladislav Prskavec 
To: Zend Framework General 
Sent: Sat, October 24, 2009 6:01:09 PM
Subject: Re: [fw-general] Zend_View adapters

umpirsky wrote:
> Hi.
>
> I saw Twig adapter for Zend_View recently
> http://svn.twig-project.org/branches/zend_adapter/.
>
> So I wonder, are there any plans for implementing some adapterts for smarty,
> savant...? Or will twig adapter get it's place in zf some day?
>
> If yes, will they have all features which Zend_View has? Because it looks
> like Zend_View is a bit hard to customize.
>
> Regards,
> Sasa Stamenkovic.
>  
I make some example using Twig in Zend, source are on 
http://github.com/abtris/twigZend

Try It!

-- 
Ing. Ladislav Prskavec
E-mail: ladislav.prska...@gmail.com
Tel. / Phone: +420 604 419 262
Blog: http://blog.prskavec.net
LinkedIn: http://www.linkedin.com/in/ladislavprskavec
Twitter: http://twitter.com/abtris/

Re: [fw-general] Zend_Mail - sending from a cron task

2009-10-24 Thread Pádraic Brady
Are you sure both are using the same configuration for SMTP? You may have lost 
something in the translation from ZF to CLI script - check for any statically 
set default adapters. I think there's at least one of those somewhere you may 
have missed on the CLI side.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: debussy007 
To: fw-general@lists.zend.com
Sent: Sat, October 24, 2009 2:22:25 PM
Subject: [fw-general] Zend_Mail - sending from a cron task


Hi!

When a mail is sent from the webserver of my website, using the Gmail SMTP
server, I can see the mail that has been sent in Gmail (in Sent mails)

However, when a mail is sent from a php script in background triggered by a
CRON task, the sent mail doesn't appear appear in Gmail's Sent mails.

Does anyone have an idea why ?
(I hope my question was clear, if not I may clarify further)

Thank you for any help !
-- 
View this message in context: 
http://www.nabble.com/Zend_Mail---sending-from-a-cron-task-tp26038975p26038975.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Zend_Feed_Reader Categories

2009-10-24 Thread Pádraic Brady
Hi Bradley,

Sure - it just didn't quite make the timeline for 1.9, and with 1.10 not yet 
scheduled it was left by the wayside while I fixed up some other areas (like 
the support for relative URLs in Atom). Since you asked though, I'll get it 
added to trunk during the week. You can file an improvement issue if you want 
to track it.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Bradley Holt 
To: Zend Framework General 
Sent: Sat, October 24, 2009 10:42:39 PM
Subject: [fw-general] Zend_Feed_Reader Categories

Are there any plans to add support for categories in Zend_Feed_Reader?
A getCategories method on Zend_Feed_Reader_FeedInterface and
Zend_Feed_Reader_EntryInterface would be very useful. A cursory glance
shows that both Atom and RSS support categories.

Thanks,
Bradley

-- 
Bradley Holt
bradley.h...@foundline.com


Re: [fw-general] Zend_Feed::import($url) Invalid Chunk Size Error - Zend_Http_Client_Adapter_Socket Problem

2009-10-16 Thread Pádraic Brady
It's on my development PC, but here's the output from "php -m":

[PHP Modules]
bcmath
bz2
calendar
ctype
curl
date
dba
dom
exif
filter
ftp
gd
gettext
gmp
hash
iconv
json
libxml
mbstring
mcrypt
memcache
mhash
mime_magic
mysql
mysqli
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
standard
suhosin
svn
syck
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]
Xdebug

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Arthur M. Kang 
To: Pádraic Brady 
Cc: Zend Framework General 
Sent: Fri, October 16, 2009 4:26:51 PM
Subject: Re: [fw-general] Zend_Feed::import($url) Invalid Chunk Size Error - 
Zend_Http_Client_Adapter_Socket Problem

 I have tried it with the latest
version (1.9.4) and it gives me the same results.  Do you have mbstring
installed?

I know the problem is with Zend_Http_Client_Adapter_Socket.  And it may
be coupled with multibyte encoding.  When I force HTTP/1.0, the invalid
chunk message goes away (as it's no longer chunking) but then, I get an
XML error because the string is corrupt.

Paddy, would you mind sending me the php modules installed on your
system?

Thanks.

Arthur



Pádraic Brady wrote: 
> 
>I
>just tested both Zend_Feed and also Zend_Feed_Reader but was unable to
>replicate the Exception. Can you try with the most recent ZF version in
>case this was a transitory bug in 1.9.0 resolved since?
>
>>Thanks,
>>Paddy
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish
>Representative
> 
>
>
>
>
>

From: >Arthur Kang 
>To: fw-general@lists.zend.com
>Sent: Fri, October 16,
>2009 12:16:12 AM
>Subject: [fw-general]
>Zend_Feed::import($url) Invalid Chunk Size Error
>
>
>Using ver 1.9.0
>
>>Code:
>try {
>>$test = Zend_Feed::import('http://feeds.feedburner.com/techcrunch');
>>} catch (Exception $e) {
>>echo "Error: {$e->getMessage()}\n";
>>}
>
>>Produces:
>Error: Invalid chunk
>size
>"" unable to read chunked body 
>
>>Can anyone confirm this?  Any workarounds?  Anyway to manually specify
>that HTTP/1.0 should be used instead of 1.1?
>
>>Any help is appreciated.
>
>>Arthur
> 
>

Re: [fw-general] commit privileges

2009-10-16 Thread Pádraic Brady
Any of the Zend team should be able to get you started. It's Bug Hunt Day, and 
Zendcon is upcoming, so you may been to be patient if they are busy.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Michael Depetrillo 
To: Zend Framework 
Sent: Fri, October 16, 2009 4:06:17 AM
Subject: [fw-general] commit privileges

Who do we contact to receive svn commit privileges?  I signed the cla and have 
issue tracker access but cannot commit to the trunk. 

Michael DePetrillo


Re: [fw-general] Zend_Feed::import($url) Invalid Chunk Size Error

2009-10-16 Thread Pádraic Brady
I just tested both Zend_Feed and also Zend_Feed_Reader but was unable to 
replicate the Exception. Can you try with the most recent ZF version in case 
this was a transitory bug in 1.9.0 resolved since?

Thanks,
Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Arthur Kang 
To: fw-general@lists.zend.com
Sent: Fri, October 16, 2009 12:16:12 AM
Subject: [fw-general] Zend_Feed::import($url) Invalid Chunk Size Error

 
Using ver 1.9.0

Code:
try {
$test = Zend_Feed::import('http://feeds.feedburner.com/techcrunch');
} catch (Exception $e) {
echo "Error: {$e->getMessage()}\n";
}

Produces:
Error: Invalid chunk size
"" unable to read chunked body 

Can anyone confirm this?  Any workarounds?  Anyway to manually specify
that HTTP/1.0 should be used instead of 1.1?

Any help is appreciated.

Arthur

Re: [fw-general] How to make a global Zend_Log with Zend_Application_Bootstrap

2009-10-11 Thread Pádraic Brady
Hi Peter,

You can initialise the Zend_Log instance from a method on the bootstrap called 
_initLog(), and return it from that method (essential). Then all you need to do 
from any action to get the object is 
$this->getInvokeArg('bootstrap')->getResource('Log'). If you need it in a 
Model, it depends how the Model works, where it is instantiated, etc. But 
generally you want to inject the Log into the Model through its constructor or 
a setter (assuming it's the same object you need!).

You can set up multiple logs in a similar way used specifically named bootstrap 
methods, or a single bootstrap method that creates an array or object 
collection of needed logs. If you dig around the Incubator there's a class 
called Zend_Cache_Manager where I lazy load caches using "configuration 
templates". You can do something similar with Logs (it's a really simple class) 
to configure them up front, but only instantiate Log objects when they are 
really needed (lazy loading).

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Peter Smit 
To: fw-general@lists.zend.com
Sent: Sun, October 11, 2009 8:53:05 AM
Subject: [fw-general] How to make a global Zend_Log with 
Zend_Application_Bootstrap


I would like to make a global Zend_Log object that I can reach from my 
Controllers and my Models.
What should I add to my Bootstrap? (My bootstrap extends 
Zend_Application_Bootstrap)
How then can I reach the logger object from my controller actions and from my 
model?Regards,

Peter Smit

Re: [fw-general] A router that reacts to three different possibilities...

2009-10-02 Thread Pádraic Brady
I'm not entirely sure what you're looking for? The first case is the default 
match for any route. The second can map to any controller/action pair just like 
the first part - it doesn't need a database lookup, just have a matching 
module/controller/action or it will automatically divert to the 
ErrorController. The third case is still no different - add a route to a 
controller handling users, and include in it a possible parameter for the 
username.

These are all very easily accomplished with the default router. Is there some 
compelling need to rely on a database lookup? You could just match a 
controller/action, and then check if any parameter (e.g. your user name) is 
valid or not.

So long as a URL does not match a route, or a non-existing controller/action, 
it should use an ErrorController.

I strongly recommend re-reading the manual section on routing, adding routes 
and route parameters, and the use of an ErrorController.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: oportell 
To: fw-general@lists.zend.com
Sent: Fri, October 2, 2009 10:51:48 PM
Subject: [fw-general] A router that reacts to three different possibilities...


Hello, I have a question...

I want my application to react differently based on the url typed or clicked
by the user. 
And I want it to check to three different possibilities:

1) Does the url correspond to a valid (an existing) module/controller/action
combination, 
even if the word "default" is omitted for the default module? Then dispatch
it.

For example: www.example.com/module/controller/action
www.example.com/controller/action (default module)

2) If that combination does not exist, look at a database whether the piece
of the url after 
"www.example.com" corresponds to a section of the website... If true,
dispatch a 
controller/action that shows this section of the site.

For example: www.example.com/sub1/subsub1/subsubsub3/subsubsubsub1

3) If not, look at a database if the piece of the url after
"www.example.com" corresponds 
to the username of a user and, if so, show his/her profile.

For example: www.example.com/profile34

4) If not, show an error.

How can I do that? Where should I do that?
-- 
View this message in context: 
http://www.nabble.com/A-router-that-reacts-to-three-different-possibilities...-tp25722083p25722083.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] bootstrap application from CLI

2009-09-28 Thread Pádraic Brady
I'm actually curious about this myself - how are people differentiating their 
application.ini settings between a web environment and console environment? 
Another inherited settings section? A separate config file?

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Sudheer Satyanarayana 
To: Zend Framework General 
Sent: Monday, September 28, 2009 2:11:47 PM
Subject: Re: [fw-general] bootstrap application from CLI


> 
> The problem is, Zend_Application instantiates the front controller which in 
> turn registers the FlashMessenger action helper. This throws the
> Zend_Session exception.
Sorted it out.

In my application.ini config file, I had defined a layout resource. This was 
bootrapping the view resource which in turn was bootstrapping the front 
controller resource.


-- 
With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, 
Personal: http://sudheer.net

Re: [fw-general] zend_feed: get n entries by getXpath

2009-09-26 Thread Pádraic Brady
Be careful how you go about this. Technically, the position of an entry/item in 
an XML feed should have no meaning (i.e. the newest could be last and the feed 
would still be completely valid) so you would need to retrieve all entries into 
an array, order by publish date descending, and then select the top five. So I 
wouldn't use XPath just to pick the first five in the feed.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: admirau 
To: fw-general@lists.zend.com
Sent: Saturday, September 26, 2009 10:43:47 AM
Subject: [fw-general] zend_feed: get n entries by getXpath


How to use Zend_Feed::getXpath() method,
to limit feed entries just to five newest entries?

-- 
regards
takeshin
-- 
View this message in context: 
http://www.nabble.com/zend_feed%3A-get-n-entries-by-getXpath-tp25623791p25623791.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Split controller actions into multiple classes

2009-09-24 Thread Pádraic Brady
I'd agree. The View handles the rendering of output, etc. But the Controller 
determines the View, constructs responses, and can do a lot to influence the 
final presentation. The Controller+View make up the presentation layer of the 
application.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: josh.ribakoff 
To: fw-general@lists.zend.com
Sent: Thursday, September 24, 2009 11:11:57 AM
Subject: Re: [fw-general] Split controller actions into multiple classes


The view displays the model in the UI yes, but the controller also affects
the application's presentation, albeit not visually. Repetitive controller
logic like a repeating subroutine that is modifying the view, should be
factored into action helpers. Repetitive display logic belongs in view
helpers as you correctly pointed out. I consider both part of my
application's presentation ( but maybe the line is blurred in passive MVC )


Matthew Weier O'Phinney-3 wrote:
> 
> 
> Umm, not really. Controllers take the request, and determine what
> view(s) and/or model(s) need to be instantiated. The view is the actual
> presentation layer.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Split-controller-actions-into-multiple-classes-tp25508838p25551508.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Is there anybody from Zend team ?

2009-09-23 Thread Pádraic Brady
Before you make an even bigger fool out of yourself...

Nabble's default view (you are using Nabble, right?) shows comments with a 
rating of two or more. Your email was rated down to 1 (i.e. a poor post), so it 
is removed from the default view. You can reset the rating filter to 0 to see 
your original email. Why it was rated so poorly I'll leave to you to concoct a 
reason for just as you concocted your ill advised blaming of Zend for 
"deleting" your original email, a feat that is impossible unless they access 
every mail server list members use (and then access their PCs to get at the 
local copy).

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: aoohralex 
To: fw-general@lists.zend.com
Sent: Wednesday, September 23, 2009 9:59:36 AM
Subject: Re: [fw-general] Is there anybody from Zend team ?


My critical subject about Zend Framework was deleted. Somebody from Zend
deleted my post. My criticism PHP authors and Zend Framework in compare to
other frameworks wasn't comfortable for Zend company. You can don't agree
with me but delete my subject ? So again:

I have started learn ZF because I wanted to learn something new.
If we have range 0 – 10. My knowledge ZF is 1 – I can make basic things in
ZF – connect to database, queries insert/update/delete, basic zend forms,
authorization, use jquery and layout in zend, controllers, views.
My knowledge Symfony Framework is 5. My knowledge ASP.NET MVC (not ASP.NET)
is 4.

Now I can say that ZF is very bad framework or maybe rather it isn't a
framework. Everybody knows that authors of PHP are always late and behind –
for example PHP is really OO from version v5 (eariel it was only some OO
elements in PHP). The same is in Zend Framework – this framework is behind
others frameworks. 

First - Zend_Db is nothing compared to Doctrine ORM. Using Zend_Db I have to
create myself models:
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
! In Symfony Framework with Doctrine ORM and in ASP.NET MVC with Linq to
SQL I don't need because it is wasting of time – there it is automatic – in
Symfony using console and in ASP.NET MVC using Visual Studio. Of course
Doctrine and Linq to SQL have got more better things. 

In Zend Framework almost nothing you can do using console (of course almost
nothing compared to Symfony) – in Symfony using console you can generate
much more (I don't use in Symfony console to generate modules, controllers
or forms but for begginners it is very comfortable). In ASP.NET MVC I don't
need use console but Visual Studio but ASP.NET MVC is very young so
generated controllers/views etc. don't have so good code as in Symfony. In
ASP>NET MVC and Symfony Framework I don't need to enable layout like in Zend
Framework. The most horrible thing in Zend it was for me Zend_Acl – using
that I can't still make that only logged users can have access to action
'add' controller 'books' – in Symfony I can make that using 2 lines of code
in module 'books':

add:
  is_secure: on

and in ASP.NET one line of code in controller:

[Authorize] 

What is more in Symfony and ASP.NET MVC we have tables in database and
everything else related with users, authorization etc. created in these
frameworks – in Zend I must myself do that.
There is of course more good things in these frameworks – better than in
Zend.

Documentation – hahah – in Zend documentation is chaotic, is HORRIBLE !!
Have you ever seen documentation of Symfony or ASP.NET MVC ? I have never
seen worse documentation than in Zend.

For me Zend isn't a framework but rather components that we can use in other
frameworks – for example Zend Lucene in Symfony:
http://www.symfony-project.org/jobeet/1_2/Doctrine/en/17 

As I thought – authors of PHP are always late and they are always behind so
Zend is always late and behind. For now Symfony and ASP.NET MVC are from XXI
aga, Zend is from XX age.

This was my compare these frameworks. Sry for my English – it isn't my
national language.

PS. bold text = I am angry because of delete my subject by Zend company.
-- 
View this message in context: 
http://www.nabble.com/Is-there-anybody-from-Zend-team---tp25455352p25531048.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] grade zend framework and compared to Symfony and ASP.NET MVC

2009-09-22 Thread Pádraic Brady
a) ZF is a framework - though it may have been deceiving me all these years...
b) Zend_Db is not Doctrine, it's not even an ORM.
c) You can use Doctrine with ZF. I kid you not.
d) Nothing you said indicated that "PHP is behind". Take a peek at how 
Rails+merb are evolving. Flexibility is key.
e) PHP 5 is positively ancient, and has been OO for years.
f) You criticise the console functionality, but then say you don't use it.
g) You forget people have seen your other emails, and you also profess your 
knowledge is minimal.
h) I can't really argue about the documentation since I actually agree...damn 
;).

Honestly, no framework will ever work for you until you spend time with it. It 
takes months to get to the point where you make a framework work for you. That 
goes for ALL frameworks. Judging one based on mere days of use will get you 
nowhere.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: aoohralex 
To: fw-general@lists.zend.com
Sent: Tuesday, September 22, 2009 7:30:49 PM
Subject: [fw-general] grade zend framework and compared to Symfony and ASP.NET 
MVC


Sry for my English – it isn't my national language.

I have started learn ZF because I wanted to learn something new.
If we have range 0 – 10. My knowledge ZF is 1 – I can make basic things in
ZF – connect to database, queries insert/update/delete, basic zend forms,
authorization, use jquery and layout in zend, controllers, views.
My knowledge Symfony Framework is 5. My knowledge ASP.NET MVC (not ASP.NET)
is 4.

Now I can say that ZF is very bad framework or maybe rather it isn't a
framework. Everybody knows that authors of PHP are always late and behind –
for example PHP is really OO from version v5 (eariel it was only some OO
elements in PHP). The same is in Zend Framework – this framework is behind
others frameworks. 

First - Zend_Db is nothing compared to Doctrine ORM. Using Zend_Db I have to
create myself models:
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
! In Symfony Framework with Doctrine ORM and in ASP.NET MVC with Linq to
SQL I don't need because it is wasting of time – there it is automatic – in
Symfony using console and in ASP.NET MVC using Visual Studio. Of course
Doctrine and Linq to SQL have got more better things. 

In Zend Framework almost nothing you can do using console (of course almost
nothing compared to Symfony) – in Symfony using console you can generate
much more (I don't use in Symfony console to generate modules, controllers
or forms but for begginners it is very comfortable). In ASP.NET MVC I don't
need use console but Visual Studio but ASP.NET MVC is very young so
generated controllers/views etc. don't have so good code as in Symfony. In
ASP>NET MVC and Symfony Framework I don't need to enable layout like in Zend
Framework. The most horrible thing in Zend it was for me Zend_Acl – using
that I can't still make that only logged users can have access to action
'add' controller 'books' – in Symfony I can make that using 2 lines of code
in module 'books':

add:
  is_secure: on

and in ASP.NET one line of code in controller:

[Authorize] 

What is more in Symfony and ASP.NET MVC we have tables in database and
everything else related with users, authorization etc. created in these
frameworks – in Zend I must myself do that.
There is of course more good things in these frameworks – better than in
Zend.

Documentation – hahah – in Zend documentation is chaotic, is HORRIBLE !!
Have you ever seen documentation of Symfony or ASP.NET MVC ? I have never
seen worse documentation than in Zend.

For me Zend isn't a framework but rather components that we can use in other
frameworks – for example Zend Lucene in Symfony:
http://www.symfony-project.org/jobeet/1_2/Doctrine/en/17 

As I thought – authors of PHP are always late and they are always behind so
Zend is always late and behind. For now Symfony and ASP.NET MVC are from XXI
age, Zend is from XX age.

This was my compare these frameworks.

-- 
View this message in context: 
http://www.nabble.com/grade-zend-framework-and-compared-to-Symfony-and-ASP.NET-MVC-tp25530860p25530860.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] error messages in form

2009-09-19 Thread Pádraic Brady
May I suggest you read the documentation before asking questions on the mailing 
list? I don't mean to be rude, but the documentation has all your answers and 
it supports a search form also. Failing that, run a google search using 
"site:http://framework.zend.com/manual/en"; as a search term.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: aoohralex 
To: fw-general@lists.zend.com
Sent: Saturday, September 19, 2009 7:27:57 PM
Subject: [fw-general] error messages in form


I must create my own 3. error communicates for field - 'name' - in Symfony
Framework it would be:
$this->setValidators(array(
  'name' => new sfValidatorString(array('min_length' => 2, 'max_length' =>
50, 'trim' => true), 
  array('required' => 'Name is required.', 'min_length' => 'Name is too
short.', 'max_length' => 'Name is too long.'))
));

In Zend Framework I have:
$this->addElement('text', 'name', array(
'label'  => 'Name:',
'required'   => true,
'filters'=> array('StripTags', 'StringTrim'), 
'validators' => array(
array('validator' => 'StringLength', 'options' => array(2,
50)),
)
));

How can I add these 3. error communicates to that field above ??
Error communicates:
- Name is required.
- Name is too short.
- Name is too long.

-- 
View this message in context: 
http://www.nabble.com/error-messages-in-form-tp25524216p25524216.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Bug Hunt Days!

2009-09-18 Thread Pádraic Brady
If I can chime in with another benefit - bug hunting tends to push you into 
exploring components you take for granted. You have no idea how useful that can 
be, not only in using the component, but identifying improvements and fixes not 
currently raised as issues. Let's not forget the "hunting" part of the exercise 
:). As Matthew said, you'll get a lot of insight into QA and will certainly 
learn to appreciate the work of people fixing bugs more regularly.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Matthew Weier O'Phinney 
To: fw-general@lists.zend.com
Sent: Friday, September 18, 2009 4:15:51 PM
Subject: [fw-general] Bug Hunt Days!

Greetings, all!

Four years ago today, I boarded a plane to San Jose, CA, to start work
at my new employer, Zend Technologies, Ltd., as a PHP Developer on the
newly formed eBiz team. Since I first started at Zend, I've been
contributing to Zend Framework, with gradually more areas of
responsibility and community involvement. My first contributions were
Zend_XmlRpc_Server and Zend_Server_Reflection, and code
audits/refactoring of Zend_Json and Zend_Mail. I monitored the mailing
lists and answered questions where I could, but my first really big
involvement in the project occurred in the fall of 2006, when Andi asked
me to spearhead a rewrite of the MVC layer, a project I did in parallel
with my official work duties maintaining and expanding the zend.com CMS
system. It was a task I could never have accomplished without the
excellent collaboration of many, many contributors and users.

Yesterday, we took a step to regain some of that spirit by beginning the
first monthly bug hunt days. All told, contributors closed 53(!) issues
-- and the momentum continued well after I logged off for the day! 

If you were unable to join us yesterday, I encourage you to hop onto the
#zftalk.dev IRC channel on Freenode and join the group of lively
contributors there today. If you can't make it today -- join us next
month on the third Thursday and Friday (the 15th and 16th) when we'll do
it all over again!

I've heard a number of people asking if we could hold at least one bug
hunt day on the weekend or in the evening. We may explore this
possibility in the coming months (I have some reservations; since my
team are all FTE, I don't want to make work requirements in their
off-hours!). However, one of the reasons often cited is that interested
developers can't get time from their employers to join, and to this, I
offer the following arguments to offer your boss(es):

* Helping squash bugs in ZF will help your *work* projects, by ensuring
   quality code upstream. Ultimately, this will likely save your company
   money.

* How much money does Zend Framework save your company? By using a
   framework, your developers are not needing to create their own
   low-level components to handle mundane tasks such as routing,
   validation and filtering, web service requests, etc. Allocating
   resources to help maintain ZF is a way to "pay" for the convenience
   ZF offers you.

* How much value does ZF add to your offerings? For instance, what
   features on your sites or client sites do you offer simply because ZF
   has a component for it? (e.g., Twitter live-stream, GData-app
   integration, localization, etc.) Again, consider allocating resources
   to help maintain ZF as a way of saying "thank you" to the many
   contributors who have made these features possible.

* Developers who help in the bug hunt likely are gaining important
   skills in quality assurance -- all bugfixes need to be accompanied by
   associated unit tests and/or documentation. Consider this important
   professional development for your developers.

Just because we will be having official bug hunt days monthly doesn't
mean your contributions need to be limited to those windows, either!
Hopefully, many of you will discover how much fun and satisfaction comes
with closing issue reports and continue the trend in the days and weeks
following!

I hope to see as many of you as possible helping out today and in future
months -- the esprit de corps I witnessed yesterday was phenomenal, and
it's representative of the best that open source has to offer. Keep up
the good work, everyone -- and THANK YOU to everyone who helps make this
framework better each and every day!

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


Re: [fw-general] Announcement: Monthly Bug Hunt Days

2009-09-17 Thread Pádraic Brady
Just a reminder to list members that the Bug Hunt is starting today ;). If you 
don't have a lot of time I suggest adopting just 1-2 issues to help solve - 
every little bit helps! See details below from Matthew's original email.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Matthew Weier O'Phinney 
To: fw-general@lists.zend.com
Sent: Monday, September 14, 2009 5:56:23 PM
Subject: [fw-general] Announcement: Monthly Bug Hunt Days

Greetings, one and all!

I've alluded several times in the past month to having a plan for
helping manage our ever-growing bug list in the issue tracker. We're now
ready to roll out phase one of this plan, and we need *you*!

Starting this month, we will be sponsoring two bug hunt days monthly, on
the third Thursday and Friday of the month. That's this upcoming
Thursday and Friday, 17-18 September 2009.

During those days, the Zend team -- myself, Ralph, and Alex -- will be
in #zftalk.dev on Freenode for our entire work day (Ralph and myself are
in the United States, Alex is based in Russia; figure out the timezones
yourself (-: ). We will be triaging bugs ourselves, but, more
importantly, we will be there to help facilitate *you*, our contributors
and users, in resolving issue reports. 

As an incentive, each month, we will ship a Zend Framework t-shirt to
the individual that assists in the most issue resolutions during the bug
hunt days, whether via patches or direct commits. Quarterly, we will
evaluate overall contributions, including documentation, bug fixes, and
newly contributed components, and award a developer with their choice of
a Zend Studio license or Zend Framework Certification voucher. (Caveat:
one t-shirt per person per year, and one license/voucher per person per
year, folks!) 

For those interested in participating in the bug hunt days, the rules
are simple: have a signed CLA on file, and resolve issues in the
tracker. 

If you have not yet signed a CLA and want to participate, you can get a
copy of the form here:

http://framework.zend.com/cla

Sign it and return it (you can email it, fax it, or send it via post);
if you send it via post, you'll need to wait for confirmation that
we've received it before we can accept code contributions from you.

Now, when it comes to the issue tracker, you'll need to determine if the
issue:

* is simply the reporter misunderstanding or misusing code OR
* is a request for a new feature OR
* is a reproducible issue

In the first case, comment on it and indicate the correct usage, and ask
the component maintainer or somebody from Zend to review your response
and mark the issue as resolved. In the second case, please try and focus
on issue reports instead of feature requests during the bug hunt days.

That brings us to the final case, reproducible issue reports. With
these, you'll need to do the following:

* Capture the reproduce case as a unit test
* Resolve the issue in such a way as to maintain backwards
   compatibility with existing usage. (In other words, don't change the
   signature of a method unless the signature is what is actually
   broken.)

From there, you then have two options:

* If you already have commit access, commit the test and fix to the
   repository, and either resolve the issue or ask somebody from Zend to
   review and resolve.  Don't forget to merge your changes to the 1.9
   release branch!

* If you do not have commit rights, create a patch with the unit test
   and fix, and attach the patch to the issue. Ask the maintainer or
   somebody from Zend to review and apply the patch.

If you need help creating the unit test or patch file, hop onto the
#zftalk.dev IRC channel and ask for help.

How should you choose issues to work on? Answer the following questions,
and you should be able to hop right in:

* What components do you have expertise in?
* What components are you interested in learning more about?
* What issues have a high number of voters or watchers?

Bug hunting should be fun, so pick components and issues you're
interested in. Ask questions on IRC if you don't understand how
something works.

So, spread the word, and come prepared this week to help make the
framework even better! I look forward to seeing you on IRC this week!

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


Re: [fw-general] Clarification needed about "Zend" and its products

2009-09-12 Thread Pádraic Brady
APC works perfectly well with Zend Framework - there was some concern but it 
related to PHP pre 5.2 treatment of a large number of include_path and 
autoloaded classes. The debate was, surprisingly, one of the most misinformed 
I've seen in PHP for a long time. Nobody seemed able to quite figure out how 
APC and class loading worked in different scenarios.

All you need to know, is that PHP 5.2 with APC works just fine whether you 
autoload or not. There are some differences in efficiency but it rarely matters 
and the strategies for getting the most performance out of the system with any 
PHP 5 library or framework are well documented.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: ataulkarim 
To: fw-general@lists.zend.com
Sent: Saturday, September 12, 2009 9:56:21 PM
Subject: Re: [fw-general] Clarification needed about "Zend" and its products



Thanks Sudheer ,

Things are getting easier now to understand. Its just that a few articles
commenting on the fact that APC does not work well with Zend Framework, was
a bit confusing. But thanks for the enlightenment :-).


Regards,
Ataulkarim



Sudheer Satyanarayana wrote:
> 
>  
> There is no compulsion to use other Zend products with Zend Framework. 
> Zend Framework can be used on any PHP 5 installation.
> 
> You don't have to use Zend Server in order to use Zend Framework. But if 
> you wish, you can.
> 
> Yes, you can use APC or any other op code caching component of your 
> choice. Just treat Zend Framework as any other PHP library.
> 
> There are good tutorials on ZF. http://www.survivethedeepend.com/ for 
> example. The blogosphere offers some good tutorials. There is also the 
> http://www.zendcasts.com/.( The domain name might mislead. It is not an 
> official Zend website).
> 
> 
> With warm regards,
> Sudheer. S
> Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net,
> Personal: http://sudheer.net
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Clarification-needed-about-%22Zend%22-and-its-products-tp25415258p25418191.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] How to help solving bugs?

2009-09-01 Thread Pádraic Brady
Looking forward to the bug fixing initiative :). I'll help in any area I'm 
familiar with.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Matthew Weier O'Phinney 
To: fw-general@lists.zend.com
Sent: Tuesday, September 1, 2009 5:34:19 PM
Subject: Re: [fw-general] How to help solving bugs?

-- Jurian Sluiman  wrote
(on Tuesday, 01 September 2009, 06:17 PM +0200):
> I recently updated from 1.8.x to 1.9.x. Having the idea I had no problem, so I
> marked the update as succeeded. Nevertheless I was lately confronted with a 
> bug
> I had seen before. After some digging, I found it.
> 
> 
> The issue tracker is aware of the bug and I provided a patch when I found the
> bug the first time. Still, the issue isn't solved (and it's a really simple 
> one
> to do so) and it's now three months later since I provided the patch (http://
> framework.zend.com/issues/browse/ZF-3726).
> 
> 
> Not trying to be too specific: there are several issues in the tracker which
> are easy to solve. They can still have a big impact on the users of the
> framework. How can *we*, the community, help solving these bugs faster?
> I know it's a good idea to file issues, create examples and provide patches
> when possible. Still, patched issues are not always included in the next
> release. Is it a good idea to create a page at the wiki with "easy to fix bugs
> with a patch provided", so the ZF developers can scan them quickly?

One note: patches are much easier for us to evaluate and apply if they
include *unit tests*. Without those, we have to spend as much if not
more time evaluating the issue as without the patch - as we have to
create and run the test case(s) ourselves.

Next note: I'll be announcing an initiative regarding bug fixing within
the next week. Stay tuned for details!

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


Re: [fw-general] How to add a database genarated menu for a layout

2009-08-30 Thread Pádraic Brady
A View Helper is a class, for example Zend_View_Helper_Doctype. Like any class, 
you can query the database, and use the results to create a string containing 
the HTML markup you need. Usually it's good to implement PHP's __string() 
method so the resulting object can be directly echoed or cast to string. It 
should also implement a method similar to its name to return the object or 
accept some parameters and then return the object.

As an example, you could have a custom helper: My_View_Helper_NavMenu. It has a 
method My_View_Helper_NavMenu::navMenu() which returns the object (i.e. $this) 
after it has been initialised and completed any queries needed. It should also 
have My_View_Helper_NavMenu::__toString() which returns the HTML markup to 
insert. You should register the locations of custom helpers with the View using 
Zend_View_Abstract::addHelperPath(), i.e.

$view->addHelperPath('My/View/Helper', 'My_View_Helper'); // path and classname 
prefix

Then you can call the helper from your view:

navMenu() ?>

Read the reference guide for lots more details and examples.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: neobeacon 
To: fw-general@lists.zend.com
Sent: Sunday, August 30, 2009 11:21:18 AM
Subject: Re: [fw-general] How to add a database genarated menu for a layout


view helper is a .phtml file .Can I genarate it's code from database
-- 
View this message in context: 
http://www.nabble.com/How-to-add-a-database-genarated-menu-for-a-layout-tp25209362p25210306.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Creating a dummy object of Zend_Oauth_Token_Access for Unit Testing

2009-08-25 Thread Pádraic Brady
PHPUnit's Mock Objects system is a little weird. What I frequently do is 
implement a total or clean Mock where everything is mocked, including abstract 
methods. I also disable the constructor. Once you figure out how to do that, 
the rest is easy. Partial Mocks need something a bit different but I don't use 
partials very often. Here's a method I add somewhere in a test helper method to 
make this easy.

protected function _getCleanMock($className, $testClassName) {
$class = new ReflectionClass($className);
$methods = $class->getMethods();
$stubMethods = array();
foreach ($methods as $method) {
if ($method->isPublic() || ($method->isProtected()
&& $method->isAbstract())) {
$stubMethods[] = $method->getName();
}
}
$mocked = $this->getMock(
$className,
$stubMethods,
array(),
$className . '_' . $testClassName . '_' . uniqid(),
false
);
return $mocked;
}

It's safe to use from a setup() method since it creates a unique Mock name on 
every call.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: wenbert 
To: fw-general@lists.zend.com
Sent: Tuesday, August 25, 2009 4:39:19 AM
Subject: [fw-general] Creating a dummy object of Zend_Oauth_Token_Access for 
Unit Testing


Hello,

I am just getting into unit testing. I am testing out my application. It
uses Zend_Oauth and Zend_Service_Twitter.

I have a model which requires me to feed it an instance of
Zend_Oauth_Token_Access. The problem is, how do I create a dummy for that
intance?

I have the following below:
--
$oauth_token_stub = $this->getMock('Zend_Oauth',
array('getAccessToken'),array(),'',FALSE);
$oauth_token_stub->expects($this->once())->method('getAccessToken');
--

The error I get from PHPUnit is:
--
1) testuserTimeline(Model_TwitterTest)
Argument 1 passed to Twitter_Model_Twitter::__construct() must be an
instance of Zend_Oauth_Token_Access, instance of Mock_Zend_Oauth_8e38a582
given, called in /htdocs/twitter/tests/application/models/TwitterTest.php on
line 63 and defined
/htdocs/twitter/application/models/Twitter.php:15
/htdocs/twitter/tests/application/models/TwitterTest.php:63
--
NOTE: that Argument 1 is is $oauth_token_stub I am trying to pass...

Any ideas?

Thanks,
Wenbert

EDIT: edited the code and error message to latest

-
http://blog.ekini.net
-- 
View this message in context: 
http://www.nabble.com/Creating-a-dummy-object-of-Zend_Oauth_Token_Access-for-Unit-Testing-tp25127669p25127669.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Zend_Oauth + Zend_Service_Twitter: Zend_Oauth_Token_Access::toQueryString() error

2009-08-22 Thread Pádraic Brady
Wenbert,

Update from the Inbubator and try again - I have some uncommitted work on OAuth 
and Zend_Crypt I'm finishing. I committed a change on Zend_Oauth_Token_Access 
which I think is the cause of the error.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: wenbert 
To: fw-general@lists.zend.com
Sent: Saturday, August 22, 2009 1:04:13 PM
Subject: [fw-general] Zend_Oauth + Zend_Service_Twitter: 
Zend_Oauth_Token_Access::toQueryString() error

 hello, I am getting this error: 
 Catchable fatal error: Argument 2 passed to 
Zend_Oauth_Token_Access::toQueryString() must 
implement interface Zend_Oauth_Config_Interface, instance of Zend_Oauth_Client 
given, called in 
/htdocs/twitter/library/Zend/Oauth/Client.php on line 131 and defined in 
/htdocs/twitter/library/Zend/Oauth/Token/Access.php on line 55

I am trying to make Zend_Oauth work with my existing Twitter_Model. 
/**
 * I'm trying to extend Zend_Service_Twitter to use Oauth instead
 */

require_once 'Zend/Service/Twitter.php';

class Mytwitterapp_Twitteroauth extends Zend_Service_Twitter
{
/**
 * Oauth
 * @var Zend_Oauth_Token_Access
 */
protected $_token;

/**
 * Config Array for Zend_Oauth_Consumer (i think)
 * @var Zend_Config_Ini
 */
protected $_config;

/**
 * @param object Zend_Oauth_Token_Access $token
 * @return void
 */
public function __construct(Zend_Oauth_Token_Access $token)
{
$this->_config = new Zend_Config_Ini(APPLICATION_INI, 
APPLICATION_ENV);
$this->_token = $token;

$this->setUri('http://twitter.com');


self::setHttpClient($token->getHttpClient($this->_config->oauth->toArray()));
}

public function _init()
{
parent::_init();
}
//...more code...
}

I am now able to get a valid token from Twitter.com, but I could not debug the 
error above. Would be glad to hear any of your replies. If this is a bug/issue 
with Zend_Oauth, I will file an issue in the issue tracker.
http://blog.ekini.net

 View this message in context: Zend_Oauth + Zend_Service_Twitter: 
Zend_Oauth_Token_Access::toQueryString() error
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Question regarding models

2009-08-21 Thread Pádraic Brady
Hi Koen,

Marry the query to a domain model method (i.e. add it to the Data Mapper), and 
filter it into domain objects before returning the collection. You'll need a 
Collection class, just like Zend_Db_*'s rowset classes for the root of the 
aggregate (User) but it needn't be more than a general Iterator implementation. 
You can also filter the query inputs (any primary keys) against a local 
Identity Map to prevent duplicates. This does have a slight disadvantage if the 
existing entities are not fully loaded as they can spark extra queries to load 
the reference entities through lazy loading.

The filter logic, is really just another form of mapping logic. I know I use a 
simplistic use case but the principles remain the same - you just need a more 
specific set of operations in a Mapper to make the JOIN translate across to the 
domain model. Ensuring the returned results are easy to pick apart by entity is 
the only requirement needed for the query.

So no, you do not need Doctrine to do this. ;).

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Koen 
To: Pádraic Brady 
Cc: Zend Framework General 
Sent: Friday, August 21, 2009 2:51:32 PM
Subject: Re: [fw-general] Question regarding models

Hi Pádraic,

Thanks for mentioning the URL, it's very interesting! Still I have some 
questions left.

As an example lets say I want to list 50 users. Every user has several linked 
fields in another table, like department, company, etc. If doing this the 
aggregated way, you will end up having it least 150 queries, while this can be 
done using 1 (!) query with a few joins.
Here's a quote from the URL you gave:   "Database operations are expensive, 
often the most expensive operation"
So with this in mind, its hard for me to use the 150+ queries solution, 
although I see some big advantages. I know you can cache, but still...

Isn't there some 'in between' solution?

Regards,

Koen



2009/8/21 Pádraic Brady 

Hi Koen,
>
>I just published a chapter on implementing the Model you may want to look into 
>to see how it fits. The book is free to read ;).
>http://www.survivethedeepend.com/zendframeworkbook/en/1.0/implementing.the.domain.model.entries.and.authors
>
>I think the main point I think is that you are thinking in terms of the 
>database. Why use a join? You can use two distinct SQL queries and then 
>aggregate these as objects. In the book, I used a simple example of blog 
>entries needing authors - so the entry object contains an author object.
>
>Joins are great, no mistake, but they are also premature optimisation. You can 
>offset the cost of two queries using caching and
> lazy loading to avoid database access in the first place.
>
>Hope this helps!
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish Representative
>
>
>
>
>
>

 From: Koen 
>To: fw-general@lists.zend.com
>Sent: Friday, August 21, 2009 11:36:35 AM
>Subject: [fw-general] Question regarding models
>
>
>>I've been looking at the new Quick Start in the ZF manual, particularly the 
>>model part. For a new project I'm trying to create my models in the same way 
>>(including a data mapper, etc). 
>
>Unfortunately I don't know how to handle the relationships. When requesting 
>data from your model you often want to include some fields in related tables 
>(using joins), but I don't see a way doing that using the pattern as described 
>in the quick start guide. Can someone give me some tips regarding this?
>
>Thanks in advance!
>


Re: [fw-general] Question regarding models

2009-08-21 Thread Pádraic Brady
Hi Koen,

I just published a chapter on implementing the Model you may want to look into 
to see how it fits. The book is free to read ;).
http://www.survivethedeepend.com/zendframeworkbook/en/1.0/implementing.the.domain.model.entries.and.authors

I think the main point I think is that you are thinking in terms of the 
database. Why use a join? You can use two distinct SQL queries and then 
aggregate these as objects. In the book, I used a simple example of blog 
entries needing authors - so the entry object contains an author object.

Joins are great, no mistake, but they are also premature optimisation. You can 
offset the cost of two queries using caching and lazy loading to avoid database 
access in the first place.

Hope this helps!

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Koen 
To: fw-general@lists.zend.com
Sent: Friday, August 21, 2009 11:36:35 AM
Subject: [fw-general] Question regarding models

I've been looking at the new Quick Start in the ZF manual, particularly the 
model part. For a new project I'm trying to create my models in the same way 
(including a data mapper, etc). 

Unfortunately I don't know how to handle the relationships. When requesting 
data from your model you often want to include some fields in related tables 
(using joins), but I don't see a way doing that using the pattern as described 
in the quick start guide. Can someone give me some tips regarding this?

Thanks in advance!


Re: [fw-general] Zend/Application.php failing to open Bootstrap.php

2009-08-09 Thread Pádraic Brady
It must be something obvious - this isn't a Zend_Application error. It's PHP 
itself telling you it can't find the file - so it's not something framework 
related. The error clearly states this file could not be found:

/Users/Steven/Sites/farstrider.eu/application/Bootstrap.php

Either it's there, and readable, or it's not there. You can check with any 
plain PHP script with a require statement to replicate this. If the path is 
correct, then Zend_Application is doing nothing wrong.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative





____
From: Steven Szymczak 
To: Pádraic Brady ; fw-general@lists.zend.com
Sent: Sunday, August 9, 2009 3:13:48 PM
Subject: Re: [fw-general] Zend/Application.php failing to open Bootstrap.php

The /application directory is not on the include path, but it shouldn't need to 
be as Application.php is trying to include Bootstrap.php with the full path 
(i.e. /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php).

My config file is as follows:

application.xml





  

  0
  0



  
/Bootstrap.php
  
  Bootstrap


  

  /controllers

  

  

  

  1
  1
    
  


Cheers,
-- Steven

Pádraic Brady wrote:
> I can't see from the error message, but is the /application directory added 
> to the include_path? Shouldn't this be done in index.php before the Bootstrap 
> class is needed. I'm not sure, but I don't think you can add this path using 
> the Zend_Application configuration file. It's also very hard to see how the 
> Bootstrap class and path is made known to Zend_Application - can you post the 
> config file showing the settings used for the bootstrap prefix, i.e. 
> bootstrap.path and bootstrap.class
>  Pádraic Brady
> 
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative <http://www.openideurope.eu/>
> 
> 
> 
> *From:* Steven Szymczak 
> *To:* Ruslan Zavackiy ; fw-general@lists.zend.com
> *Sent:* Sunday, August 9, 2009 1:01:51 PM
> *Subject:* Re: [fw-general] Zend/Application.php failing to open Bootstrap.php
> 
> The full path is correct, and the file/class name is "Bootstrap" with an 
> upper case "B".
> 
> Ruslan Zavackiy wrote:
>  > Check for Bootstrap.php to be exactly with uppercase, not bootstrap.php 
> and check full path for this also
>  >
>  > Best regards,
>  > Ruslan zavackiy.
>  >
>  > On 2009.9.8, at 02:04, Steven Szymczak  <mailto:sc.szymc...@googlemail.com>> wrote:
>  >
>  >> I'm trying to update my site to make use of Zend_Application, and I've 
> set everything up according to the QuickStart and Zend_Application docs, but 
> all I get is the following error:
>  >>
>  >> "Warning: require_once( 
> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php ) 
> [function.require-once]: failed to open stream: No such file or directory in 
> /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line 290
>  >>
>  >> Fatal error: require_once() [function.require]: Failed opening required ' 
> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php ' 
> (include_path='/Users/Steven/Sites/farstrider.eu/library:.:/php/includes:/usr/local/php/lib/php')
>  in /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line 
> 290"
>  >>
>  >> Even though Bootstrap.php does indeed exist in the application/ 
> directory, and all permissions are correctly set.
>  >>
>  >> I'm using ZF 1.9, and my application/Bootstrap.php and public/index.php 
> files are as follows:
>  >>
>  >> Bootstrap.php
>  >> -
>  >>
>  >>   >>
>  >> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>  >> {
>  >>
>  >> }
>  >>
>  >> index.php
>  >> -
>  >>
>  >>   >>
>  >> // Define path to application directory
>  >> defined('APPLICATION_PATH') || define('APPLICATION_PATH', 
> realpath(dirname(__FILE__) .'/../application'));
>  >>
>  >> // Define application environment
>  >> defined('APPLICATION_ENV') || define('APPLICATION_ENV', 
> (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
>  >>
>  >> // Set include path
>  >> set_include_path(implode(PATH_SEPARATOR, array(dirname(dirname(__FILE__)) 
> .'/library', get_include_path(),)));
>  >>
>  >> // Zend Application
>  >> require_once 'Zend/Application.php';
>  >>
>  >> // Create application, bootstrap, and run
>  >> $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH 
> .'/config/application.xml');
>  >> $application->bootstrap()->run();
>  >>
>  >> Any ideas?
>  >>
>  >> -- スティーブン
>  >>
> 
> -- スティーブン
> 

-- スティーブン

Re: [fw-general] Zend Framework 2.0

2009-08-09 Thread Pádraic Brady
According to Matthew planning is underway. Backwards compatibility will be 
retained, I'm sure, for many components but many others will break 
compatibility since this is a major revision giving everyone the opportunity to 
replace/fix components, APIs, and other behaviour.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: admirau 
To: fw-general@lists.zend.com
Sent: Sunday, August 9, 2009 2:48:03 PM
Subject: [fw-general] Zend Framework 2.0


Are there any known plans for ZF 2.0?
It will be an 'regular' release? Are planned any 'breaktrough' features
(e.g. application backend like in Symfony, ORM)?

I'm sure, it will be backwards compatilble,
but what can we expect?

I've found only this roadmap for Zend_Controller:
http://framework.zend.com/wiki/display/ZFDEV/Zend_Controller+2.0
-- 
View this message in context: 
http://www.nabble.com/Zend-Framework-2.0-tp24887311p24887311.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Zend/Application.php failing to open Bootstrap.php

2009-08-09 Thread Pádraic Brady
I can't see from the error message, but is the /application directory added to 
the include_path? Shouldn't this be done in index.php before the Bootstrap 
class is needed. I'm not sure, but I don't think you can add this path using 
the Zend_Application configuration file. It's also very hard to see how the 
Bootstrap class and path is made known to Zend_Application - can you post the 
config file showing the settings used for the bootstrap prefix, i.e. 
bootstrap.path and bootstrap.class

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Steven Szymczak 
To: Ruslan Zavackiy ; fw-general@lists.zend.com
Sent: Sunday, August 9, 2009 1:01:51 PM
Subject: Re: [fw-general] Zend/Application.php failing to open Bootstrap.php

The full path is correct, and the file/class name is "Bootstrap" with an upper 
case "B".

Ruslan Zavackiy wrote:
> Check for Bootstrap.php to be exactly with uppercase, not bootstrap.php and 
> check full path for this also
> 
> Best regards,
> Ruslan zavackiy.
> 
> On 2009.9.8, at 02:04, Steven Szymczak  wrote:
> 
>> I'm trying to update my site to make use of Zend_Application, and I've set 
>> everything up according to the QuickStart and Zend_Application docs, but all 
>> I get is the following error:
>> 
>> "Warning: require_once( 
>> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php ) 
>> [function.require-once]: failed to open stream: No such file or directory in 
>> /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line 290
>> 
>> Fatal error: require_once() [function.require]: Failed opening required ' 
>> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php ' 
>> (include_path='/Users/Steven/Sites/farstrider.eu/library:.:/php/includes:/usr/local/php/lib/php')
>>  in /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line 
>> 290"
>> 
>> Even though Bootstrap.php does indeed exist in the application/ directory, 
>> and all permissions are correctly set.
>> 
>> I'm using ZF 1.9, and my application/Bootstrap.php and public/index.php 
>> files are as follows:
>> 
>> Bootstrap.php
>> -
>> 
>> > 
>> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>> {
>> 
>> }
>> 
>> index.php
>> -
>> 
>> > 
>> // Define path to application directory
>> defined('APPLICATION_PATH') || define('APPLICATION_PATH', 
>> realpath(dirname(__FILE__) .'/../application'));
>> 
>> // Define application environment
>> defined('APPLICATION_ENV') || define('APPLICATION_ENV', 
>> (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
>> 
>> // Set include path
>> set_include_path(implode(PATH_SEPARATOR, array(dirname(dirname(__FILE__)) 
>> .'/library', get_include_path(),)));
>> 
>> // Zend Application
>> require_once 'Zend/Application.php';
>> 
>> // Create application, bootstrap, and run
>> $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH 
>> .'/config/application.xml');
>> $application->bootstrap()->run();
>> 
>> Any ideas?
>> 
>> -- スティーブン
>> 

-- スティーブン

Re: [fw-general] Creating Zend_Feed with custom namespace

2009-08-08 Thread Pádraic Brady
That pretty much what I am suggesting - let Zend_Feed work away, then grab the 
DOM, then append your thumbnail elements using the DOM *NS methods. If it's 
just the one element you're adding, it would only take a few lines of code.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Gautam Arora 
To: fw-general@lists.zend.com
Sent: Saturday, August 8, 2009 12:33:15 AM
Subject: Re: [fw-general] Creating Zend_Feed with custom namespace


are you recommending I create the feed first and then intercept DOM to inject
the namespaces? because how would i add a thumbnail in the entry in the
first place as importArray() does not allow me to extend the syntax of the
feed.
I want to add a media:thumbnail to every entry of the rss feed.
The closest I've come to is make changes in the Zend_Feed and associated
classes themselves to add a new thumbnail field and am trying to add
namespace to it now to make this a media:thumbnail, though i would prefer
not to make changes to the framework itself.

are there other parts in ZFR i can look for ideas? or other things i could
try?



Pádraic Brady wrote:
> 
> Depending on the type of module you need the new namespace for ( I think
> MRSS isn't all that huge) I'd just intercept the DOM and do it manually.
> You can access the DOM from Zend_Feed with a little persuasion, even if
> it's not documented as a feature. ZFR's importFeed() method does this.
> 
>  Pádraic Brady
> 
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
> 
> 
> 
> 
> 
> 
> From: Gautam Arora 
> To: fw-general@lists.zend.com
> Sent: Thursday, August 6, 2009 2:28:55 AM
> Subject: Re: [fw-general] Creating Zend_Feed with custom namespace
> 
> 
> @Paddy
> Zend_Feed_Writer will be great. Looking forward to it.
> 
> In the meanwhile, can anyone recommend the best way to create a rss zend
> feed with custom namespaces? I'm sure there must be a way around using
> custom builders or ability to append entries (just that I havent come
> across
> it as yet :) )
> 
> Thanks!
> 
> 
> Pádraic Brady wrote:
>> 
>> I can't speak for Zend_Feed itself, but in terms of the future I have
>> proposed Zend_Feed_Writer to the wiki for comment following in the
>> footsteps of Zend_Feed_Reader. It's not operational to the point of
>> handling custom namespaces, though the plan is to allow users write
>> Extensions for any Atom/RSS modules they wish (and support many at
>> release
>> date). So it is planned - unfortunately not implemented just yet. I am
>> hoping to get it into ZF 1.10 once I have time in the next few weeks to
>> build it up some more and request the Zend review.
>> 
>> Paddy
>> 
>>  Pádraic Brady
>> 
>> http://blog.astrumfutura.com
>> http://www.survivethedeepend.com
>> OpenID Europe Foundation Irish Representative
>> 
>> 
>> 
>> 
>> 
>> 
>> From: Gautam Arora 
>> To: fw-general@lists.zend.com
>> Sent: Thursday, August 6, 2009 12:03:34 AM
>> Subject: [fw-general] Creating Zend_Feed with custom namespace
>> 
>> 
>> I've created a zend rss feed using importArray() but now need to add some
>> custom namespaces (e.g. for media mrss). Their is no support for custom
>> namespaces in importArray() method and only single Zend_Feed_Rss_Entry
>> can
>> be created with custom namespace (they cant be appended together to form
>> a
>> complete rss)
>> These issues have been raised earlier by other members as well.
>> http://www.nabble.com/Producing-Google-Base-atom-feeds-td20488222.html#a20488222
>> http://www.nabble.com/Beyond-Zend_Feed--td23376966.html#a23376966
>> 
>> are there any workarounds or alternatives to use custom namespaces with
>> zend_feed? Is support being planned for it as it is an important feature.
>> 
>> Thanks
>> -- 
>> View this message in context:
>> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24837727.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>> 
>> -
>> Pádraic Brady
>> 
>> Blog: http://blog.astrumfutura.com
>> Free Zend Framework Book: http://www.survivethedeepend.com
>> OpenID Europe Foundation - Irish Representative
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24838961.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -
> Pádraic Brady
> 
> Blog: http://blog.astrumfutura.com
> Free Zend Framework Book: http://www.survivethedeepend.com
> OpenID Europe Foundation - Irish Representative
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24873427.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Creating Zend_Feed with custom namespace

2009-08-06 Thread Pádraic Brady
Depending on the type of module you need the new namespace for ( I think MRSS 
isn't all that huge) I'd just intercept the DOM and do it manually. You can 
access the DOM from Zend_Feed with a little persuasion, even if it's not 
documented as a feature. ZFR's importFeed() method does this.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Gautam Arora 
To: fw-general@lists.zend.com
Sent: Thursday, August 6, 2009 2:28:55 AM
Subject: Re: [fw-general] Creating Zend_Feed with custom namespace


@Paddy
Zend_Feed_Writer will be great. Looking forward to it.

In the meanwhile, can anyone recommend the best way to create a rss zend
feed with custom namespaces? I'm sure there must be a way around using
custom builders or ability to append entries (just that I havent come across
it as yet :) )

Thanks!


Pádraic Brady wrote:
> 
> I can't speak for Zend_Feed itself, but in terms of the future I have
> proposed Zend_Feed_Writer to the wiki for comment following in the
> footsteps of Zend_Feed_Reader. It's not operational to the point of
> handling custom namespaces, though the plan is to allow users write
> Extensions for any Atom/RSS modules they wish (and support many at release
> date). So it is planned - unfortunately not implemented just yet. I am
> hoping to get it into ZF 1.10 once I have time in the next few weeks to
> build it up some more and request the Zend review.
> 
> Paddy
> 
>  Pádraic Brady
> 
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
> 
> 
> 
> 
> 
> 
> From: Gautam Arora 
> To: fw-general@lists.zend.com
> Sent: Thursday, August 6, 2009 12:03:34 AM
> Subject: [fw-general] Creating Zend_Feed with custom namespace
> 
> 
> I've created a zend rss feed using importArray() but now need to add some
> custom namespaces (e.g. for media mrss). Their is no support for custom
> namespaces in importArray() method and only single Zend_Feed_Rss_Entry can
> be created with custom namespace (they cant be appended together to form a
> complete rss)
> These issues have been raised earlier by other members as well.
> http://www.nabble.com/Producing-Google-Base-atom-feeds-td20488222.html#a20488222
> http://www.nabble.com/Beyond-Zend_Feed--td23376966.html#a23376966
> 
> are there any workarounds or alternatives to use custom namespaces with
> zend_feed? Is support being planned for it as it is an important feature.
> 
> Thanks
> -- 
> View this message in context:
> http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24837727.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -
> Pádraic Brady
> 
> Blog: http://blog.astrumfutura.com
> Free Zend Framework Book: http://www.survivethedeepend.com
> OpenID Europe Foundation - Irish Representative
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24838961.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Creating Zend_Feed with custom namespace

2009-08-05 Thread Pádraic Brady
I can't speak for Zend_Feed itself, but in terms of the future I have proposed 
Zend_Feed_Writer to the wiki for comment following in the footsteps of 
Zend_Feed_Reader. It's not operational to the point of handling custom 
namespaces, though the plan is to allow users write Extensions for any Atom/RSS 
modules they wish (and support many at release date). So it is planned - 
unfortunately not implemented just yet. I am hoping to get it into ZF 1.10 once 
I have time in the next few weeks to build it up some more and request the Zend 
review.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Gautam Arora 
To: fw-general@lists.zend.com
Sent: Thursday, August 6, 2009 12:03:34 AM
Subject: [fw-general] Creating Zend_Feed with custom namespace


I've created a zend rss feed using importArray() but now need to add some
custom namespaces (e.g. for media mrss). Their is no support for custom
namespaces in importArray() method and only single Zend_Feed_Rss_Entry can
be created with custom namespace (they cant be appended together to form a
complete rss)
These issues have been raised earlier by other members as well.
http://www.nabble.com/Producing-Google-Base-atom-feeds-td20488222.html#a20488222
http://www.nabble.com/Beyond-Zend_Feed--td23376966.html#a23376966

are there any workarounds or alternatives to use custom namespaces with
zend_feed? Is support being planned for it as it is an important feature.

Thanks
-- 
View this message in context: 
http://www.nabble.com/Creating-Zend_Feed-with-custom-namespace-tp24837727p24837727.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Re: [fw-general] Unit Testing ZFW

2009-08-03 Thread Pádraic Brady
For example, under Ubuntu there is
/etc/php5/cli/php.ini and /etc/php5/apache2/php.ini

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Tim Fountain 
To: fw-general@lists.zend.com
Sent: Monday, August 3, 2009 3:08:29 PM
Subject: Re: [fw-general] Unit Testing ZFW


2009/8/3 Ryan Chan 


>> php -f AllTests.php
>
>>Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
>>allocate 7680 bytes)
>>in /home/ZendFramework/tests/Zend/Config/Writer/XmlTest.php on
>>line 54
>
>>I have checked my php.ini - memory limit is 32M.
>
>>Even I increased the value to 1GB, memory exhausted still exist,
>>anything I missed?

When you increased the memory limit, did the error above change to "Allowed 
memory size of  1073741824 bytes exhausted..."? If not, remember that the 
command line version of PHP has its own php.ini file, so make sure you're 
editing the correct one.

-- 
Tim Fountain
http://tfountain.co.uk/


[fw-general] Zend_Feed_Writer Proposal Needs Community Feedback

2009-07-27 Thread Pádraic Brady
Hi all,

I just finished the Zend_Feed_Writer proposal over on 
http://framework.zend.com/wiki/display/ZFPROP/Zend_Feed_Writer+-+Padraic+Brady. 
I would appreciate if those interested could take some time to read it over the 
next few days and post any comments you wish.

The proposal references a first basic iteration of the proposed source code 
currently on github which is capable of creating Atom feeds - feel free to give 
that a test run. The next step is adding some important features like HTML 
escaping where it's needed, implementing RSS support, and from there increasing 
the scope of what you can put in feeds using the API.

 Let me know what you think! :)

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Pádraic Brady
>Finally, proposed solution seems to be the best one, with the current
>Zend_View design, but it's wrong to thing that you rise level of
>security in your application; the level is still same as a before.

I have to disagree - simply by removing the need to manually escape everything 
removes the human factor entirely. Sure, your JSON might not be escaped 
correctly by default and break functionality (you should have tests to detect 
that so it won't go unnoticed), but missing that in your code is a lot better 
than the current system where you could miss a simple HTML escape and throw the 
application wide open to an XSS attack. Auto-escaping while imperfect does 
lower your risk of falling afoul of XSS. The more complex and involved your 
views are, the more likely human error will play a factor, and the more 
valuable a poka-yoke system becomes.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Ondrej Ivanič 
To: fw-general@lists.zend.com
Sent: Wednesday, July 15, 2009 1:09:53 AM
Subject: Re: [fw-general] XSS Prevention with Zend Framework

Hi

On Wed, Jul 15, 2009 at 2:39 AM, Matthew Weier
O'Phinney wrote:
>
> Within your view, you, the developer, know your context, so it's up to
> you to define the escaping mechanism. We're just going to provide a sane
> default for the 80/20 use case.
>

80/20 is a nice rule but not for security. I went through this way few
years ago and as you mention it was so convenient to don't care in 80%
of cases but the rest was pain in the ass. The setEscape() method
doesn't help too much when you have to mix css/js/html code in a
single phtml file.

I believe that first set of message to this list will ask questions like this:
- how to to turn of automatic escaping
- why my Javascript doesn't work
...

Finally, proposed solution seems to be the best one, with the current
Zend_View design, but it's wrong to thing that you rise level of
security in your application; the level is still same as a before.

-- 
Ondrej Ivanic
(ondrej.iva...@gmail.com)


Re: [fw-general] Actionstack bad, Layout and View Helpers good??

2009-07-14 Thread Pádraic Brady
It's one of those ongoing debates ;). Those who avoid ActionStack (disclaimer: 
I rarely use them) believe that reusing Controllers in order to construct a 
View is symtomatic of a poorly designed Controller system. Controllers are 
nothing more than supervisors - the Models and View should do all the heavy 
lifting as much as possible (references to Thin Controllers/Fat Models are 
commonplace in Rails land where the concept got its catchy name). Once 
Controllers take on too much responsibility, people hit the problem that unit 
testing Controllers is hard, requires the use of Dependency Injection, and 
usually ends up testing the View (since the Controller has no actual output 
itself except through a View or Model writes). While Rails publicised this a 
lot, it really started back with J2EE where the View Helper design pattern (a 
different concept to what ZF calls a View Helper) was defined in the 
literature. What all of this means in practice - is that
 Controllers are expensive. A View Helper is one simple reusable class, a 
Controller is a class that depends on dozens of other classes doing routing, 
dispatching, action plugin usage, etc, that is far more expensive. You can test 
a View Helper in isolation - you can't with a Controller.

>But what I can gather from the articles is that if I want to display a left
>hand menu, which perhaps lists 'posts' based on a date from the URL, then I
>should write a ViewHelper.  Lets call it My_View_Helper_LeftNav();

Pretty much - the navigation column is then reusable across any View embedded 
in a layout.

>The articles suggest that its fine to allow read access to models from the
>View via the ViewHelper.  So basically all I need to do is grab the date
>from the URL and send it to the Model via the ViewHelper.  I can then spit
>out the results.

It's been a common misconception in the past that Controllers must read Models 
and pass information to Views. This neglects that the Controller is actually 
just reading from a Model, and then passing a second Model (array/object of 
read data) to the Views. The middleman is not always required - just let Views 
read Models directly. The main warning here is that Views must never write to 
Models.

>And thats the problem... how do I access the date from the URL? How do I get
>the request object? Would you get it via the front controllers like this?

This works because the Front Controller in ZF is a singleton. I wouldn't rely 
on that behaviour because it's essentially writing something that depends on 
the existence of a global. The behaviour may (should in my opinion) change with 
ZF 2.0. I would take a slightly more distanced route - add the FC to the 
default Registry and use the Registry in your helpers. I would also encapsulate 
a core response access class as a View Helper - make sure that if FC changes it 
singleton nature, you only need to change one class - not dozens.

>With the Layout/ViewHelper approach is the setResponseSegment pretty much
>redundant?

I wouldn't say it's redundant. Zend_View has evolved to offer flexible 
approaches to composing Views. Segmented responses still serve a purpose, it's 
cheap to maintain, and there's no reason to view it as redundant.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Sam Davey 
To: fw-general@lists.zend.com
Sent: Tuesday, July 14, 2009 7:29:43 AM
Subject: [fw-general] Actionstack bad, Layout and View Helpers good??


Hi,

I've been reading a number of articles about why the Action Stack is bad and
everything you need to achieve with the action stack could be achieved with
ViewHelpers.

I completely buy into this... I can't remember the number of times I've had
to fudge code because my predispatch hooks are being caled over and over
depending on how many things are in the action stack.  I wish i'd read these
articles 12 months ago.

So I just have a couple of questions about ViewHelpers, Lahyout and URL
parameters.

Zend_Layout is great, full control over layout of the whole application. 
Just spit out your main content via layout()->content; ?>

But what I can gather from the articles is that if I want to display a left
hand menu, which perhaps lists 'posts' based on a date from the URL, then I
should write a ViewHelper.  Lets call it My_View_Helper_LeftNav();

Its in the left hand of my Layout so in the layout I'm just spitting it out 
in my layout script e.g. LeftNav(); ?>

The articles suggest that its fine to allow read access to models from the
View via the ViewHelper.  So basically all I need to do is grab the date
from the URL and send it to the Model via the ViewHelper.  I can then spit
out the results.

And thats the problem... how do I access the date from the URL? How do I get
the

Re: [fw-general] XSS Prevention with Zend Framework

2009-07-14 Thread Pádraic Brady
PHP's magic_quotes was a mistake because it failed to do anything useful and 
instead created more problems that lead to greater insecurity and uncertainty 
instead. Automatic escaping with ZF 2.0 is anything but - it is a simple 
concept whereby html escaping is applied by default to any request for a view 
variable (one can assume most views are HTML). If you wish not to have this 
escaping applied, there will be a similar method for retrieving the raw value 
of any variable (then you can do the XML/JSON thing).

The security principle involved is "never trust a human" ;). People forget to 
manually escape variables - especially when escaping has it's own method which 
is tortuous to use everywhere on everything it's needed on - it also looks ugly 
cluttering up my view templates. All you need is someone to get lazy or forget 
to use it and the application is thrown into risk. Then you have the smarties 
who like to use it only where they believe it's necessary - a silly presumption 
since any change could make put any view variable into a scope where escaping 
is essential. The ZF 2.0 default behaviour is therefore a poka-yoke (from 
Japanese - refers to any system in a process which helps an operator avoid 
mistakes due to human error). Since we can't trust humans - we won't. We'll 
escape everything and then if you want unescaped values you will need to use an 
obvious "raw" retrieval method which can be spotted by anyone, requires 
deliberate action to use, and can be
 double-checked by peers.

How is that even remotely like the magic_quotes problem?

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Ondrej Ivanič 
To: fw-general@lists.zend.com
Sent: Tuesday, July 14, 2009 6:47:19 AM
Subject: Re: [fw-general] XSS Prevention with Zend Framework

Hi

> fixing that...), but I will note: Starting with 2.0, escaping will be
> the default when retrieving variables from the view object, and you will
> need to request the raw value explicitly if you need it. This is a

Thats sounds like a ZF version of magic_quotes... How do you want to
deal with different escaping in javascript, css, html, xml? View
script could be mix of anything i.e:

var = '1/2"' ?>
var; ?>


document.title = "<?php echo $this->var; ?>"


and the correct output is:

1/2"

document.title = "1\/2\"";


For a proper automatic escaping you need an information about context
which is very hard (impossible) to get now...

html: htmlspecialchars($s, ENT_QUOTES)
xml: htmlspecialchars(preg_replace('#[\x00-\x08\x0B\x0C\x0E-\x1F]+#',
'', $s), ENT_QUOTES)
css: addcslashes($s, "\x00..\x2C./:;<=>?...@[\\]^`{|}~")
ccs inside html attributes: htmlspecialchars(addcslashes($s,
"\x00..\x2C./:;<=>?...@[\\]^`{|}~"), ENT_QUOTES)
javascript: json_encode($s)
js inside html attributes: htmlspecialchars(json_encode($s),  ENT_QUOTES);

-- 
Ondrej Ivanic
(ondrej.iva...@gmail.com)


Re: [fw-general] XSS Prevention with Zend Framework

2009-07-13 Thread Pádraic Brady
Hi Howard,

The wiki page referred to wasn't all that clear that there are numerous vectors 
for XSS. The Zend Framework bakes in anti-XSS tactics for a subset of these 
vectors, but does not cover all of them. Indeed it couldn't possibly do so. 
When people talk about the XSS filtering in ZF, they are referring to the 
ability to escape HTML or XML output from Zend_View (which will be enabled by 
default in 2.0). The ZF also offers a reasonably robust validation and 
filtering system for forms. Zend_Db additionally has its own inward oriented 
escaping when dealing with databases.

The wiki page refers to something else - the filtering of HTML input to make it 
safe for output a HTML (a case where Zend_View escaping doesn't apply). For 
example, perhaps users can submit comments containing HTML elements (you can't 
escape this or the HTML is lost and displayed literally). Perhaps you are 
consuming RSS or Atom feeds which contain HTML content (which is pretty much 
inevitable). These specific cases - where you need to output HTML coming from 
an external source out of your direct control is not addressed by the 
framework. The library noted, HTMLPurifier, is an amazing solution in my 
opinion and one that would be extremely difficult to emulate in the Zend 
Framework given its complexity (Edward does an amazing job maintaining it). For 
this specific XSS vector HTMLPurifier has no peer within the ZF.

So in short, ZF does assist with XSS prevention - but there are vectors it 
simply does not address. This is not a failing or weakness but perhaps it is 
something we should note more clearly in the documentation where it is relevant.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: howard chen 
To: Zend Framework General 
Sent: Monday, July 13, 2009 2:32:38 PM
Subject: [fw-general] XSS Prevention with Zend Framework

Back to the Mar 2008, some guy posted :
http://framework.zend.com/wiki/display/ZFDEV/Cross+Site+Scripting+Prevention+for+PHP

Any update on it?

Is it possible to do XSS filtering with Zend Framework now?


Thanks.


Re: [fw-general] Zend Framework Custom Builds

2009-07-09 Thread Pádraic Brady
It's not huge, but there are cases where size matters - mostly because the 
public perceive a huge application download as a sign of something bloated and 
probably hard to use. Imagine releasing a cool new HTML Cleaner Library - with 
a 5MB download of which only 268KB is the cleaner library itself ;).

That said - that scenario is when deploying/distributing something - getting 
the component from the ZF site to start with should mean size doesn't matter. 
It's a relatively tiny download - a few seconds with a decent connection.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Christopher Östlund 
Cc: fw-general@lists.zend.com
Sent: Thursday, July 9, 2009 3:01:13 PM
Subject: Re: [fw-general] Zend Framework Custom Builds

The minimal version of ZF is just 4.5MB, is that really too big?


On Thu, Jul 9, 2009 at 3:52 PM, umpirsky  wrote:


>>Hi.
>
>>Is there a custom build download page for zf, which can build zf component
>>with dependencies? For e.g. if I want to use just Zend_Service_Twitter or
>>Zend_Form, I don't need entire framework to be included into my project.
>
>>Regards,
>>Sasa Stamenkovic.
>--
>>View this message in context: 
>>http://www.nabble.com/Zend-Framework-Custom-Builds-tp24410459p24410459.html
>>Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


  1   2   3   4   >