Permalink
Browse files

remove inline condition

  • Loading branch information...
1 parent 5a73699 commit 1f40d81e69a4cecee1d986a41b3df9193f67f487 ulrich committed Mar 11, 2013
Showing with 21 additions and 3 deletions.
  1. +21 −3 lib/symfony2/doctrine.rb
View
@@ -5,23 +5,41 @@
task :clear_metadata, :roles => :app, :except => { :no_release => true } do
capifony_pretty_print "--> Clearing Doctrine metadata cache"
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-metadata --env=#{symfony_env_prod}#{doctrine_em_flag}"+ if doctrine_clear_use_flush_option then " --flush" else "" end +"'"
+ if doctrine_clear_use_flush_option
+ flush_option = " --flush"
+ else
+ flush_option = ""
+ end
+
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-metadata --env=#{symfony_env_prod}#{doctrine_em_flag}#{flush_option}'"
capifony_puts_ok
end
desc "Clears all query cache for a entity manager"
task :clear_query, :roles => :app, :except => { :no_release => true } do
capifony_pretty_print "--> Clearing Doctrine query cache"
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-query --env=#{symfony_env_prod}#{doctrine_em_flag}"+ if doctrine_clear_use_flush_option then " --flush" else "" end +"'"
+ if doctrine_clear_use_flush_option
+ flush_option = " --flush"
+ else
+ flush_option = ""
+ end
+
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-query --env=#{symfony_env_prod}#{doctrine_em_flag}#{flush_option}'"
capifony_puts_ok
end
desc "Clears result cache for a entity manager"
task :clear_result, :roles => :app, :except => { :no_release => true } do
capifony_pretty_print "--> Clearing Doctrine result cache"
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-result --env=#{symfony_env_prod}#{doctrine_em_flag}"+ if doctrine_clear_use_flush_option then " --flush" else "" end +"'"
+ if doctrine_clear_use_flush_option
+ flush_option = " --flush"
+ else
+ flush_option = ""
+ end
+
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:cache:clear-result --env=#{symfony_env_prod}#{doctrine_em_flag}#{flush_option}'"
capifony_puts_ok
end
end

0 comments on commit 1f40d81

Please sign in to comment.