Полный справочник по symfony v. 1.1 - Глава 5 - Конфигурирование Symfony

ttp://www.symfony-project.org, “The Definitive Guide to symfony for the 1.1 version - Chapter 5 - Configuring Symfony”, public translation into Russian from English More about this translation.

See also 42 similar translations

Translate into another language.

Participants

mysolo1248 points
rastajanx872 points
dmsx461 points
And others...
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next next untranslated

The Definitive Guide to symfony for the 1.1 version - Chapter 5 - Configuring Symfony

Полный справочник по symfony v. 1.1 - Глава 5 - Конфигурирование Symfony

History of edits (Latest: dmsx 3 years, 9 months ago) §

To be simple and easy to use, symfony defines a few conventions, which should satisfy the most common requirements of standard applications without need for modification. However, using a set of simple and powerful configuration files, it is possible to customize almost everything about the way the framework and your application interact with each other. With these files, you will also be able to add specific parameters for your applications.

Будучи простой и легкой в использовании, symfony определяет несколько соглашений, которые должны удовлетворять самым распространенным требованиям стандартных приложений без необходимости модификации. Однако, используя набор простых и действенных конфигурационных файлов, возможно кастомизировать почти всё, что касается взаимодействия фреймворка и вашего приложения. Эти файлы также позволят вам добавлять специфические параметры для ваших приложений.

History of edits (Latest: develop7 3 years, 8 months ago) §

This chapter explains how the configuration system works:

Данная глава объясняет, как работает система конфигурации:

History of edits (Latest: develop7 3 years, 8 months ago) §

* The symfony configuration is kept in files written in YAML, although you can always choose another format.

Конфигурация Symfony хранится в файлах YAML формата, однако вы всегда можете выбрать другой формат.

History of edits (Latest: paveli 3 years, 9 months ago) §

* Configuration files are at the project, application, and module levels in a project's directory structure.

* Конфигурационные файлы есть на уровнях проекта, приложений и модулей в структуре директорий проекта.

History of edits (Latest: chocky 3 years, 9 months ago) §

* You can define several sets of configuration settings; in symfony, a set of configuration is called an environment.

Вы можете определить несколько наборов конфигурационных установок; в Synfony, набор конфигурационных установок называется окружением.

History of edits (Latest: paveli 3 years, 9 months ago) §

* The values defined in the configuration files are available from the PHP code of your application.

Переменные, определенные в конфигурационных файлах, доступны из PHP кода вашего приложения.

History of edits (Latest: develop7 3 years, 8 months ago) §

* Additionally, symfony authorizes PHP code in YAML files and other tricks to make the configuration system even more flexible.

* Кроме этого, symfony разрешает PHP-код в файлах YAML и прочие трюки для достижения ещё большей гибкости системы конфигурации.

History of edits (Latest: develop7 3 years, 8 months ago) §

The Configuration System

Система конфигурации

History of edits (Latest: chocky 3 years, 9 months ago) §

Regardless of purpose, most web applications share a common set of characteristics. For instance, some sections can be restricted to a subset of users, or the pages can be decorated by a layout, or a form can be filled with the user input after a failed validation. A framework defines a structure for emulating these characteristics, and the developer can further tweak them by changing a configuration setting. This strategy saves a lot of development time, since many changes don't require a single line of code, even if there is a lot of code behind. It is also much more efficient, because it ensures such information can be maintained in a single and easily identifiable location.

Вне зависимости от назначения, большинство веб-приложений имеют общий набор характеристик. Например, некоторые сегменты могут быть открыты только для определенной группы пользователей, или страницы могуть быть декорированы, или форма может заполняться пользователем после неудавшейся валидации. Фреймворк определяет структуру для эмуляции этих характеристик, а разработчик может далее изменять их, меняя конфигурационные настройки. Эта стратегия значительно экономит время разработки, поскольку на множество изменений не требуется ни одной строчки кода, даже если за ней стоит много кода. Она так же гораздо более результативна, потому что обеспечивается хранение этой информации в единственном и легко определяемом месте.

History of edits (Latest: chocky 3 years, 9 months ago) §

However, this approach has two serious drawbacks:

Однако, у этого подхода есть два серьёзных недостатка:

History of edits (Latest: chocky 3 years, 9 months ago) §

* Developers end up writing endlessly complex XML files.

* В результате разработчики пишут бесконечно сложные XML файлы.

History of edits (Latest: chocky 3 years, 9 months ago) §

* In a PHP architecture, every request takes much longer to process.

* В архитектуре PHP каждый запрос обрабатывается гораздо дольше.

History of edits (Latest: chocky 3 years, 9 months ago) §
Pages: ← previous Ctrl next next untranslated

© sensiolabs. License: GFDL license