GUIA RÁPIDO PARA CRIAÇÃO DE PROJETOS SYMFONY 1.4 USANDO SUBVERSION - baixar versão mais recente do symfony - criar pasta para o projeto - criar pasta lib/vendor - descompactar symfony dentro da pasta lib/vendor - remover números de versão do nome da pasta do symfony, deixando somente "symfony" - no terminal, voltar à pasta raiz do projeto (todos os comandos daqui pra frente são inseridos na raiz) * php lib/vendor/symfony/data/bin/symfony generate:project PROJECT_NAME * ./symfony configure:database "mysql:host=localhost;dbname=database" user password * ./symfony generate:app frontend - setar virtualhost no apache (exemplo no fim do arquivo) - editar arquivo /etc/hosts adicionando a linha "127.0.0.1 servername" - criar repositório para o projeto no subversion * svn mkdir -m "directory structure" http://svn.example.com/jobeet/trunk http://svn.example.com/jobeet/tags http://svn.example.com/jobeet/branches * svn co http://svn.example.com/jobeet/trunk/ . * rm -rf cache/* log/* * chmod 777 cache/* log/* * svn add * * svn propedit svn:ignore cache - um editor de texto vai abrir, adicionar um * na primeira linha, salvar e sair * svn propedit svn:ignore log - um editor de texto vai abrir, adicionar um * na primeira linha, salvar e sair * svn import -m "initial import" . http://svn.example.com/jobeet/trunk - criar modelo de dados editando o arquivo config/doctrine/schema.yml * ./symfony doctrine:build --all --and-load --no-confirmation * ./symfony cc - done! worflow básico do subversion (mais detalhes em http://svnbook.red-bean.com/en/1.1/ch03s05.html) - update your working copy * svn update - make changes * svn add * svn delete * svn copy * svn move - examine your changes * svn status * svn diff * svn revert - merge others' changes into your working copy * svn update * svn resolved - commit your changes * svn commit exemplo de configuração do virtualhost: ServerName sfproject DocumentRoot "/home/sfproject/web" DirectoryIndex index.php AllowOverride All Allow from All Alias /sf /home/sfproject/lib/vendor/symfony/data/web/sf AllowOverride All Allow from All referência do symfony CLI (pode mudar dependendo da versão - essa é a lista da 1.4.0): Usage: symfony [options] task_name [arguments] Options: --help -H Display this help message. --quiet -q Do not log messages to standard output. --trace -t Turn on invoke/execute tracing, enable full backtrace. --version -V Display the program version. --color Forces ANSI color output. --xml To output help as XML Available tasks: :help Displays help for a task :list Lists tasks app :routes Displays current routes for an application cache :clear Clears the cache (cc) configure :author Configure project author :database Configure database DSN doctrine :build Generate code based on your schema :build-db Creates database for current model (doctrine:create-db) :build-filters Creates filter form classes for the current model :build-forms Creates form classes for the current model :build-model Creates classes for the current model :build-schema Creates a schema from an existing database :build-sql Creates SQL for the current model :clean-model-files Delete all generated model classes for models which no longer exist in your YAML schema (doctrine:clean) :create-model-tables Drop and recreate tables for specified models. :data-dump Dumps data to the fixtures directory :data-load Loads YAML fixture data :delete-model-files Delete all the related auto generated files for a given model name. :dql Execute a DQL query and view the results :drop-db Drops database for current model :generate-admin Generates a Doctrine admin module :generate-migration Generate migration class :generate-migrations-db Generate migration classes from existing database connections :generate-migrations-diff Generate migration classes by producing a diff between your old and new schema. :generate-migrations-models Generate migration classes from an existing set of models :generate-module Generates a Doctrine module :generate-module-for-route Generates a Doctrine module for a route definition :insert-sql Inserts SQL for current model :migrate Migrates database to current/specified version generate :app Generates a new application :module Generates a new module :project Generates a new project :task Creates a skeleton class for a new task i18n :extract Extracts i18n strings from php files :find Finds non "i18n ready" strings in an application log :clear Clears log files :rotate Rotates an application's log files plugin :add-channel Add a new PEAR channel :install Installs a plugin :list Lists installed plugins :publish-assets Publishes web assets for all plugins :uninstall Uninstalls a plugin :upgrade Upgrades a plugin project :clear-controllers Clears all non production environment controllers :deploy Deploys a project to another server :disable Disables an application in a given environment :enable Enables an application in a given environment :optimize Optimizes a project for better performance :permissions Fixes symfony directory permissions :send-emails Sends emails stored in a queue :validate Finds deprecated usage in a project symfony :test Launches the symfony test suite test :all Launches all tests :coverage Outputs test code coverage :functional Launches functional tests :unit Launches unit tests