Changeset 2043
- Timestamp:
- 09/12/06 07:01:42 (2 years ago)
- Files:
-
- branches/synace/CHANGELOG (modified) (1 diff)
- branches/synace/UPGRADE (deleted)
- branches/synace/bin (deleted)
- branches/synace/data/skeleton/app/app/config/cache.yml (modified) (1 diff)
- branches/synace/data/skeleton/app/app/config/config.php (modified) (1 diff)
- branches/synace/data/skeleton/app/app/config/logging.yml (modified) (2 diffs)
- branches/synace/data/skeleton/app/app/config/settings.yml (modified) (1 diff)
- branches/synace/data/skeleton/app/app/config/tidy.conf (deleted)
- branches/synace/data/skeleton/app/app/config/view.yml (modified) (1 diff)
- branches/synace/doc/book/content/cache.txt (modified) (2 diffs)
- branches/synace/doc/book/content/cli.txt (modified) (5 diffs)
- branches/synace/doc/book/content/configuration.txt (modified) (2 diffs)
- branches/synace/doc/book/content/configuration_practice.txt (modified) (2 diffs)
- branches/synace/doc/book/content/cookie.txt (modified) (1 diff)
- branches/synace/doc/book/content/custom_helper.txt (modified) (1 diff)
- branches/synace/doc/book/content/generator.txt (modified) (3 diffs)
- branches/synace/doc/book/content/i18n.txt (modified) (1 diff)
- branches/synace/doc/book/content/javascript.txt (modified) (4 diffs)
- branches/synace/doc/book/content/model.txt (modified) (10 diffs)
- branches/synace/doc/book/content/plugin.txt (modified) (6 diffs)
- branches/synace/doc/book/content/routing.txt (modified) (4 diffs)
- branches/synace/doc/book/content/templating_configuration.txt (modified) (1 diff)
- branches/synace/doc/book/content/templating_form_helpers.txt (modified) (2 diffs)
- branches/synace/doc/book/content/templating_link_helpers.txt (modified) (2 diffs)
- branches/synace/doc/book/content/upload.txt (modified) (1 diff)
- branches/synace/doc/book/content/validate_form.txt (modified) (2 diffs)
- branches/synace/doc/book/content/view.txt (modified) (2 diffs)
- branches/synace/doc/book/convert2docbook.php (modified) (1 diff)
- branches/synace/doc/phpdoc (deleted)
- branches/synace/doc/phpdoc.ini (deleted)
- branches/synace/lib/BRANCH (modified) (1 diff)
- branches/synace/lib/action/sfAction.class.php (modified) (14 diffs)
- branches/synace/lib/action/sfActionStack.class.php (modified) (1 diff)
- branches/synace/lib/action/sfActionStackEntry.class.php (modified) (3 diffs)
- branches/synace/lib/action/sfActions.class.php (modified) (2 diffs)
- branches/synace/lib/action/sfComponent.class.php (modified) (1 diff)
- branches/synace/lib/addon/propel/builder/SfExtensionObjectBuilder.php (copied) (copied from trunk/lib/addon/propel/builder/SfExtensionObjectBuilder.php)
- branches/synace/lib/addon/propel/builder/SfExtensionPeerBuilder.php (copied) (copied from trunk/lib/addon/propel/builder/SfExtensionPeerBuilder.php)
- branches/synace/lib/addon/propel/builder/SfMapBuilderBuilder.php (copied) (copied from trunk/lib/addon/propel/builder/SfMapBuilderBuilder.php)
- branches/synace/lib/addon/propel/builder/SfMultiExtendObjectBuilder.php (copied) (copied from trunk/lib/addon/propel/builder/SfMultiExtendObjectBuilder.php)
- branches/synace/lib/addon/propel/builder/SfObjectBuilder.php (modified) (2 diffs)
- branches/synace/lib/addon/propel/builder/SfPeerBuilder.php (modified) (2 diffs)
- branches/synace/lib/addon/propel/sfPropelData.class.php (modified) (3 diffs)
- branches/synace/lib/addon/propel/sfPropelDatabaseSchema.class.php (modified) (24 diffs)
- branches/synace/lib/addon/propel/sfPropelManyToMany.class.php (copied) (copied from trunk/lib/addon/propel/sfPropelManyToMany.class.php)
- branches/synace/lib/addon/sfMail/sfMail.class.php (modified) (5 diffs)
- branches/synace/lib/addon/sfPager/sfPropelPager.class.php (modified) (4 diffs)
- branches/synace/lib/cache/sfFileCache.class.php (modified) (3 diffs)
- branches/synace/lib/cache/sfFunctionCache.class.php (modified) (2 diffs)
- branches/synace/lib/config/sfAutoloadConfigHandler.class.php (modified) (5 diffs)
- branches/synace/lib/config/sfCacheConfigHandler.class.php (modified) (4 diffs)
- branches/synace/lib/config/sfCompileConfigHandler.class.php (modified) (1 diff)
- branches/synace/lib/config/sfConfigCache.class.php (modified) (5 diffs)
- branches/synace/lib/config/sfDefineEnvironmentConfigHandler.class.php (modified) (1 diff)
- branches/synace/lib/config/sfFactoryConfigHandler.class.php (modified) (1 diff)
- branches/synace/lib/config/sfGeneratorConfigHandler.class.php (modified) (3 diffs)
- branches/synace/lib/config/sfLoader.class.php (copied) (copied from trunk/lib/config/sfLoader.class.php)
- branches/synace/lib/config/sfValidatorConfigHandler.class.php (modified) (1 diff)
- branches/synace/lib/config/sfViewConfigHandler.class.php (modified) (8 diffs)
- branches/synace/lib/controller/sfController.class.php (modified) (15 diffs)
- branches/synace/lib/controller/sfRouting.class.php (modified) (13 diffs)
- branches/synace/lib/controller/sfWebController.class.php (modified) (5 diffs)
- branches/synace/lib/database/sfCreoleDatabase.class.php (modified) (2 diffs)
- branches/synace/lib/database/sfPropelDatabase.class.php (modified) (2 diffs)
- branches/synace/lib/debug/sfWebDebug.class.php (modified) (18 diffs)
- branches/synace/lib/exception/sfException.class.php (modified) (6 diffs)
- branches/synace/lib/filter/sfCacheFilter.class.php (modified) (9 diffs)
- branches/synace/lib/filter/sfCommonFilter.class.php (modified) (1 diff)
- branches/synace/lib/filter/sfExecutionFilter.class.php (modified) (6 diffs)
- branches/synace/lib/filter/sfFillInFormFilter.class.php (modified) (7 diffs)
- branches/synace/lib/filter/sfRenderingFilter.class.php (modified) (1 diff)
- branches/synace/lib/generator/sfPropelAdminGenerator.class.php (modified) (19 diffs)
- branches/synace/lib/generator/sfPropelCrudGenerator.class.php (modified) (2 diffs)
- branches/synace/lib/helper/AssetHelper.php (modified) (11 diffs)
- branches/synace/lib/helper/CacheHelper.php (modified) (3 diffs)
- branches/synace/lib/helper/DateHelper.php (modified) (1 diff)
- branches/synace/lib/helper/EscapingHelper.php (modified) (1 diff)
- branches/synace/lib/helper/FormHelper.php (modified) (9 diffs)
- branches/synace/lib/helper/HelperHelper.php (modified) (2 diffs)
- branches/synace/lib/helper/JavascriptHelper.php (modified) (11 diffs)
- branches/synace/lib/helper/ObjectAdminHelper.php (modified) (3 diffs)
- branches/synace/lib/helper/ObjectHelper.php (modified) (7 diffs)
- branches/synace/lib/helper/PartialHelper.php (modified) (8 diffs)
- branches/synace/lib/helper/TagHelper.php (modified) (1 diff)
- branches/synace/lib/helper/UrlHelper.php (modified) (12 diffs)
- branches/synace/lib/i18n/sfDateFormat.class.php (modified) (1 diff)
- branches/synace/lib/i18n/sfI18N.class.php (modified) (2 diffs)
- branches/synace/lib/i18n/util.php (modified) (2 diffs)
- branches/synace/lib/log/sfLog/console.class.php (modified) (10 diffs)
- branches/synace/lib/log/sfLogEntry.class.php (modified) (2 diffs)
- branches/synace/lib/log/sfLogManager.class.php (copied) (copied from trunk/lib/log/sfLogManager.class.php)
- branches/synace/lib/log/sfLogger.class.php (modified) (3 diffs)
- branches/synace/lib/pear.php (modified) (1 diff)
- branches/synace/lib/request/sfWebRequest.class.php (modified) (6 diffs)
- branches/synace/lib/response/sfResponse.class.php (modified) (1 diff)
- branches/synace/lib/response/sfWebResponse.class.php (modified) (11 diffs)
- branches/synace/lib/storage/sfSessionStorage.class.php (modified) (1 diff)
- branches/synace/lib/symfony.php (modified) (7 diffs)
- branches/synace/lib/test/sfLiveProjectUnitTestCase.class.php (modified) (1 diff)
- branches/synace/lib/test/sfTestBrowser.class.php (modified) (5 diffs)
- branches/synace/lib/user/sfBasicSecurityUser.class.php (modified) (4 diffs)
- branches/synace/lib/util/Spyc.class.php (modified) (1 diff)
- branches/synace/lib/util/sfFinder.class.php (modified) (1 diff)
- branches/synace/lib/util/sfTimer.class.php (copied) (copied from trunk/lib/util/sfTimer.class.php)
- branches/synace/lib/util/sfTimerManager.class.php (copied) (copied from trunk/lib/util/sfTimerManager.class.php)
- branches/synace/lib/util/sfToolkit.class.php (modified) (3 diffs)
- branches/synace/lib/util/sfYaml.class.php (modified) (2 diffs)
- branches/synace/lib/validator/sfCallbackValidator.class.php (copied) (copied from trunk/lib/validator/sfCallbackValidator.class.php)
- branches/synace/lib/validator/sfFileValidator.class.php (modified) (1 diff)
- branches/synace/lib/validator/sfUrlValidator.class.php (copied) (copied from trunk/lib/validator/sfUrlValidator.class.php)
- branches/synace/lib/vendor (modified) (1 prop)
- branches/synace/lib/vendor/creole/CreoleTypes.php (modified) (2 diffs)
- branches/synace/lib/vendor/creole/drivers/mysql/MySQLResultSet.php (modified) (1 diff)
- branches/synace/lib/vendor/creole/drivers/oracle/OCI8Connection.php (modified) (2 diffs)
- branches/synace/lib/vendor/creole/drivers/oracle/OCI8Types.php (modified) (2 diffs)
- branches/synace/lib/vendor/creole/drivers/oracle/metadata/OCI8DatabaseInfo.php (modified) (1 diff)
- branches/synace/lib/vendor/creole/drivers/oracle/metadata/OCI8TableInfo.php (modified) (1 diff)
- branches/synace/lib/vendor/creole/drivers/sqlite/SQLiteResultSet.php (modified) (1 diff)
- branches/synace/lib/vendor/creole/drivers/sqlite/metadata/SQLiteTableInfo.php (modified) (5 diffs)
- branches/synace/lib/vendor/creole/metadata/DatabaseInfo.php (modified) (1 diff)
- branches/synace/lib/vendor/propel-generator/classes/propel/engine/platform/MysqliPlatform.php (modified) (1 diff)
- branches/synace/lib/vendor/propel/util/BasePeer.php (modified) (3 diffs)
- branches/synace/lib/view/escaper/sfOutputEscaper.class.php (modified) (1 diff)
- branches/synace/lib/view/escaper/sfOutputEscaperArrayDecorator.class.php (modified) (1 diff)
- branches/synace/lib/view/escaper/sfOutputEscaperGetterDecorator.class.php (modified) (1 diff)
- branches/synace/lib/view/escaper/sfOutputEscaperIteratorDecorator.class.php (modified) (1 diff)
- branches/synace/lib/view/escaper/sfOutputEscaperObjectDecorator.class.php (modified) (2 diffs)
- branches/synace/lib/view/sfMailView.class.php (modified) (3 diffs)
- branches/synace/lib/view/sfPHPView.class.php (modified) (6 diffs)
- branches/synace/lib/view/sfPartialView.class.php (copied) (copied from trunk/lib/view/sfPartialView.class.php)
- branches/synace/lib/view/sfView.class.php (modified) (11 diffs)
- branches/synace/lib/view/sfViewCacheManager.class.php (modified) (14 diffs)
- branches/synace/package.xml.tmpl (modified) (6 diffs)
- branches/synace/pakefile.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/synace/CHANGELOG
r1500 r2043 1 1 SVN 2 2 --- 3 4 WARNING: All deprecated function, methods and tasks has been removed (see r1631, r1638 and r1799). 5 6 If you try to use this release with 0.6.X projects, you must upgrade them with: symfony upgrade 0.8 7 8 * major partial and component refactoring (big speed improvement) 9 * output escaping is now a global setting 10 * new helpers: use_stylesheet() and use_javascript() 11 * new time information in the symfony log and debug toolbar 12 * major performance improvements 13 * new sfLoader class 14 * symfony command line now works out the box (for PEAR, SVN or .tgz) 15 * new plugin system 16 * propel-build-all now works as expected 17 * major cache refactoring 18 * autoloading is now more flexible 19 * AJAX actions have now layout to off by default 20 * new slot support 21 * added setLayout() method to sfComponent 22 * better exception handling in symfony command line (try -t) 23 * symfony command line now in color (only for *nix) 24 * bundled pake and phing (symfony has no external dependancy) 25 * better i18n support thanks to the new charset setting (FillInFilter, translations, ...) 26 * added a new charset setting 27 * updated creole, Propel and scriptaculous (1.6.2) 28 * many-to-many relationship support in admin generator 29 * removed my* classes from skeleton except myUser 30 * new classes :sfProcessCache, sfLogManager 31 * removed all deprecated functions, methods and tasks. 32 * removed old php, css and js files that are not used anymore 33 * strip comments in production environment by default 34 * better sfTextBrowser with POST support and redirects 35 * support for database schema in YAML format 36 * updated calendar language files (js, ca) 37 * new tasks: init-batch, propel-convert-yaml-schema, propel-load-data, propel-build-all, propel-build-all-load 38 init-controller, clear-controllers, rotate-log, purge-logs, freeze, unfreeze, enable, disable, 39 plugin-list 40 * new validators: sfDateValidator, sfUrlValidator, sfCallbackValidator 41 * and more than 160 bug fixes and small enhancements 42 43 For more detailed information on bugs fixed in this release, see the trac ticket list for 0.6.4: 44 http://www.symfony-project.com/trac/report/10 3 45 4 46 Version 0.6.3 branches/synace/data/skeleton/app/app/config/cache.yml
r500 r2043 1 1 default: 2 activate: off3 type: slot4 lifetime: 864002 activate: off 3 with_layout: false 4 lifetime: 86400 branches/synace/data/skeleton/app/app/config/config.php
r1566 r2043 51 51 set_include_path( 52 52 sfConfig::get('sf_lib_dir').PATH_SEPARATOR. 53 sfConfig::get('sf_root_dir').PATH_SEPARATOR. 53 54 sfConfig::get('sf_app_lib_dir').PATH_SEPARATOR. 54 55 sfConfig::get('sf_symfony_lib_dir').DIRECTORY_SEPARATOR.'vendor'.PATH_SEPARATOR. branches/synace/data/skeleton/app/app/config/logging.yml
r500 r2043 2 2 active: off 3 3 level: err 4 rotate: on 5 purge: off 4 6 5 7 dev: … … 10 12 # active: on 11 13 # level: debug 14 # rotate: off 15 # period: 7 16 # history: 10 17 # purge: on branches/synace/data/skeleton/app/app/config/settings.yml
r1641 r2043 91 91 # validation_error_class: form_error 92 92 # validation_error_id_prefix: error_for_ 93 # 94 # autoloading_functions: ~ 95 # 96 # charset: utf-8 97 # 98 # escaping_strategy: bc 99 # escaping_method: ESC_ENTITIES 100 # 101 # prototype_web_dir: /sf/prototype 102 # admin_web_dir: /sf/sf_admin 103 # web_debug_web_dir: /sf/sf_web_debug branches/synace/data/skeleton/app/app/config/view.yml
r1631 r2043 1 1 default: 2 2 http_metas: 3 content-type: text/html ; charset=utf-83 content-type: text/html 4 4 5 5 metas: branches/synace/doc/book/content/cache.txt
r1624 r2043 103 103 104 104 [php] 105 <?php include_partial('mymodule/my_other_partial', array('foo' => 'bar )) ?>105 <?php include_partial('mymodule/my_other_partial', array('foo' => 'bar')) ?> 106 106 107 107 A component is a lightweight action put on top of a partial. A component slot is a component for which the action varies according to the calling actions. These two inclusion types are very similar to partials, and support caching the same way. For instance, if your global layout shows a: … … 402 402 etag: on 403 403 404 When the server receives a request for a page containing an etag, it processes this page as it would usually. For a page of 'page' type cac e, the response it directly taken from the cache. The server will compute a new md5 hash of the cached response and see that it's the same as the one sent by the browser. Instead of sending the response again, the server will send a 304 header only, and the browser will redisplay the page it keeps in its local cache.404 When the server receives a request for a page containing an etag, it processes this page as it would usually. For a page of 'page' type cache, the response it directly taken from the cache. The server will compute a new md5 hash of the cached response and see that it's the same as the one sent by the browser. Instead of sending the response again, the server will send a 304 header only, and the browser will redisplay the page it keeps in its local cache. 405 405 406 406 ### Conditional GET branches/synace/doc/book/content/cli.txt
r1584 r2043 17 17 -------- 18 18 19 To get the installed version of the symfony package, type:20 21 19 $ symfony -V 22 20 23 To get the full list of the available administration operations, use: 24 25 $ symfony -T 21 Returns the installed version of the symfony package. 22 23 $ symfony 24 25 Returns the full list of the available administration operations. 26 26 27 27 The symfony command expects tasks, and some tasks require additional parameters. The general syntax is: … … 34 34 // does the same thing as 35 35 $ symfony clear-cache 36 37 When an exception occurs, you might want to get the stack trace and detailed explanation. Add the `-t` option before the task name to get the trace. 36 38 37 39 CLI tasks … … 40 42 ### Structure generation 41 43 42 `init-project`: Initialize a new symfony project (shortcut: `new`)43 44 44 $ symfony init-project <PROJECT_NAME> 45 46 `init-app`: Initialize a new symfony application (shortcut: `app`) 45 46 Initializes a new symfony project (shortcut: `new`). 47 47 48 48 $ symfony init-app <APPLICATION_NAME> 49 50 `init-module`: Initialize a new symfony module (shortcut: `module`) 49 50 Initializes a new symfony application (shortcut: `app`). 51 51 52 52 $ symfony init-module <APPLICATION_NAME> <MODULE_NAME> 53 54 Initializes a new symfony module (shortcut: `module`). 55 56 $ symfony init-batch <SKELETON_NAME> [...] 57 58 Initializes a new batch file (shortcut: `batch`). You must select a batch skeleton to init, and then follow the prompts. 59 60 $ symfony init-controller <APPLICATION_NAME> <ENVIRONMENT_NAME> [<SCRIPT_NAME>] [true|false] 61 62 Initializes a new controller (shortcut: `controller`). The default script name follows the symfony convention. 53 63 54 64 Find more about these commands in the [project creation chapter](project_creation.txt). … … 56 66 ### Model generation 57 67 58 `propel-build-model`: Create Propel classes for the current model, based on the `schema.yml` file. If you have several files ending with `schema.yml` in your `config/` directory, they are all taken into account.59 60 68 $ symfony propel-build-model 61 69 62 The connection settings used by the following commands are taken from the `config/propel.ini` configuration. 63 64 `propel-build-schema`: Create `schema.xml` from an existing database 70 Generates the Propel classes for the current model, based on the schema files (YAML or XML) of your `config/` directory. 71 72 The connection settings used by the following commands are taken from the `config/propel.ini` configuration. 73 74 $ symfony propel-build-sql 75 76 Generates the SQL code to create the tables described in the `schema.yml`, in a `data/schema.sql` file. 77 78 $ symfony propel-build-db 79 80 Creates an empty database based on the connection settings. 81 82 $ symfony propel-insert-sql 83 84 Inserts the SQL code from `data/schema.sql` into the database. 85 86 $ symfony propel-build-all 87 88 Executes `propel-build-schema`, `propel-build-sql` and then `propel-insert-sql` all in one command. 89 90 $ symfony propel-load-data <APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>] 91 92 Loads all data from default `data/fixtures/` directory unless otherwise specified. Environment is default to `dev`. The fixtures directory must be specified relative to the project's data dir, for example `fixtures` (default) or `testdata` or specify a single file `fixtures/file.yml`. 93 94 $ symfony propel-build-all-load <APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>] 95 96 Executes `propel-build-all` then `propel-load-data`. Accepts same arguments as `propel-load-data`. 65 97 66 98 $ symfony propel-build-schema 67 99 68 `propel-build-sql`: Create the SQL code to create the tables described in the `schema.yml`, in a `data/schema.sql` file. 69 70 $ symfony propel-build-sql 71 72 `propel-build-db`: Create an empty database 73 74 $ symfony propel-build-db 75 76 `propel-insert-sql`: Insert the SQL code from `data/schema.sql` into the database 77 78 $ symfony propel-insert-sql 79 80 If you want to learn more about the model and the effect of these commands, refer to the [model chapter](model.txt). 100 Creates a `schema.yml` from an existing database. 101 102 Find more about these commands in the [model chapter](model.txt). 81 103 82 104 ### Development tools 83 105 84 `clear-cache`: Clear the cached information (shortcut: `cc`) (find more in the [cache chapter](cache.txt)) 85 86 $ symfony clear-cache <APPLICATION_NAME> [template|config] 87 88 `fix-perms`: Fix directories permissions, to change to `777` the directories that need to be writable. The permission can be broken if you use a checkout from a SVN repository. 106 $ symfony clear-cache [<APPLICATION_NAME>] [template|config] 107 108 Clears the cached information (shortcut: `cc`) (find more in the [cache chapter](cache.txt)). 109 110 $ symfony clear-controllers 111 112 Clears the web directory of all controllers other than ones running in a production environment. Very useful before deployment to the production server. 89 113 90 114 $ symfony fix-perms 91 115 92 `test`: Launch the test suite for an application (find more in the [unit test chapter](test_unit_testing.txt)) 116 Fixes directories permissions, to change to `777` the directories that need to be writable. The permission can be broken if you use a checkout from a SVN repository. 93 117 94 118 $ symfony test <APPLICATION_NAME> 95 96 `sync`: Synchronise the current project with another machine (find more in the [deployment chapter](deployment.txt)) 119 120 Launches the test suite for an application (find more in the [unit test chapter](test_unit_testing.txt)). 121 122 $ symfony freeze 123 $ symfony unfreeze 124 125 Copies all the necessary symfony libraries into the `data/`, `lib/` and `web/sf/` directories of your project. Your project then becomes a kind of sandbox, i.e. a standalone application with no dependence and ready to be transferred to production via FTP. Works fine with PEAR installations as well as symbolic links. Unfreeze your project with the `unfreeze` task. 97 126 98 127 $ symfony sync <ENVIRONMENT_NAME> [go] 128 129 Synchronises the current project with another machine (find more in the [deployment chapter](deployment.txt)). 130 131 ### Project administration 132 133 $ symfony disable <APPLICATION_NAME> <ENVIRONMENT_NAME> 134 135 Forwards the user to the unavailable module and action in your `settings.yml` file and acts in the same way as if you had set the unavaiable setting in your `settings.yml` file. The advantage over the setting is that you can disable a single application for a single environment, and not only the whole project. 136 137 $ symfony enable <APPLICATION_NAME> <ENVIRONMENT_NAME> 138 139 Enables the application and clears the cache. 140 141 $ symfony purge-logs 142 143 Clears the logs files in the log directory depending on your settings in logging.yml (find more in the [logging chapter](logging.txt)). 144 145 $ symfony rotate-log <APPLICATION_NAME> <ENVIRONMENT_NAME> 146 147 Forces a rotation of a log file if rotate is enabled for the log file in logging.yml. (find more in the [logging chapter](logging.txt)). 99 148 100 149 ### Scaffolding and admin generation 101 150 102 `propel-generate-crud`: Generate a new Propel CRUD module based on a class from the model103 104 151 $ symfony propel-generate-crud <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 105 106 `propel-init-crud`: Same as `propel-generate-crud`, except that the generated code is visible only in the `cache/` folder (the generated actions and templates inherit from the framework) 107 108 `propel-init-admin`: Initialize a new Propel admin module based on a class from the model 152 $ symfony propel-init-crud <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 153 154 Generates a new Propel CRUD module based on a class from the model. The `generate` version copies the code from the framework to a new module, the `init` verson creates an empty module that inherits from the one in the framework. In this case, the generated code is visible only in the `cache/` folder (the generated actions and templates inherit from the framework). 109 155 110 156 $ symfony propel-init-admin <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 111 112 You will find a lot of details about scaffolding and generated administrations in the [scaffolding](scaffolding.txt) and [generator chapter](generator.txt). 157 158 Initializes a new Propel admin module based on a class from the model 159 160 Find more about these commands in the [scaffolding](scaffolding.txt) and [generator chapter](generator.txt). 113 161 114 162 ### Plugin management 115 163 116 `plugin-install`: Install a new plugin117 118 164 $ symfony plugin-install [local|global] <CHANNEL_NAME>/<PLUGIN_NAME> 119 165 120 `plugin-upgrade`: Upgrade a plugin 121 166 Installs a new plugin. 167 122 168 $ symfony plugin-upgrade [local|global] <CHANNEL_NAME>/<PLUGIN_NAME> 123 169 124 `plugin-upgrade-all`: Upgrade all the plugins previously installed in local 170 Upgrades a plugin. 125 171 126 172 $ symfony plugin-upgrade-all 127 173 128 `plugin-uninstall`: Uninstall a plugin 174 Upgrades all the plugins previously installed in local 129 175 130 176 $ symfony plugin-uninstall [local|global] <CHANNEL_NAME>/<PLUGIN_NAME> 177 178 Uninstalls a plugin. 131 179 132 180 The way to build, install and manage plugins is described in the [plugin chapter](plugin.txt). … … 134 182 ### Fast Web server for test 135 183 136 The `server` command launches a fast web server written in PHP to serve a symfony application in the `dev` environment. The default port is 8000.137 138 184 $ symfony server <APPLICATION_NAME> [<PORT>] 185 186 Launches a fast web server written in PHP to serve a symfony application in the `dev` environment. The default port is 8000. 139 187 140 188 For instance, if you want to test a symfony application called `myapp` without changing your server configuration, type: branches/synace/doc/book/content/configuration.txt
r1600 r2043 248 248 But maybe you need to add an array, an associative array or a lot of new parameters. In this case it is better to create a new configuration file, together with the corresponding configuration handler. 249 249 250 >**Note**: For project-wide custom settings, you can still take advantage of the `config/config.php` file to call directly the `sfConfig::set()` method or load your own YAML file with `sfYaml::load($file)`. 250 >**Note**: For project-wide custom settings, you can still take advantage of the `config/config.php` file to call directly the `sfConfig::set()` method or load your own YAML file with `sfYaml::load($file)`. Beware that autoloading is not active when the `config.php` is executed, so you need to manually include the class files that you want to use. 251 251 252 252 Scriptable configuration … … 266 266 Be also aware that in the production environment, the configuration is cached, so the configuration files are parsed (and executed) only once after the cache is cleared. 267 267 268 And if you are allergic to YAML, or if you prefer to avoid writing both a configuration file and a configuration handler to finally get an associative array in PHP, you can bypass YAML parsing completely and return a PHP array in any YAML file. It means that you can write the `logging.yml` as follows: 269 270 [php] 271 <?php 272 return array( 273 'default' => array( 274 'active' => true, 275 'level' => 'debug' 276 ) 277 ); 278 279 ...instead of the classic 280 281 default: 282 active: on 283 level: debug 284 268 285 Configuration handlers 269 286 ---------------------- branches/synace/doc/book/content/configuration_practice.txt
r1623 r2043 193 193 ### `factories.yml`: Factories settings {#factories} 194 194 195 Symfony uses classes such as `sfFrontWebController`, `sf User`, `sfRequest` that are part of the framework. In the `myproject/apps/myapp/lib/` directory, you will find some files defining classes called `myFrontWebController`, `myUser`, `myRequest`, etc. They all simply inherit of the 'sf-' classes, and this allows you to customize their behavior. The framework knows to use the 'my-' classes instead of the 'sf-' ones by the configuration settingfound in the `factories.yml` file:195 Symfony uses classes such as `sfFrontWebController`, `sfRequest`, `sfUser`, that are part of the framework. In the `myproject/apps/myapp/lib/` directory, you can override them with your own `myFrontWebController`, `myRequest` classes (`myUser` already exists). They simply need inherit of the 'sf-' classes, and this allows you to customize their behavior. Teel the framework to use the 'my-' classes instead of the 'sf-' ones by changing the settings found in the `factories.yml` file: 196 196 197 197 ... 198 198 all: 199 199 # controller: 200 # class: myFrontWebController200 # class: sfFrontWebController 201 201 # 202 202 # request: 203 # class: myWebRequest203 # class: sfWebRequest 204 204 # 205 205 # user: … … 207 207 ... 208 208 209 This means that you have a prebuilt mechanism to change the **factories** of symfony, the big classes that run behind the curtain, by adding or inheriting methods in the 'my-' classes. 210 211 But if you want to use completely different factories, well, you can. Just modify the `factories.yml` entries to point to your custom files. 209 Have a look at the existing `myUser` class to see how the inheritance allows for extension and overriding of **factories** classes. 212 210 213 211 ### Front controller configuration branches/synace/doc/book/content/cookie.txt
r1016 r2043 208 208 sfContext::getInstance()->getResponse()->setCookie('MyWebSite', '', time() - 3600, '/'); 209 209 } 210 211 >**Note**: This solution works only for non-secure pages, since the security check for secure pages occurs _before_ the custom `remember` filter. Consequently, if a user with a proper cookie tries to access a secure page without having logged to the site in a non-secure page before, he/she will be redirected to the login page as anybody else. If you want the remember me feature to work for secure pages as well, the implementation has to be slightly different. You must create a `myBasicSecurityFilter` class, specializing the `sfBasicSecurityFilter` class, and put the cookie control in it. Then, in the `factories.yml`, change the name of the `security_filter` class to this `myBasicSecurityFilter`. The details of the implementation are left to your sagacity. branches/synace/doc/book/content/custom_helper.txt
r1251 r2043 24 24 [php] 25 25 <?php use_helper('Name') ?> 26 27 >**Note**: If you create a helper file with the same name as one of the existing helper packages of symfony, it will override the one in the framework. It means that you can redefine all the symfony helpers at the application or project level. Beware that your custom file is read _instead_ of the one in the framework, so it is not actually inheritance, and helpers not included in your version will not be available in the code. 26 28 27 29 ### Example branches/synace/doc/book/content/generator.txt
r1627 r2043 123 123 The following sections explain in detail the parameters that can be used in this configuration file. 124 124 125 Table relations126 ---------------127 128 The 1-n table relations are taken care of by the admin generator. In the example mentionned above, the `weblog_comment` table is related to the `weblog_article` table via the `article_id` field. If you initiate the module of the `Comment` class with the admin generator:129 130 $ symfony propel-init-admin myapp comment Comment131 132 The `comment/edit` action will automatically display the `article_id` as a select list showing the ids of the available records of the `weblog_article` table. In addition, if you define a `__toString()` method in the `Article` object, the string returned by this method is used instead of the ids in the select list.133 134 If you need to display the list of comments related to an article in the `article` module (n-1 relation), or if you need to handle related records through a hash table (n-m relation), you will need to customize the module a little by the way of *custom field* or a *partial field*, both described later in this chapter.135 136 125 Fields 137 126 ------ … … 275 264 > article_link: { name: Article } 276 265 > 266 267 If your partial gets crowded with more and more logic, you'll probably want to replace it by a component. Change the `_` prefix by a `~` and you can define a component column: 268 269 ... 270 list: 271 display: [id, ~article_link, date] 272 273 In the generated template, this will result by a call to the `articleLink` component of the current module. 277 274 278 275 Custom and partial fields can be used in the list view and in the edit view. … … 472 469 473 470 >**Note**: In the real world, a `user/edit` view usually contains two `password` fields, the second having to match the first one to avoid typing mistakes. In practice, this is done via a [validator](validate_form.txt). The admin generated modules benefit from this mechanism just like regular modules. 471 472 Table relationships 473 ------------------- 474 475 ### One to many 476 477 The 1-n table relationships are taken care of by the admin generator. In the example mentionned above, the `weblog_comment` table is related to the `weblog_article` table via the `article_id` field. If you initiate the module of the `Comment` class with the admin generator: 478 479 $ symfony propel-init-admin myapp comment Comment 480 481 The `comment/edit` action will automatically display the `article_id` as a select list showing the ids of the available records of the `weblog_article` table. In addition, if you define a `__toString()` method in the `Article` object, the string returned by this method is used instead of the ids in the select list. 482 483 If you need to display the list of comments related to an article in the `article` module (n-1 relationship), you will need to customize the module a little by the way of a partial field. 484 485 ### Many to many 486 487 The n-n table relationships are also taken care of. The implementation of such relationships is made through an intermediate table. For instance, if there is a n-n relation between a `blog_article` and a `blog_author` table (an article can be written by more than one author and, obviously, an author can write more than one article), then your database will always end up with a table called `blog_article_author` or similar. 488 489 | blog_article | blog_article_author | blog_author | 490 | ------------ | ------------------- | ----------- | 491 | id | article_id | id | 492 | title | author_id | name | 493 | ... | | ... | 494 495 The model will then have a class called `ArticleAuthor` and this is the only thing that the admin generator needs - but you have to pass it as a parameter of the field, called `trough_class`. 496 497 For instance, in a generated module based on the `Article` class, you can add a field to create new n-n associations with the `Author` class. 498 499 edit: 500 fields: 501 article_author: { type: admin_double_list, params: through_class=ArticleAuthor } 502 503 Such a field handles links between existing objects, so a regular select list is not enough. You must use a special type of input for that. Symfony offers three widgets to help relate members of two lists. You have the choice between an `admin_double_list`, an `admin_select_list` and an `admin_check_list`. 474 504 475 505 Interactions branches/synace/doc/book/content/i18n.txt
r1605 r2043 237 237 The syntax of the last lines illustrates the ability to do a simple substitution within the `__()` function, to avoid unnecessary chunking of text. 238 238 239 One of the common problems with tran lsation is the use of the plural form. According to the number of results, the text changes, such as in:239 One of the common problems with translation is the use of the plural form. According to the number of results, the text changes, such as in: 240 240 241 241 [php] branches/synace/doc/book/content/javascript.txt
r1547 r2043 26 26 ------------- 27 27 28 The most common use of JavaScript is in a hyperlink that triggers a particular script. In HTML, you would probably write it like that: 29 30 [php] 31 <a href="#" onClick="alert('foobar');return none;">Click me!</a> 32 33 Symfony proposes a helper to write it in a more concise way, the `link_to_function()`: 34 35 [php] 36 <?php echo link_to_function("Click me!", "alert('foobar')") ?> 37 38 Like the `link_to()` [URL helper](templating_link_helpers.txt), you can add options to the `<a>` tag generated by a `link_to_function()`: 39 40 [php] 41 <?php echo link_to_function("Click me!", "alert('foobar')", "class=mylink style=color:#f00 alt=please click me" ) ?> 42 43 >**Note**: Just like the `link_to()` helper has a `button_to()` brother, you can trigger a JavaScript from a button (`<input type="button">`) by calling the `button_to_function()` helper. And if you prefer a clickable image, just call `link_to_function(image_tag('myimage'), "alert('foobar')")`. 28 ### Clean XHTML JavaScript inclusion 44 29 45 30 If you want to write a piece of JavaScript code in your page, instead of writing manually something like: … … 64 49 } 65 50 ") ?> 51 52 ### Link behavior 53 54 The most common use of JavaScript is in a hyperlink that triggers a particular script. In HTML, you would probably write it like that: 55 56 [php] 57 <a href="#" onClick="alert('foobar');return none;">Click me!</a> 58 59 Symfony proposes a helper to write it in a more concise way, the `link_to_function()`: 60 61 [php] 62 <?php echo link_to_function("Click me!", "alert('foobar')") ?> 63 64 Like the `link_to()` [URL helper](templating_link_helpers.txt), you can add options to the `<a>` tag generated by a `link_to_function()`: 65 66 [php] 67 <?php echo link_to_function("Click me!", "alert('foobar')", "class=mylink style=color:#f00 alt=please click me" ) ?> 68 69 >**Note**: Just like the `link_to()` helper has a `button_to()` brother, you can trigger a JavaScript from a button (`<input type="button">`) by calling the `button_to_function()` helper. And if you prefer a clickable image, just call `link_to_function(image_tag('myimage'), "alert('foobar')")`. 70 71 ### Updating an element 66 72 67 73 One common task in applications that use JavaScript a lot is the update of an element in the page. This is something that you usually write: … … 97 103 98 104 The helper makes your templates easier to understand than any JavaScript code, and you have one single syntax for similar behaviours. That's also why the helper name is so long: It makes the code self-sufficient, without the need of extra commentaries. 105 106 ### Graceful degradation