From 12d1ea9edbd0a12efc3d9ad89c410138ea52c1e2 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 11 Mar 2010 03:02:44 +0000 Subject: [PATCH] BUGFIX #5157 If paths are longer than 255 characters, fopen() produces an "Invalid argument" error, shorten the paths by using basename() instead of realpath() on the manifest filename when producing the cache path in ManifestBuilder git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100861 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/ManifestBuilder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/ManifestBuilder.php b/core/ManifestBuilder.php index ee0ce8fb4..110d8c395 100644 --- a/core/ManifestBuilder.php +++ b/core/ManifestBuilder.php @@ -418,7 +418,7 @@ class ManifestBuilder { // We use an MD5 of the file as a part of the cache key because using datetime caused problems when users // were upgrading their sites $fileMD5 = md5($file); - $parseCacheFile = TEMP_FOLDER . "/manifestClassParse-" . str_replace(array("/",":", "\\"),"_", realpath($filename)) . "-$fileMD5"; + $parseCacheFile = TEMP_FOLDER . "/manifestClassParse-" . str_replace(array("/", ":", "\\", "."), "_", basename($filename)) . "-$fileMD5"; if(!file_exists($parseCacheFile)) { $tokens = token_get_all($file); $classes = self::getClassDefParser()->findAll($tokens); @@ -427,7 +427,8 @@ class ManifestBuilder { $cacheContent = '