Backporting ZF1 eventmanager - question about compat

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Backporting ZF1 eventmanager - question about compat

weierophinney
Administrator
Hey, all --

As part of the work for 1.12, I'm backporting the EventManager component
from ZF2 to ZF1. In working on it, I realized something:
SplPriorityQueue was not introduced until 5.3.0.

Since ZF 1.X has a minimum version requirement of 5.2.4, This raises a
question:

 * Do I sniff for 5.3, and, if not present, raise an exception?
   (Note: this would mean that we have an exception to the minimum
   required PHP version for this particular component.)
 
 * 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)

Opinions?

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

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Wil Moore III
>
>  * 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.
--
Wil Moore III

Best Practices for Working with Open-Source Developers
http://www.faqs.org/docs/artu/ch19s02.html

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

DO NOT TOP-POST and DO trim your replies:
http://linux.sgms-centre.com/misc/netiquette.php#toppost
Reply | Threaded
Open this post in threaded view
|

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

Anthony Shireman
In reply to this post by weierophinney
On Thu, Mar 15, 2012 at 2:19 PM, Matthew Weier O'Phinney
<[hidden email]>wrote:

> Hey, all --
>
> As part of the work for 1.12, I'm backporting the EventManager component
> from ZF2 to ZF1. In working on it, I realized something:
> SplPriorityQueue was not introduced until 5.3.0.
>
> Since ZF 1.X has a minimum version requirement of 5.2.4, This raises a
> question:
>
>  * Do I sniff for 5.3, and, if not present, raise an exception?
>   (Note: this would mean that we have an exception to the minimum
>   required PHP version for this particular component.)
>

+1 Can the exception say to upgrade their PHP version... and while they're
at it upgrade to ZF2?


>
>  * 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)
>
> Opinions?
>

I think allowing the older version to use new features isn't as important
as the code for ZF2. Don't write something more to make it work.
I'm all for the Exception rather than new code for ZF1.


>
> --
> Matthew Weier O'Phinney
> Project Lead            | [hidden email]
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>
Reply | Threaded
Open this post in threaded view
|

RE: [zf-contributors] Backporting ZF1 eventmanager - question about compat

Kevin Schroeder-2
In reply to this post by Wil Moore III

I would go with Wil on this one.  We specifically state that 5.2 is the minimum version and we shouldn’t introduce features that break that, IMHO.  A minimum version is a minimum version.

 

 

 

Kevin Schroeder
Technology Evangelist
Zend Technologies, Ltd.

www.zend.com

www.twitter.com/kpschrade

www.eschrade.com

Skype: kevin.schroeder

 

 

 

 

 

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Wil Moore III
Sent: Thursday, March 15, 2012 4:23 PM
To: [hidden email]; [hidden email]
Subject: Re: [zf-contributors] Backporting ZF1 eventmanager - question about compat

 

 * 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.

 

Reply | Threaded
Open this post in threaded view
|

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

Pádraic Brady
In reply to this post by Wil Moore III
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 <[hidden email]> 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: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

sjwdavies
In reply to this post by Anthony Shireman
Hey Guys,

+1 For the 'You must use PHP version 5.3 with this version of the Framework.'

I think we're at a time now, especially with the milestone that is PHP
5.4 being released, where 5.3 has to be a minimum.

Sent from my iPhone

Steve Davies
@sjwdavies

On 15 Mar 2012, at 21:34, Anthony Shireman <[hidden email]> wrote:

