Permalink
Browse files

Fixes to allow slir to be run from a subdirectory

  • Loading branch information...
1 parent 0992a79 commit b36f2a343267f74c069b0108b3f14a3fb1a014c2 @kolber committed Mar 19, 2012
Showing with 5 additions and 4 deletions.
  1. +3 −3 app/parsers/slir/slir.class.php
  2. +2 −1 app/parsers/slir/slirconfig.class.php
@@ -1128,15 +1128,15 @@ private function cacheRequest($imageData, $copyEXIF = TRUE)
private function cacheFile($cacheFilePath, $imageData, $copyEXIF = TRUE, $symlinkToPath = NULL)
{
$this->initializeCache();
-
+
// Try to create just a symlink to minimize disk space
- if ($symlinkToPath && function_exists('symlink') && (file_exists($cacheFilePath) || symlink($symlinkToPath, $cacheFilePath)))
+ if ($symlinkToPath && function_exists('symlink') && (file_exists($cacheFilePath) || @symlink($symlinkToPath, $cacheFilePath)))
{
return TRUE;
}
// Create the file
- if (!file_put_contents($cacheFilePath, $imageData))
+ if (!@file_put_contents($cacheFilePath, $imageData))
{
return FALSE;
}
@@ -44,7 +44,8 @@ class SLIRConfig extends SLIRConfigDefaults
public static function init()
{
- self::$cacheDirName = '/../../_cache/images';
+ self::$cacheDir = '../../_cache/images';
+ self::$documentRoot = '../../..';
// This must be the last line of this function
parent::init();
}

0 comments on commit b36f2a3

Please sign in to comment.