Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

White space cleanup. Hat tip to @evansolomon.

  • Loading branch information...
commit 2dedf203c72368c76bbba278905c6d696cb40746 1 parent c2f1825
@markjaquith authored
View
2  WordPress-Dropins/wp-stack-manual-db-upgrades.php
@@ -26,7 +26,7 @@ public function option_db_version( $version ) {
if ( strpos( $_SERVER['REQUEST_URI'], '/wp-admin/upgrade.php' ) === false )
return $GLOBALS['wp_db_version'];
else
- return $version;
+ return $version;
}
}
View
28 config/SAMPLE.config.rb
@@ -17,20 +17,20 @@
# Database
# Set the values for host, user, pass, and name for both production and staging.
set :wpdb do
- {
- :production => {
- :host => 'PRODUCTION DB HOST',
- :user => 'PRODUCTION DB USER',
- :password => 'PRODUCTION DB PASS',
- :name => 'PRODUCTION DB NAME',
- },
- :staging => {
- :host => 'STAGING DB HOST',
- :user => 'STAGING DB USER',
- :password => 'STAGING DB PASS',
- :name => 'STAGING DB NAME',
- }
- }
+ {
+ :production => {
+ :host => 'PRODUCTION DB HOST',
+ :user => 'PRODUCTION DB USER',
+ :password => 'PRODUCTION DB PASS',
+ :name => 'PRODUCTION DB NAME',
+ },
+ :staging => {
+ :host => 'STAGING DB HOST',
+ :user => 'STAGING DB USER',
+ :password => 'STAGING DB PASS',
+ :name => 'STAGING DB NAME',
+ }
+ }
end
# You're not done! You must also configure production.rb and staging.rb
View
14 lib/misc.rb
@@ -1,9 +1,9 @@
def loadFile file
- begin
- raise "Could not find #{file}" unless FileTest.readable? file
- load file
- rescue Exception => e
- puts '[Error] ' + e.message
- exit 1
- end
+ begin
+ raise "Could not find #{file}" unless FileTest.readable? file
+ load file
+ rescue Exception => e
+ puts '[Error] ' + e.message
+ exit 1
+ end
end
View
56 lib/tasks.rb
@@ -16,10 +16,10 @@
end
namespace :phpfpm do
- desc" Restarts PHP-FPM"
- task :restart do
- run "sudo /etc/init.d/php-fpm restart"
- end
+ desc" Restarts PHP-FPM"
+ task :restart do
+ run "sudo /etc/init.d/php-fpm restart"
+ end
end
namespace :git do
@@ -36,35 +36,35 @@
end
desc "Updates the pool of memcached servers"
task :update do
- unless find_servers( :roles => :memcached ).empty? then
- mc_servers = '<?php return array( "' + find_servers( :roles => :memcached ).join( ':11211", "' ) + ':11211" ); ?>'
- run "echo '#{mc_servers}' > #{current_path}/memcached.php", :roles => :memcached
- end
+ unless find_servers( :roles => :memcached ).empty? then
+ mc_servers = '<?php return array( "' + find_servers( :roles => :memcached ).join( ':11211", "' ) + ':11211" ); ?>'
+ run "echo '#{mc_servers}' > #{current_path}/memcached.php", :roles => :memcached
+ end
end
end
namespace :db do
desc "Syncs the staging database (and uploads) from production"
- task :sync, :roles => :web do
- if stage != :staging then
- puts "[ERROR] You must run db:sync from staging with cap staging db:sync"
- else
- puts "Hang on... this might take a while."
- random = rand( 10 ** 5 ).to_s.rjust( 5, '0' )
- p = wpdb[ :production ]
- s = wpdb[ :staging ]
- puts "db:sync"
- puts stage
- system "mysqldump -u #{p[:user]} --result-file=/tmp/wpstack-#{random}.sql -h #{p[:host]} -p#{p[:password]} #{p[:name]}"
- system "mysql -u #{s[:user]} -h #{s[:host]} -p#{s[:password]} #{s[:name]} < /tmp/wpstack-#{random}.sql && rm /tmp/wpstack-#{random}.sql"
- puts "Database synced to staging"
- # memcached.restart
- puts "Memcached flushed"
- # Now to copy files
- find_servers( :roles => :web ).each do |server|
- system "rsync -avz --delete #{production_deploy_to}/shared/files/ #{server}:#{shared_path}/files/"
- end
- end
+ task :sync, :roles => :web do
+ if stage != :staging then
+ puts "[ERROR] You must run db:sync from staging with cap staging db:sync"
+ else
+ puts "Hang on... this might take a while."
+ random = rand( 10 ** 5 ).to_s.rjust( 5, '0' )
+ p = wpdb[ :production ]
+ s = wpdb[ :staging ]
+ puts "db:sync"
+ puts stage
+ system "mysqldump -u #{p[:user]} --result-file=/tmp/wpstack-#{random}.sql -h #{p[:host]} -p#{p[:password]} #{p[:name]}"
+ system "mysql -u #{s[:user]} -h #{s[:host]} -p#{s[:password]} #{s[:name]} < /tmp/wpstack-#{random}.sql && rm /tmp/wpstack-#{random}.sql"
+ puts "Database synced to staging"
+ # memcached.restart
+ puts "Memcached flushed"
+ # Now to copy files
+ find_servers( :roles => :web ).each do |server|
+ system "rsync -avz --delete #{production_deploy_to}/shared/files/ #{server}:#{shared_path}/files/"
+ end
+ end
end
desc "Sets the database credentials (and other settings) in wp-config.php"
task :make_config do
Please sign in to comment.
Something went wrong with that request. Please try again.