git-hacks

git-hacks Commit Details

Date:2012-11-23 15:24:10 (5 years 7 months ago)
Author:Nicola Fontana
Branch:master
Commit:a1d2278066c580fdd715f43d1f7a09043cca5f9b
Parents: 98c3b8985c69ab175bcebc095c221ab2264ba065
Message:gitdeploy: disable cache entirely

When using in production, the cache for a site is yet present but it is
usually owned by another user (web infrastructure dependent detail).
Hence, the TEMP_FOLDER is not writable and refresh_silverstripe crashes.

To overcome this problem, just try to avoid the cache entirely by using
BlackHole as 'default' cache backend.
Changes:
Mgitdeploy (1 diff)

File differences

gitdeploy
6666
6767
6868
69
6970
7071
7172
7273
7374
75
7476
77
78
79
7580
7681
7782
7883
7984
80
81
85
86
8287
8388
8489
refresh_silverstripe() {
local path="$1"
local code
local cfg type server username password database
local php="
define('BASE_PATH', '$path');
define('FRAMEWORK_DIR', 'framework');
define('TEMP_FOLDER', '/tmp');
set_include_path(BASE_PATH . '/framework' . PATH_SEPARATOR . get_include_path());
// Disable cache entirely
require_once('cache/Cache.php');
SS_Cache::add_backend('default', 'black_hole');
require_once('core/Core.php');
foreach (\$databaseConfig as \$k => \$v)
echo \$k, '=', \$v, \"\n\";"
for cfg in "$path"/*/_config.php; do
eval $(php -r "$php")
[ -n "$database" ] && break
code=$(php -r "$php" 2>/dev/null)
[ "$?" = "0" ] && eval "$code" && [ -n "$database" ] && break
done
if [ -z "$server" -o -z "$username" -o -z "$password" -o -z "$database" ]; then

Archive Download the corresponding diff file

Branches