Deprecations and removals in 1.3
This document lists all settings, classes, methods, functions, and tasks that have been deprecated or removed in symfony 1.3.
Core Plugins
The following core plugins have been deprecated in symfony 1.3 and will be removed in symfony 1.4:
sfCompat10Plugin
: By deprecating this plugin, we also deprecate all other elements in the framework that rely on this plugin to work (1.0 admin generator, and 1.0 form system). It also includes the default admin generator theme for 1.0 located inlib/plugins/sfPropelPlugin/data/generator/sfPropelAdmin
.sfProtoculousPlugin
: The helpers provided by this plugin do not support unobstrusiveness, and as such should not be used anymore.
Methods and Functions
The following methods and functions have been deprecated in symfony 1.3 or before, and will be removed in symfony 1.4:
sfToolkit::getTmpDir()
: You can replace all occurrences of this method bysys_get_temp_dir()
sfToolkit::removeArrayValueForPath()
,sfToolkit::hasArrayValueForPath()
, andgetArrayValueForPathByRef()
sfValidatorBase::setInvalidMessage()
: You can replace it by a call to the newsfValidatorBase::setDefaultMessage()
methodsfValidatorBase::setRequiredMessage()
: You can replace it by a call to the newsfValidatorBase::setDefaultMessage()
methodsfTesterResponse::contains()
: You can use the more powerfulmatches()
methodsfTestFunctionalBase
following methods:isRedirected()
,isStatusCode()
,responseContains()
,isRequestParameter()
,isResponseHeader()
,isUserCulture()
,isRequestFormat()
, andcheckResponseElement()
: These methods have been deprecated since 1.2, and replaced with the tester classes.sfTestFunctional
following methods:isCached()
,isUriCached()
: These methods have been deprecated since 1.2, and replaced with the tester classes.sfFilesystem::sh()
: You can replace all occurrences of this method by calls to the newsfFilesystem::execute()
method. Be warned that the returned value of this method is an array composed of thestdout
output and thestderr
output.sfAction::getDefaultView()
,sfAction::handleError()
,sfAction::validate()
: These methods have been deprecated in symfony 1.1, and they was not really useful. As of symfony 1.1, they need thecompat_10
setting set toon
to work.sfComponent::debugMessage()
: Use thelog_message()
helper instead.sfApplicationConfiguration::loadPluginConfig()
: UseinitializePlugins()
instead.sfLoader::getHelperDirs()
andsfLoader::loadHelpers()
: Use the same methods from thesfApplicationConfiguration
object. As all methods of the classsfLoader
are deprecated, thesfLoader
class will be removed in symfony 1.4.sfController::sendEmail()
: Use the new mailer feature of Symfony 1.3 instead.sfGeneratorManager::initialize()
: It does nothing.debug_message()
: Use thelog_message()
helper instead.sfWebRequest::getMethodName()
: UsegetMethod()
instead.sfDomCssSelector::getTexts()
: UsematchAll()->getValues()
sfDomCssSelector::getElements()
: UsematchAll()
sfVarLogger::getXDebugStack()
: UsesfVarLogger::getDebugBacktrace()
instead.sfVarLogger
: The loggeddebug_stack
value is deprecated in favor of thedebug_backtrace
value.sfContext::retrieveObjects()
: The method is only used by ObjectHelper, which is deprecated
The following methods and functions have been removed in symfony 1.3:
sfApplicationConfiguration::checkSymfonyVersion()
: see below for the explanation (check_symfony_version
setting)
Classes
The following classes have been deprecated in symfony 1.3 and will be removed in symfony 1.4:
sfDoctrineLogger
: UsesfDoctrineConnectionProfiler
instead.sfNoRouting
andsfPathInfoRouting
sfRichTextEditor
,sfRichTextEditorFCK
, andsfRichTextEditorTinyMCE
: They have been replaced by the widget system (see the "Helpers" section below)sfCrudGenerator
,sfAdminGenerator
,sfPropelCrudGenerator
,sfPropelAdminGenerator
: These classes were used by the 1.0 admin generatorsfPropelUniqueValidator
,sfDoctrineUniqueValidator
: These classes were used by the 1.0 form systemsfLoader
: see the "Methods and Functions" sectionsfConsoleRequest
,sfConsoleResponse
,sfConsoleController
sfDoctrineDataRetriever
,sfPropelDataRetriever
: These classes are only used by ObjectHelper, which is deprecatedsfWidgetFormI18nSelectLanguage
,sfWidgetFormI18nSelectCurrency
, andsfWidgetFormI18nSelectCountry
: Use the correspondingChoice
widgets (sfWidgetFormI18nChoiceLanguage
,sfWidgetFormI18nChoiceCurrency
, andsfWidgetFormI18nChoiceCountry
respectively) as they act exactly in the same way, except they have more customization possibilitiessfWidgetFormChoiceMany
,sfWidgetFormPropelChoiceMany
,sfWidgetFormDoctrineChoiceMany
,sfValidatorChoiceMany
,sfValidatorPropelChoiceMany
,sfValidatorPropelDoctrineMany
: Use the same classes but withoutMany
at the end, and set themultiple
option totrue
SfExtensionObjectBuilder
,SfExtensionPeerBuilder
,SfMultiExtendObjectBuilder
,SfNestedSetBuilder
,SfNestedSetPeerBuilder
,SfObjectBuilder
,SfPeerBuilder
: The custom Propel builder classes have been ported to Propel 1.4's new behaviors system
The following classes have been deprecated in symfony 1.3:
sfCommonFilter
: see the "Removal of the common filter" section of the UPGRADE_TO_1_3 file for more information about the consequences and how to migrate your code.
Helpers
The following helper groups have been deprecated in symfony 1.3 and will be removed in symfony 1.4:
- All helpers related to the 1.0 form system as provided by the
sfCompat10Plugin
:DateForm
,Form
,ObjectAdmin
,Object
, andValidation
The form_tag()
helper from the Form
helper group has been moved to the
Url
helper group, and as such is still available in symfony 1.4.
Loading helpers from the PHP include path has been deprecated in 1.3 and
removed in 1.4. Helpers must be located in one of the project, application or
module lib/helper/
directories.
Settings
The following settings (managed in the settings.yml
configuration file) have
been removed from symfony 1.3:
check_symfony_version
: This setting was introduced years ago to allow automatic cache cleaning in case of a change of the symfony version. It was mainly useful for shared hosting configuration where the symfony version is shared amongst all customers. As this is bad practice since symfony 1.1 (you need to embed the symfony version in each of your project), the settings does not make sense anymore. Moreover, when the setting is set toon
, the check adds a small overhead to each request, as we need to get the content of a file.max_forwards
: This settings controls the number of forwards allowed before symfony throws an exception. Making it configurable has no value. If you need more than 5 forwards, you have both a conception problem and a performance one.sf_lazy_cache_key
: Introduced as a big performance improvement in symfony 1.2.6, this setting allowed you to turn on a lazy cache key generation for the view cache. While we think doing it lazy was the best idea, some people might have relied onsfViewCacheManager::isCacheable()
being called even when the action itself wasn't cacheable. As of symfony 1.3, the behavior is the same as ifsf_lazy_cache_key
was set totrue
.strip_comments
: Thestrip_comments
was introduced to be able to disable the comment stripping because of some bugs in the tokenizer of some PHP 5.0.X versions. It was also used later on to avoid large memory consumption when the Tokenizer extension was not compiled with PHP. The first problem is not relevant anymore as the minimum version of PHP needed is 5.2 and the second one has already been fixed by removing the regular expression that simulated the comment stripping.lazy_routes_deserialize
: This option is not needed anymore.
The following settings have been deprecated in symfony 1.3 and will be removed in symfony 1.4:
calendar_web_dir
,rich_text_js_dir
: These settings are used by the Form helper group, which is deprecated in symfony 1.3.validation_error_prefix
,validation_error_suffix
,validation_error_class
,validation_error_id_prefix
: These settings are used by the Validation helper group, which is deprecated in symfony 1.3.is_internal
(inmodule.yml
): Theis_internal
flag was used to prevent actions from being called from a browser. This was added to protect email sending in symfony 1.0. As email support does not require this trick anymore, this flag will be removed and not checked anymore in the symfony core code.
Tasks
The following tasks have been removed in symfony 1.3:
project:freeze
andproject:unfreeze
: These tasks used to embed the symfony version used by a project inside the project itself. They are not needed anymore as the best practice has been to embed symfony in the project for a very long time now. Moreover, switching from one version of symfony to another is really simple now as you only need to change the path in theProjectConfiguration
class. Embedding by hand symfony is also very simple as you just need to copy the whole symfony directory somewhere in your project (lib/vendor/symfony/
is the recommended one).
The following tasks are deprecated in symfony 1.3, and will be removed in symfony 1.4:
All symfony 1.0 task aliases.
propel:init-admin
: This task generated admin generator modules for symfony 1.0.
The following Doctrine tasks have been merged into doctrine:build
and will
be removed in symfony 1.4:
doctrine:build-all
doctrine:build-all-load
doctrine:build-all-reload
doctrine:build-all-reload-test-all
doctrine:rebuild-db
doctrine:reload-data
Miscellaneous
The following behaviors are deprecated in symfony 1.3, and will be removed in symfony 1.4:
- The
sfParameterHolder::get()
,sfParameterHolder::has()
,sfParameterHolder::remove()
,sfNamespacedParameterHolder::get()
,sfNamespacedParameterHolder::has()
, andsfNamespacedParameterHolder::remove()
methods support for the array notation ([]
) is deprecated and won't be available in symfony 1.4 (better for performance).
The symfony CLI does not accept anymore the global --dry-run
option as it
was not used by any symfony built-in task. If one of your task relies on this
option, you can just add it as a local option of your task class.
The Propel templates for the 1.0 admin generator and the 1.0 CRUD will be
removed in symfony 1.4
(plugins/sfPropelPlugin/data/generator/sfPropelAdmin/
).
The "Dynarch calendar" (found in data/web/calendar/) will be removed in symfony 1.4 as it is only used by the Form helper group, which will be also removed in symfony 1.4.
As of symfony 1.3, the unavailable page will only be looked for in the
%SF_APP_CONFIG_DIR%/
and %SF_CONFIG_DIR%/
directories. If you still have
it stored in %SF_WEB_DIR%/errors/
, you must move it before migrating to
symfony 1.4.
The doc/
directory at the root of a project is not generated anymore, as it
was not used by symfony itself. And so the related sf_doc_dir
has also been
removed.
The sfDoctrinePlugin_doctrine_lib_path
setting, previously used to specify a
custom Doctrine lib directory, has been deprecated in 1.3 and removed in 1.4.
Use the sf_doctrine_dir
setting instead.
All symfony Base*
classes generated classes are not marked as abstract
.
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License license.