Repository is archived
No commit activity in last 3 years
No release in over 3 years
Provides various utility tasks for PHP based sites that use capistrano for deployment. Currently provides a method to clear the APC to avoid encountering memory allocation errors.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0

Runtime

 Project Readme

Capistrano::PHPTools

This gem provides various utility tasks for PHP based sites that use capistrano for deployment. Currently it provides a method to clear the APC (Alternative PHP Cache) to avoid encountering memory allocation errors.

Installation & Setup

Add the following to your Gemfile:

group :development do
  gem 'capistrano', '~> 3.1'
  gem 'capistrano-php-tools', '~> 1.0'
end

Then run:

bundle install

In order to make use of the tools you have to set a uri variable in your capistrano settings. This variable should be the full uri to your deployed site. An example setup would be to set this variable in each stage file. So in your config/deploy/production.rb file:

set :uri, 'http://example.com'

Usage

Add this line to your Capfile

require 'capistrano/php_tools'

An example which clears the APC after deployment:

namespace :deploy do
  after :finishing, "php_tools:apc_clear"
end

Credits

Initial implementation of the gem functionality developed by Chad Fennell.

Gem assembled by Bryce Kalow.