Manage different ZF projects on one server

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

Manage different ZF projects on one server

Jurian Sluiman-4
Hi all,

With several ZF projects on one server and each a default config (Zend and
ZendX libraries in the library/ folder of a project) we have many ZF libraries
on our system.

Not all versions are the same but we'd like to reduce the number (mainly
because of APC performance). We run Zend Server CE and have zend-server-
framework installed. What is the best option?

1) All projects use the /usr/local/zend/share/ZendFramework/library/Zend lib
2) We install our own /usr/local/zend-framework/1.11.5/Zend libs
3) Status quo (libraries per project)

For 1) we need to make sure all projects still work after an update. With BC
breaks, it can cost suddenly a serious amount of time to fix it. Advantage:
simple update, all in one place.
For 2) we don't need to worry about the different versions, because we install
the libraries under different version numbers.
For 3) I don't think it's the best option, but maintainability is the best.

The next thing is namely not to worry about production, but rather development
environments: how do we manage keeping the libraries in a custom place for all
different developers?

I'd like to hear your thoughts,
Jurian
--
Jurian Sluiman
Soflomo - http://soflomo.com

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


Reply | Threaded
Open this post in threaded view
|

Re: Manage different ZF projects on one server

Marco Pivetta
I'm for the first option.
Just simply use symlinks or include path (anyway, longer include path could
add some stat calls).
Supposing you have a main "library" (like with pear, in /usr/share or
similars) ZF will be loaded from there by every project. Thus, APC Opcode
cache should resolve always to the same location.
This is the best in terms of performance, but requires you to check for BCs
as youy said. Anyway, ZF 1.X should probably become more like a stable
security-fix-mantained version after ZF2. Therefore, if those updates are
not vital to your project, just take some time and try to read all
changelogs.
My 2 cents :)

Marco Pivetta
@Ocramius <http://twitter.com/Ocramius>
http://marco-pivetta.com



On 10 April 2011 15:28, Jurian Sluiman <[hidden email]> wrote:

> Hi all,
>
> With several ZF projects on one server and each a default config (Zend and
> ZendX libraries in the library/ folder of a project) we have many ZF
> libraries
> on our system.
>
> Not all versions are the same but we'd like to reduce the number (mainly
> because of APC performance). We run Zend Server CE and have zend-server-
> framework installed. What is the best option?
>
> 1) All projects use the /usr/local/zend/share/ZendFramework/library/Zend
> lib
> 2) We install our own /usr/local/zend-framework/1.11.5/Zend libs
> 3) Status quo (libraries per project)
>
> For 1) we need to make sure all projects still work after an update. With
> BC
> breaks, it can cost suddenly a serious amount of time to fix it. Advantage:
> simple update, all in one place.
> For 2) we don't need to worry about the different versions, because we
> install
> the libraries under different version numbers.
> For 3) I don't think it's the best option, but maintainability is the best.
>
> The next thing is namely not to worry about production, but rather
> development
> environments: how do we manage keeping the libraries in a custom place for
> all
> different developers?
>
> I'd like to hear your thoughts,
> Jurian
> --
> Jurian Sluiman
> Soflomo - http://soflomo.com
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Manage different ZF projects on one server

Simon Walter
In reply to this post by Jurian Sluiman-4
On 10/04/2011 22:28, Jurian Sluiman wrote:
> 1) All projects use the /usr/local/zend/share/ZendFramework/library/Zend lib
> 2) We install our own /usr/local/zend-framework/1.11.5/Zend libs
> 3) Status quo (libraries per project)

I'd say go with 1 as the default. Then use 2 where you have
incompatibilities, except make it "/path/zf-version" rather than
"/path/zf/version" then you can have "/path/zf" which would be the
latest and greatest along with "/path/zf-oldversion" Sometimes
incompatibilities cannot be fixed, because of dependence on an older
feature. I've not seen this the case with ZF though.

I don't know 3 would the status quo. 1. is my MO using the PHP include
path. I've up graded ZF every single time with nothing more than minor
changes to my apps if any at all. Admittedly, I only have three apps on
my server. So you may have more to think about.

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


