Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adds the ability to set your index.php and other application.php file…

…s to an environment
  • Loading branch information...
commit 90f74c7f121545f49a9290b5b748b60123edb519 1 parent a609995
@bshaffer bshaffer authored committed
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/capifony.rb
View
20 lib/capifony.rb
@@ -207,6 +207,26 @@ def load_database_config(data, env)
stream "#{php_bin} #{latest_release}/symfony project:send-emails --message-limit=#{message_limit} --time-limit=#{time_limit} --env=#{symfony_env}"
end
+
+ desc 'Task to set all front controllers to a specific environment'
+ task :set_environment do
+ if (env = fetch(:symfony_env, nil)) && env != 'prod'
+ cmd = []
+ apps = fetch(:symfony_apps, ['frontend'])
+
+ # First application listed becomes index.php
+ if app = apps.shift
+ cmd << "cp #{release_path}/web/#{app}_#{env}.php #{release_path}/web/index.php"
+ end
+
+ # All other apps are copied to their default controllers
+ for app in apps
+ cmd << "cp #{release_path}/web/#{app}_#{env}.php #{release_path}/web/#{app}.php"
+ end
+
+ run cmd.join(';') if cmd.join(';')
+ end
+ end
end
namespace :plugin do
Please sign in to comment.
Something went wrong with that request. Please try again.