Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactored destructive tasks agreements:

 - removed agreement from non-destructive `:migrate`
 - moved all agreement checks to ORM-specific namespaces (`:doctrine` & `:propel`)
  • Loading branch information...
commit 584b8f59337e9e4fc6031d95509225aafba04767 1 parent e8fdcd2
@everzet authored
Showing with 27 additions and 23 deletions.
  1. +27 −23 lib/capifony.rb
View
50 lib/capifony.rb
@@ -12,7 +12,7 @@
# PHP binary to execute
set :php_bin, "php"
-# Symfony local app environment
+# Symfony environment on local
set :symfony_env_local, "dev"
# Symfony environment
@@ -247,9 +247,7 @@ def load_database_config(data, env)
desc "Migrates database to current version"
task :migrate do
- if Capistrano::CLI.ui.agree("Do you really want to migrate your #{symfony_env}'s database ? (type yes or no)")
- find_and_execute_task("symfony:#{symfony_orm}:migrate")
- end
+ find_and_execute_task("symfony:#{symfony_orm}:migrate")
end
desc "Generate model lib form and filters classes based on your schema"
@@ -259,30 +257,22 @@ def load_database_config(data, env)
desc "Generate code & database based on your schema"
task :build_all do
- if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
- find_and_execute_task("symfony:#{symfony_orm}:build_all")
- end
+ find_and_execute_task("symfony:#{symfony_orm}:build_all")
end
desc "Generate code & database based on your schema & load fixtures"
task :build_all_and_load do
- if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database and load #{symfony_env}'s fixtures ? (type yes or no)")
- find_and_execute_task("symfony:#{symfony_orm}:build_all_and_load")
- end
+ find_and_execute_task("symfony:#{symfony_orm}:build_all_and_load")
end
desc "Generate sql & database based on your schema"
task :build_db do
- if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
- find_and_execute_task("symfony:#{symfony_orm}:build_db")
- end
+ find_and_execute_task("symfony:#{symfony_orm}:build_db")
end
desc "Generate sql & database based on your schema & load fixtures"
task :build_db_and_load do
- if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database and load #{symfony_env}'s fixtures ? (type yes or no)")
- find_and_execute_task("symfony:#{symfony_orm}:build_db_and_load")
- end
+ find_and_execute_task("symfony:#{symfony_orm}:build_db_and_load")
end
end
@@ -329,17 +319,23 @@ def load_database_config(data, env)
desc "Generate code & database based on your schema"
task :build_all do
- run "#{php_bin} #{latest_release}/symfony doctrine:build --all --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony doctrine:build --all --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate code & database based on your schema & load fixtures"
task :build_all_and_load do
- run "#{php_bin} #{latest_release}/symfony doctrine:build --all --and-load --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database and load #{symfony_env}'s fixtures ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony doctrine:build --all --and-load --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate sql & database based on your schema"
task :build_db do
- run "#{php_bin} #{latest_release}/symfony doctrine:build --sql --db --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony doctrine:build --sql --db --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate sql & database based on your schema & load fixtures"
@@ -373,22 +369,30 @@ def load_database_config(data, env)
desc "Generate code & database based on your schema"
task :build_all do
- run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate code & database based on your schema & load fixtures"
task :build_all_and_load do
- run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --and-load --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database and load #{symfony_env}'s fixtures ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --and-load --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate sql & database based on your schema"
task :build_db do
- run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --no-confirmation --env=#{symfony_env}"
+ end
end
desc "Generate sql & database based on your schema & load fixtures"
task :build_db_and_load do
- run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --and-load --no-confirmation --env=#{symfony_env}"
+ if Capistrano::CLI.ui.agree("Do you really want to rebuild #{symfony_env}'s database and load #{symfony_env}'s fixtures ? (type yes or no)")
+ run "#{php_bin} #{latest_release}/symfony propel:build --sql --db --and-load --no-confirmation --env=#{symfony_env}"
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.