Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made the Symfony2 console command configurable (symfony_console)

  • Loading branch information...
commit 2bef5ea79a7326353997531f14c997a9f81817da 1 parent 85d22dd
@ruudk ruudk authored
Showing with 27 additions and 24 deletions.
  1. +3 −0  lib/capifony.rb
  2. +24 −24 lib/symfony2.rb
View
3  lib/capifony.rb
@@ -4,6 +4,9 @@
# Symfony environment
set :symfony_env_prod, "prod"
+# Symfony2 console file
+set :symfony_console, "console"
+
# PHP binary to execute
set :php_bin, "php"
View
48 lib/symfony2.rb
@@ -69,7 +69,7 @@
desc "Migrate Symfony2 Doctrine ORM database."
task :migrate do
currentVersion = nil
- run "#{php-bin} #{app-path}/console doctrine:migrations:status" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/#{symfony_console} doctrine:migrations:status" do |ch, stream, out|
if stream == :out and out =~ /Current Version:[^$]+\(([0-9]+)\)/
currentVersion = Regexp.last_match(1)
end
@@ -84,14 +84,14 @@
puts "Current database version #{currentVersion}"
on_rollback {
- run "#{php-bin} #{app-path}/console doctrine:migrations:migrate #{currentVersion}" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/#{symfony_console} doctrine:migrations:migrate #{currentVersion}" do |ch, stream, out|
if out =~ /Are you sure you wish to continue/
ch.send_data("y\r\n")
end
end
}
- run "#{php-bin} #{app-path}/console doctrine:migrations:migrate" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/#{symfony_console} doctrine:migrations:migrate" do |ch, stream, out|
if out =~ /Are you sure you wish to continue/
ch.send_data("y\r\n")
end
@@ -104,32 +104,32 @@
task :default do
prompt_with_default(:task_arguments, "cache:clear")
- stream "cd #{latest_release} && #{php_bin} #{app_path}/console #{task_arguments}"
+ stream "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} #{task_arguments}"
end
namespace :assets do
desc "Install bundle's assets"
task :install do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console assets:install #{web_path}"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} assets:install #{web_path}"
end
end
namespace :assetic do
desc "Dumps all assets to the filesystem"
task :dump do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console assetic:dump #{web_path} --env=#{symfony_env_prod}"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} assetic:dump #{web_path} --env=#{symfony_env_prod}"
end
end
namespace :cache do
desc "Clears project cache."
task :clear do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:clear"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} cache:clear"
end
desc "Warms up an empty cache."
task :warmup do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:warmup"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} cache:warmup"
end
end
@@ -137,65 +137,65 @@
namespace :cache do
desc "Clear all metadata cache for a entity manager."
task :clear_metadata do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-metadata"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:cache:clear-metadata"
end
desc "Clear all query cache for a entity manager."
task :clear_query do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-query"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:cache:clear-query"
end
desc "Clear result cache for a entity manager."
task :clear_result do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-result"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:cache:clear-result"
end
end
namespace :database do
desc "Create the configured databases."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:database:create"
end
desc "Drop the configured databases."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:database:drop"
end
end
namespace :generate do
desc "Generates proxy classes for entity classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:proxies"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:generate:proxies"
end
desc "Generate repository classes from your mapping information."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:repositories"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:generate:repositories"
end
end
namespace :schema do
desc "Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:schema:create"
end
desc "Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:schema:drop"
end
end
namespace :migrations do
desc "Execute a migration to a specified version or the latest available version."
task :migrate do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:migrate"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:migrations:migrate"
end
desc "View the status of a set of migrations."
task :status do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:status"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:migrations:status"
end
end
@@ -203,29 +203,29 @@
namespace :generate do
desc "Generates hydrator classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:hydrators"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:mongodb:generate:hydrators"
end
desc "Generates proxy classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:proxies"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:mongodb:generate:proxies"
end
desc "Generates repository classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:repositories"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:mongodb:generate:repositories"
end
end
namespace :schema do
desc "Allows you to create databases, collections and indexes for your documents."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:mongodb:schema:create"
end
desc "Allows you to drop databases, collections and indexes for your documents."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/#{symfony_console} doctrine:mongodb:schema:drop"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.