From 1b9566070bc9c68ac6b92da1b8c1aefed3500d85 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 20 Apr 2012 00:07:15 +0400 Subject: [PATCH 1/3] File::delete() now returns result of unlink(). Signed-off-by: Pavel --- laravel/file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/file.php b/laravel/file.php index 0346c83c..0a0069f1 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -61,11 +61,11 @@ class File { * Delete a file. * * @param string $path - * @return void + * @return bool */ public static function delete($path) { - if (static::exists($path)) @unlink($path); + if (static::exists($path)) return @unlink($path); } /** From 33c6027476398a8623d8382fdab838fbb0425ac2 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Thu, 26 Apr 2012 21:24:06 +0200 Subject: [PATCH 2/3] Adding has_file method Signed-off-by: Koen Schmeets --- laravel/input.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/laravel/input.php b/laravel/input.php index a44bd85b..802b4008 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -178,6 +178,18 @@ class Input { return array_get($_FILES, $key, $default); } + /** + * Determine if the uploaded data contains a file. + * + * @param string $key + * @return bool + */ + public static function has_file($key) + { + $file = static::file($key); + return ! empty($file['tmp_name']); + } + /** * Move an uploaded file to permanent storage. * From 9c109849c3abb00f351f09ce4669d981d0de9639 Mon Sep 17 00:00:00 2001 From: "asdfgh746@gmail.com" Date: Wed, 2 May 2012 16:51:52 -0400 Subject: [PATCH 3/3] Fix typos. Signed-off-by: asdfgh746@gmail.com Change "develoepr" into "developer". Change "started, yet but" into "started yet, but". --- laravel/bundle.php | 2 +- laravel/core.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/bundle.php b/laravel/bundle.php index 7e93af4e..2259228e 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -64,7 +64,7 @@ class Bundle { static::$bundles[$bundle] = array_merge($defaults, $config); - // It is possible for the develoepr to specify auto-loader mappings + // It is possible for the developer to specify auto-loader mappings // directly on the bundle registration. This provides a convenient // way to register mappings withuot a bootstrap. if (isset($config['autoloads'])) diff --git a/laravel/core.php b/laravel/core.php index abcd809f..0dcaaca5 100644 --- a/laravel/core.php +++ b/laravel/core.php @@ -210,7 +210,7 @@ if (defined('STDIN')) |-------------------------------------------------------------------------- | | Finally we will register all of the bundles that have been defined for -| the application. None of them will be started, yet but will be setup +| the application. None of them will be started yet, but will be setup | so that they may be started by the developer at any time. | */