diff -u b/core/lib/Drupal/Component/PhpLoader/MTimeProtectedLoader.php b/core/lib/Drupal/Component/PhpLoader/MTimeProtectedLoader.php --- b/core/lib/Drupal/Component/PhpLoader/MTimeProtectedLoader.php +++ b/core/lib/Drupal/Component/PhpLoader/MTimeProtectedLoader.php @@ -55,6 +55,7 @@ include_once $filename; return TRUE; } + return FALSE; } /** @@ -67,7 +68,7 @@ mkdir($this->prefix, 0700, TRUE); chmod($this->prefix, 0700); } - if (!$length = @file_put_contents($original_path, $data)) { + if (!@file_put_contents($original_path, $data)) { return FALSE; } chmod($original_path, 0400); @@ -109,7 +110,7 @@ chmod($dir, 0100); $loop++; } - return $length; + return TRUE; } /** @@ -118,7 +119,7 @@ public function delete($filename) { $dir = $this->prefix . '/' . str_replace('/', '#', $filename); $this->cleanDir($dir); - rmdir($dir); + return rmdir($dir); } /** diff -u b/core/lib/Drupal/Component/PhpLoader/NativeLoader.php b/core/lib/Drupal/Component/PhpLoader/NativeLoader.php --- b/core/lib/Drupal/Component/PhpLoader/NativeLoader.php +++ b/core/lib/Drupal/Component/PhpLoader/NativeLoader.php @@ -1,4 +1,5 @@ prefix . '/' . $filename; - return TRUE; + $path = $this->prefix . '/' . $filename; + if (file_exists($path)) { + include_once $path; + return TRUE; + } + return FALSE; } /** @@ -43,12 +48,12 @@ $path = $this->prefix . '/' . $filename; @mkdir(dirname($path), 0700, TRUE); - return file_put_contents($path, $data); + return (bool) file_put_contents($path, $data); } /** * Implements Drupal\Component\PhpLoader\PhpLoaderInterface::delete() */ public function delete($filename) { - unlink($filename); + return unlink($filename); } } diff -u b/core/lib/Drupal/Component/PhpLoader/PhpLoaderInterface.php b/core/lib/Drupal/Component/PhpLoader/PhpLoaderInterface.php --- b/core/lib/Drupal/Component/PhpLoader/PhpLoaderInterface.php +++ b/core/lib/Drupal/Component/PhpLoader/PhpLoaderInterface.php @@ -18,8 +18,8 @@ * @param string $filename * The filename. Can be a relative path. * - * @return - * TRUE if the include was successful. + * @return bool + * TRUE if the include succeeded, FALSE if it failed. */ public function includePhp($filename); @@ -31,9 +31,8 @@ * @param string $data * The PHP code to be written. * - * @return - * FALSE if the write failed, anything but FALSE on success. For example, - * core implementations return the number of bytes written. + * @return bool + * TRUE if the write succeeded, FALSE if it failed. */ public function write($filename, $data); @@ -44,6 +43,9 @@ * The filename to be deleted. Can be a relative path. * @param string $bin * An optional bin. Separate bins can use a different loader class. + * + * @return bool + * TRUE if the delete succeeded, FALSE if it failed. */ public function delete($filename); }