> On Thu, Mar 15, 2012 at 2:19 PM, Matthew Weier O'Phinney
> <[hidden email]>wrote:
>
>> Hey, all --
>>
>> As part of the work for 1.12, I'm backporting the EventManager component
>> from ZF2 to ZF1. In working on it, I realized something:
>> SplPriorityQueue was not introduced until 5.3.0.
>>
>> Since ZF 1.X has a minimum version requirement of 5.2.4, This raises a
>> question:
>>
>> * Do I sniff for 5.3, and, if not present, raise an exception?
>>  (Note: this would mean that we have an exception to the minimum
>>  required PHP version for this particular component.)
>>
>
> +1 Can the exception say to upgrade their PHP version... and while they're
> at it upgrade to ZF2?
>
>
>>
>> * 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)
>>
>> Opinions?
>>
>
> I think allowing the older version to use new features isn't as important
> as the code for ZF2. Don't write something more to make it work.
> I'm all for the Exception rather than new code for ZF1.
>
>
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead            | [hidden email]
>> Zend Framework          | http://framework.zend.com/
>> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

akrabat
In reply to this post by Pádraic Brady
Same here.

Choices are to either make it 5.2 compatible or to not backport at all.

Regards,

Rob…

On 15 Mar 2012, at 21:29, Pádraic Brady wrote:

> 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 <[hidden email]> 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.
>>


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

Adam Lundrigan
In reply to this post by Kevin Schroeder-2
On Thu, Mar 15, 2012 at 6:59 PM, Kevin Schroeder <[hidden email]> wrote:

>  I would go with Wil on this one.  We specifically state that 5.2 is the
> minimum version and we shouldn’t introduce features that break that, IMHO.
> A minimum version is a minimum version.
>

Agreed.  We shouldn't provide components that don't match up with ZF's
established minimum requirements.  IMO, consistency trumps performance in
this case, so I am in favour of having a userland implementation of
SplPriorityQueue to fall back on for PHP <5.3

One additional Q: will we be able to use anonymous functions with the EM,
as we do in ZF2?  I assume that as long as one is running ZF1 on 5.3+ that
will be possible, but I just want to make sure :)

Thanks for your work on this, Matthew!
--
Adam Lundrigan, B.Sc, ZCE
[hidden email]
Reply | Threaded
Open this post in threaded view
|

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

H Glenn Hatfield
In reply to this post by weierophinney
I feel that if it's going to be backported, it needs to be 5.2.4 compatible.

-H


On Mar 15, 2012, at 3:19 PM, Matthew Weier O'Phinney wrote:

> Hey, all --
>
> As part of the work for 1.12, I'm backporting the EventManager component
> from ZF2 to ZF1. In working on it, I realized something:
> SplPriorityQueue was not introduced until 5.3.0.
>
> Since ZF 1.X has a minimum version requirement of 5.2.4, This raises a
> question:
>
> * Do I sniff for 5.3, and, if not present, raise an exception?
>   (Note: this would mean that we have an exception to the minimum
>   required PHP version for this particular component.)
>
> * 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)
>
> Opinions?
>
> --
> Matthew Weier O'Phinney
> Project Lead            | [hidden email]
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc


--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

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

weierophinney
Administrator
In reply to this post by Adam Lundrigan
-- Adam Lundrigan <[hidden email]> wrote
(on Friday, 16 March 2012, 01:24 PM -0230):
> On Thu, Mar 15, 2012 at 6:59 PM, Kevin Schroeder <[hidden email]> wrote:
>     I would go with Wil on this one.  We specifically state that 5.2 is the
>     minimum version and we shouldn’t introduce features that break that, IMHO.
>     A minimum version is a minimum version.
>
> Agreed.  We shouldn't provide components that don't match up with ZF's
> established minimum requirements.  IMO, consistency trumps performance in this
> case, so I am in favour of having a userland implementation of SplPriorityQueue
> to fall back on for PHP <5.3

It's pretty clear from the responses so far that this is the direction
to take. I've written the implementation at this point, and am working
out a few kinks in sorting, but it should "just work" for folks.

> One additional Q: will we be able to use anonymous functions with the
> EM, as we do in ZF2?  I assume that as long as one is running ZF1 on
> 5.3+ that will be possible, but I just want to make sure :)

Yes -- it simply tests for is_callable(), and Closures and Functors pass
that test fine. :)

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

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]