Reply | Threaded
Open this post in threaded view
|

Re: Manage different ZF projects on one server

weierophinney
Administrator
In reply to this post by Jurian Sluiman-4
-- Jurian Sluiman <[hidden email]> wrote
(on Sunday, 10 April 2011, 03:28 PM +0200):

> With several ZF projects on one server and each a default config (Zend and
> ZendX libraries in the library/ folder of a project) we have many ZF libraries
> on our system.
>
> Not all versions are the same but we'd like to reduce the number (mainly
> because of APC performance). We run Zend Server CE and have zend-server-
> framework installed. What is the best option?
>
> 1) All projects use the /usr/local/zend/share/ZendFramework/library/Zend lib
> 2) We install our own /usr/local/zend-framework/1.11.5/Zend libs
> 3) Status quo (libraries per project)
>
> For 1) we need to make sure all projects still work after an update. With BC
> breaks, it can cost suddenly a serious amount of time to fix it. Advantage:
> simple update, all in one place.
> For 2) we don't need to worry about the different versions, because we install
> the libraries under different version numbers.
> For 3) I don't think it's the best option, but maintainability is the best.
>
> The next thing is namely not to worry about production, but rather development
> environments: how do we manage keeping the libraries in a custom place for all
> different developers?

Zend_Loader_Autoloader actually understands a concept of versioned ZF
libraries already, which would make (2) an obvious choice. On the
following page:

    http://framework.zend.com/manual/en/zend.loader.autoloader.html

look for the section entitled "Selecting a Zend Framework version".
Basically, have the latest version of ZF symlinked to a standard
directory, use the Zend_Loader_Autoloader class from that directory,
and then point it to the base directory and indicate a version you wish
to use.

Zend_Application is also aware of this information, and you can
configure it with the keys "autoloaderzfpath" and "autoloaderzfversion".

This approach allows you to have parallel ZF installs, while still
re-using them if several applications share the same versions.
Additionally, you can keep only the latest version of a given minor
release at a time -- these introduce BC breaks *extremely* *rarely* (as
in: only for security issues), which allows you to further minimize the
number of versions you retain on your system.

--
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: Manage different ZF projects on one server

Jurian Sluiman-4
On Monday 11 Apr 2011 16:23:41 Matthew Weier O'Phinney wrote:

> Zend_Loader_Autoloader actually understands a concept of versioned ZF
> libraries already, which would make (2) an obvious choice. On the
> following page:
>
>     http://framework.zend.com/manual/en/zend.loader.autoloader.html
>
> look for the section entitled "Selecting a Zend Framework version".
> Basically, have the latest version of ZF symlinked to a standard
> directory, use the Zend_Loader_Autoloader class from that directory,
> and then point it to the base directory and indicate a version you wish
> to use.
>
> Zend_Application is also aware of this information, and you can
> configure it with the keys "autoloaderzfpath" and "autoloaderzfversion".
>
> This approach allows you to have parallel ZF installs, while still
> re-using them if several applications share the same versions.
> Additionally, you can keep only the latest version of a given minor
> release at a time -- these introduce BC breaks *extremely* *rarely* (as
> in: only for security issues), which allows you to further minimize the
> number of versions you retain on your system.

Hi Matthew,

Thanks for the advice, I did not know about this new autoloader function. Also
thanks to Simon and Marco for the responses!

Besides the Zend and ZendX libraries I have a Doctrine, DomPdf and a custom ZF
library as well. Our Doctrine and DomPdf libraries have a fixed version, but
our own library is also versioned (with different version numbers than ZF). Is
it possible to use this version select for ZF, another version select for our
own library and a fixed version for 3rd party libraries? Or is this too
complex?

Regards, Jurian

PS. I know minor and micro releases rarely cause BC breaks, but I'd rather be
aware of it (and it does not happen) than the opposite ;-)
--
Jurian Sluiman
Soflomo - http://soflomo.com

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