%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/bbw/farmaci/kritik-portale/capistrano/config/deploy/recipes/
Upload File :
Create Path :
Current File : /var/www/html/bbw/farmaci/kritik-portale/capistrano/config/deploy/recipes/opcache_clear.rb

##
# Opcache recipe
# => convenience rules for dealing with opcode cache in PHP5.5+ applications using opcache (Zend Optimizer+)
##


_cset(:opcache_webroot) { "/public" }

namespace :opcache do
	desc <<-DESC
		Create a temporary PHP file to clear cache, call it (using curl) and removes it
		This task must be triggered AFTER the deployment to clear cache
	DESC
	task :clear_cache, :roles => :app do
		opcache_file = "#{latest_release}#{opcache_webroot}/opcache_clear.php"
		curl_options = "-s -k"
		if !http_auth_users.to_a.empty? then
			curl_options = curl_options + " --user " + http_auth_users[0][0] + ":" + http_auth_users[0][1]
		end

		put "<?php opcache_reset(); ?>", opcache_file, :mode => 0664
		run "curl #{curl_options} https://#{domain}/opcache_clear.php && rm -f #{opcache_file}"
	end
end

Zerion Mini Shell 1.0