Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# cd /home/ file_names = Dir.glob("*/public_html/admin/includes/application_top.php") file_names.each do |file_name| text = File.read(file_name) text = text.gsub(/\$PHP_SELF = \(isset\(\$HTTP_SERVER_VARS\['PHP_SELF'\]\) \? \$HTTP_SERVER_VARS\['PHP_SELF'\] \: \$HTTP_SERVER_VARS\['SCRIPT_NAME'\]\);/, "$PHP_SELF = $_SERVER['PHP_SELF'];") text = text.gsub(/^ \$current_page = basename\(\$PHP_SELF\);/, " $current_page = basename($_SERVER['SCRIPT_FILENAME']);") File.open(file_name, "w") { |file| file.puts text } end
This paste will be private.
From the Design Piracy series on my blog: