Releases for sf 1.1
| Version |
License |
API |
Released |
|
1.0.2stable
|
MIT license |
1.0.0stable
|
18/05/2007 |
Releases for sf 1.0
| Version |
License |
API |
Released |
|
1.0.2stable
|
MIT license |
1.0.0stable
|
18/05/2007 |
|
1.0.1stable
|
MIT license |
1.0.0stable
|
01/12/2006 |
Copyright (c) 2004-2006 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Changelog for release 1.0.2 - 18/05/2007
Not available
Other releases
Release 1.0.2 - 18/05/2007
Not available
Release 1.0.1 - 01/12/2006
Not available
Release 1.0.0 - 21/10/2006
Not available
Installation for sf 1.1
php symfony plugin:install sfOptimizerPlugin --release=1.0.2
Installation for sf 1.0
php symfony plugin-install http://plugins.symfony-project.org/sfOptimizerPlugin
PEAR
Download the PEAR package
Repository
Go to the repository: http://svn.symfony-project.com/plugins/sfOptimizerPlugin
sfOptimizerPlugin plugin
The sfOptimizerPlugin tries to optimize your cache files for production environment.
Installation
To install the plugin for a symfony project, the usual process is to use the symfony command line:
$ symfony plugin-install http://plugins.symfony-project.com/sfOptimizerPlugin
Alternatively, if you don't have PEAR installed, you can download the latest package attached to this plugin's wiki page and extract it under your project's plugins/ directory.
Clear the cache to enable the autoloading to find the new classes:
$ php symfony cc
You're done.
What the plugin does
The plugin optimizes the code of a symfony application using various strategies:
It looks in the code for tests based on symfony configuration that cannot change at runtime, and replaces the call to sfConfig::get() by the actual configuration value.
// it replaces blocks such as
if (sfConfig::get('sf_logging_enabled'))
{
// do things
}
// by
if (false)
{
// do things
}
It looks for obvious tests and removes the test or the whole block based on the condition value.
// it replaces blocks such as
if (true)
{
// do things
}
// by
// do things
// and removes blocks such as
if (false)
{
// do things
}
It removes comments and whitespace in PHP code, which accelerates the parsing.
You can extend the sfOptimizerPlugin to add other optimization strategies. See the code for more information.
The code concerned by the optimization is the one included in the core_compile.yml configuration file. By default, this code contains only files from the symfony libraries, but you can add files from your application to the core compile to have them optimized as well (see the Performance Chapter of the symfony Guide for more details).
Usage
The optimization concerns one application in one environment at a time. To launch an optimization, use the new optimize CLI task, as follows:
$ php symfony optimize [[ENVIRONMENT](APPLICATION])
For instance:
$ php symfony optimize frontend prod
Changelog
2007-05-18 | 1.0.2 Stable
- francois: fixed parameter name in
sfConstantOptimizer
- francois: wrote README