Changeset 8287
- Timestamp:
- 04/04/08 15:35:58 (3 months ago)
- Files:
-
- doc/branches/1.1/book/17-Extending-Symfony.txt (modified) (1 diff)
- doc/branches/1.1/cookbook/cli.txt (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.1/book/17-Extending-Symfony.txt
r8283 r8287 642 642 *.yml // Fixtures files 643 643 tasks/ 644 *.php // Paketasks644 *.php // CLI tasks 645 645 lib/ 646 646 *.php // Classes doc/branches/1.1/cookbook/cli.txt
r3526 r8287 40 40 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. 41 41 42 >**Note**: For the records, symfony uses a dedicated tool called [Pake][1] to manage common tasks. Pake is a php tool similar to the [Rake][2] command, a Ruby translation of the `make` command. Pake was built by the symfony team. It automates some administration tasks according to a specific configuration file called `pakefile.php`. But since you use the `pake` tool just by typing `symfony` in a command line, you don't even need to learn what pake does and how it works..43 44 42 45 43 CLI tasks … … 48 46 ### Structure generation 49 47 50 $ php symfony init-project <PROJECT_NAME>48 $ php symfony generate:project <PROJECT_NAME> 51 49 52 50 Initializes a new symfony project (shortcut: `new`). 53 51 54 $ php symfony init-app <APPLICATION_NAME>52 $ php symfony generate:app <APPLICATION_NAME> 55 53 56 54 Initializes a new symfony application (shortcut: `app`). 57 55 58 $ php symfony init-module <APPLICATION_NAME> <MODULE_NAME> 59 60 Initializes a new symfony module (shortcut: `module`). 61 62 $ php symfony init-batch <SKELETON_NAME> [...] 63 64 Initializes a new batch file (shortcut: `batch`). You must select a batch skeleton to init, and then follow the prompts. 65 66 $ php symfony init-controller <APPLICATION_NAME> <ENVIRONMENT_NAME> [<SCRIPT_NAME>] [true|false] 67 68 Initializes a new controller (shortcut: `controller`). The default script name follows the symfony convention. 69 56 $ php symfony generate:module <APPLICATION_NAME> <MODULE_NAME> 57 70 58 Find more about these commands in [Chapter 16](http://www.symfony-project.com/book/trunk/16-Application-Management-Tools). 71 59 72 60 ### Model generation 73 61 74 $ php symfony propel -build-model62 $ php symfony propel:build-model 75 63 76 64 Generates the Propel classes for the current model, based on the schema files (YAML or XML) of your `config/` directory. … … 78 66 The connection settings used by the following commands are taken from the `config/propel.ini` configuration. 79 67 80 $ php symfony propel -build-sql68 $ php symfony propel:build-sql 81 69 82 70 Generates the SQL code to create the tables described in the `schema.yml`, in a `data/schema.sql` file. 83 71 84 $ php symfony propel -build-db85 86 Creates an empty database based on the connection settings. 87 88 $ php symfony propel -insert-sql72 $ php symfony propel:build-db 73 74 Creates an empty database based on the connection settings. 75 76 $ php symfony propel:insert-sql 89 77 90 78 Inserts the SQL code from `data/schema.sql` into the database. 91 79 92 $ php symfony propel -build-all93 94 Executes `propel -build-model`, `propel-build-sql` and then `propel-insert-sql` all in one command.80 $ php symfony propel:build-all 81 82 Executes `propel:build-model`, `propel:build-sql` and then `propel:insert-sql` all in one command. 95 83 96 84 Find more about these commands in [Chapter 8](http://www.symfony-project.com/book/trunk/08-Inside-the-Model-Layer). … … 98 86 ### Schema management 99 87 100 $ php symfony propel -build-schema [xml]88 $ php symfony propel:build-schema [xml] 101 89 102 90 Creates a `schema.yml` from an existing database. If the `xml` parameter is added, the tasks creates a `schema.xml` instead of the YAML version. 103 91 104 $ php symfony propel -convert-xml-schema92 $ php symfony propel:schema-to-yml 105 93 106 94 Creates YAML versions of the XML schemas found. 107 95 108 $ php symfony propel -convert-yml-schema96 $ php symfony propel:schema-to-xml 109 97 110 98 Creates XML versions of the YAML schemas found. … … 112 100 ### Data management 113 101 114 $ php symfony propel -load-data<APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>]102 $ php symfony propel:data-load <APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>] 115 103 116 104 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`. 117 105 118 $ php symfony propel -build-all-load <APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>]119 120 Executes `propel -build-all` then `propel-load-data`. Accepts same arguments as `propel-load-data`.121 122 $ php symfony propel -dump-data<APPLICATION_NAME> <FIXTURES_DIR_OR_FILE> [<ENVIRONMENT_NAME>]106 $ php symfony propel:build-all-load <APPLICATION_NAME> [<ENVIRONMENT_NAME>] [<FIXTURES_DIR_OR_FILE>] 107 108 Executes `propel:build-all` then `propel:data-load`. Accepts same arguments as `propel:data-load`. 109 110 $ php symfony propel:data-dump <APPLICATION_NAME> <FIXTURES_DIR_OR_FILE> [<ENVIRONMENT_NAME>] 123 111 124 112 Dumps database data to a file in the fixtures directory in YAML format. … … 126 114 ### Development tools 127 115 128 $ php symfony c lear-cache[<APPLICATION_NAME>] [template|config]116 $ php symfony cache:cmear [<APPLICATION_NAME>] [template|config] 129 117 130 118 Clears the cached information (shortcut: `cc`) (find more in [Chapter 12](http://www.symfony-project.com/book/trunk/12-Caching)). 131 119 132 $ php symfony clear-controllers120 $ php symfony project:clear-controllers 133 121 134 122 Clears the web directory of all controllers other than ones running in a production environment. Very useful before deployment to the production server. 135 123 136 $ php symfony fix-perms124 $ php symfony project:permissions 137 125 138 126 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. 139 127 140 $ php symfony freeze141 $ php symfony unfreeze142 143 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.144 145 $ php symfony sync<ENVIRONMENT_NAME> [go]128 $ php symfony project:freeze 129 $ php symfony project:unfreeze 130 131 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 `project:unfreeze` task. 132 133 $ php symfony project:deploy <ENVIRONMENT_NAME> [go] 146 134 147 135 Synchronises the current project with another machine (find more in [Chapter 16](http://www.symfony-project.com/book/trunk/16-Application-Management-Tools#Deploying%20Applications)). … … 149 137 ### Tests 150 138 151 $ php symfony test -unit <UNIT_TEST>139 $ php symfony test:unit <UNIT_TEST> 152 140 153 141 Launches a unit test located in the `test/unit/` directory. The parameter can be the name of a single unit test file (omitting the `Test.php` suffix), a group of unit test files, or a file path with wildcards. If no test name is given, all unit tests are run. 154 142 155 $ php symfony test -unit143 $ php symfony test:unit 156 144 157 145 Launches all unit tests in harness mode. 158 146 159 $ php symfony test -functional <APPLICATION_NAME> <TEST>147 $ php symfony test:functional <APPLICATION_NAME> <TEST> 160 148 161 149 Launches a functional test for a given application. The `TEST` parameter can be the name of a single functional test file (omitting the `Test.php` suffix), a group of unit test files, or a file path with wildcards. 162 150 163 $ php symfony test -functional <APPLICATION_NAME>151 $ php symfony test:functional <APPLICATION_NAME> 164 152 165 153 Launches all functional tests of an application in harness mode. 166 154 167 $ php symfony test -all155 $ php symfony test:all 168 156 169 157 Launches all unit and functional tests in harness mode. … … 173 161 ### Project administration 174 162 175 $ php symfony disable <APPLICATION_NAME> <ENVIRONMENT_NAME>163 $ php symfony project:disable <APPLICATION_NAME> <ENVIRONMENT_NAME> 176 164 177 165 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. 178 166 179 $ php symfony enable <APPLICATION_NAME> <ENVIRONMENT_NAME>167 $ php symfony project:enable <APPLICATION_NAME> <ENVIRONMENT_NAME> 180 168 181 169 Enables the application and clears the cache. 182 170 183 $ php symfony purge-logs171 $ php symfony log:clear 184 172 185 173 Clears the logs files in the log directory in applications and environments where the `logging.yml` specifies `purge: on` (which is the default value). 186 174 187 $ php symfony rotate-log<APPLICATION_NAME> <ENVIRONMENT_NAME>175 $ php symfony log:rotate <APPLICATION_NAME> <ENVIRONMENT_NAME> 188 176 189 177 Forces a rotation of a log file if `rotate` is enabled for the log file in `logging.yml`. The rotation parameters are the `period` (the number of days a single log file lasts) and the `history` (the number of backup log files kept). Here is an example of `logging.yml` withrotation configutation: … … 196 184 ### Scaffolding and admin generation 197 185 198 $ php symfony propel-generate-crud <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 199 $ php symfony propel-init-crud <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 200 201 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). 202 203 $ php symfony propel-init-admin <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 186 $ php symfony propel:generate-crud <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 187 188 Generates a new Propel CRUD module based on a class from the model. The normal version copies the code from the framework to a new module; if you add the `--generate-in-cache` option, the task 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). 189 190 $ php symfony propel:init-admin <APPLICATION_NAME> <MODULE_NAME> <CLASS_NAME> 204 191 205 192 Initializes a new Propel admin module based on a class from the model … … 209 196 ### Plugin management 210 197 211 $ php symfony plugin -install <CHANNEL_NAME>/<PLUGIN_NAME>198 $ php symfony plugin:install <CHANNEL_NAME>/<PLUGIN_NAME> 212 199 213 200 Installs a new plugin. To install a new plugin from the symfony wiki, use `http://plugins.symfony-project.com` as a channel name. 214 201 215 $ php symfony plugin -upgrade <CHANNEL_NAME>/<PLUGIN_NAME>202 $ php symfony plugin:upgrade <CHANNEL_NAME>/<PLUGIN_NAME> 216 203 217 204 Upgrades a plugin. 218 205 219 $ php symfony plugin -upgrade-all206 $ php symfony plugin:upgrade-all 220 207 221 208 Upgrades all the plugins previously installed in local 222 209 223 $ php symfony plugin -uninstall <CHANNEL_NAME>/<PLUGIN_NAME>210 $ php symfony plugin:uninstall <CHANNEL_NAME>/<PLUGIN_NAME> 224 211 225 212 Uninstalls a plugin. … … 233 220 234 221 * [Bash completion](http://www.symfony-project.com/trac/wiki/BashCompletion) 235 * [Zsh completion](http://www.symfony-project.com/trac/wiki/ZshCompletion) 236 237 [1]: http://www.pake-project.org/ "Pake" 238 [2]: http://rake.rubyforge.org/ "Rake" 222 * [Zsh completion](http://www.symfony-project.com/trac/wiki/ZshCompletion)