From 7d4a346f84536f0a7cbb70a38660fbc439a74070 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 2 Apr 2012 11:30:53 -0500 Subject: [PATCH 01/83] Adding Schema::rename('oldtable','newtable') support Signed-off-by: Colin Viebrock --- laravel/database/schema/grammars/mysql.php | 12 ++++++++++++ laravel/database/schema/grammars/postgres.php | 14 +++++++++++++- laravel/database/schema/grammars/sqlite.php | 12 ++++++++++++ laravel/database/schema/grammars/sqlserver.php | 14 +++++++++++++- laravel/database/schema/table.php | 11 +++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index c2ae7455..bcc8e94a 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -212,6 +212,18 @@ protected function key(Table $table, Fluent $command, $type) return 'ALTER TABLE '.$this->wrap($table)." ADD {$type} {$name}({$keys})"; } + /** + * Generate the SQL statement for a rename table command. + * + * @param Table $table + * @param Fluent $command + * @return string + */ + public function rename(Table $table, Fluent $command) + { + return 'RENAME TABLE '.$this->wrap($table).' TO '.$this->wrap($command->name); + } + /** * Generate the SQL statement for a drop table command. * diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 760af1a8..3c1b62e2 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -198,6 +198,18 @@ protected function key(Table $table, Fluent $command, $unique = false) return $create." INDEX {$command->name} ON ".$this->wrap($table)." ({$columns})"; } + /** + * Generate the SQL statement for a rename table command. + * + * @param Table $table + * @param Fluent $command + * @return string + */ + public function rename(Table $table, Fluent $command) + { + return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name); + } + /** * Generate the SQL statement for a drop table command. * @@ -302,7 +314,7 @@ protected function drop_key(Table $table, Fluent $command) */ public function drop_foreign(Table $table, Fluent $command) { - return $this->drop_constraint($table, $command); + return $this->drop_constraint($table, $command); } /** diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 09102f52..00c69604 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -201,6 +201,18 @@ protected function key(Table $table, Fluent $command, $unique = false) return $create." INDEX {$command->name} ON ".$this->wrap($table)." ({$columns})"; } + /** + * Generate the SQL statement for a rename table command. + * + * @param Table $table + * @param Fluent $command + * @return string + */ + public function rename(Table $table, Fluent $command) + { + return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name); + } + /** * Generate the SQL statement for a drop table command. * diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index 0fb80f6a..513ed0f4 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -212,6 +212,18 @@ protected function key(Table $table, Fluent $command, $unique = false) return $create." INDEX {$command->name} ON ".$this->wrap($table)." ({$columns})"; } + /** + * Generate the SQL statement for a rename table command. + * + * @param Table $table + * @param Fluent $command + * @return string + */ + public function rename(Table $table, Fluent $command) + { + return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name); + } + /** * Generate the SQL statement for a drop table command. * @@ -320,7 +332,7 @@ protected function drop_key(Table $table, Fluent $command) */ public function drop_foreign(Table $table, Fluent $command) { - return $this->drop_constraint($table, $command); + return $this->drop_constraint($table, $command); } /** diff --git a/laravel/database/schema/table.php b/laravel/database/schema/table.php index 9518d6e7..f9561f07 100644 --- a/laravel/database/schema/table.php +++ b/laravel/database/schema/table.php @@ -142,6 +142,17 @@ public function key($type, $columns, $name) return $this->command($type, compact('name', 'columns')); } + /** + * Rename the database table. + * + * @param string $name + * @return Fluent + */ + public function rename($name) + { + return $this->command(__FUNCTION__, compact('name')); + } + /** * Drop the database table. * From 7293c0448d6df8c5ff74e006d1a4352531957369 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 2 Apr 2012 11:38:12 -0500 Subject: [PATCH 02/83] One more change (comments may need to be altered) Signed-off-by: Colin Viebrock --- laravel/database/schema.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/laravel/database/schema.php b/laravel/database/schema.php index 3787e33b..6290fa4e 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -40,6 +40,25 @@ public static function create($table, $callback) return static::execute($table); } + /** + * Rename a database table in the schema. + * + * @param string $table + * @param string $name + * @return void + */ + public static function rename($table, $rename) + { + $table = new Schema\Table($table); + + // To indicate that the table needs to be renamed, we will run the + // "rename" command on the table instance and pass the instance to + // the execute method as calling a Closure isn't needed. + $table->rename($name); + + return static::execute($table); + } + /** * Drop a database table from the schema. * From ef5ab30ca29f6a9349d921e1b3b6d6a7dd5d2edf Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Sat, 26 May 2012 20:51:35 -0500 Subject: [PATCH 03/83] Fix ... thanks Vespakoen! --- laravel/database/schema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/database/schema.php b/laravel/database/schema.php index 6290fa4e..a81d5bc3 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -47,14 +47,14 @@ public static function create($table, $callback) * @param string $name * @return void */ - public static function rename($table, $rename) + public static function rename($table, $new_name) { $table = new Schema\Table($table); // To indicate that the table needs to be renamed, we will run the // "rename" command on the table instance and pass the instance to // the execute method as calling a Closure isn't needed. - $table->rename($name); + $table->rename($new_name); return static::execute($table); } From 161ea09861ef42355a28c96c247b14b025d046f2 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 4 Jun 2012 20:34:04 +0300 Subject: [PATCH 04/83] Documentation: Add link to Controller Routing section to Routing submenu. --- laravel/documentation/contents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 1d5ce11e..07dc02c3 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -18,6 +18,7 @@ ### General - [Named Routes](/docs/routing#named-routes) - [HTTPS Routes](/docs/routing#https-routes) - [Bundle Routing](/docs/routing#bundle-routing) + - [Controller Routing](/docs/routing#controller-routing) - [CLI Route Testing](/docs/routing#cli-route-testing) - [Controllers](/docs/controllers) - [The Basics](/docs/controllers#the-basics) From 3ccc37bd8fd481d9eee38caa665b851d96736136 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 4 Jun 2012 20:36:33 +0300 Subject: [PATCH 05/83] Documentation: Fix typo on routing page's TOC. --- laravel/documentation/routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/routing.md b/laravel/documentation/routing.md index 18c90671..7d2aa6fd 100644 --- a/laravel/documentation/routing.md +++ b/laravel/documentation/routing.md @@ -4,7 +4,7 @@ ## Contents - [The Basics](#the-basics) - [Wildcards](#wildcards) -- [The 404 Events](#the-404-event) +- [The 404 Event](#the-404-event) - [Filters](#filters) - [Pattern Filters](#pattern-filters) - [Global Filters](#global-filters) From 3d7dc61697ddfe4b64c0309a76a690514f08544a Mon Sep 17 00:00:00 2001 From: Aaron Kuzemchak Date: Mon, 4 Jun 2012 14:48:22 -0400 Subject: [PATCH 06/83] Fixing multiline Blade comments, making closing comment tag required --- laravel/blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/blade.php b/laravel/blade.php index c362d57b..1a895ab8 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -185,9 +185,9 @@ protected static function extract($value, $expression) */ protected static function compile_comments($value) { - $value = preg_replace('/\{\{--(.+?)(--\}\})?\n/', "", $value); - - return preg_replace('/\{\{--((.|\s)*?)--\}\}/', "\n", $value); + $value = preg_replace('/\{\{--(.*?)--\}\}/', "", $value); + + return preg_replace('/\{\{--(.*?)--\}\}/s', "$1", $value); } /** From 75033f6287445d2bc10d779074511812363d96cc Mon Sep 17 00:00:00 2001 From: Aaron Kuzemchak Date: Mon, 4 Jun 2012 14:51:42 -0400 Subject: [PATCH 07/83] Updating docs for Blade comments --- laravel/documentation/views/templating.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/laravel/documentation/views/templating.md b/laravel/documentation/views/templating.md index 8849f0e1..c0d7b2fa 100644 --- a/laravel/documentation/views/templating.md +++ b/laravel/documentation/views/templating.md @@ -129,6 +129,12 @@ #### Blade comments: {{-- This is a comment --}} ... @endif + + {{-- + This is + a multi-line + comment. + --}} > **Note:** Blade comments, unlike HTML comments, are not visible in the HTML source. From ea3021f3dd6c22beab5aa460f0319cd7ab8d910d Mon Sep 17 00:00:00 2001 From: Loic Sharma Date: Tue, 5 Jun 2012 22:46:35 -0500 Subject: [PATCH 08/83] Fixed bug where the profiler did not correctly put quotes around bindings --- laravel/profiling/profiler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index 9b6edfef..ec14004f 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -54,6 +54,8 @@ public static function query($sql, $bindings, $time) { foreach ($bindings as $binding) { + $binding = "'{$binding}'"; + $sql = preg_replace('/\?/', $binding, $sql, 1); } From f2e915f13d930f765bc918208bbefdef7155f695 Mon Sep 17 00:00:00 2001 From: Loic Sharma Date: Tue, 5 Jun 2012 22:57:56 -0500 Subject: [PATCH 09/83] Improved the way the quotes were added to the bindings. --- laravel/profiling/profiler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index ec14004f..73f4d4fd 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -5,6 +5,7 @@ use Laravel\Event; use Laravel\Config; use Laravel\Request; +use Laravel\Database; class Profiler { @@ -54,7 +55,7 @@ public static function query($sql, $bindings, $time) { foreach ($bindings as $binding) { - $binding = "'{$binding}'"; + $binding = Database::connection()->pdo->quote($binding); $sql = preg_replace('/\?/', $binding, $sql, 1); } From fafaf724b0113bee94b9825a7779a672cd4adf82 Mon Sep 17 00:00:00 2001 From: Chris Berthe Date: Wed, 13 Jun 2012 11:19:20 -0400 Subject: [PATCH 10/83] Grammar/Vocabulary fixes Signed-off-by: Chris Berthe --- application/config/application.php | 8 ++++---- application/config/cache.php | 2 +- application/config/database.php | 4 ++-- application/config/error.php | 4 ++-- application/config/session.php | 2 +- application/config/strings.php | 2 +- bundles/docs/routes.php | 4 ++-- laravel/auth/drivers/driver.php | 4 ++-- laravel/auth/drivers/fluent.php | 2 +- laravel/autoloader.php | 6 +++--- laravel/blade.php | 2 +- laravel/bundle.php | 14 +++++++------- laravel/cli/artisan.php | 2 +- laravel/cli/command.php | 2 +- laravel/cli/tasks/bundle/providers/provider.php | 2 +- laravel/cli/tasks/migrate/migrator.php | 6 +++--- laravel/config.php | 4 ++-- laravel/cookie.php | 2 +- laravel/core.php | 6 +++--- laravel/database/connection.php | 6 +++--- laravel/database/eloquent/model.php | 4 ++-- laravel/database/eloquent/query.php | 8 ++++---- .../relationships/has_many_and_belongs_to.php | 4 ++-- laravel/database/grammar.php | 4 ++-- laravel/database/query.php | 16 ++++++++-------- laravel/database/query/grammars/grammar.php | 14 +++++++------- laravel/database/query/grammars/postgres.php | 2 +- laravel/database/query/grammars/sqlserver.php | 2 +- laravel/database/schema.php | 2 +- laravel/database/schema/grammars/mysql.php | 10 +++++----- laravel/database/schema/grammars/postgres.php | 4 ++-- laravel/database/schema/grammars/sqlite.php | 12 ++++++------ laravel/database/schema/grammars/sqlserver.php | 8 ++++---- laravel/error.php | 2 +- laravel/event.php | 2 +- laravel/file.php | 8 ++++---- laravel/helpers.php | 2 +- laravel/ioc.php | 4 ++-- laravel/lang.php | 2 +- laravel/laravel.php | 6 +++--- laravel/log.php | 2 +- laravel/paginator.php | 2 +- laravel/pluralizer.php | 6 +++--- laravel/response.php | 2 +- laravel/routing/filter.php | 2 +- laravel/routing/route.php | 8 ++++---- laravel/routing/router.php | 10 +++++----- laravel/session.php | 2 +- laravel/session/drivers/driver.php | 2 +- laravel/uri.php | 2 +- laravel/url.php | 6 +++--- laravel/validator.php | 10 +++++----- laravel/view.php | 4 ++-- paths.php | 2 +- 54 files changed, 130 insertions(+), 130 deletions(-) diff --git a/application/config/application.php b/application/config/application.php index 9f597954..1bf0137f 100755 --- a/application/config/application.php +++ b/application/config/application.php @@ -8,7 +8,7 @@ |-------------------------------------------------------------------------- | | The URL used to access your application without a trailing slash. The URL - | does not have to be set. If it isn't we'll try our best to guess the URL + | does not have to be set. If it isn't, we'll try our best to guess the URL | of your application. | */ @@ -48,7 +48,7 @@ | | This key is used by the encryption and cookie classes to generate secure | encrypted strings and hashes. It is extremely important that this key - | remain secret and should not be shared with anyone. Make it about 32 + | remains secret and it should not be shared with anyone. Make it about 32 | characters of random gibberish. | */ @@ -63,7 +63,7 @@ | Laravel includes a beautiful profiler toolbar that gives you a heads | up display of the queries and logs performed by your application. | This is wonderful for development, but, of course, you should - | disable the toolbar for production applications.. + | disable the toolbar for production applications. | */ @@ -99,7 +99,7 @@ | SSL Link Generation |-------------------------------------------------------------------------- | - | Many sites use SSL to protect their users data. However, you may not be + | Many sites use SSL to protect their users' data. However, you may not be | able to use SSL on your development machine, meaning all HTTPS will be | broken during development. | diff --git a/application/config/cache.php b/application/config/cache.php index a507ff66..5dc267e6 100644 --- a/application/config/cache.php +++ b/application/config/cache.php @@ -29,7 +29,7 @@ | This key will be prepended to item keys stored using Memcached and APC | to prevent collisions with other applications on the server. Since the | memory based stores could be shared by other applications, we need to - | be polite and use a prefix to uniquely identifier our items. + | be polite and use a prefix to uniquely identify our items. | */ diff --git a/application/config/database.php b/application/config/database.php index d5e6ac1b..94b36f11 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -35,7 +35,7 @@ | Default Database Connection |-------------------------------------------------------------------------- | - | The name of your default database connection. This connection will used + | The name of your default database connection. This connection will be used | as the default for all database operations unless a different name is | given when performing said operation. This connection name should be | listed in the array of connections below. @@ -54,7 +54,7 @@ | the freedom to specify as many connections as you can handle. | | All database work in Laravel is done through the PHP's PDO facilities, - | so make sure you have the PDO drivers for your particlar database of + | so make sure you have the PDO drivers for your particular database of | choice installed on your machine. | */ diff --git a/application/config/error.php b/application/config/error.php index 1713afce..c4d27fe4 100644 --- a/application/config/error.php +++ b/application/config/error.php @@ -9,7 +9,7 @@ | | Here you simply specify the error levels that should be ignored by the | Laravel error handler. These levels will still be logged; however, no - | information about about them will be displayed. + | information about them will be displayed. | */ @@ -56,7 +56,7 @@ | logging is enabled. | | You may log the error message however you like; however, a simple log - | solution has been setup for you which will log all error messages to + | solution has been set up for you which will log all error messages to | text files within the application storage directory. | */ diff --git a/application/config/session.php b/application/config/session.php index ea686f89..dbfe8b27 100644 --- a/application/config/session.php +++ b/application/config/session.php @@ -23,7 +23,7 @@ | Session Database |-------------------------------------------------------------------------- | - | The database table on which the session should be stored. It probably + | The database table in which the session should be stored. It probably | goes without saying that this option only matters if you are using | the super slick database session driver. | diff --git a/application/config/strings.php b/application/config/strings.php index 5d94f81c..3d8b68f6 100644 --- a/application/config/strings.php +++ b/application/config/strings.php @@ -8,7 +8,7 @@ |-------------------------------------------------------------------------- | | This array contains the singular and plural forms of words. It's used by - | the "singular" and "plural" methods on the Str class to convert a given + | the "singular" and "plural" methods in the Str class to convert a given | word from singular to plural and vice versa. | | Note that the regular expressions are only for inflecting English words. diff --git a/bundles/docs/routes.php b/bundles/docs/routes.php index 334c652d..2a8561ff 100644 --- a/bundles/docs/routes.php +++ b/bundles/docs/routes.php @@ -38,7 +38,7 @@ function document_exists($page) } /** - * Attach the sidebar to the documentatoin template. + * Attach the sidebar to the documentation template. */ View::composer('docs::template', function($view) { @@ -68,7 +68,7 @@ function document_exists($page) // If no page was specified, but a "home" page exists for the section, // we'll set the file to the home page so that the proper page is - // display back out to the client for the requested doc page. + // displayed back out to the client for the requested doc page. if (is_null($page) and document_exists($file.'/home')) { $file .= '/home'; diff --git a/laravel/auth/drivers/driver.php b/laravel/auth/drivers/driver.php index 4a272ba4..db649d24 100644 --- a/laravel/auth/drivers/driver.php +++ b/laravel/auth/drivers/driver.php @@ -80,7 +80,7 @@ public function user() } /** - * Get the a given application user by ID. + * Get the given application user by ID. * * @param int $id * @return mixed @@ -192,7 +192,7 @@ protected function cookie($name, $value, $minutes) } /** - * Get session key name used to store the token. + * Get the session key name used to store the token. * * @return string */ diff --git a/laravel/auth/drivers/fluent.php b/laravel/auth/drivers/fluent.php index 4c23468b..0bac2b01 100644 --- a/laravel/auth/drivers/fluent.php +++ b/laravel/auth/drivers/fluent.php @@ -11,7 +11,7 @@ class Fluent extends Driver { * * If the user is a guest, null should be returned. * - * @param int $id + * @param int $id * @return mixed|null */ public function retrieve($id) diff --git a/laravel/autoloader.php b/laravel/autoloader.php index 296b9dbd..4168e305 100644 --- a/laravel/autoloader.php +++ b/laravel/autoloader.php @@ -40,7 +40,7 @@ class Autoloader { /** * Load the file corresponding to a given class. * - * This method is registerd in the bootstrap file as an SPL auto-loader. + * This method is registered in the bootstrap file as an SPL auto-loader. * * @param string $class * @return void @@ -55,7 +55,7 @@ public static function load($class) return class_alias(static::$aliases[$class], $class); } - // All classes in Laravel are staticly mapped. There is no crazy search + // All classes in Laravel are statically mapped. There is no crazy search // routine that digs through directories. It's just a simple array of // class to file path maps for ultra-fast file loading. elseif (isset(static::$mappings[$class])) @@ -102,7 +102,7 @@ protected static function load_namespaced($class, $namespace, $directory) protected static function load_psr($class, $directory = null) { // The PSR-0 standard indicates that class namespaces and underscores - // shoould be used to indcate the directory tree in which the class + // should be used to indicate the directory tree in which the class // resides, so we'll convert them to slashes. $file = str_replace(array('\\', '_'), '/', $class); diff --git a/laravel/blade.php b/laravel/blade.php index c362d57b..12381482 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -150,7 +150,7 @@ protected static function compile_layouts($value) } // First we'll split out the lines of the template so we can get the - // layout from the top of the template. By convention it must be + // layout from the top of the template. By convention, it must be // located on the first line of the template contents. $lines = preg_split("/(\r?\n)/", $value); diff --git a/laravel/bundle.php b/laravel/bundle.php index 2259228e..ea057475 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -46,7 +46,7 @@ public static function register($bundle, $config = array()) // If the given configuration is actually a string, we will assume it is a // location and set the bundle name to match it. This is common for most - // bundles who simply live in the root bundle directory. + // bundles that simply live in the root bundle directory. if (is_string($config)) { $bundle = $config; @@ -55,7 +55,7 @@ public static function register($bundle, $config = array()) } // If no location is set, we will set the location to match the name of - // the bundle. This is for bundles who are installed to the root of + // the bundle. This is for bundles that are installed on the root of // the bundle directory so a location was not set. if ( ! isset($config['location'])) { @@ -66,7 +66,7 @@ public static function register($bundle, $config = array()) // 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. + // way to register mappings without a bootstrap. if (isset($config['autoloads'])) { static::autoloads($bundle, $config); @@ -74,7 +74,7 @@ public static function register($bundle, $config = array()) } /** - * Load a bundle by running it's start-up script. + * Load a bundle by running its start-up script. * * If the bundle has already been started, no action will be taken. * @@ -124,7 +124,7 @@ public static function routes($bundle) $path = static::path($bundle).'routes'.EXT; - // By setting the bundle property on the router the router knows what + // By setting the bundle property on the router, the router knows what // value to replace the (:bundle) place-holder with when the bundle // routes are added, keeping the routes flexible. Router::$bundle = static::option($bundle, 'handles'); @@ -201,7 +201,7 @@ public static function handles($uri) } /** - * Deteremine if a bundle exists within the bundles directory. + * Determine if a bundle exists within the bundles directory. * * @param string $bundle * @return bool @@ -372,7 +372,7 @@ public static function resolve($bundle) } /** - * Parse a element identifier and return the bundle name and element. + * Parse an element identifier and return the bundle name and element. * * * // Returns array(null, 'admin.user') diff --git a/laravel/cli/artisan.php b/laravel/cli/artisan.php index 46886dc8..e7bd130e 100644 --- a/laravel/cli/artisan.php +++ b/laravel/cli/artisan.php @@ -34,7 +34,7 @@ * We will wrap the command execution in a try / catch block and * simply write out any exception messages we receive to the CLI * for the developer. Note that this only writes out messages - * for the CLI exceptions. All others will be not be caught + * for the CLI exceptions. All others will not be caught * and will be totally dumped out to the CLI. */ try diff --git a/laravel/cli/command.php b/laravel/cli/command.php index 7b4ae3af..de11406e 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -121,7 +121,7 @@ public static function resolve($bundle, $task) } // If the task file exists, we'll format the bundle and task name - // into a task class name and resolve an instance of the so that + // into a task class name and resolve an instance of the class so that // the requested method may be executed. if (file_exists($path = Bundle::path($bundle).'tasks/'.$task.EXT)) { diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index bf6401f7..3a5e880c 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -27,7 +27,7 @@ protected function zipball($url, $bundle, $path) // When installing a bundle from a Zip archive, we'll first clone // down the bundle zip into the bundles "working" directory so - // we have a spot to do all of our bundle extration work. + // we have a spot to do all of our bundle extraction work. $target = $work.'laravel-bundle.zip'; File::put($target, $this->download($url)); diff --git a/laravel/cli/tasks/migrate/migrator.php b/laravel/cli/tasks/migrate/migrator.php index 5bf7617b..4ab2ef05 100644 --- a/laravel/cli/tasks/migrate/migrator.php +++ b/laravel/cli/tasks/migrate/migrator.php @@ -151,7 +151,7 @@ public function install() $table->create(); // Migrations can be run for a specific bundle, so we'll use - // the bundle name and string migration name as an unique ID + // the bundle name and string migration name as a unique ID // for the migrations, allowing us to easily identify which // migrations have been run for each bundle. $table->string('bundle', 50); @@ -206,7 +206,7 @@ public function make($arguments = array()) // Once the migration has been created, we'll return the // migration file name so it can be used by the task - // consumer if necessary for futher work. + // consumer if necessary for further work. return $file; } @@ -223,7 +223,7 @@ protected function stub($bundle, $migration) $prefix = Bundle::class_prefix($bundle); - // The class name is formatted simialrly to tasks and controllers, + // The class name is formatted similarly to tasks and controllers, // where the bundle name is prefixed to the class if it is not in // the default "application" bundle. $class = $prefix.Str::classify($migration); diff --git a/laravel/config.php b/laravel/config.php index 50bd7dc8..ac46693b 100644 --- a/laravel/config.php +++ b/laravel/config.php @@ -73,7 +73,7 @@ public static function get($key, $default = null) $items = static::$items[$bundle][$file]; // If a specific configuration item was not requested, the key will be null, - // meaning we'll to return the entire array of configuration item from the + // meaning we'll return the entire array of configuration items from the // requested configuration file. Otherwise we can return the item. if (is_null($item)) { @@ -175,7 +175,7 @@ public static function load($bundle, $file) // requested. This allows many types of config "drivers". $config = Event::first(static::loader, func_get_args()); - // If configuration items were actually found for the bundle and file we + // If configuration items were actually found for the bundle and file, we // will add them to the configuration array and return true, otherwise // we will return false indicating the file was not found. if (count($config) > 0) diff --git a/laravel/cookie.php b/laravel/cookie.php index 1f79a69b..8bb508a1 100644 --- a/laravel/cookie.php +++ b/laravel/cookie.php @@ -3,7 +3,7 @@ class Cookie { /** - * How long is forever (in minutes). + * How long is forever (in minutes)? * * @var int */ diff --git a/laravel/core.php b/laravel/core.php index a38bf9dd..b19d924d 100644 --- a/laravel/core.php +++ b/laravel/core.php @@ -147,7 +147,7 @@ | Determine The Application Environment |-------------------------------------------------------------------------- | -| Next we're ready to determine the application environment. This may be +| Next, we're ready to determine the application environment. This may be | set either via the command line options or via the mapping of URIs to | environments that lives in the "paths.php" file for the application | and is parsed. When determining the CLI environment, the "--env" @@ -178,7 +178,7 @@ | | Once we have determined the application environment, we will set it on | the global server array of the HttpFoundation request. This makes it -| available throughout the application, thought it is mainly only +| available throughout the application, though it is mainly only | used to determine which configuration files to merge in. | */ @@ -216,7 +216,7 @@ |-------------------------------------------------------------------------- | | 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 set up | so that they may be started by the developer at any time. | */ diff --git a/laravel/database/connection.php b/laravel/database/connection.php index 66601ef8..b3774fd4 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -209,7 +209,7 @@ public function query($sql, $bindings = array()) /** * Execute a SQL query against the connection. * - * The PDO statement and boolean result will be return in an array. + * The PDO statement and boolean result will be returned in an array. * * @param string $sql * @param array $bindings @@ -265,7 +265,7 @@ protected function execute($sql, $bindings = array()) throw $exception; } - // Once we have execute the query, we log the SQL, bindings, and + // Once we have executed the query, we log the SQL, bindings, and // execution time in a static array that is accessed by all of // the connections actively being used by the application. if (Config::get('database.profile')) @@ -287,7 +287,7 @@ protected function fetch($statement, $style) { // If the fetch style is "class", we'll hydrate an array of PHP // stdClass objects as generic containers for the query rows, - // otherwise we'll just use the fetch styel value. + // otherwise we'll just use the fetch style value. if ($style === PDO::FETCH_CLASS) { return $statement->fetchAll(PDO::FETCH_CLASS, 'stdClass'); diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 2c28b8f9..64802cdc 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -736,7 +736,7 @@ public function __call($method, $parameters) { $meta = array('key', 'table', 'connection', 'sequence', 'per_page', 'timestamps'); - // If the method is actually the name of a static property on the model we'll + // If the method is actually the name of a static property on the model, we'll // return the value of the static property. This makes it convenient for // relationships to access these values off of the instances. if (in_array($method, $meta)) @@ -746,7 +746,7 @@ public function __call($method, $parameters) $underscored = array('with', 'find'); - // Some methods need to be accessed both staticly and non-staticly so we'll + // Some methods need to be accessed both statically and non-statically so we'll // keep underscored methods of those methods and intercept calls to them // here so they can be called either way on the model instance. if (in_array($method, $underscored)) diff --git a/laravel/database/eloquent/query.php b/laravel/database/eloquent/query.php index 3aee79c9..f3a54174 100644 --- a/laravel/database/eloquent/query.php +++ b/laravel/database/eloquent/query.php @@ -118,7 +118,7 @@ public function hydrate($model, $results) $new = new $class(array(), true); // We need to set the attributes manually in case the accessible property is - // set on the array which will prevent the mass assignemnt of attributes if + // set on the array which will prevent the mass assignment of attributes if // we were to pass them in using the constructor or fill methods. $new->fill_raw($result); @@ -141,7 +141,7 @@ public function hydrate($model, $results) } } - // The many to many relationships may have pivot table column on them + // The many to many relationships may have pivot table columns on them // so we will call the "clean" method on the relationship to remove // any pivot columns that are on the model. if ($this instanceof Relationships\Has_Many_And_Belongs_To) @@ -199,7 +199,7 @@ protected function nested_includes($relationship) foreach ($this->model_includes() as $include => $constraints) { // To get the nested includes, we want to find any includes that begin - // the relationship and a dot, then we will strip off the leading + // the relationship with a dot, then we will strip off the leading // nesting indicator and set the include in the array. if (starts_with($include, $relationship.'.')) { @@ -222,7 +222,7 @@ protected function model_includes() foreach ($this->model->includes as $relationship => $constraints) { // When eager loading relationships, constraints may be set on the eager - // load definition; however, is none are set, we need to swap the key + // load definition; however, if none are set, we need to swap the key // and the value of the array since there are no constraints. if (is_numeric($relationship)) { diff --git a/laravel/database/eloquent/relationships/has_many_and_belongs_to.php b/laravel/database/eloquent/relationships/has_many_and_belongs_to.php index 587e504c..5b247c9c 100644 --- a/laravel/database/eloquent/relationships/has_many_and_belongs_to.php +++ b/laravel/database/eloquent/relationships/has_many_and_belongs_to.php @@ -44,7 +44,7 @@ public function __construct($model, $associated, $table, $foreign, $other) $this->joining = $table ?: $this->joining($model, $associated); // If the Pivot table is timestamped, we'll set the timestamp columns to be - // fetched when the pivot table models are fetched by the developer else + // fetched when the pivot table models are fetched by the developer, or else // the ID will be the only "extra" column fetched in by default. if (Pivot::$timestamps) { @@ -131,7 +131,7 @@ public function sync($ids) } // Next we will take the difference of the current and given IDs and detach - // all of the entities that exists in the current array but are not in + // all of the entities that exist in the current array but are not in // the array of IDs given to the method, finishing the sync. $detach = array_diff($current, $ids); diff --git a/laravel/database/grammar.php b/laravel/database/grammar.php index 13d92d8e..0ff5bd14 100644 --- a/laravel/database/grammar.php +++ b/laravel/database/grammar.php @@ -35,7 +35,7 @@ public function __construct(Connection $connection) */ public function wrap_table($table) { - // Expressions should be injected into the query as raw strings so + // Expressions should be injected into the query as raw strings // so we do not want to wrap them in any way. We will just return // the string value from the expression to be included. if ($table instanceof Expression) @@ -64,7 +64,7 @@ public function wrap_table($table) */ public function wrap($value) { - // Expressions should be injected into the query as raw strings so + // Expressions should be injected into the query as raw strings // so we do not want to wrap them in any way. We will just return // the string value from the expression to be included. if ($value instanceof Expression) diff --git a/laravel/database/query.php b/laravel/database/query.php index 83c92b83..1fafb1cb 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -158,7 +158,7 @@ public function join($table, $column1, $operator = null, $column2 = null, $type { // If the "column" is really an instance of a Closure, the developer is // trying to create a join with a complex "ON" clause. So, we will add - // the join, and then call the Closure with the join/ + // the join, and then call the Closure with the join. if ($column1 instanceof Closure) { $this->joins[] = new Query\Join($type, $table); @@ -167,8 +167,8 @@ public function join($table, $column1, $operator = null, $column2 = null, $type } // If the column is just a string, we can assume that the join just - // has a simple on clause, and we'll create the join instance and - // add the clause automatically for the develoepr. + // has a simple "ON" clause, and we'll create the join instance and + // add the clause automatically for the developer. else { $join = new Query\Join($type, $table); @@ -453,7 +453,7 @@ private function dynamic_where($method, $parameters) foreach ($segments as $segment) { - // If the segment is not a boolean connector, we can assume it it is + // If the segment is not a boolean connector, we can assume it is // a column name, and we'll add it to the query as a new constraint // of the query's where clause and keep iterating the segments. if ($segment != '_and_' and $segment != '_or_') @@ -676,7 +676,7 @@ public function get($columns = array('*')) public function aggregate($aggregator, $columns) { // We'll set the aggregate value so the grammar does not try to compile - // a SELECT clause on the query. If an aggregator is present, it's own + // a SELECT clause on the query. If an aggregator is present, its own // grammar function will be used to build the SQL syntax. $this->aggregate = compact('aggregator', 'columns'); @@ -730,12 +730,12 @@ public function insert($values) { // Force every insert to be treated like a batch insert to make creating // the binding array simpler since we can just spin through the inserted - // rows as if there/ was more than one every time. + // rows as if there was more than one every time. if ( ! is_array(reset($values))) $values = array($values); $bindings = array(); - // We need to merge the the insert values into the array of the query + // We need to merge the insert values into the array of the query // bindings so that they will be bound to the PDO statement when it // is executed by the database connection. foreach ($values as $value) @@ -836,7 +836,7 @@ public function update($values) /** * Execute the query as a DELETE statement. * - * Optionally, an ID may be passed to the method do delete a specific row. + * Optionally, an ID may be passed to the method to delete a specific row. * * @param int $id * @return int diff --git a/laravel/database/query/grammars/grammar.php b/laravel/database/query/grammars/grammar.php index 65c62cf3..5f3c88e7 100644 --- a/laravel/database/query/grammars/grammar.php +++ b/laravel/database/query/grammars/grammar.php @@ -13,7 +13,7 @@ class Grammar extends \Laravel\Database\Grammar { public $datetime = 'Y-m-d H:i:s'; /** - * All of the query componenets in the order they should be built. + * All of the query components in the order they should be built. * * @var array */ @@ -125,7 +125,7 @@ protected function from(Query $query) protected function joins(Query $query) { // We need to iterate through each JOIN clause that is attached to the - // query an translate it into SQL. The table and the columns will be + // query and translate it into SQL. The table and the columns will be // wrapped in identifiers to avoid naming collisions. foreach ($query->joins as $join) { @@ -135,7 +135,7 @@ protected function joins(Query $query) // Each JOIN statement may have multiple clauses, so we will iterate // through each clause creating the conditions then we'll join all - // of the together at the end to build the clause. + // of them together at the end to build the clause. foreach ($join->clauses as $clause) { extract($clause); @@ -149,7 +149,7 @@ protected function joins(Query $query) // The first clause will have a connector on the front, but it is // not needed on the first condition, so we will strip it off of - // the condition before adding it to the arrya of joins. + // the condition before adding it to the array of joins. $search = array('AND ', 'OR '); $clauses[0] = str_replace($search, '', $clauses[0]); @@ -376,7 +376,7 @@ public function insert(Query $query, $values) } /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values @@ -389,7 +389,7 @@ public function insert_get_id(Query $query, $values, $column) } /** - * Compile a SQL UPDATE statment from a Query instance. + * Compile a SQL UPDATE statement from a Query instance. * * @param Query $query * @param array $values @@ -416,7 +416,7 @@ public function update(Query $query, $values) } /** - * Compile a SQL DELETE statment from a Query instance. + * Compile a SQL DELETE statement from a Query instance. * * @param Query $query * @return string diff --git a/laravel/database/query/grammars/postgres.php b/laravel/database/query/grammars/postgres.php index 002b4cc7..6041ae82 100644 --- a/laravel/database/query/grammars/postgres.php +++ b/laravel/database/query/grammars/postgres.php @@ -5,7 +5,7 @@ class Postgres extends Grammar { /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values diff --git a/laravel/database/query/grammars/sqlserver.php b/laravel/database/query/grammars/sqlserver.php index def519a5..f912f562 100644 --- a/laravel/database/query/grammars/sqlserver.php +++ b/laravel/database/query/grammars/sqlserver.php @@ -95,7 +95,7 @@ protected function ansi_offset(Query $query, $components) // Next we need to calculate the constraint that should be placed on // the row number to get the correct offset and limit on the query. - // If there is not limit, we'll just handle the offset. + // If there is not a limit, we'll just handle the offset. if ($query->limit > 0) { $finish = $query->offset + $query->limit; diff --git a/laravel/database/schema.php b/laravel/database/schema.php index c7e56309..c943e15c 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -71,7 +71,7 @@ public static function execute($table) { // The implications method is responsible for finding any fluently // defined indexes on the schema table and adding the explicit - // commands that are needed to tbe schema instance. + // commands that are needed for the schema instance. static::implications($table); foreach ($table->commands as $command) diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index c2ae7455..fa725136 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -37,7 +37,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -47,7 +47,7 @@ public function add(Table $table, Fluent $command) { $columns = $this->columns($table); - // Once we the array of column definitions, we need to add "add" to the + // Once we have the array of column definitions, we need to add "add" to the // front of each definition, then we'll concatenate the definitions // using commas like normal and generate the SQL. $columns = implode(', ', array_map(function($column) @@ -260,7 +260,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -284,7 +284,7 @@ public function drop_fulltext(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -353,7 +353,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 930c5160..9853523f 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -35,7 +35,7 @@ public function add(Table $table, Fluent $command) { $columns = $this->columns($table); - // Once we the array of column definitions, we need to add "add" to the + // Once we have the array of column definitions, we need to add "add" to the // front of each definition, then we'll concatenate the definitions // using commas like normal and generate the SQL. $columns = implode(', ', array_map(function($column) @@ -246,7 +246,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 09102f52..31e23624 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -29,7 +29,7 @@ public function create(Table $table, Fluent $command) return $value->type == 'primary'; }); - // If we found primary key in the array of commands, we'll create the SQL for + // If we found primary keys in the array of commands, we'll create the SQL for // the key addition and append it to the SQL table creation statement for // the schema table so the index is properly generated. if ( ! is_null($primary)) @@ -43,7 +43,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -53,7 +53,7 @@ public function add(Table $table, Fluent $command) { $columns = $this->columns($table); - // Once we the array of column definitions, we need to add "add" to the + // Once we have the array of column definitions, we need to add "add" to the // front of each definition, then we'll concatenate the definitions // using commas like normal and generate the SQL. $columns = array_map(function($column) @@ -87,7 +87,7 @@ protected function columns(Table $table) { // Each of the data type's have their own definition creation method // which is responsible for creating the SQL for the type. This lets - // us to keep the syntax easy and fluent, while translating the + // us keep the syntax easy and fluent, while translating the // types to the types used by the database. $sql = $this->wrap($column).' '.$this->type($column); @@ -214,7 +214,7 @@ public function drop(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -226,7 +226,7 @@ public function drop_unique(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index 5f756c2e..0e556abd 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -32,7 +32,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -42,7 +42,7 @@ public function add(Table $table, Fluent $command) { $columns = $this->columns($table); - // Once we the array of column definitions, we need to add "add" to the + // Once we have the array of column definitions, we need to add "add" to the // front of each definition, then we'll concatenate the definitions // using commas like normal and generate the SQL. $columns = implode(', ', array_map(function($column) @@ -235,7 +235,7 @@ public function drop_column(Table $table, Fluent $command) { $columns = array_map(array($this, 'wrap'), $command->columns); - // Once we the array of column names, we need to add "drop" to the front + // Once we have the array of column names, we need to add "drop" to the front // of each column, then we'll concatenate the columns using commas and // generate the alter statement SQL. $columns = implode(', ', array_map(function($column) @@ -260,7 +260,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqiue key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command diff --git a/laravel/error.php b/laravel/error.php index 729f632a..606ad64a 100644 --- a/laravel/error.php +++ b/laravel/error.php @@ -80,7 +80,7 @@ public static function native($code, $error, $file, $line) */ public static function shutdown() { - // If a fatal error occured that we have not handled yet, we will + // If a fatal error occurred that we have not handled yet, we will // create an ErrorException and feed it to the exception handler, // as it will not yet have been handled. $error = error_get_last(); diff --git a/laravel/event.php b/laravel/event.php index 1f88d99f..ea2eb715 100644 --- a/laravel/event.php +++ b/laravel/event.php @@ -125,7 +125,7 @@ public static function first($event, $parameters = array()) } /** - * Fire an event and return the the first response. + * Fire an event and return the first response. * * Execution will be halted after the first valid response is found. * diff --git a/laravel/file.php b/laravel/file.php index efb46dec..d2022268 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -161,7 +161,7 @@ public static function mime($extension, $default = 'application/octet-stream') } /** - * Determine if a file is a given type. + * Determine if a file is of a given type. * * The Fileinfo PHP extension is used to determine the file's MIME type. * @@ -184,7 +184,7 @@ public static function is($extensions, $path) $mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); // The MIME configuration file contains an array of file extensions and - // their associated MIME types. We will spin through each extension the + // their associated MIME types. We will loop through each extension the // developer wants to check and look for the MIME type. foreach ((array) $extensions as $extension) { @@ -296,7 +296,7 @@ public static function rmdir($directory, $preserve = false) { // If the item is a directory, we can just recurse into the // function and delete that sub-directory, otherwise we'll - // just deleete the file and keep going! + // just delete the file and keep going! if ($item->isDir()) { static::rmdir($item->getRealPath()); @@ -335,7 +335,7 @@ public static function latest($directory, $options = fIterator::SKIP_DOTS) $items = new fIterator($directory, $options); - // To get the latest created file, we'll simply spin through the + // To get the latest created file, we'll simply loop through the // directory, setting the latest file if we encounter a file // with a UNIX timestamp greater than the latest one. foreach ($items as $item) diff --git a/laravel/helpers.php b/laravel/helpers.php index 07f9940a..3357c4df 100644 --- a/laravel/helpers.php +++ b/laravel/helpers.php @@ -462,7 +462,7 @@ function root_namespace($class, $separator = '\\') /** * Get the "class basename" of a class or object. * - * The basename is considered the name of the class minus all namespaces. + * The basename is considered to be the name of the class minus all namespaces. * * @param object|string $class * @return string diff --git a/laravel/ioc.php b/laravel/ioc.php index 512cf863..475932c5 100644 --- a/laravel/ioc.php +++ b/laravel/ioc.php @@ -152,7 +152,7 @@ protected static function build($type, $parameters = array()) $reflector = new \ReflectionClass($type); // If the type is not instantiable, the developer is attempting to resolve - // an abstract type such as an Interface of Abstract Class and there is + // an abstract type such as an Interface of an Abstract Class and there is // no binding registered for the abstraction so we need to bail out. if ( ! $reflector->isInstantiable()) { @@ -189,7 +189,7 @@ protected static function dependencies($parameters) $dependency = $parameter->getClass(); // If the class is null, it means the dependency is a string or some other - // primitive type, which we can not esolve since it is not a class and + // primitive type, which we can not resolve since it is not a class and // we'll just bomb out with an error since we have nowhere to go. if (is_null($dependency)) { diff --git a/laravel/lang.php b/laravel/lang.php index 8fd5f7ba..fd3bf177 100644 --- a/laravel/lang.php +++ b/laravel/lang.php @@ -134,7 +134,7 @@ public function get($language = null, $default = null) $line = array_get($lines, $line, $default); // If the line is not a string, it probably means the developer asked for - // the entire langauge file and the value of the requested value will be + // the entire language file and the value of the requested value will be // an array containing all of the lines in the file. if (is_string($line)) { diff --git a/laravel/laravel.php b/laravel/laravel.php index a1ca2061..2772e323 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -54,7 +54,7 @@ |-------------------------------------------------------------------------- | | By setting error reporting to -1, we essentially force PHP to report -| every error, and this is guranteed to show every error on future +| every error, and this is guaranteed to show every error on future | releases of PHP. This allows everything to be fixed early! | */ @@ -143,7 +143,7 @@ |-------------------------------------------------------------------------- | | If a session driver has been configured, we will save the session to -| storage so it is avaiable for the next request. This will also set +| storage so it is available for the next request. This will also set | the session cookie in the cookie jar to be sent to the user. | */ @@ -172,7 +172,7 @@ | And We're Done! |-------------------------------------------------------------------------- | -| Raise the "done" event so extra output can be attached to the response +| Raise the "done" event so extra output can be attached to the response. | This allows the adding of debug toolbars, etc. to the view, or may be | used to do some kind of logging by the application. | diff --git a/laravel/log.php b/laravel/log.php index 4cd3a30e..7c565131 100644 --- a/laravel/log.php +++ b/laravel/log.php @@ -51,7 +51,7 @@ public static function write($type, $message) // If there aren't listeners on the log event, we'll just write to the // log files using the default conventions, writing one log file per - // day so they files don't get too crowded. + // day so the files don't get too crowded. else { $message = static::format($type, $message); diff --git a/laravel/paginator.php b/laravel/paginator.php index ceffbe85..3deb5f61 100644 --- a/laravel/paginator.php +++ b/laravel/paginator.php @@ -47,7 +47,7 @@ class Paginator { /** * The compiled appendage that will be appended to the links. * - * This consists of a sprintf format with a page place-holder and query string. + * This consists of a sprintf format with a page place-holder and query string. * * @var string */ diff --git a/laravel/pluralizer.php b/laravel/pluralizer.php index 857a7ff5..ef5b7cb6 100644 --- a/laravel/pluralizer.php +++ b/laravel/pluralizer.php @@ -48,7 +48,7 @@ public function singular($value) } // English words may be automatically inflected using regular expressions. - // If the word is english, we'll just pass off the word to the automatic + // If the word is English, we'll just pass off the word to the automatic // inflection method and return the result, which is cached. $irregular = $this->config['irregular']; @@ -77,7 +77,7 @@ public function plural($value, $count = 2) } // English words may be automatically inflected using regular expressions. - // If the word is english, we'll just pass off the word to the automatic + // If the word is English, we'll just pass off the word to the automatic // inflection method and return the result, which is cached. $irregular = array_flip($this->config['irregular']); @@ -104,7 +104,7 @@ protected function auto($value, $source, $irregular) return $value; } - // Next we will check the "irregular" patterns, which contains words + // Next, we will check the "irregular" patterns, which contain words // like "children" and "teeth" which can not be inflected using the // typically used regular expression matching approach. foreach ($irregular as $irregular => $pattern) diff --git a/laravel/response.php b/laravel/response.php index b6fa4d84..11458fb8 100644 --- a/laravel/response.php +++ b/laravel/response.php @@ -239,7 +239,7 @@ public function send() public function render() { // If the content is a stringable object, we'll go ahead and call - // to toString method so that we can get the string content of + // the toString method so that we can get the string content of // the content object. Otherwise we'll just cast to string. if (str_object($this->content)) { diff --git a/laravel/routing/filter.php b/laravel/routing/filter.php index 14b6e2e3..80beec93 100644 --- a/laravel/routing/filter.php +++ b/laravel/routing/filter.php @@ -14,7 +14,7 @@ class Filter { public static $filters = array(); /** - * The route filters that are based on pattern. + * The route filters that are based on a pattern. * * @var array */ diff --git a/laravel/routing/route.php b/laravel/routing/route.php index 73b79521..c1c38a8e 100644 --- a/laravel/routing/route.php +++ b/laravel/routing/route.php @@ -10,7 +10,7 @@ class Route { /** - * The URI the route response to. + * The URI the route responds to. * * @var string */ @@ -52,7 +52,7 @@ class Route { public $action; /** - * The parameters that will passed to the route callback. + * The parameters that will be passed to the route callback. * * @var array */ @@ -79,7 +79,7 @@ public function __construct($method, $uri, $action, $parameters = array()) // We'll set the parameters based on the number of parameters passed // compared to the parameters that were needed. If more parameters - // are needed, we'll merge in defaults. + // are needed, we'll merge in the defaults. $this->parameters($action, $parameters); } @@ -96,7 +96,7 @@ protected function parameters($action, $parameters) // If there are less parameters than wildcards, we will figure out how // many parameters we need to inject from the array of defaults and - // merge them in into the main array for the route. + // merge them into the main array for the route. if (count($defaults) > count($parameters)) { $defaults = array_slice($defaults, count($parameters)); diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 7c4888a2..dd3e0568 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -55,7 +55,7 @@ class Router { public static $group; /** - * The "handes" clause for the bundle currently being routed. + * The "handles" clause for the bundle currently being routed. * * @var string */ @@ -303,7 +303,7 @@ public static function controller($controllers, $defaults = 'index', $https = nu { list($bundle, $controller) = Bundle::parse($identifier); - // First we need to replace the dots with slashes in thte controller name + // First we need to replace the dots with slashes in the controller name // so that it is in directory format. The dots allow the developer to use // a cleaner syntax when specifying the controller. We will also grab the // root URI for the controller's bundle. @@ -311,7 +311,7 @@ public static function controller($controllers, $defaults = 'index', $https = nu $root = Bundle::option($bundle, 'handles'); - // If the controller is a "home" controller, we'll need to also build a + // If the controller is a "home" controller, we'll need to also build an // index method route for the controller. We'll remove "home" from the // route root and setup a route to point to the index method. if (ends_with($controller, 'home')) @@ -428,7 +428,7 @@ public static function uses($action) // To find the route, we'll simply spin through the routes looking // for a route with a "uses" key matching the action, and if we - // find one we cache and return it. + // find one, we cache and return it. foreach (static::routes() as $method => $routes) { foreach ($routes as $key => $value) @@ -484,7 +484,7 @@ protected static function match($method, $uri) { foreach (static::method($method) as $route => $action) { - // We only need to check routes with regular expression since all other + // We only need to check routes with regular expression since all others // would have been able to be matched by the search for literal matches // we just did before we started searching. if (str_contains($route, '(')) diff --git a/laravel/session.php b/laravel/session.php index b5b833fa..00b4a356 100644 --- a/laravel/session.php +++ b/laravel/session.php @@ -24,7 +24,7 @@ class Session { const csrf_token = 'csrf_token'; /** - * Create the session payload and the load the session. + * Create the session payload and load the session. * * @return void */ diff --git a/laravel/session/drivers/driver.php b/laravel/session/drivers/driver.php index 8a54ac98..e5cef1ee 100644 --- a/laravel/session/drivers/driver.php +++ b/laravel/session/drivers/driver.php @@ -63,7 +63,7 @@ public function id() return Str::random(40); } - // We'll containue generating random IDs until we find an ID that is + // We'll continue generating random IDs until we find an ID that is // not currently assigned to a session. This is almost definitely // going to happen on the first iteration. do { diff --git a/laravel/uri.php b/laravel/uri.php index 2477fe62..3e89ea4b 100644 --- a/laravel/uri.php +++ b/laravel/uri.php @@ -68,7 +68,7 @@ public static function is($pattern) } /** - * Get a specific segment of the request URI via an one-based index. + * Get a specific segment of the request URI via a one-based index. * * * // Get the first segment of the request URI diff --git a/laravel/url.php b/laravel/url.php index 44b89428..424d0f30 100644 --- a/laravel/url.php +++ b/laravel/url.php @@ -101,7 +101,7 @@ public static function to($url = '', $https = null) return $url; } - // Unless $https is specified (true or false) then maintain the current request + // Unless $https is specified (true or false), we maintain the current request // security for any new links generated. So https for all secure links. if (is_null($https)) $https = Request::secure(); @@ -169,7 +169,7 @@ public static function to_action($action, $parameters = array()) } /** - * Generate a action URL from a route definition + * Generate an action URL from a route definition * * @param array $route * @param string $action @@ -196,7 +196,7 @@ protected static function convention($action, $parameters) $bundle = Bundle::get($bundle); - // If a bundle exists for the action, we will attempt to use it's "handles" + // If a bundle exists for the action, we will attempt to use its "handles" // clause as the root of the generated URL, as the bundle can only handle // URIs that begin with that string and no others. $root = $bundle['handles'] ?: ''; diff --git a/laravel/validator.php b/laravel/validator.php index 3290bc17..2196fdec 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -401,8 +401,8 @@ protected function validate_max($attribute, $value, $parameters) protected function size($attribute, $value) { // This method will determine if the attribute is a number, string, or file and - // return the proper size accordingly. If it is a number, then number itself is - // the size; if it is a file, the size is kilobytes in the size; if it is a + // return the proper size accordingly. If it is a number, the number itself is + // the size; if it is a file, the kilobytes is the size; if it is a // string, the length is the size. if (is_numeric($value) and $this->has_rule($attribute, $this->numeric_rules)) { @@ -743,7 +743,7 @@ protected function size_message($bundle, $attribute, $rule) } // We assume that attributes present in the $_FILES array are files, // which makes sense. If the attribute doesn't have numeric rules - // and isn't as file, it's a string. + // and isn't a file, it's a string. elseif (array_key_exists($attribute, Input::file())) { $line = 'file'; @@ -862,7 +862,7 @@ protected function replace_not_in($message, $attribute, $rule, $parameters) } /** - * Replace all place-holders for the not_in rule. + * Replace all place-holders for the mimes rule. * * @param string $message * @param string $attribute @@ -953,7 +953,7 @@ protected function attribute($attribute) // If no language line has been specified for the attribute, all of // the underscores are removed from the attribute name and that - // will be used as the attribtue name. + // will be used as the attribute name. else { return str_replace('_', ' ', $attribute); diff --git a/laravel/view.php b/laravel/view.php index f97b3dee..2e38000d 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -163,7 +163,7 @@ public static function file($bundle, $view, $directory) { $directory = str_finish($directory, DS); - // Views may have either the default PHP file extension of the "Blade" + // Views may have either the default PHP file extension or the "Blade" // extension, so we will need to check for both in the view path // and return the first one we find for the given view. if (file_exists($path = $directory.$view.EXT)) @@ -291,7 +291,7 @@ public static function render_each($view, array $data, $iterator, $empty = 'raw| } // If there is no data in the array, we will render the contents of - // the "empty" view. Alternative, the "empty view" can be a raw + // the "empty" view. Alternatively, the "empty view" can be a raw // string that is prefixed with "raw|" for convenience. else { diff --git a/paths.php b/paths.php index 2a38aff0..e3742042 100644 --- a/paths.php +++ b/paths.php @@ -14,7 +14,7 @@ |---------------------------------------------------------------- | | Laravel takes a dead simple approach to environments, and we -| think you'll love it. Just specify which URLs belongs to a +| think you'll love it. Just specify which URLs belong to a | given environment, and when you access your application | from a URL matching that pattern, we'll be sure to | merge in that environment's configuration files. From ddee5b7199cbb291916595078bcb3c44c6efba44 Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Sat, 16 Jun 2012 20:02:03 -0700 Subject: [PATCH 11/83] Blade cleanup sanitized most functions and regular expressions. made the bigger functions a bit more solid, flexible in what they ignore and simplified various processes. --- laravel/blade.php | 83 ++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/laravel/blade.php b/laravel/blade.php index c362d57b..31273fe1 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -149,19 +149,19 @@ protected static function compile_layouts($value) return $value; } - // First we'll split out the lines of the template so we can get the - // layout from the top of the template. By convention it must be - // located on the first line of the template contents. - $lines = preg_split("/(\r?\n)/", $value); + // First we'll get the layout from the top of the template and remove it. + // Then it is replaced with @include and attached to the end. + // By convention it must be located on the first line of the template contents. + preg_replace_callback( + '/^@layout(\s*?\(.+?\))(\r?\n)?/', + function($matches) use (&$value) + { + $value = substr( $value, strlen( $matches[0] ) ).CRLF.'@include'.$matches[1]; + }, + $value + ); - $pattern = static::matcher('layout'); - - $lines[] = preg_replace($pattern, '$1@include$2', $lines[0]); - - // We will add a "render" statement to the end of the templates and - // then slice off the "@layout" shortcut from the start so the - // sections register before the parent template renders. - return implode(CRLF, array_slice($lines, 1)); + return $value; } /** @@ -172,9 +172,10 @@ protected static function compile_layouts($value) */ protected static function extract($value, $expression) { - preg_match('/@layout(\s*\(.*\))(\s*)/', $value, $matches); - - return str_replace(array("('", "')"), '', $matches[1]); + if ( preg_match("/@layout\s*?\(\s*?'(.+?)'\s*?\)/", $value, $matches)) + { + return trim( $matches[1] ); + } } /** @@ -209,27 +210,21 @@ protected static function compile_echos($value) */ protected static function compile_forelse($value) { - preg_match_all('/(\s*)@forelse(\s*\(.*\))(\s*)/', $value, $matches); + preg_match_all('/@forelse\s*?\(\s*?\$(.+?)\s*?as\s*?\$(.+?)\s*?\)/', $value, $matches, PREG_SET_ORDER ); + + if ( count($matches) < 1 ) return $value; - foreach ($matches[0] as $forelse) + foreach ($matches as $forelse) { - preg_match('/\s*\(\s*(\S*)\s/', $forelse, $variable); - // Once we have extracted the variable being looped against, we can add // an if statement to the start of the loop that checks if the count // of the variable being looped against is greater than zero. - $if = " 0): ?>"; - - $search = '/(\s*)@forelse(\s*\(.*\))/'; - - $replace = '$1'.$if.''; - - $blade = preg_replace($search, $replace, $forelse); + $replace = ' 0): foreach ($'.$forelse[1].' as $'.$forelse[2].'): ?>'; // Finally, once we have the check prepended to the loop we'll replace // all instances of this forelse syntax in the view content of the // view being compiled to Blade syntax with real PHP syntax. - $value = str_replace($forelse, $blade, $value); + $value = str_replace($forelse[0], $replace, $value); } return $value; @@ -243,7 +238,7 @@ protected static function compile_forelse($value) */ protected static function compile_empty($value) { - return str_replace('@empty', '', $value); + return str_replace('@empty', '', $value); } /** @@ -265,9 +260,9 @@ protected static function compile_endforelse($value) */ protected static function compile_structure_openings($value) { - $pattern = '/(\s*)@(if|elseif|foreach|for|while)(\s*\(.*\))/'; + $pattern = '/@(if|elseif|foreach|for|while)\s*?(\(.+?\))/'; - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -278,9 +273,9 @@ protected static function compile_structure_openings($value) */ protected static function compile_structure_closings($value) { - $pattern = '/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/'; + $pattern = '/@(endif|endforeach|endfor|endwhile)/'; - return preg_replace($pattern, '$1$3', $value); + return preg_replace($pattern, '', $value); } /** @@ -291,7 +286,7 @@ protected static function compile_structure_closings($value) */ protected static function compile_else($value) { - return preg_replace('/(\s*)@(else)(\s*)/', '$1$3', $value); + return str_replace( '@else', '', $value); } /** @@ -302,9 +297,9 @@ protected static function compile_else($value) */ protected static function compile_unless($value) { - $pattern = '/(\s*)@unless(\s*\(.*\))/'; + $pattern = static::matcher('unless'); - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -328,7 +323,7 @@ protected static function compile_includes($value) { $pattern = static::matcher('include'); - return preg_replace($pattern, '$1with(get_defined_vars())->render(); ?>', $value); + return preg_replace($pattern, 'with(get_defined_vars())->render(); ?>', $value); } /** @@ -341,7 +336,7 @@ protected static function compile_render($value) { $pattern = static::matcher('render'); - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -354,7 +349,7 @@ protected static function compile_render_each($value) { $pattern = static::matcher('render_each'); - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -369,7 +364,7 @@ protected static function compile_yields($value) { $pattern = static::matcher('yield'); - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -379,9 +374,7 @@ protected static function compile_yields($value) */ protected static function compile_yield_sections($value) { - $replace = ''; - - return str_replace('@yield_section', $replace, $value); + return str_replace('@yield_section', '', $value); } /** @@ -396,7 +389,7 @@ protected static function compile_section_start($value) { $pattern = static::matcher('section'); - return preg_replace($pattern, '$1', $value); + return preg_replace($pattern, '', $value); } /** @@ -409,7 +402,7 @@ protected static function compile_section_start($value) */ protected static function compile_section_end($value) { - return preg_replace('/@endsection/', '', $value); + return str_replace('@endsection', '', $value); } /** @@ -436,7 +429,7 @@ protected static function compile_extensions($value) */ public static function matcher($function) { - return '/(\s*)@'.$function.'(\s*\(.*\))/'; + return '/@'.$function.'\s*?(\(.+?\))/'; } /** From be264ab181e32478fc6ed6bb989c0a28766038fd Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Thu, 21 Jun 2012 00:09:08 -0700 Subject: [PATCH 12/83] added break function to closing structure --- laravel/blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/blade.php b/laravel/blade.php index 31273fe1..7e4e2fdb 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -273,7 +273,7 @@ protected static function compile_structure_openings($value) */ protected static function compile_structure_closings($value) { - $pattern = '/@(endif|endforeach|endfor|endwhile)/'; + $pattern = '/@(endif|endforeach|endfor|endwhile|break)/'; return preg_replace($pattern, '', $value); } From 61a61fc285bad4452ddf3d4c5859c4cd613e806b Mon Sep 17 00:00:00 2001 From: Tobsn Date: Fri, 22 Jun 2012 06:06:54 -0700 Subject: [PATCH 13/83] Added explanation about PDO default attributes regarding issue #788 https://github.com/laravel/laravel/issues/788 --- laravel/documentation/database/config.md | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/laravel/documentation/database/config.md b/laravel/documentation/database/config.md index a4eddb62..3768f013 100644 --- a/laravel/documentation/database/config.md +++ b/laravel/documentation/database/config.md @@ -5,6 +5,7 @@ ## Contents - [Quick Start Using SQLite](#quick) - [Configuring Other Databases](#server) - [Setting The Default Connection Name](#default) +- [Overwriting The Default PDO Options](#options) Laravel supports the following databases out of the box: @@ -43,4 +44,27 @@ ## Setting The Default Connection Name 'default' => 'sqlite'; -The default connection will always be used by the [fluent query builder](/docs/database/fluent). If you need to change the default connection during a request, use the **Config::set** method. \ No newline at end of file +The default connection will always be used by the [fluent query builder](/docs/database/fluent). If you need to change the default connection during a request, use the **Config::set** method. + + +##Overwriting The Default PDO Options + +The PDO connecter class (**laravel/database/connectors/connector.php**) has a set of default PDO attributes defined which can be overwritten in the options array for each system. For example, one of the default attributes is to force column names to lowercase (**PDO::CASE_LOWER**) even if they are defined in UPPERCASE or CamelCase in the table. Therefor, under the default attributes, query result object variables would only be accessible in lowercase. +An example of the MySQL system settings with added default PDO attributes: + + 'mysql' => array( + 'driver' => 'mysql', + 'host' => 'localhost', + 'database' => 'database', + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + 'prefix' => '', + PDO::ATTR_CASE => PDO::CASE_LOWER, + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, + PDO::ATTR_STRINGIFY_FETCHES => false, + PDO::ATTR_EMULATE_PREPARES => false, + ), + +More about the PDO connection attributes can be found [here](http://php.net/manual/en/pdo.setattribute.php). \ No newline at end of file From 59397eb726840d640873bc3c668ccc5e1912b3c6 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sun, 24 Jun 2012 21:17:32 +0300 Subject: [PATCH 14/83] Calculate the total render time in the profiler. --- laravel/profiling/profiler.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index 9b6edfef..0dc837c3 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -14,6 +14,15 @@ class Profiler { * @var array */ protected static $data = array('queries' => array(), 'logs' => array()); + + /** + * The time when the profiler was setup. + * + * This is used for generating the total page rendering time. + * + * @var float + */ + protected static $start_time; /** * Get the rendered contents of the Profiler. @@ -28,6 +37,10 @@ public static function render($response) // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { + if ($this->start_time) + { + static::$data['time'] = number_format((microtime(true) - $this->start_time) * 1000, 2); + } return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } } @@ -67,6 +80,9 @@ public static function query($sql, $bindings, $time) */ public static function attach() { + // Record when the profiler was setup (as a rough measure for render time) + $this->start_time = microtime(true); + // First we'll attach to the query and log events. These allow us to catch // all of the SQL queries and log messages that come through Laravel, // and we will pass them onto the Profiler for simple storage. From c74123098beb026de713efa139a532f9ba3aa9cd Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sun, 24 Jun 2012 21:27:57 +0300 Subject: [PATCH 15/83] Render page generation time on anbu profiler console. --- laravel/profiling/template.blade.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/laravel/profiling/template.blade.php b/laravel/profiling/template.blade.php index 0b0ffef8..a06f7957 100755 --- a/laravel/profiling/template.blade.php +++ b/laravel/profiling/template.blade.php @@ -61,6 +61,9 @@ @endif + @if (isset($time)) +
  • Time {{ $time }}ms
  • + @endif
  • ×
  • From 52f98b7cf6fff813698a3e7220104bf1f5c81e77 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 25 Jun 2012 01:12:31 +0300 Subject: [PATCH 16/83] Use start_time attribute like a static attribute (as it is). --- laravel/profiling/profiler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index 0dc837c3..d39f8bd9 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -37,9 +37,9 @@ public static function render($response) // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { - if ($this->start_time) + if (static::$start_time) { - static::$data['time'] = number_format((microtime(true) - $this->start_time) * 1000, 2); + static::$data['time'] = number_format((microtime(true) - static::$start_time) * 1000, 2); } return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } @@ -81,7 +81,7 @@ public static function query($sql, $bindings, $time) public static function attach() { // Record when the profiler was setup (as a rough measure for render time) - $this->start_time = microtime(true); + static::$start_time = microtime(true); // First we'll attach to the query and log events. These allow us to catch // all of the SQL queries and log messages that come through Laravel, From a8b5231e579830643d681eb9c7d3ece7da17dabd Mon Sep 17 00:00:00 2001 From: Steve Frost Date: Mon, 25 Jun 2012 12:16:14 +0200 Subject: [PATCH 17/83] Updated the dd function to var_dump inside pre tags, makes is a bit more readable --- laravel/helpers.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/laravel/helpers.php b/laravel/helpers.php index 07f9940a..b5bf9848 100644 --- a/laravel/helpers.php +++ b/laravel/helpers.php @@ -34,7 +34,10 @@ function __($key, $replacements = array(), $language = null) */ function dd($value) { - die(var_dump($value)); + echo "
    ";
    +	var_dump($value);
    +	echo "
    "; + die; } /** From 204a64f006992894b57811596e2e66e91c912216 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 25 Jun 2012 14:56:04 +0300 Subject: [PATCH 18/83] Simply use the LARAVEL_START constant for calculation page generation time in profiler. --- laravel/profiling/profiler.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index d39f8bd9..4fd9c183 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -15,15 +15,6 @@ class Profiler { */ protected static $data = array('queries' => array(), 'logs' => array()); - /** - * The time when the profiler was setup. - * - * This is used for generating the total page rendering time. - * - * @var float - */ - protected static $start_time; - /** * Get the rendered contents of the Profiler. * @@ -37,10 +28,7 @@ public static function render($response) // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { - if (static::$start_time) - { - static::$data['time'] = number_format((microtime(true) - static::$start_time) * 1000, 2); - } + static::$data['time'] = number_format((microtime(true) - LARAVEL_START) * 1000, 2); return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } } @@ -80,9 +68,6 @@ public static function query($sql, $bindings, $time) */ public static function attach() { - // Record when the profiler was setup (as a rough measure for render time) - static::$start_time = microtime(true); - // First we'll attach to the query and log events. These allow us to catch // all of the SQL queries and log messages that come through Laravel, // and we will pass them onto the Profiler for simple storage. From bcd63ab5affaa29e187baf75452a74ee5a5772c3 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 25 Jun 2012 14:56:42 +0300 Subject: [PATCH 19/83] We can be fairly sure the $time variable is set in the profiler view. --- laravel/profiling/template.blade.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/laravel/profiling/template.blade.php b/laravel/profiling/template.blade.php index a06f7957..d87b19d5 100755 --- a/laravel/profiling/template.blade.php +++ b/laravel/profiling/template.blade.php @@ -61,9 +61,7 @@ @endif - @if (isset($time))
  • Time {{ $time }}ms
  • - @endif
  • ×
  • From a04f38c2625deb7e26a52147c6e8fd45581cffe2 Mon Sep 17 00:00:00 2001 From: Tobsn Date: Wed, 27 Jun 2012 03:46:31 -0700 Subject: [PATCH 20/83] Now with Balanced Parentheses! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it's not regex, its not posix, but it can fly… finally balanced parentheses to fix all the () issue. it's ugly but it's fast and works with all kinds of combinations. it basically just counts open vs. closed and if they are even again it knows exactly where the condition is and does not cut into html or cut off too much. --- laravel/blade.php | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/laravel/blade.php b/laravel/blade.php index 7e4e2fdb..f224614a 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -260,9 +260,42 @@ protected static function compile_endforelse($value) */ protected static function compile_structure_openings($value) { - $pattern = '/@(if|elseif|foreach|for|while)\s*?(\(.+?\))/'; - - return preg_replace($pattern, '', $value); + preg_replace_callback( + '/@(if|elseif|foreach|for|while)(\s*?)(\([^\n\r\t]+\))/', + function($matches) use (&$value) + { + if(count( $matches ) === 4) + { + $open = 0; + $close = 0; + $cut = 0; + $len = strlen($matches[3]); + for($i = 0; $i < $len; $i++) + { + if($matches[3][$i] === '(' ) + { + $open++; + } + if($matches[3][$i] === ')' ) + { + $close++; + } + if($open !== 0 && ($open === $close)) + { + break; + } + } + $condition = substr($matches[3], 0, ($i + 1)); + $value = str_replace( + '@'.$matches[1].$matches[2].$condition, + '', + $value + ); + } + }, + $value + ); + return $value; } /** From 98b92185e314d8866ab7dae8d35fa8c8cec5c87f Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 2 Jul 2012 03:38:58 +0300 Subject: [PATCH 21/83] Calculate memory and peak memory usage in profiler, too. --- laravel/profiling/profiler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index 4fd9c183..b2a8635f 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -28,10 +28,24 @@ public static function render($response) // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { + static::$data['memory'] = static::get_file_size(memory_get_usage(true)); + static::$data['memory_peak'] = static::get_file_size(memory_get_peak_usage(true)); static::$data['time'] = number_format((microtime(true) - LARAVEL_START) * 1000, 2); return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } } + + /** + * Calculate the human-readable file size (with proper units). + * + * @param int $size + * @return string + */ + private static function get_file_size($size) + { + $units = array('Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); + return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$units[$i]; + } /** * Add a log entry to the log entries array. From 94e9106b760eb1b50eb81ac83b23f400b6a3e829 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 2 Jul 2012 03:42:43 +0300 Subject: [PATCH 22/83] Display memory usage (and peak usage) in the profiler bar, too. --- laravel/profiling/template.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/profiling/template.blade.php b/laravel/profiling/template.blade.php index d87b19d5..32c430a6 100755 --- a/laravel/profiling/template.blade.php +++ b/laravel/profiling/template.blade.php @@ -62,6 +62,7 @@
  • Time {{ $time }}ms
  • +
  • Memory {{ $memory }} ({{ $memory_peak }})
  • ×
  • From 6b5cccc15f015a531099ae27455c02b0f869a043 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 7 Jul 2012 02:13:44 +0200 Subject: [PATCH 23/83] Move get_file_size() helper function to helpers.php. --- laravel/helpers.php | 12 ++++++++++++ laravel/profiling/profiler.php | 16 ++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/laravel/helpers.php b/laravel/helpers.php index 07f9940a..b45fd9d2 100644 --- a/laravel/helpers.php +++ b/laravel/helpers.php @@ -580,4 +580,16 @@ function get_cli_option($option, $default = null) } return value($default); +} + +/** + * Calculate the human-readable file size (with proper units). + * + * @param int $size + * @return string + */ +function get_file_size($size) +{ + $units = array('Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); + return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$units[$i]; } \ No newline at end of file diff --git a/laravel/profiling/profiler.php b/laravel/profiling/profiler.php index b2a8635f..c8f069ae 100644 --- a/laravel/profiling/profiler.php +++ b/laravel/profiling/profiler.php @@ -28,24 +28,12 @@ public static function render($response) // type applications, so we will not send anything in those scenarios. if ( ! Request::ajax()) { - static::$data['memory'] = static::get_file_size(memory_get_usage(true)); - static::$data['memory_peak'] = static::get_file_size(memory_get_peak_usage(true)); + static::$data['memory'] = get_file_size(memory_get_usage(true)); + static::$data['memory_peak'] = get_file_size(memory_get_peak_usage(true)); static::$data['time'] = number_format((microtime(true) - LARAVEL_START) * 1000, 2); return render('path: '.__DIR__.'/template'.BLADE_EXT, static::$data); } } - - /** - * Calculate the human-readable file size (with proper units). - * - * @param int $size - * @return string - */ - private static function get_file_size($size) - { - $units = array('Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'); - return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$units[$i]; - } /** * Add a log entry to the log entries array. From 2d2a6bffa50c8057a42ea66ee183b4bbb06946cd Mon Sep 17 00:00:00 2001 From: Hirohisa Kawase Date: Sun, 8 Jul 2012 08:42:13 +0900 Subject: [PATCH 24/83] Add Japanese language resource files. --- application/language/ja/pagination.php | 31 ++++++ application/language/ja/validation.php | 142 +++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 application/language/ja/pagination.php create mode 100644 application/language/ja/validation.php diff --git a/application/language/ja/pagination.php b/application/language/ja/pagination.php new file mode 100644 index 00000000..e5906f60 --- /dev/null +++ b/application/language/ja/pagination.php @@ -0,0 +1,31 @@ + '« 前', + 'next' => '次 »', + +); \ No newline at end of file diff --git a/application/language/ja/validation.php b/application/language/ja/validation.php new file mode 100644 index 00000000..84da816c --- /dev/null +++ b/application/language/ja/validation.php @@ -0,0 +1,142 @@ + ":attributeを承認してください。", + "active_url" => ":attributeが有効なURLではありません。", + "after" => ":attributeには、:date以降の日付を指定してください。", + "alpha" => ":attributeはアルファベッドのみがご利用できます。", + "alpha_dash" => ":attributeは英数字とダッシュ(-)及び下線(_)がご利用できます。", + "alpha_num" => ":attributeは英数字がご利用できます。", + "before" => ":attributeには、:date以前の日付をご利用ください。", + "between" => array( + "numeric" => ":attributeは、:minから、:maxまでの数字をご指定ください。", + "file" => ":attributeには、:min kBから:max kBまでのサイズのファイルをご指定ください。", + "string" => ":attributeは、:min文字から:max文字の間でご指定ください。", + ), + "confirmed" => ":attributeと、確認フィールドとが、一致していません。", + "different" => ":attributeと:otherには、異なった内容を指定してください。", + "email" => ":attributeには正しいメールアドレスの形式をご指定ください。", + "exists" => "選択された:attributeは正しくありません。", + "image" => ":attributeには画像ファイルを指定してください。", + "in" => "選択された:attributeは正しくありません。", + "integer" => ":attributeは整数でご指定ください。", + "ip" => ":attributeには、有効なIPアドレスをご指定ください。", + "match" => ":attributeの入力フォーマットが間違っています。", + "max" => array( + "numeric" => ":attributeには、:max以下の数字をご指定ください。", + "file" => ":attributeには、:max kB以下のファイルをご指定ください。", + "string" => ":attributeは、:max文字以下でご指定ください。", + ), + "mimes" => ":attributeには:valuesタイプのファイルを指定してください。", + "min" => array( + "numeric" => ":attributeには、:min以上の数字をご指定ください。", + "file" => ":attributeには、:min kB以上のファイルをご指定ください。", + "string" => ":attributeは、:min文字以上でご指定ください。", + ), + "not_in" => "選択された:attributeは正しくありません。", + "numeric" => ":attributeには、数字を指定してください。", + "required" => ":attributeは必ず指定してください。", + "same" => ":attributeと:otherには同じ値を指定してください。", + "size" => array( + "numeric" => ":attributeには:sizeを指定してください。", + "file" => ":attributeのファイルは、:sizeキロバイトでなくてはなりません。", + "string" => ":attributeは:size文字で指定してください。", + ), + "unique" => ":attributeに指定された値は既に存在しています。", + "url" => ":attributeのフォーマットが正しくありません。", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + /* + |-------------------------------------------------------------------------- + | カスタムバリデーション言語設定 + |-------------------------------------------------------------------------- + | + | ここでは、"属性_ルール"の記法を使用し、属性に対するカスタムバリデーションメッセージを + | 指定してください。これにより、カスタムバリデーションをきれいに美しく保てます。 + | + | 例えば、"email"属性のuniqueバリデーションで、カスタムバリデーションメッセージを + | 使いたいならば、"email_unique"をカスタムメッセージとともに、配列に追加してください。 + | Validatorクラスが残りの面倒を見ます! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + /* + |-------------------------------------------------------------------------- + | バリデーション属性 + |-------------------------------------------------------------------------- + | + | 以下の言語設定は属性のプレースホルダーを例えば"email"属性を"E-Mailアドレス"という風に + | 読み手に親切になるよう置き換えるために使用されます。 + | あなたのユーザーは、あなたに感謝するでしょう。 + | + | Validatorクラスは、自動的にメッセージに含まれる:attributeプレースホルダーを + | この配列の値に置き換えようと試みます。絶妙ですね。あなたも気に入ってくれるでしょう。 + */ + + 'attributes' => array(), + +); \ No newline at end of file From cbff59b59b922fce13abb2276b35f9eaf271b5f7 Mon Sep 17 00:00:00 2001 From: Hirohisa Kawase Date: Sun, 8 Jul 2012 08:46:44 +0900 Subject: [PATCH 25/83] Add Japanese language resource files. --- application/language/ja/pagination.php | 2 +- application/language/ja/validation.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/ja/pagination.php b/application/language/ja/pagination.php index e5906f60..47e9d3f2 100644 --- a/application/language/ja/pagination.php +++ b/application/language/ja/pagination.php @@ -28,4 +28,4 @@ 'previous' => '« 前', 'next' => '次 »', -); \ No newline at end of file +); diff --git a/application/language/ja/validation.php b/application/language/ja/validation.php index 84da816c..45e3208b 100644 --- a/application/language/ja/validation.php +++ b/application/language/ja/validation.php @@ -139,4 +139,4 @@ 'attributes' => array(), -); \ No newline at end of file +); From 9dd964c3169f58417c4ecd31e993854c5758dccb Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Mon, 9 Jul 2012 21:34:17 -0400 Subject: [PATCH 26/83] Extend Auth::laravel to accept multiple params to verify Signed-off-by: Jeffrey Way --- laravel/auth/drivers/eloquent.php | 30 ++++++++++++++++++------------ laravel/auth/drivers/fluent.php | 22 ++++++++++++++-------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/laravel/auth/drivers/eloquent.php b/laravel/auth/drivers/eloquent.php index 8c1c6a80..26e143b9 100644 --- a/laravel/auth/drivers/eloquent.php +++ b/laravel/auth/drivers/eloquent.php @@ -26,21 +26,27 @@ public function retrieve($id) */ public function attempt($arguments = array()) { - $username = Config::get('auth.username'); + $user = $this->model()->where(function($query) use($arguments) { + $username = Config::get('auth.username'); + + $query->where($username, '=', $arguments['username']); - $user = $this->model()->where($username, '=', $arguments['username'])->first(); + foreach( array_except($arguments, array('username', 'password')) as $column => $val ) + { + $query->where($column, '=', $val); + } + })->first(); - // This driver uses a basic username and password authentication scheme - // so if the credentials match what is in the database we will just - // log the user into the application and remember them if asked. - $password = $arguments['password']; + // If the credentials match what is in the database we will just + // log the user into the application and remember them if asked. + $password = $arguments['password']; - $password_field = Config::get('auth.password', 'password'); + $password_field = Config::get('auth.password', 'password'); - if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) - { - return $this->login($user->id, array_get($arguments, 'remember')); - } + if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) + { + return $this->login($user->id, array_get($arguments, 'remember')); + } return false; } @@ -57,4 +63,4 @@ protected function model() return new $model; } -} \ No newline at end of file +} diff --git a/laravel/auth/drivers/fluent.php b/laravel/auth/drivers/fluent.php index 4c23468b..e5aaa506 100644 --- a/laravel/auth/drivers/fluent.php +++ b/laravel/auth/drivers/fluent.php @@ -30,10 +30,9 @@ public function retrieve($id) */ public function attempt($arguments = array()) { - $user = $this->get_user($arguments['username']); + $user = $this->get_user($arguments); - // This driver uses a basic username and password authentication scheme - // so if the credentials match what is in the database we will just + // If the credentials match what is in the database we will just // log the user into the application and remember them if asked. $password = $arguments['password']; @@ -48,18 +47,25 @@ public function attempt($arguments = array()) } /** - * Get the user from the database table by username. + * Get the user from the database table. * - * @param mixed $value + * @param mixed $array * @return mixed */ - protected function get_user($value) + protected function get_user($arguments) { $table = Config::get('auth.table'); - $username = Config::get('auth.username'); + return DB::table($table)->where(function($query) use($arguments) { + $username = Config::get('auth.username'); + + $query->where($username, '=', $arguments['username']); - return DB::table($table)->where($username, '=', $value)->first(); + foreach( array_except($arguments, array('username', 'password')) as $column => $val ) + { + $query->where($column, '=', $val); + } + })->first(); } } From ff525b995b21998aeba4d87ff97a54b0cb6c6df3 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Mon, 9 Jul 2012 22:18:32 -0400 Subject: [PATCH 27/83] Add "remember" to ignore list Signed-off-by: Jeffrey Way --- laravel/auth/drivers/eloquent.php | 23 ++++++++++++----------- laravel/auth/drivers/fluent.php | 5 +++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/laravel/auth/drivers/eloquent.php b/laravel/auth/drivers/eloquent.php index 26e143b9..4b365d1e 100644 --- a/laravel/auth/drivers/eloquent.php +++ b/laravel/auth/drivers/eloquent.php @@ -26,27 +26,28 @@ public function retrieve($id) */ public function attempt($arguments = array()) { - $user = $this->model()->where(function($query) use($arguments) { + $user = $this->model()->where(function($query) use($arguments) + { $username = Config::get('auth.username'); $query->where($username, '=', $arguments['username']); - foreach( array_except($arguments, array('username', 'password')) as $column => $val ) + foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val) { $query->where($column, '=', $val); } - })->first(); + })->first(); - // If the credentials match what is in the database we will just - // log the user into the application and remember them if asked. - $password = $arguments['password']; + // If the credentials match what is in the database we will just + // log the user into the application and remember them if asked. + $password = $arguments['password']; - $password_field = Config::get('auth.password', 'password'); + $password_field = Config::get('auth.password', 'password'); - if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) - { - return $this->login($user->id, array_get($arguments, 'remember')); - } + if ( ! is_null($user) and Hash::check($password, $user->get_attribute($password_field))) + { + return $this->login($user->id, array_get($arguments, 'remember')); + } return false; } diff --git a/laravel/auth/drivers/fluent.php b/laravel/auth/drivers/fluent.php index e5aaa506..ed660881 100644 --- a/laravel/auth/drivers/fluent.php +++ b/laravel/auth/drivers/fluent.php @@ -56,12 +56,13 @@ protected function get_user($arguments) { $table = Config::get('auth.table'); - return DB::table($table)->where(function($query) use($arguments) { + return DB::table($table)->where(function($query) use($arguments) + { $username = Config::get('auth.username'); $query->where($username, '=', $arguments['username']); - foreach( array_except($arguments, array('username', 'password')) as $column => $val ) + foreach(array_except($arguments, array('username', 'password', 'remember')) as $column => $val) { $query->where($column, '=', $val); } From 204a6a79803b17b14cf663a11471a625bb0e9eaa Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 10 Jul 2012 15:29:26 +0300 Subject: [PATCH 28/83] Add a Request::time() function. --- laravel/request.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/laravel/request.php b/laravel/request.php index 84763449..a37360a2 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -177,6 +177,25 @@ public static function referrer() { return static::foundation()->headers->get('referer'); } + + /** + * Get the timestamp of the time when the request was started. + * + * The value is actually calculated when this function gets first called. + * + * @return int + */ + public static function time() + { + static $time; + + if (!isset($time)) + { + $time = time(); + } + + return $time; + } /** * Determine if the current request is via the command line. From c659a926034da8e724e2766b90aef48c8fbb3018 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Tue, 10 Jul 2012 11:03:55 -0400 Subject: [PATCH 29/83] Fix typo in comments --- laravel/auth/drivers/eloquent.php | 2 +- laravel/auth/drivers/fluent.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/auth/drivers/eloquent.php b/laravel/auth/drivers/eloquent.php index 4b365d1e..aaea515b 100644 --- a/laravel/auth/drivers/eloquent.php +++ b/laravel/auth/drivers/eloquent.php @@ -21,7 +21,7 @@ public function retrieve($id) /** * Attempt to log a user into the application. * - * @param array $arguments + * @param array $arguments * @return void */ public function attempt($arguments = array()) diff --git a/laravel/auth/drivers/fluent.php b/laravel/auth/drivers/fluent.php index ed660881..f8654e9a 100644 --- a/laravel/auth/drivers/fluent.php +++ b/laravel/auth/drivers/fluent.php @@ -25,7 +25,7 @@ public function retrieve($id) /** * Attempt to log a user into the application. * - * @param array $arguments + * @param array $arguments * @return void */ public function attempt($arguments = array()) @@ -49,7 +49,7 @@ public function attempt($arguments = array()) /** * Get the user from the database table. * - * @param mixed $array + * @param array $arguments * @return mixed */ protected function get_user($arguments) From 27fb9d06122d46b38d4c4948ab3267779c13b2fe Mon Sep 17 00:00:00 2001 From: Tobsn Date: Wed, 11 Jul 2012 12:27:29 +0200 Subject: [PATCH 30/83] fixed "here" link --- laravel/documentation/database/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/database/config.md b/laravel/documentation/database/config.md index 3768f013..2a1b0453 100644 --- a/laravel/documentation/database/config.md +++ b/laravel/documentation/database/config.md @@ -67,4 +67,4 @@ ## Setting The Default Connection Name PDO::ATTR_EMULATE_PREPARES => false, ), -More about the PDO connection attributes can be found [here](http://php.net/manual/en/pdo.setattribute.php). \ No newline at end of file +More about the PDO connection attributes can be found [in the PHP manual](http://php.net/manual/en/pdo.setattribute.php). \ No newline at end of file From 8a4aade8f7156bdeb00652520b80e536bfef8b8d Mon Sep 17 00:00:00 2001 From: Anahkiasen Date: Wed, 11 Jul 2012 16:27:11 +0200 Subject: [PATCH 31/83] Quick notes on Pivot tables --- laravel/documentation/database/eloquent.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index bc70483b..71e3a402 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -244,6 +244,7 @@ ### Many-To-Many **Roles_Users:** + id - INTEGER user_id - INTEGER role_id - INTEGER @@ -277,6 +278,17 @@ ### Many-To-Many } +By default only certain fields from the pivot table will be returned (the two **id** fields, and the timestamps). If your pivot table contains additional columns, you can fetch them too by using the **with()** method : + + class User extends Eloquent { + + public function roles() + { + return $this->has_many_and_belongs_to('Role', 'user_roles')->with('column'); + } + + } + ## Inserting Related Models From c8718a32eccee418baec7be18d51f53cd34e91d7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Jul 2012 10:18:48 -0500 Subject: [PATCH 32/83] added option for URI languages. --- application/config/application.php | 15 ++++++++++- laravel/laravel.php | 42 ++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/application/config/application.php b/application/config/application.php index 9f597954..abfcf072 100755 --- a/application/config/application.php +++ b/application/config/application.php @@ -84,7 +84,7 @@ /* |-------------------------------------------------------------------------- - | Application Language + | Default Application Language |-------------------------------------------------------------------------- | | The default language of your application. This language will be used by @@ -94,6 +94,19 @@ 'language' => 'en', + /* + |-------------------------------------------------------------------------- + | Supported Languages + |-------------------------------------------------------------------------- + | + | These languages may also be supported by your application. If a request + | enters your application with a URI beginning with one of these values + | the default language will automatically be set to that language. + | + */ + + 'languages' => array('fr', 'sp'), + /* |-------------------------------------------------------------------------- | SSL Link Generation diff --git a/laravel/laravel.php b/laravel/laravel.php index a1ca2061..2544c617 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -107,6 +107,46 @@ return Event::first('404'); }); +/* +|-------------------------------------------------------------------------- +| Gather The URI And Locales +|-------------------------------------------------------------------------- +| +| When routing, we'll need to grab the URI and the supported locales for +| the route so we can properly set the language and route the request +| to the proper end-point in the application. +| +*/ + +$uri = URI::current(); + +$locales = Config::get('application.languages', array()); + +$locales[] = Config::get('application.language'); + +/* +|-------------------------------------------------------------------------- +| Set The Locale Based On Route +|-------------------------------------------------------------------------- +| +| If the URI starts with one of the supported languages, we will set +| the default language to match that URI segment and shorten the +| URI we'll pass to the router to not include the lang segment. +| +*/ + +foreach ($locales as $locale) +{ + if (starts_with($uri, $locale)) + { + Config::set('application.language', $locale); + + $uri = trim(substr($uri, strlen($locale)), '/'); break; + } +} + +if ($uri === '') $uri = '/'; + /* |-------------------------------------------------------------------------- | Route The Incoming Request @@ -118,8 +158,6 @@ | */ -$uri = URI::current(); - Request::$route = Routing\Router::route(Request::method(), $uri); $response = Request::$route->call(); From 5f919d76a5f9bb86c2a5c8d74f62ee91eebf8e8c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Jul 2012 10:20:12 -0500 Subject: [PATCH 33/83] updated change log. --- laravel/documentation/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/documentation/changes.md b/laravel/documentation/changes.md index 7fb72d41..d969d5a2 100644 --- a/laravel/documentation/changes.md +++ b/laravel/documentation/changes.md @@ -38,6 +38,7 @@ ## Laravel 3.2.4 - Speed up many to many eager loading mapping. - Tweak the Eloquent::changed() method. +- Added support for locales in the URI. ## Upgrading From 3.2.3 From 10e5918e237f354c9f8a650a5be51ec919ff6bb4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Jul 2012 10:24:08 -0500 Subject: [PATCH 34/83] clear out langauges option. --- application/config/application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/application.php b/application/config/application.php index abfcf072..07bb2157 100755 --- a/application/config/application.php +++ b/application/config/application.php @@ -105,7 +105,7 @@ | */ - 'languages' => array('fr', 'sp'), + 'languages' => array(), /* |-------------------------------------------------------------------------- From e19e4ebd2490efcc5c5463c1ac11b8a5beca625a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 11 Jul 2012 10:30:44 -0500 Subject: [PATCH 35/83] tweak url for languages. --- laravel/url.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/laravel/url.php b/laravel/url.php index 44b89428..443ddb2a 100644 --- a/laravel/url.php +++ b/laravel/url.php @@ -107,6 +107,14 @@ public static function to($url = '', $https = null) $root = static::base().'/'.Config::get('application.index'); + // If multiple languages are being supported via URIs, we will append current + // language to the URI so all redirects and URLs generated include the + // current language so it is not lost on further requests. + if (count(Config::get('application.languages')) > 0) + { + $root .= '/'.Config::get('application.language'); + } + // Since SSL is not often used while developing the application, we allow the // developer to disable SSL on all framework generated links to make it more // convenient to work with the site while developing locally. @@ -242,6 +250,11 @@ public static function to_asset($url, $https = null) $url = str_replace($index.'/', '', $url); } + if (count(Config::get('application.languages')) > 0) + { + $url = str_replace(Config::get('application.language').'/', '', $url); + } + return $url; } From 05ada38d8f6d3642a5d52a668c7b895a1e599a66 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Wed, 11 Jul 2012 22:36:20 +0200 Subject: [PATCH 36/83] style update --- laravel/documentation/install.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/laravel/documentation/install.md b/laravel/documentation/install.md index cb3f9dc6..1e051e06 100644 --- a/laravel/documentation/install.md +++ b/laravel/documentation/install.md @@ -41,10 +41,6 @@ ### Problems? - Make sure the **public** directory is the document root of your web server. (see: Server Configuration below) - If you are using mod_rewrite, set the **index** option in **application/config/application.php** to an empty string. -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> hotfix/fix_markdown - Verify that your storage folder and the folders within are writable by your web server. From 29b668b83d5be0be6034e9161e3629e7fad6fdf1 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Thu, 12 Jul 2012 00:30:04 +0200 Subject: [PATCH 37/83] added help:commands task to artisan --- laravel/cli/dependencies.php | 12 ++++++ laravel/cli/tasks/help.json | 78 ++++++++++++++++++++++++++++++++++++ laravel/cli/tasks/help.php | 35 ++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 laravel/cli/tasks/help.json create mode 100644 laravel/cli/tasks/help.php diff --git a/laravel/cli/dependencies.php b/laravel/cli/dependencies.php index f0c59e81..2e7f23b6 100644 --- a/laravel/cli/dependencies.php +++ b/laravel/cli/dependencies.php @@ -125,4 +125,16 @@ { return new Tasks\Bundle\Providers\Github; }); +} + +/** + * The "help" task provides information about + * artisan usage. + */ +if(! IoC::registered('task: help')) +{ + IoC::singleton('task: help', function() + { + return new Tasks\Help; + }); } \ No newline at end of file diff --git a/laravel/cli/tasks/help.json b/laravel/cli/tasks/help.json new file mode 100644 index 00000000..69e16fe6 --- /dev/null +++ b/laravel/cli/tasks/help.json @@ -0,0 +1,78 @@ +{ + "Application Configuration": { + "key:generate": { + "description": "Generate a secure application key.", + "command": "php artisan key:generate" + } + }, + "Database Tables": { + "session:table": { + "description": "Generate a migration for the sessions database table.", + "command": "php artisan session:table" + } + }, + "Migrations": { + "migrate:install": { + "description": "Create the Laravel migration table.", + "command": "php artisan migrate:install" + }, + "migrate:make": { + "description": "Create a migration.", + "command": "php artisan migrate:make create_users_table" + }, + "migrate": { + "description": "Run outstanding migrations.", + "command": "php artisan migrate" + }, + "migrate:rollback": { + "description": "Roll back the most recent migration.", + "command": "php artisan migrate:rollback" + }, + "migrate:reset": { + "description": "Roll back all migrations.", + "command": "php artisan migrate:reset" + } + }, + "Bundles": { + "bundle:install": { + "description": "Install a bundle.", + "command": "php artisan bundle:install swiftmailer" + }, + "bundle:upgrade": { + "description": "Upgrade a bundle.", + "command": "php artisan bundle:upgrade swiftmailer" + }, + "bundle:publish": { + "description": "Publish all bundles' assets.", + "command": "php artisan bundle:publish" + } + }, + "Unit Tests": { + "test": { + "description": "Run the application's tests.", + "command": "php artisan test" + } + }, + "Routing": { + "route:call": { + "description": "Call a route.", + "command": "php artisan route:call get api/user/1" + } + }, + "Application Keys": { + "key:generate": { + "description": "Generate an application key.", + "command": "php artisan key:generade" + } + }, + "CLI Options": { + "--env=": { + "description": "Set the Laravel environment.", + "command": "php artisan task --env=local" + }, + "--database=": { + "description": "Set the default database connection.", + "command": "php artisan task --database=mysql" + } + } +} \ No newline at end of file diff --git a/laravel/cli/tasks/help.php b/laravel/cli/tasks/help.php new file mode 100644 index 00000000..5add2e75 --- /dev/null +++ b/laravel/cli/tasks/help.php @@ -0,0 +1,35 @@ + $commands) + { + + if($i++ != 0) echo PHP_EOL; + + echo PHP_EOL . "# $category" . PHP_EOL; + + foreach($commands as $command => $details) + { + echo PHP_EOL . str_pad($command, 20) . str_pad($details->description, 30); + } + } + } + +} \ No newline at end of file From 644ecfcc2586add3143f73a02f7411876a018b7d Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Thu, 12 Jul 2012 13:00:35 +0200 Subject: [PATCH 38/83] adding basic help functions to artisan --- laravel/cli/tasks/help.php | 1 - 1 file changed, 1 deletion(-) diff --git a/laravel/cli/tasks/help.php b/laravel/cli/tasks/help.php index 5add2e75..e81bc945 100644 --- a/laravel/cli/tasks/help.php +++ b/laravel/cli/tasks/help.php @@ -31,5 +31,4 @@ public function commands() } } } - } \ No newline at end of file From ce3721a7a131bd3a1aac04ac046a3427e9a233e2 Mon Sep 17 00:00:00 2001 From: Baycan Aydin Date: Thu, 12 Jul 2012 16:37:12 +0200 Subject: [PATCH 39/83] Add dutch language Signed-off-by: Baycan Aydin --- application/language/nl/pagination.php | 8 +++ application/language/nl/validation.php | 90 ++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 application/language/nl/pagination.php create mode 100644 application/language/nl/validation.php diff --git a/application/language/nl/pagination.php b/application/language/nl/pagination.php new file mode 100644 index 00000000..003e13de --- /dev/null +++ b/application/language/nl/pagination.php @@ -0,0 +1,8 @@ + '« Vorige', + 'next' => 'Volgende »', + +); \ No newline at end of file diff --git a/application/language/nl/validation.php b/application/language/nl/validation.php new file mode 100644 index 00000000..51e2a0b7 --- /dev/null +++ b/application/language/nl/validation.php @@ -0,0 +1,90 @@ + "Het :attribute moet geaccepteerd zijn.", + "active_url" => "Het :attribute is geen geldig URL.", + "after" => "Het :attribute moet een datum na :date zijn.", + "alpha" => "Het :attribute mag alleen letters bevatten.", + "alpha_dash" => "Het :attribute mag alleen letters, nummers, onderstreep(_) en strepen(-) bevatten.", + "alpha_num" => "Het :attribute mag alleen letters en nummers", + "before" => "Het :attribute moet een datum voor :date zijn.", + "between" => array( + "numeric" => "Het :attribute moet tussen :min en :max zijn.", + "file" => "Het :attribute moet tussen :min en :max kilobytes zijn.", + "string" => "Het :attribute moet tussen :min en :max tekens zijn.", + ), + "confirmed" => "Het :attribute bevestiging komt niet overeen.", + "different" => "Het :attribute en :other moeten verschillend zijn.", + "email" => "Het :attribute formaat is ongeldig.", + "exists" => "Het gekozen :attribute is al ingebruik.", + "image" => "Het :attribute moet een afbeelding zijn.", + "in" => "Het gekozen :attribute is ongeldig.", + "integer" => "Het :attribute moet een getal zijn.", + "ip" => "Het :attribute moet een geldig IP adres bevatten.", + "match" => "Het :attribute formaat is ongeldig.", + "max" => array( + "numeric" => "Het :attribute moet minder dan :max zijn.", + "file" => "Het :attribute moet minder dan :max kilobytes zijn.", + "string" => "Het :attribute moet minder dan :max tekens zijn.", + ), + "mimes" => "Het :attribute moet een bestand zijn van het bestandstype :values.", + "min" => array( + "numeric" => "Het :attribute moet minimaal :min zijn.", + "file" => "Het :attribute moet minimaal :min kilobytes zijn.", + "string" => "Het :attribute moet minimaal :min characters zijn.", + ), + "not_in" => "Het :attribute formaat is ongeldig.", + "numeric" => "Het :attribute moet een nummer zijn.", + "required" => "Het :attribute veld is verplicht.", + "same" => "Het :attribute en :other moeten overeenkomen.", + "size" => array( + "numeric" => "Het :attribute moet :size zijn.", + "file" => "Het :attribute moet :size kilobyte zijn.", + "string" => "Het :attribute moet :size characters zijn.", + ), + "unique" => "Het :attribute is al in gebruik.", + "url" => "Het :attribute formaat is ongeldig.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file From 4d44df4885511e230847942b42794c2cdd6317eb Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Thu, 12 Jul 2012 10:40:41 -0500 Subject: [PATCH 40/83] Allow second param of HTML::link* methods to be null, in which case the title of the link is the URL itself, similar to HTML::email() method. Signed-off-by: Colin Viebrock --- laravel/html.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/laravel/html.php b/laravel/html.php index 498ea28c..22025ee1 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -137,10 +137,12 @@ public static function span($value, $attributes = array()) * @param bool $https * @return string */ - public static function link($url, $title, $attributes = array(), $https = null) + public static function link($url, $title = null, $attributes = array(), $https = null) { $url = URL::to($url, $https); + if (is_null($title)) $title = $url; + return ''.static::entities($title).''; } @@ -152,7 +154,7 @@ public static function link($url, $title, $attributes = array(), $https = null) * @param array $attributes * @return string */ - public static function link_to_secure($url, $title, $attributes = array()) + public static function link_to_secure($url, $title = null, $attributes = array()) { return static::link($url, $title, $attributes, true); } @@ -168,7 +170,7 @@ public static function link_to_secure($url, $title, $attributes = array()) * @param bool $https * @return string */ - public static function link_to_asset($url, $title, $attributes = array(), $https = null) + public static function link_to_asset($url, $title = null, $attributes = array(), $https = null) { $url = URL::to_asset($url, $https); @@ -183,7 +185,7 @@ public static function link_to_asset($url, $title, $attributes = array(), $https * @param array $attributes * @return string */ - public static function link_to_secure_asset($url, $title, $attributes = array()) + public static function link_to_secure_asset($url, $title = null, $attributes = array()) { return static::link_to_asset($url, $title, $attributes, true); } @@ -207,7 +209,7 @@ public static function link_to_secure_asset($url, $title, $attributes = array()) * @param array $attributes * @return string */ - public static function link_to_route($name, $title, $parameters = array(), $attributes = array()) + public static function link_to_route($name, $title = null, $parameters = array(), $attributes = array()) { return static::link(URL::to_route($name, $parameters), $title, $attributes); } @@ -231,7 +233,7 @@ public static function link_to_route($name, $title, $parameters = array(), $attr * @param array $attributes * @return string */ - public static function link_to_action($action, $title, $parameters = array(), $attributes = array()) + public static function link_to_action($action, $title = null, $parameters = array(), $attributes = array()) { return static::link(URL::to_action($action, $parameters), $title, $attributes); } @@ -418,7 +420,7 @@ public static function __callStatic($method, $parameters) { return call_user_func_array(static::$macros[$method], $parameters); } - + throw new \Exception("Method [$method] does not exist."); } From 71f8e4acc09d0c768e4f54dfc09b1e15f09ddfeb Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 12 Jul 2012 23:16:22 +0300 Subject: [PATCH 41/83] Fix a bug introduced in pull request #799 that caused eager loading constraints to stop working. --- laravel/database/eloquent/model.php | 37 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index ccdd42d5..9a90279f 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -257,25 +257,38 @@ public function _with($includes) { $includes = (array) $includes; - $all_includes = array(); + $given_includes = array(); - foreach($includes as $include) + foreach ($includes as $relationship => $constraints) { - $nested = explode('.', $include); - - $inc = array(); - - foreach($nested as $relation) + // When eager loading relationships, constraints may be set on the eager + // load definition; however, is none are set, we need to swap the key + // and the value of the array since there are no constraints. + if (is_numeric($relationship)) { - $inc[] = $relation; - - $all_includes[] = implode('.', $inc); + list($relationship, $constraints) = array($constraints, null); } + $given_includes[$relationship] = $constraints; } - //remove duplicates and reset the array keys. - $this->includes = array_values(array_unique($all_includes)); + $relationships = array_keys($given_includes); + $implicits = array(); + + foreach ($relationships as $relationship) + { + $parts = explode('.', $relationship); + + $prefix = ''; + foreach ($parts as $part) + { + $implicits[$prefix.$part] = null; + $prefix .= $part.'.'; + } + } + + // Add all implicit includes to the explicit ones + $this->includes = $given_includes + $implicits; return $this; } From 8c2a4fba14015f166451f25f6c9ef3f87c0fe51a Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 12 Jul 2012 23:20:17 +0300 Subject: [PATCH 42/83] The Eloquent model includes can now be taken directly from the model when assembling the query. --- laravel/database/eloquent/query.php | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/laravel/database/eloquent/query.php b/laravel/database/eloquent/query.php index 3aee79c9..25fa4fbc 100644 --- a/laravel/database/eloquent/query.php +++ b/laravel/database/eloquent/query.php @@ -127,7 +127,7 @@ public function hydrate($model, $results) if (count($results) > 0) { - foreach ($this->model_includes() as $relationship => $constraints) + foreach ($this->model->includes as $relationship => $constraints) { // If the relationship is nested, we will skip loading it here and let // the load method parse and set the nested eager loads on the right @@ -196,7 +196,7 @@ protected function nested_includes($relationship) { $nested = array(); - foreach ($this->model_includes() as $include => $constraints) + foreach ($this->model->includes as $include => $constraints) { // To get the nested includes, we want to find any includes that begin // the relationship and a dot, then we will strip off the leading @@ -210,31 +210,6 @@ protected function nested_includes($relationship) return $nested; } - /** - * Get the eagerly loaded relationships for the model. - * - * @return array - */ - protected function model_includes() - { - $includes = array(); - - foreach ($this->model->includes as $relationship => $constraints) - { - // When eager loading relationships, constraints may be set on the eager - // load definition; however, is none are set, we need to swap the key - // and the value of the array since there are no constraints. - if (is_numeric($relationship)) - { - list($relationship, $constraints) = array($constraints, null); - } - - $includes[$relationship] = $constraints; - } - - return $includes; - } - /** * Get a fluent query builder for the model. * From 78920c5d270f0abcf3eccf557fea88d83d3470ed Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 12 Jul 2012 22:32:43 +0200 Subject: [PATCH 43/83] Move automatic relationship parsing to Eloquent's query class. --- laravel/database/eloquent/model.php | 22 ++------------------- laravel/database/eloquent/query.php | 30 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 9a90279f..32c504c5 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -257,7 +257,7 @@ public function _with($includes) { $includes = (array) $includes; - $given_includes = array(); + $this->includes = array(); foreach ($includes as $relationship => $constraints) { @@ -269,27 +269,9 @@ public function _with($includes) list($relationship, $constraints) = array($constraints, null); } - $given_includes[$relationship] = $constraints; + $this->includes[$relationship] = $constraints; } - $relationships = array_keys($given_includes); - $implicits = array(); - - foreach ($relationships as $relationship) - { - $parts = explode('.', $relationship); - - $prefix = ''; - foreach ($parts as $part) - { - $implicits[$prefix.$part] = null; - $prefix .= $part.'.'; - } - } - - // Add all implicit includes to the explicit ones - $this->includes = $given_includes + $implicits; - return $this; } diff --git a/laravel/database/eloquent/query.php b/laravel/database/eloquent/query.php index 25fa4fbc..56fd15c7 100644 --- a/laravel/database/eloquent/query.php +++ b/laravel/database/eloquent/query.php @@ -127,7 +127,7 @@ public function hydrate($model, $results) if (count($results) > 0) { - foreach ($this->model->includes as $relationship => $constraints) + foreach ($this->model_includes() as $relationship => $constraints) { // If the relationship is nested, we will skip loading it here and let // the load method parse and set the nested eager loads on the right @@ -196,7 +196,7 @@ protected function nested_includes($relationship) { $nested = array(); - foreach ($this->model->includes as $include => $constraints) + foreach ($this->model_includes() as $include => $constraints) { // To get the nested includes, we want to find any includes that begin // the relationship and a dot, then we will strip off the leading @@ -210,6 +210,32 @@ protected function nested_includes($relationship) return $nested; } + /** + * Get the eagerly loaded relationships for the model. + * + * @return array + */ + protected function model_includes() + { + $relationships = array_keys($this->model->includes); + $implicits = array(); + + foreach ($relationships as $relationship) + { + $parts = explode('.', $relationship); + + $prefix = ''; + foreach ($parts as $part) + { + $implicits[$prefix.$part] = NULL; + $prefix .= $part.'.'; + } + } + + // Add all implicit includes to the explicit ones + return $this->model->includes + $implicits; + } + /** * Get a fluent query builder for the model. * From 6d23c4f5c6db7ef62ba8d3b183e92d43991ab431 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 13 Jul 2012 00:21:18 +0300 Subject: [PATCH 44/83] Fix missing semicolon in laravel/cli/test/runner.php. --- laravel/cli/tasks/test/runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/cli/tasks/test/runner.php b/laravel/cli/tasks/test/runner.php index 953c9857..937046d8 100644 --- a/laravel/cli/tasks/test/runner.php +++ b/laravel/cli/tasks/test/runner.php @@ -83,7 +83,7 @@ protected function test() // fix the spaced directories problem when using the command line // strings with spaces inside should be wrapped in quotes. - $path = escapeshellarg($path) + $path = escapeshellarg($path); passthru('phpunit --configuration '.$path); From eb76c34cd3974426b8bd33e5fe702a878a8a475c Mon Sep 17 00:00:00 2001 From: Loic Sharma Date: Thu, 12 Jul 2012 17:46:17 -0500 Subject: [PATCH 45/83] Added a missing parenthesis and semicolon. --- laravel/documentation/validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/validation.md b/laravel/documentation/validation.md index 6490d418..367569a5 100644 --- a/laravel/documentation/validation.md +++ b/laravel/documentation/validation.md @@ -417,7 +417,7 @@ #### Registering a custom validation rule: Validator::register('awesome', function($attribute, $value, $parameters) { return $value == $parameters[0]; - } + }); In this case, the parameters argument of your validation rule would receive an array containing one element: "yes". From dc6bcf079380359227f569825e55ad8c143a350a Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 16 Jul 2012 10:05:07 +0200 Subject: [PATCH 46/83] use global paginator alias in the query class --- laravel/database/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/query.php b/laravel/database/query.php index 55e9606a..c2516188 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -2,7 +2,7 @@ use Closure; use Laravel\Database; -use Laravel\Paginator; +use Paginator; use Laravel\Database\Query\Grammars\Postgres; use Laravel\Database\Query\Grammars\SQLServer; From 7dcbf33a80017276b034ce93b9f002a2f7ce18a2 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 16 Jul 2012 10:28:40 +0200 Subject: [PATCH 47/83] cleaned up help task --- laravel/cli/tasks/help.json | 2 +- laravel/cli/tasks/help.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/laravel/cli/tasks/help.json b/laravel/cli/tasks/help.json index 69e16fe6..3f614ad1 100644 --- a/laravel/cli/tasks/help.json +++ b/laravel/cli/tasks/help.json @@ -47,7 +47,7 @@ "command": "php artisan bundle:publish" } }, - "Unit Tests": { + "Unit Testing": { "test": { "description": "Run the application's tests.", "command": "php artisan test" diff --git a/laravel/cli/tasks/help.php b/laravel/cli/tasks/help.php index e81bc945..8cfcd768 100644 --- a/laravel/cli/tasks/help.php +++ b/laravel/cli/tasks/help.php @@ -6,21 +6,22 @@ class Help extends Task { /** - * List + * List available artisan commands. * * @param array $arguments * @return void */ public function commands() { + // read help contents - $command_data = json_decode(file_get_contents(__DIR__.'/help.json')); + $command_data = json_decode(File::get(__DIR__.'/help.json')); + + // format and display help contents $i=0; - foreach($command_data as $category => $commands) { - if($i++ != 0) echo PHP_EOL; echo PHP_EOL . "# $category" . PHP_EOL; From 25b8bd889b9f38c665b227672257063fd0feb590 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 16 Jul 2012 11:37:05 +0300 Subject: [PATCH 48/83] add help:commands artisan task to documentation --- laravel/documentation/artisan/commands.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/laravel/documentation/artisan/commands.md b/laravel/documentation/artisan/commands.md index 997e86ce..0a2dd5ff 100644 --- a/laravel/documentation/artisan/commands.md +++ b/laravel/documentation/artisan/commands.md @@ -2,6 +2,7 @@ # Artisan Commands ## Contents +- [Help](#help) - [Application Configuration](#application-configuration) - [Sessions](#sessions) - [Migrations](#migrations) @@ -12,6 +13,13 @@ ## Contents - [Application Keys](#keys) - [CLI Options](#cli-options) + +## Help + +Description | Command +------------- | ------------- +View a list of available artisan commands. | `php artisan help:commands` + ## Application Configuration [(More Information)](/docs/install#basic-configuration) From b973c259059b92b633388c5c067cd4de37712e53 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 16 Jul 2012 14:57:35 +0300 Subject: [PATCH 49/83] Add documentation about deleting files. --- laravel/documentation/files.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/laravel/documentation/files.md b/laravel/documentation/files.md index d0ed3f85..711dd963 100644 --- a/laravel/documentation/files.md +++ b/laravel/documentation/files.md @@ -4,6 +4,7 @@ ## Contents - [Reading Files](#get) - [Writing Files](#put) +- [Removing files](#delete) - [File Uploads](#upload) - [File Extensions](#ext) - [Checking File Types](#is) @@ -29,6 +30,13 @@ #### Appending to a file: File::append('path/to/file', 'appended file content'); + +## Removing Files + +#### Deleting a single file: + + File::delete('path/to/file'); + ## File Uploads From 096f9c2b7871af431638329d9c4e4170b9a23bf5 Mon Sep 17 00:00:00 2001 From: Rack Lin Date: Tue, 17 Jul 2012 17:42:01 +0800 Subject: [PATCH 50/83] Fixed IoC::resolve forces singleton issue. Signed-off-by: Rack Lin --- laravel/ioc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/ioc.php b/laravel/ioc.php index 11292925..60313de9 100644 --- a/laravel/ioc.php +++ b/laravel/ioc.php @@ -124,7 +124,7 @@ public static function resolve($type, $parameters = array()) // If the requested type is registered as a singleton, we want to cache off // the instance in memory so we can return it later without creating an // entirely new instances of the object on each subsequent request. - if (isset(static::$registry[$type]['singleton'])) + if (isset(static::$registry[$type]['singleton']) && static::$registry[$type]['singleton'] === true) { static::$singletons[$type] = $object; } From a03bcb521ba8099f9f935d4a8fac13058460e926 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 17 Jul 2012 23:51:00 +0300 Subject: [PATCH 51/83] Mention default value helper function in database schema documentation. --- laravel/documentation/database/schema.md | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/documentation/database/schema.md b/laravel/documentation/database/schema.md index 16ed318c..65c4e6ca 100644 --- a/laravel/documentation/database/schema.md +++ b/laravel/documentation/database/schema.md @@ -69,6 +69,7 @@ ## Adding Columns `$table->text('description');` | TEXT equivalent to the table `$table->blob('data');` | BLOB equivalent to the table `->nullable()` | Designate that the column allows NULL values +`->default($value)` | Declare a default value for a column > **Note:** Laravel's "boolean" type maps to a small integer column on all database systems. From 02e84eb5eb69322e1cf941c6c65a426a915b61cc Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 17 Jul 2012 23:56:43 +0300 Subject: [PATCH 52/83] Documentation: fix menu link to "Bundle Routes" section. --- laravel/documentation/contents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 63a2b86f..14b819a4 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -18,7 +18,7 @@ ### General - [Route Groups](/docs/routing#groups) - [Named Routes](/docs/routing#named-routes) - [HTTPS Routes](/docs/routing#https-routes) - - [Bundle Routing](/docs/routing#bundle-routing) + - [Bundle Routes](/docs/routing#bundle-routes) - [CLI Route Testing](/docs/routing#cli-route-testing) - [Controllers](/docs/controllers) - [The Basics](/docs/controllers#the-basics) From 61364c553ddbd1e809a39c20c14bca20e019d4ef Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 17 Jul 2012 23:47:05 +0200 Subject: [PATCH 53/83] Make sure default values in schema columns are always non-empty (especially booleans). --- laravel/database/schema/grammars/grammar.php | 15 +++++++++++++++ laravel/database/schema/grammars/mysql.php | 2 +- laravel/database/schema/grammars/postgres.php | 2 +- laravel/database/schema/grammars/sqlite.php | 2 +- laravel/database/schema/grammars/sqlserver.php | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/laravel/database/schema/grammars/grammar.php b/laravel/database/schema/grammars/grammar.php index da93aa64..62a55719 100644 --- a/laravel/database/schema/grammars/grammar.php +++ b/laravel/database/schema/grammars/grammar.php @@ -96,4 +96,19 @@ protected function type(Fluent $column) return $this->{'type_'.$column->type}($column); } + /** + * Format a value so that it can be used in SQL DEFAULT clauses. + * @param mixed $value + * @return string + */ + protected function default_value($value) + { + if (is_bool($value)) + { + return intval($value); + } + + return strval($value); + } + } \ No newline at end of file diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index fc9107d0..85fe4b31 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -128,7 +128,7 @@ protected function defaults(Table $table, Fluent $column) { if ( ! is_null($column->default)) { - return " DEFAULT '".$column->default."'"; + return " DEFAULT '".$this->default_value($column->default)."'"; } } diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 930c5160..d694b2b3 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -101,7 +101,7 @@ protected function defaults(Table $table, Fluent $column) { if ( ! is_null($column->default)) { - return " DEFAULT '".$column->default."'"; + return " DEFAULT '".$this->default_value($column->default)."'"; } } diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 09102f52..a1f2399a 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -127,7 +127,7 @@ protected function defaults(Table $table, Fluent $column) { if ( ! is_null($column->default)) { - return ' DEFAULT '.$this->wrap($column->default); + return ' DEFAULT '.$this->wrap($this->default_value($column->default)); } } diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index 5f756c2e..4c3fa99c 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -108,7 +108,7 @@ protected function defaults(Table $table, Fluent $column) { if ( ! is_null($column->default)) { - return " DEFAULT '".$column->default."'"; + return " DEFAULT '".$this->default_value($column->default)."'"; } } From d46b98199c7979b029ab8e53639990a0de0280fe Mon Sep 17 00:00:00 2001 From: Jakobud Date: Wed, 18 Jul 2012 15:59:19 -0600 Subject: [PATCH 54/83] Fixed some bugs with the docs bundle Signed-off-by: Jakobud --- bundles/docs/views/template.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 bundles/docs/views/template.blade.php diff --git a/bundles/docs/views/template.blade.php b/bundles/docs/views/template.blade.php old mode 100644 new mode 100755 index 20bf601f..658895e4 --- a/bundles/docs/views/template.blade.php +++ b/bundles/docs/views/template.blade.php @@ -6,8 +6,8 @@ Laravel: A Framework For Web Artisans - {{ HTML::style('laravel/css/style.css') }} - {{ HTML::style('laravel/js/modernizr-2.5.3.min.js') }} + {{ HTML::style(URL::$base.'/laravel/css/style.css') }} + {{ HTML::script(URL::$base.'/laravel/js/modernizr-2.5.3.min.js') }}
    @@ -28,7 +28,7 @@
    {{ HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js') }} - {{ HTML::script('laravel/js/prettify.js') }} - {{ HTML::script('laravel/js/scroll.js') }} + {{ HTML::script(URL::$base.'/laravel/js/prettify.js') }} + {{ HTML::script(URL::$base.'/laravel/js/scroll.js') }} - \ No newline at end of file + From 54f4cb2644e0ffe59d3fe936220282940dc31087 Mon Sep 17 00:00:00 2001 From: Rack Lin Date: Thu, 19 Jul 2012 12:55:23 +0800 Subject: [PATCH 55/83] Added support PostgreSQL schema setting, if schema has been specified. Signed-off-by: Rack Lin --- application/config/database.php | 1 + laravel/database/connectors/postgres.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/application/config/database.php b/application/config/database.php index d5e6ac1b..021bcce9 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -85,6 +85,7 @@ 'password' => '', 'charset' => 'utf8', 'prefix' => '', + 'schema' => 'public', ), 'sqlsrv' => array( diff --git a/laravel/database/connectors/postgres.php b/laravel/database/connectors/postgres.php index 3721f368..d4a54344 100644 --- a/laravel/database/connectors/postgres.php +++ b/laravel/database/connectors/postgres.php @@ -44,6 +44,13 @@ public function connect($config) $connection->prepare("SET NAMES '{$config['charset']}'")->execute(); } + // If a schema has been specified, we'll execute a query against + // the database to set the search path. + if (isset($config['schema'])) + { + $connection->prepare("SET search_path TO '{$config['schema']}'")->execute(); + } + return $connection; } From 19c64f1ea7d3eaab98f77dc9ea3be30236b5eddd Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 19 Jul 2012 15:39:18 -0500 Subject: [PATCH 56/83] return false on empty string for active url. --- laravel/validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/validator.php b/laravel/validator.php index 968e94b7..3bc4d703 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -581,7 +581,7 @@ protected function validate_active_url($attribute, $value) { $url = str_replace(array('http://', 'https://', 'ftp://'), '', Str::lower($value)); - return checkdnsrr($url); + return (trim($url) !== '') ? checkdnsrr($url) : false; } /** From 9944192af9ef971332d7cf08af2aca1a67ad1edd Mon Sep 17 00:00:00 2001 From: Rack Lin Date: Fri, 20 Jul 2012 22:20:37 +0800 Subject: [PATCH 57/83] Fixed Memcached get connection instance typo in __callStatic method. Signed-off-by: Rack Lin --- laravel/memcached.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/memcached.php b/laravel/memcached.php index 91e7270e..d66710bb 100644 --- a/laravel/memcached.php +++ b/laravel/memcached.php @@ -68,7 +68,7 @@ protected static function connect($servers) */ public static function __callStatic($method, $parameters) { - return call_user_func_array(array(static::instance(), $method), $parameters); + return call_user_func_array(array(static::connection(), $method), $parameters); } } \ No newline at end of file From 84fcb60f8b98293c8d5bf89e4cbc26913318cae1 Mon Sep 17 00:00:00 2001 From: Rob Meijer Date: Sat, 21 Jul 2012 20:16:57 +0100 Subject: [PATCH 58/83] Fix pivot table name in Many-to-Many section in Eloquent documentation. --- laravel/documentation/database/eloquent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index 71e3a402..b2caf7e8 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -242,7 +242,7 @@ ### Many-To-Many id - INTEGER name - VARCHAR -**Roles_Users:** +**Role_User:** id - INTEGER user_id - INTEGER From 0ea30993d4c11ee80d48a5bfc48685bc7ed82ea3 Mon Sep 17 00:00:00 2001 From: Josh Miller Date: Sat, 21 Jul 2012 20:18:55 -0400 Subject: [PATCH 59/83] Fixed various typos throughout laravel folder. Signed-off-by: Josh Miller --- application/language/bg/validation.php | 196 +++++++++--------- laravel/autoloader.php | 6 +- laravel/bundle.php | 4 +- laravel/cli/tasks/bundle/bundler.php | 4 +- .../cli/tasks/bundle/providers/provider.php | 4 +- laravel/cli/tasks/migrate/database.php | 2 +- laravel/cli/tasks/migrate/migrator.php | 4 +- laravel/cookie.php | 2 +- laravel/database/connection.php | 2 +- laravel/database/eloquent/model.php | 2 +- laravel/database/eloquent/query.php | 4 +- laravel/database/query.php | 6 +- laravel/database/query/grammars/grammar.php | 16 +- laravel/database/query/grammars/postgres.php | 2 +- laravel/database/schema.php | 2 +- laravel/database/schema/grammars/mysql.php | 6 +- laravel/database/schema/grammars/postgres.php | 6 +- laravel/database/schema/grammars/sqlite.php | 8 +- .../database/schema/grammars/sqlserver.php | 4 +- laravel/error.php | 2 +- laravel/file.php | 2 +- laravel/html.php | 2 +- laravel/ioc.php | 2 +- laravel/lang.php | 2 +- laravel/laravel.php | 4 +- laravel/log.php | 2 +- laravel/pluralizer.php | 4 +- laravel/redis.php | 2 +- laravel/routing/router.php | 2 +- laravel/session/drivers/database.php | 2 +- laravel/session/drivers/driver.php | 2 +- laravel/session/drivers/file.php | 2 +- laravel/session/drivers/sweeper.php | 2 +- laravel/session/payload.php | 2 +- laravel/url.php | 2 +- laravel/validator.php | 2 +- 36 files changed, 159 insertions(+), 159 deletions(-) diff --git a/application/language/bg/validation.php b/application/language/bg/validation.php index c76a6e92..4e46f6ff 100644 --- a/application/language/bg/validation.php +++ b/application/language/bg/validation.php @@ -1,99 +1,99 @@ - "Трябва да приемете :attribute.", - "active_url" => "Полето :attribute не е валиден URL адрес.", - "after" => "Полето :attribute трябва да бъде дата след :date.", - "alpha" => "Полето :attribute трябва да съдържа само букви.", - "alpha_dash" => "Полето :attribute трябва да съдържа само букви, цифри, долна черта и тире.", - "alpha_num" => "Полето :attribute трябва да съдържа само букви и цифри.", - "before" => "Полето :attribute трябва да бъде дата преди :date.", - "between" => array( - "numeric" => "Полето :attribute трябва да бъде между :min и :max.", - "file" => "Полето :attribute трябва да бъде между :min и :max килобайта.", - "string" => "Полето :attribute трябва да бъде между :min и :max знака.", - ), - "confirmed" => "Полето :attribute не е потвърдено.", - "different" => "Полетата :attribute и :other трябва да са различни.", - "email" => "Полето :attribute е с невалиден формат.", - "exists" => "Избраната стойност на :attribute вече съществува.", - "image" => "Полето :attribute трябва да бъде изображение.", - "in" => "Стойността на :attribute е невалидна.", - "integer" => "Полето :attribute трябва да бъде цяло число.", - "ip" => "Полето :attribute трябва да бъде IP адрес.", - "match" => "Полето :attribute е с невалиден формат.", - "max" => array( - "numeric" => "Полето :attribute трябва да бъде по-малко от :max.", - "file" => "Полето :attribute трябва да бъде по-малко от :max килобайта.", - "string" => "Полето :attribute трябва да бъде по-малко от :max знака.", - ), - "mimes" => "Полето :attribute трябва да бъде файл от тип: :values.", - "min" => array( - "numeric" => "Полето :attribute трябва да бъде минимум :min.", - "file" => "Полето :attribute трябва да бъде минимум :min килобайта.", - "string" => "Полето :attribute трябва да бъде минимум :min знака.", - ), - "not_in" => "Стойността на :attribute е невалидна.", - "numeric" => "Полето :attribute трябва да бъде число.", - "required" => "Полето :attribute е задължително.", - "same" => "Стойностите на :attribute и :other трябва да съвпадат.", - "size" => array( - "numeric" => "Полето :attribute трябва да бъде :size.", - "file" => "Полето :attribute трябва да бъде :size килобайта.", - "string" => "Полето :attribute трябва да бъде :size знака.", - ), - "unique" => "Стойността на :attribute вече съществува.", - "url" => "Полето :attribute е с невалиден формат.", - - /* - |-------------------------------------------------------------------------- - | Custom Validation Language Lines - |-------------------------------------------------------------------------- - | - | Here you may specify custom validation messages for attributes using the - | convention "attribute_rule" to name the lines. This helps keep your - | custom validation clean and tidy. - | - | So, say you want to use a custom validation message when validating that - | the "email" attribute is unique. Just add "email_unique" to this array - | with your custom message. The Validator will handle the rest! - | - */ - - 'custom' => array(), - - /* - |-------------------------------------------------------------------------- - | Validation Attributes - |-------------------------------------------------------------------------- - | - | The following language lines are used to swap attribute place-holders - | with something more reader friendly such as "E-Mail Address" instead - | of "email". Your users will thank you. - | - | The Validator class will automatically search this array of lines it - | is attempting to replace the :attribute place-holder in messages. - | It's pretty slick. We think you'll like it. - | - */ - - 'attributes' => array(), - + "Трябва да приемете :attribute.", + "active_url" => "Полето :attribute не е валиден URL адрес.", + "after" => "Полето :attribute трябва да бъде дата след :date.", + "alpha" => "Полето :attribute трябва да съдържа само букви.", + "alpha_dash" => "Полето :attribute трябва да съдържа само букви, цифри, долна черта и тире.", + "alpha_num" => "Полето :attribute трябва да съдържа само букви и цифри.", + "before" => "Полето :attribute трябва да бъде дата преди :date.", + "between" => array( + "numeric" => "Полето :attribute трябва да бъде между :min и :max.", + "file" => "Полето :attribute трябва да бъде между :min и :max килобайта.", + "string" => "Полето :attribute трябва да бъде между :min и :max знака.", + ), + "confirmed" => "Полето :attribute не е потвърдено.", + "different" => "Полетата :attribute и :other трябва да са различни.", + "email" => "Полето :attribute е с невалиден формат.", + "exists" => "Избраната стойност на :attribute вече съществува.", + "image" => "Полето :attribute трябва да бъде изображение.", + "in" => "Стойността на :attribute е невалидна.", + "integer" => "Полето :attribute трябва да бъде цяло число.", + "ip" => "Полето :attribute трябва да бъде IP адрес.", + "match" => "Полето :attribute е с невалиден формат.", + "max" => array( + "numeric" => "Полето :attribute трябва да бъде по-малко от :max.", + "file" => "Полето :attribute трябва да бъде по-малко от :max килобайта.", + "string" => "Полето :attribute трябва да бъде по-малко от :max знака.", + ), + "mimes" => "Полето :attribute трябва да бъде файл от тип: :values.", + "min" => array( + "numeric" => "Полето :attribute трябва да бъде минимум :min.", + "file" => "Полето :attribute трябва да бъде минимум :min килобайта.", + "string" => "Полето :attribute трябва да бъде минимум :min знака.", + ), + "not_in" => "Стойността на :attribute е невалидна.", + "numeric" => "Полето :attribute трябва да бъде число.", + "required" => "Полето :attribute е задължително.", + "same" => "Стойностите на :attribute и :other трябва да съвпадат.", + "size" => array( + "numeric" => "Полето :attribute трябва да бъде :size.", + "file" => "Полето :attribute трябва да бъде :size килобайта.", + "string" => "Полето :attribute трябва да бъде :size знака.", + ), + "unique" => "Стойността на :attribute вече съществува.", + "url" => "Полето :attribute е с невалиден формат.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + ); \ No newline at end of file diff --git a/laravel/autoloader.php b/laravel/autoloader.php index 68e423d2..4168e305 100644 --- a/laravel/autoloader.php +++ b/laravel/autoloader.php @@ -40,7 +40,7 @@ class Autoloader { /** * Load the file corresponding to a given class. * - * This method is registerd in the bootstrap file as an SPL auto-loader. + * This method is registered in the bootstrap file as an SPL auto-loader. * * @param string $class * @return void @@ -55,7 +55,7 @@ public static function load($class) return class_alias(static::$aliases[$class], $class); } - // All classes in Laravel are staticly mapped. There is no crazy search + // All classes in Laravel are statically mapped. There is no crazy search // routine that digs through directories. It's just a simple array of // class to file path maps for ultra-fast file loading. elseif (isset(static::$mappings[$class])) @@ -102,7 +102,7 @@ protected static function load_namespaced($class, $namespace, $directory) protected static function load_psr($class, $directory = null) { // The PSR-0 standard indicates that class namespaces and underscores - // should be used to indcate the directory tree in which the class + // should be used to indicate the directory tree in which the class // resides, so we'll convert them to slashes. $file = str_replace(array('\\', '_'), '/', $class); diff --git a/laravel/bundle.php b/laravel/bundle.php index 2259228e..4f44268b 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -66,7 +66,7 @@ public static function register($bundle, $config = array()) // 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. + // way to register mappings without a bootstrap. if (isset($config['autoloads'])) { static::autoloads($bundle, $config); @@ -201,7 +201,7 @@ public static function handles($uri) } /** - * Deteremine if a bundle exists within the bundles directory. + * Determine if a bundle exists within the bundles directory. * * @param string $bundle * @return bool diff --git a/laravel/cli/tasks/bundle/bundler.php b/laravel/cli/tasks/bundle/bundler.php index 9d369c21..7af60e07 100644 --- a/laravel/cli/tasks/bundle/bundler.php +++ b/laravel/cli/tasks/bundle/bundler.php @@ -49,7 +49,7 @@ public function install($bundles) // all of its registered dependencies as well. // // Each bundle provider implements the Provider interface and - // is repsonsible for retrieving the bundle source from its + // is responsible for retrieving the bundle source from its // hosting party and installing it into the application. $path = path('bundle').$this->path($bundle); @@ -135,7 +135,7 @@ protected function get($bundles) $responses[] = $bundle; - // We'll also get the bundle's declared dependenceis so they + // We'll also get the bundle's declared dependencies so they // can be installed along with the bundle, making it easy // to install a group of bundles. $dependencies = $this->get($bundle['dependencies']); diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index bf6401f7..258500c2 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -27,7 +27,7 @@ protected function zipball($url, $bundle, $path) // When installing a bundle from a Zip archive, we'll first clone // down the bundle zip into the bundles "working" directory so - // we have a spot to do all of our bundle extration work. + // we have a spot to do all of our bundle extraction work. $target = $work.'laravel-bundle.zip'; File::put($target, $this->download($url)); @@ -49,7 +49,7 @@ protected function zipball($url, $bundle, $path) // Once we have the latest modified directory, we should be // able to move its contents over into the bundles folder - // so the bundle will be usable by the develoepr. + // so the bundle will be usable by the developer. File::mvdir($latest, $path); File::rmdir($work.'zip'); diff --git a/laravel/cli/tasks/migrate/database.php b/laravel/cli/tasks/migrate/database.php index a6aae9d5..31fcf110 100644 --- a/laravel/cli/tasks/migrate/database.php +++ b/laravel/cli/tasks/migrate/database.php @@ -40,7 +40,7 @@ public function last() $table = $this->table(); // First we need to grab the last batch ID from the migration table, - // as this will allow us to grab the lastest batch of migrations + // as this will allow us to grab the latest batch of migrations // that need to be run for a rollback command. $id = $this->batch(); diff --git a/laravel/cli/tasks/migrate/migrator.php b/laravel/cli/tasks/migrate/migrator.php index 5bf7617b..68235abe 100644 --- a/laravel/cli/tasks/migrate/migrator.php +++ b/laravel/cli/tasks/migrate/migrator.php @@ -206,7 +206,7 @@ public function make($arguments = array()) // Once the migration has been created, we'll return the // migration file name so it can be used by the task - // consumer if necessary for futher work. + // consumer if necessary for further work. return $file; } @@ -223,7 +223,7 @@ protected function stub($bundle, $migration) $prefix = Bundle::class_prefix($bundle); - // The class name is formatted simialrly to tasks and controllers, + // The class name is formatted similarly to tasks and controllers, // where the bundle name is prefixed to the class if it is not in // the default "application" bundle. $class = $prefix.Str::classify($migration); diff --git a/laravel/cookie.php b/laravel/cookie.php index 1f79a69b..cedb0a07 100644 --- a/laravel/cookie.php +++ b/laravel/cookie.php @@ -77,7 +77,7 @@ public static function put($name, $value, $expiration = 0, $path = '/', $domain // If the secure option is set to true, yet the request is not over HTTPS // we'll throw an exception to let the developer know that they are - // attempting to send a secure cookie over the unsecure HTTP. + // attempting to send a secure cookie over the unsecured HTTP. if ($secure and ! Request::secure()) { throw new \Exception("Attempting to set secure cookie over HTTP."); diff --git a/laravel/database/connection.php b/laravel/database/connection.php index 26197736..bb6a5d1d 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -287,7 +287,7 @@ protected function fetch($statement, $style) { // If the fetch style is "class", we'll hydrate an array of PHP // stdClass objects as generic containers for the query rows, - // otherwise we'll just use the fetch styel value. + // otherwise we'll just use the fetch style value. if ($style === PDO::FETCH_CLASS) { return $statement->fetchAll(PDO::FETCH_CLASS, 'stdClass'); diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 8703f4c4..0782db14 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -768,7 +768,7 @@ public function __call($method, $parameters) $underscored = array('with', 'find'); - // Some methods need to be accessed both staticly and non-staticly so we'll + // Some methods need to be accessed both statically and non-statically so we'll // keep underscored methods of those methods and intercept calls to them // here so they can be called either way on the model instance. if (in_array($method, $underscored)) diff --git a/laravel/database/eloquent/query.php b/laravel/database/eloquent/query.php index 3aee79c9..f2158a9c 100644 --- a/laravel/database/eloquent/query.php +++ b/laravel/database/eloquent/query.php @@ -38,7 +38,7 @@ class Query { ); /** - * Creat a new query instance for a model. + * Create a new query instance for a model. * * @param Model $model * @return void @@ -118,7 +118,7 @@ public function hydrate($model, $results) $new = new $class(array(), true); // We need to set the attributes manually in case the accessible property is - // set on the array which will prevent the mass assignemnt of attributes if + // set on the array which will prevent the mass assignment of attributes if // we were to pass them in using the constructor or fill methods. $new->fill_raw($result); diff --git a/laravel/database/query.php b/laravel/database/query.php index 55e9606a..b60ca68a 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -168,7 +168,7 @@ public function join($table, $column1, $operator = null, $column2 = null, $type // If the column is just a string, we can assume that the join just // has a simple on clause, and we'll create the join instance and - // add the clause automatically for the develoepr. + // add the clause automatically for the developer. else { $join = new Query\Join($type, $table); @@ -686,7 +686,7 @@ public function paginate($per_page = 20, $columns = array('*')) { // Because some database engines may throw errors if we leave orderings // on the query when retrieving the total number of records, we'll drop - // all of the ordreings and put them back on the query. + // all of the orderings and put them back on the query. list($orderings, $this->orderings) = array($this->orderings, null); $total = $this->count(reset($columns)); @@ -852,7 +852,7 @@ public function __call($method, $parameters) } // All of the aggregate methods are handled by a single method, so we'll - // catch them all here and then pass them off to the agregate method + // catch them all here and then pass them off to the aggregate method // instead of creating methods for each one of them. if (in_array($method, array('count', 'min', 'max', 'avg', 'sum'))) { diff --git a/laravel/database/query/grammars/grammar.php b/laravel/database/query/grammars/grammar.php index 65c62cf3..c998aeb2 100644 --- a/laravel/database/query/grammars/grammar.php +++ b/laravel/database/query/grammars/grammar.php @@ -13,7 +13,7 @@ class Grammar extends \Laravel\Database\Grammar { public $datetime = 'Y-m-d H:i:s'; /** - * All of the query componenets in the order they should be built. + * All of the query components in the order they should be built. * * @var array */ @@ -149,7 +149,7 @@ protected function joins(Query $query) // The first clause will have a connector on the front, but it is // not needed on the first condition, so we will strip it off of - // the condition before adding it to the arrya of joins. + // the condition before adding it to the array of joins. $search = array('AND ', 'OR '); $clauses[0] = str_replace($search, '', $clauses[0]); @@ -343,7 +343,7 @@ protected function offset(Query $query) } /** - * Compile a SQL INSERT statment from a Query instance. + * Compile a SQL INSERT statement from a Query instance. * * This method handles the compilation of single row inserts and batch inserts. * @@ -366,7 +366,7 @@ public function insert(Query $query, $values) $columns = $this->columnize(array_keys(reset($values))); // Build the list of parameter place-holders of values bound to the query. - // Each insert should have the same number of bound paramters, so we can + // Each insert should have the same number of bound parameters, so we can // just use the first array of values. $parameters = $this->parameterize(reset($values)); @@ -376,7 +376,7 @@ public function insert(Query $query, $values) } /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values @@ -389,7 +389,7 @@ public function insert_get_id(Query $query, $values, $column) } /** - * Compile a SQL UPDATE statment from a Query instance. + * Compile a SQL UPDATE statement from a Query instance. * * @param Query $query * @param array $values @@ -410,13 +410,13 @@ public function update(Query $query, $values) $columns = implode(', ', $columns); // UPDATE statements may be constrained by a WHERE clause, so we'll run - // the entire where compilation process for those contraints. This is + // the entire where compilation process for those constraints. This is // easily achieved by passing it to the "wheres" method. return trim("UPDATE {$table} SET {$columns} ".$this->wheres($query)); } /** - * Compile a SQL DELETE statment from a Query instance. + * Compile a SQL DELETE statement from a Query instance. * * @param Query $query * @return string diff --git a/laravel/database/query/grammars/postgres.php b/laravel/database/query/grammars/postgres.php index 002b4cc7..6041ae82 100644 --- a/laravel/database/query/grammars/postgres.php +++ b/laravel/database/query/grammars/postgres.php @@ -5,7 +5,7 @@ class Postgres extends Grammar { /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values diff --git a/laravel/database/schema.php b/laravel/database/schema.php index c7e56309..757c4058 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -71,7 +71,7 @@ public static function execute($table) { // The implications method is responsible for finding any fluently // defined indexes on the schema table and adding the explicit - // commands that are needed to tbe schema instance. + // commands that are needed to the schema instance. static::implications($table); foreach ($table->commands as $command) diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index fc9107d0..d146933d 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -37,7 +37,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -284,7 +284,7 @@ public function drop_fulltext(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -353,7 +353,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 930c5160..f3417f29 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -25,7 +25,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -246,7 +246,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -339,7 +339,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 09102f52..3d21ced1 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -43,7 +43,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -214,7 +214,7 @@ public function drop(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -226,7 +226,7 @@ public function drop_unique(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -283,7 +283,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index 5f756c2e..7c081499 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -260,7 +260,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqiue key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -357,7 +357,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/error.php b/laravel/error.php index 729f632a..606ad64a 100644 --- a/laravel/error.php +++ b/laravel/error.php @@ -80,7 +80,7 @@ public static function native($code, $error, $file, $line) */ public static function shutdown() { - // If a fatal error occured that we have not handled yet, we will + // If a fatal error occurred that we have not handled yet, we will // create an ErrorException and feed it to the exception handler, // as it will not yet have been handled. $error = error_get_last(); diff --git a/laravel/file.php b/laravel/file.php index efb46dec..f7f71805 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -296,7 +296,7 @@ public static function rmdir($directory, $preserve = false) { // If the item is a directory, we can just recurse into the // function and delete that sub-directory, otherwise we'll - // just deleete the file and keep going! + // just delete the file and keep going! if ($item->isDir()) { static::rmdir($item->getRealPath()); diff --git a/laravel/html.php b/laravel/html.php index 498ea28c..801aa2ae 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -359,7 +359,7 @@ public static function attributes($attributes) foreach ((array) $attributes as $key => $value) { // For numeric keys, we will assume that the key and the value are the - // same, as this will conver HTML attributes such as "required" that + // same, as this will convert HTML attributes such as "required" that // may be specified as required="required", etc. if (is_numeric($key)) $key = $value; diff --git a/laravel/ioc.php b/laravel/ioc.php index 11292925..14f22bf0 100644 --- a/laravel/ioc.php +++ b/laravel/ioc.php @@ -191,7 +191,7 @@ protected static function dependencies($parameters) $dependency = $parameter->getClass(); // If the class is null, it means the dependency is a string or some other - // primitive type, which we can not esolve since it is not a class and + // primitive type, which we can not resolve since it is not a class and // we'll just bomb out with an error since we have nowhere to go. if (is_null($dependency)) { diff --git a/laravel/lang.php b/laravel/lang.php index 8fd5f7ba..fd3bf177 100644 --- a/laravel/lang.php +++ b/laravel/lang.php @@ -134,7 +134,7 @@ public function get($language = null, $default = null) $line = array_get($lines, $line, $default); // If the line is not a string, it probably means the developer asked for - // the entire langauge file and the value of the requested value will be + // the entire language file and the value of the requested value will be // an array containing all of the lines in the file. if (is_string($line)) { diff --git a/laravel/laravel.php b/laravel/laravel.php index a1ca2061..e00ed40e 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -54,7 +54,7 @@ |-------------------------------------------------------------------------- | | By setting error reporting to -1, we essentially force PHP to report -| every error, and this is guranteed to show every error on future +| every error, and this is guaranteed to show every error on future | releases of PHP. This allows everything to be fixed early! | */ @@ -143,7 +143,7 @@ |-------------------------------------------------------------------------- | | If a session driver has been configured, we will save the session to -| storage so it is avaiable for the next request. This will also set +| storage so it is available for the next request. This will also set | the session cookie in the cookie jar to be sent to the user. | */ diff --git a/laravel/log.php b/laravel/log.php index 4cd3a30e..870dcd0f 100644 --- a/laravel/log.php +++ b/laravel/log.php @@ -28,7 +28,7 @@ protected static function exception_line($e) * Write a message to the log file. * * - * // Write an "error" messge to the log file + * // Write an "error" message to the log file * Log::write('error', 'Something went horribly wrong!'); * * // Write an "error" message using the class' magic method diff --git a/laravel/pluralizer.php b/laravel/pluralizer.php index 857a7ff5..95c08bd3 100644 --- a/laravel/pluralizer.php +++ b/laravel/pluralizer.php @@ -48,7 +48,7 @@ public function singular($value) } // English words may be automatically inflected using regular expressions. - // If the word is english, we'll just pass off the word to the automatic + // If the word is English, we'll just pass off the word to the automatic // inflection method and return the result, which is cached. $irregular = $this->config['irregular']; @@ -77,7 +77,7 @@ public function plural($value, $count = 2) } // English words may be automatically inflected using regular expressions. - // If the word is english, we'll just pass off the word to the automatic + // If the word is English, we'll just pass off the word to the automatic // inflection method and return the result, which is cached. $irregular = array_flip($this->config['irregular']); diff --git a/laravel/redis.php b/laravel/redis.php index d00b2f52..02267d32 100644 --- a/laravel/redis.php +++ b/laravel/redis.php @@ -17,7 +17,7 @@ class Redis { protected $port; /** - * The databse number the connection selects on load. + * The database number the connection selects on load. * * @var int */ diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 00659a22..ec6b60ee 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -303,7 +303,7 @@ public static function controller($controllers, $defaults = 'index', $https = nu { list($bundle, $controller) = Bundle::parse($identifier); - // First we need to replace the dots with slashes in thte controller name + // First we need to replace the dots with slashes in the controller name // so that it is in directory format. The dots allow the developer to use // a cleaner syntax when specifying the controller. We will also grab the // root URI for the controller's bundle. diff --git a/laravel/session/drivers/database.php b/laravel/session/drivers/database.php index c094a91f..d151ee53 100644 --- a/laravel/session/drivers/database.php +++ b/laravel/session/drivers/database.php @@ -84,7 +84,7 @@ public function delete($id) } /** - * Delete all expired sessions from persistant storage. + * Delete all expired sessions from persistent storage. * * @param int $expiration * @return void diff --git a/laravel/session/drivers/driver.php b/laravel/session/drivers/driver.php index 8a54ac98..e5cef1ee 100644 --- a/laravel/session/drivers/driver.php +++ b/laravel/session/drivers/driver.php @@ -63,7 +63,7 @@ public function id() return Str::random(40); } - // We'll containue generating random IDs until we find an ID that is + // We'll continue generating random IDs until we find an ID that is // not currently assigned to a session. This is almost definitely // going to happen on the first iteration. do { diff --git a/laravel/session/drivers/file.php b/laravel/session/drivers/file.php index d7e3b98f..744f3737 100644 --- a/laravel/session/drivers/file.php +++ b/laravel/session/drivers/file.php @@ -64,7 +64,7 @@ public function delete($id) } /** - * Delete all expired sessions from persistant storage. + * Delete all expired sessions from persistent storage. * * @param int $expiration * @return void diff --git a/laravel/session/drivers/sweeper.php b/laravel/session/drivers/sweeper.php index a62ff622..45ecd17b 100644 --- a/laravel/session/drivers/sweeper.php +++ b/laravel/session/drivers/sweeper.php @@ -3,7 +3,7 @@ interface Sweeper { /** - * Delete all expired sessions from persistant storage. + * Delete all expired sessions from persistent storage. * * @param int $expiration * @return void diff --git a/laravel/session/payload.php b/laravel/session/payload.php index 5b45a533..1149951f 100644 --- a/laravel/session/payload.php +++ b/laravel/session/payload.php @@ -71,7 +71,7 @@ public function load($id) } /** - * Deteremine if the session payload instance is valid. + * Determine if the session payload instance is valid. * * The session is considered valid if it exists and has not expired. * diff --git a/laravel/url.php b/laravel/url.php index 44b89428..c421e560 100644 --- a/laravel/url.php +++ b/laravel/url.php @@ -102,7 +102,7 @@ public static function to($url = '', $https = null) } // Unless $https is specified (true or false) then maintain the current request - // security for any new links generated. So https for all secure links. + // security for any new links generated. So https for all secure links. if (is_null($https)) $https = Request::secure(); $root = static::base().'/'.Config::get('application.index'); diff --git a/laravel/validator.php b/laravel/validator.php index 968e94b7..8fd3a6c1 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -974,7 +974,7 @@ protected function attribute($attribute) // If no language line has been specified for the attribute, all of // the underscores are removed from the attribute name and that - // will be used as the attribtue name. + // will be used as the attribute name. else { return str_replace('_', ' ', $attribute); From 0a85a54c2fc022b5ed63389fa282d26220c551ac Mon Sep 17 00:00:00 2001 From: resurtm Date: Sun, 22 Jul 2012 21:48:11 +0600 Subject: [PATCH 60/83] Indentation fixes in html.php. --- laravel/html.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/laravel/html.php b/laravel/html.php index 498ea28c..da55012a 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -9,13 +9,13 @@ class HTML { */ public static $macros = array(); - /** - * Registers a custom macro. - * - * @param string $name - * @param Closure $input - * @return void - */ + /** + * Registers a custom macro. + * + * @param string $name + * @param Closure $input + * @return void + */ public static function macro($name, $macro) { static::$macros[$name] = $macro; From c60a58ff261a91d005a7a20d18660d72ab4e3980 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Mon, 23 Jul 2012 14:29:29 -0500 Subject: [PATCH 61/83] Someone else can re-word this, but a easy-to-find paragraph on deleteing Eloquent models seemed missing. Signed-off-by: Colin Viebrock --- laravel/documentation/database/eloquent.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index 71e3a402..7a7e1b9c 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -15,6 +15,7 @@ ## Contents - [Setter & Getter Methods](#getter-and-setter-methods) - [Mass-Assignment](#mass-assignment) - [Converting Models To Arrays](#to-array) +- [Deleting Models](#delete) ## The Basics @@ -331,7 +332,7 @@ ### Inserting Related Models (Many-To-Many) $user->roles()->attach($role_id); It's also possible to attach data for fields in the intermediate table (pivot table), to do this add a second array variable to the attach command containing the data you want to attach: - + $user->roles()->attach($role_id, array('expires' => $expires)); @@ -427,14 +428,14 @@ ## Eager Loading class Book extends Eloquent { public $includes = array('author'); - + public function author() { return $this->belongs_to('Author'); } } - + **$includes** takes the same arguments that **with** takes. The following is now eagerly loaded. foreach (Book::all() as $book) @@ -536,4 +537,13 @@ #### Excluding attributes from the array: public static $hidden = array('password'); - } \ No newline at end of file + } + + +## Deleting Models + +Because Eloquent inherits all the features and methods of Fluent queries, deleting models is a snap: + + $author->delete(); + +Note, however, than this won't delete any related models (e.g. all the author's Book models will still exist), unless you have set up [foreign keys](/docs/database/schema#foreign-keys) and cascading deletes. \ No newline at end of file From 289c02ab47737d263df9d13fc1db317188dac115 Mon Sep 17 00:00:00 2001 From: Jakobud Date: Mon, 23 Jul 2012 15:50:04 -0600 Subject: [PATCH 62/83] Added documentation for paginate's second optional argument. Signed-off-by: Jakobud --- laravel/documentation/views/pagination.md | 36 +++++++++++++---------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/laravel/documentation/views/pagination.md b/laravel/documentation/views/pagination.md index 602b09ba..95b5479b 100644 --- a/laravel/documentation/views/pagination.md +++ b/laravel/documentation/views/pagination.md @@ -22,6 +22,10 @@ #### Pull the paginated results from the query: $orders = DB::table('orders')->paginate($per_page); +You can also pass an optional array of table columns to select in the query: + + $orders = DB::table('orders')->paginate($per_page, array('id', 'name', 'created_at')); + #### Display the results in a view: results as $order): ?> @@ -75,30 +79,30 @@ ## Pagination Styling All pagination link elements can be style using CSS classes. Here is an example of the HTML elements generated by the links method: - When you are on the first page of results, the "Previous" link will be disabled. Likewise, the "Next" link will be disabled when you are on the last page of results. The generated HTML will look like this: - Previous \ No newline at end of file + Previous From 1c92b907d5f87198edd5f28152127d9d70c29a0a Mon Sep 17 00:00:00 2001 From: Tobsn Date: Tue, 24 Jul 2012 20:42:38 +0200 Subject: [PATCH 63/83] fixed two typos connecter class => connector class Therefor => Therefore --- laravel/documentation/database/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/database/config.md b/laravel/documentation/database/config.md index 2a1b0453..b593dbc6 100644 --- a/laravel/documentation/database/config.md +++ b/laravel/documentation/database/config.md @@ -49,7 +49,7 @@ ## Setting The Default Connection Name ##Overwriting The Default PDO Options -The PDO connecter class (**laravel/database/connectors/connector.php**) has a set of default PDO attributes defined which can be overwritten in the options array for each system. For example, one of the default attributes is to force column names to lowercase (**PDO::CASE_LOWER**) even if they are defined in UPPERCASE or CamelCase in the table. Therefor, under the default attributes, query result object variables would only be accessible in lowercase. +The PDO connector class (**laravel/database/connectors/connector.php**) has a set of default PDO attributes defined which can be overwritten in the options array for each system. For example, one of the default attributes is to force column names to lowercase (**PDO::CASE_LOWER**) even if they are defined in UPPERCASE or CamelCase in the table. Therefore, under the default attributes, query result object variables would only be accessible in lowercase. An example of the MySQL system settings with added default PDO attributes: 'mysql' => array( From 6cb2ddad641d39f97d1834245b8630ac46698c08 Mon Sep 17 00:00:00 2001 From: Tobsn Date: Wed, 25 Jul 2012 00:21:32 +0200 Subject: [PATCH 64/83] multiline echo and comments for issue #647 --- laravel/blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/blade.php b/laravel/blade.php index f224614a..efc88aa5 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -186,9 +186,9 @@ protected static function extract($value, $expression) */ protected static function compile_comments($value) { - $value = preg_replace('/\{\{--(.+?)(--\}\})?\n/', "", $value); + $value = preg_replace('/\{\{--(.+?)(--\}\})?\n/s', "", $value); - return preg_replace('/\{\{--((.|\s)*?)--\}\}/', "\n", $value); + return preg_replace('/\{\{--((.|\s)*?)--\}\}/s', "\n", $value); } /** @@ -199,7 +199,7 @@ protected static function compile_comments($value) */ protected static function compile_echos($value) { - return preg_replace('/\{\{(.+?)\}\}/', '', $value); + return preg_replace('/\{\{(.+?)\}\}/s', '', $value); } /** From 34c746b4f8901a6b7ac61077d3074f1ff9d33798 Mon Sep 17 00:00:00 2001 From: Tobsn Date: Wed, 25 Jul 2012 00:23:31 +0200 Subject: [PATCH 65/83] added @continue like @break - as of request issue #1001 --- laravel/blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/blade.php b/laravel/blade.php index efc88aa5..b95bf6c2 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -306,7 +306,7 @@ function($matches) use (&$value) */ protected static function compile_structure_closings($value) { - $pattern = '/@(endif|endforeach|endfor|endwhile|break)/'; + $pattern = '/@(endif|endforeach|endfor|endwhile|break|continue)/'; return preg_replace($pattern, '', $value); } From a1914d65f027594abf5761d1af788f3d0a81a2ed Mon Sep 17 00:00:00 2001 From: stupoh Date: Wed, 25 Jul 2012 12:49:56 +0700 Subject: [PATCH 66/83] Added Indonesian language files Signed-off-by: stupoh --- application/language/id/pagination.php | 19 +++++ application/language/id/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/id/pagination.php create mode 100644 application/language/id/validation.php diff --git a/application/language/id/pagination.php b/application/language/id/pagination.php new file mode 100644 index 00000000..7cdad20b --- /dev/null +++ b/application/language/id/pagination.php @@ -0,0 +1,19 @@ + '« Sebelumnya', + 'next' => 'Selanjutnya »', + +); \ No newline at end of file diff --git a/application/language/id/validation.php b/application/language/id/validation.php new file mode 100644 index 00000000..3eafa4cc --- /dev/null +++ b/application/language/id/validation.php @@ -0,0 +1,99 @@ + "Isian :attribute harus diterima.", + "active_url" => "Isian :attribute bukan URL yang valid.", + "after" => "Isian :attribute harus tanggal setelah :date.", + "alpha" => "Isian :attribute hanya boleh berisi huruf.", + "alpha_dash" => "Isian :attribute hanya boleh berisi huruf, angka, dan strip.", + "alpha_num" => "Isian :attribute hanya boleh berisi huruf dan angka.", + "before" => "Isian :attribute harus tanggal sebelum :date.", + "between" => array( + "numeric" => "Isian :attribute harus antara :min - :max.", + "file" => "Isian :attribute harus antara :min - :max kilobytes.", + "string" => "Isian :attribute harus antara :min - :max karakter.", + ), + "confirmed" => "Konfirmasi :attribute tidak cocok.", + "different" => "Isian :attribute dan :other harus berbeda.", + "email" => "Format isian :attribute tidak valid.", + "exists" => "Isian :attribute yang dipilih tidak valid.", + "image" => ":attribute harus berupa gambar.", + "in" => "Isian :attribute yang dipilih tidak valid.", + "integer" => "Isian :attribute harus merupakan bilangan.", + "ip" => "Isian :attribute harus alamat IP yang valid.", + "match" => "Format isian :attribute tidak valid.", + "max" => array( + "numeric" => "Isian :attribute harus kurang dari :max.", + "file" => "Isian :attribute harus kurang dari :max kilobytes.", + "string" => "Isian :attribute harus kurang dari :max karakter.", + ), + "mimes" => "Isian :attribute harus dokumen berjenis : :values.", + "min" => array( + "numeric" => "Isian :attribute harus minimal :min.", + "file" => "Isian :attribute harus minimal :min kilobytes.", + "string" => "Isian :attribute harus minimal :min karakter.", + ), + "not_in" => "Isian :attribute yang dipilih tidak valid.", + "numeric" => "Isian :attribute harus berupa angka.", + "required" => "Isian :attribute wajib diisi.", + "same" => "Isian :attribute dan :other harus sama.", + "size" => array( + "numeric" => "Isian :attribute harus berukuran :size.", + "file" => "Isian :attribute harus berukuran :size kilobyte.", + "string" => "Isian :attribute harus berukuran :size karakter.", + ), + "unique" => "Isian :attribute sudah ada sebelumnya.", + "url" => "Format isian :attribute tidak valid.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file From 2f48bbba12283c1dc3c76acf8ab70d583b4079c5 Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Wed, 25 Jul 2012 17:28:02 +0300 Subject: [PATCH 67/83] Update laravel/documentation/views/home.md Response::view() does not take a status code as the second parameter. --- laravel/documentation/views/home.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/views/home.md b/laravel/documentation/views/home.md index be646393..e74a0c43 100644 --- a/laravel/documentation/views/home.md +++ b/laravel/documentation/views/home.md @@ -56,7 +56,7 @@ #### Returning a custom response: #### Returning a custom response containing a view: - return Response::view('home', 200, $headers); + return Response::view('home', $headers); #### Returning a JSON response: From 7475bcd3480aaa5a6897437c7e903b040fd96010 Mon Sep 17 00:00:00 2001 From: Jakobud Date: Wed, 25 Jul 2012 10:08:54 -0600 Subject: [PATCH 68/83] Added documentation for the @render() Blade method Signed-off-by: Jakobud --- laravel/documentation/views/templating.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/laravel/documentation/views/templating.md b/laravel/documentation/views/templating.md index a2273c19..d9756e26 100644 --- a/laravel/documentation/views/templating.md +++ b/laravel/documentation/views/templating.md @@ -64,18 +64,21 @@ ## Blade Template Engine #### Echoing a variable using Blade: Hello, {{$name}}. - + #### Echoing function results using Blade: {{ Asset::styles() }} -#### Rendering a view: +#### Render a view: + +You can use **@include** to render a view into another view. The rendered view will automatically inherit all of the data from the current view.

    Profile - @include('user.profile') -> **Note:** When using the **@include** Blade expression, the view will automatically inherit all of the current view data. +Similarly, you can use **@render**, which behaves the same as **@include** except the rendered view will **not** inherit the data from the current view. + + @render('admin.list') #### Creating loops using Blade: @@ -124,7 +127,7 @@ #### The "unless" control structure: #### Blade comments: - + @if ($check) {{-- This is a comment --}} ... @@ -179,4 +182,4 @@ ## Blade Layouts Welcome to the profile page! @endsection -Notice the **@parent** Blade construct? It will be replaced with the contents of the layout's navigation section, providing you with a beautiful and powerful method of performing layout extension and inheritance. \ No newline at end of file +Notice the **@parent** Blade construct? It will be replaced with the contents of the layout's navigation section, providing you with a beautiful and powerful method of performing layout extension and inheritance. From 8a34aa50774106de838500c6e63f80c7664bdb0c Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Tue, 24 Jul 2012 09:31:27 +0000 Subject: [PATCH 69/83] Fixed typos --- bundles/docs/routes.php | 2 +- laravel/autoloader.php | 6 +++--- laravel/bundle.php | 4 ++-- laravel/cli/command.php | 2 +- laravel/cli/tasks/bundle/bundler.php | 2 +- laravel/cli/tasks/bundle/providers/provider.php | 2 +- laravel/cli/tasks/migrate/database.php | 2 +- laravel/cli/tasks/migrate/migrator.php | 4 ++-- laravel/cookie.php | 2 +- laravel/database/eloquent/model.php | 2 +- laravel/database/eloquent/query.php | 2 +- laravel/database/query.php | 4 ++-- laravel/database/query/grammars/grammar.php | 16 ++++++++-------- laravel/database/query/grammars/postgres.php | 2 +- laravel/database/schema/grammars/mysql.php | 8 ++++---- laravel/database/schema/grammars/postgres.php | 4 ++-- laravel/database/schema/grammars/sqlite.php | 4 ++-- laravel/database/schema/grammars/sqlserver.php | 6 +++--- laravel/documentation/bundles.md | 2 +- laravel/documentation/database/eloquent.md | 2 +- laravel/documentation/database/fluent.md | 2 +- laravel/documentation/database/schema.md | 2 +- laravel/documentation/ioc.md | 2 +- laravel/documentation/localization.md | 2 +- laravel/documentation/logging.md | 2 +- laravel/documentation/requests.md | 2 +- laravel/documentation/routing.md | 4 ++-- laravel/documentation/validation.md | 2 +- laravel/documentation/views/html.md | 2 +- laravel/documentation/views/templating.md | 2 +- laravel/error.php | 4 ++-- laravel/file.php | 2 +- laravel/html.php | 2 +- laravel/ioc.php | 2 +- laravel/lang.php | 2 +- laravel/laravel.php | 4 ++-- laravel/redis.php | 2 +- laravel/response.php | 2 +- laravel/routing/router.php | 2 +- laravel/session/drivers/database.php | 2 +- laravel/session/drivers/driver.php | 2 +- laravel/validator.php | 2 +- paths.php | 2 +- 43 files changed, 65 insertions(+), 65 deletions(-) diff --git a/bundles/docs/routes.php b/bundles/docs/routes.php index 334c652d..0193ed51 100644 --- a/bundles/docs/routes.php +++ b/bundles/docs/routes.php @@ -38,7 +38,7 @@ function document_exists($page) } /** - * Attach the sidebar to the documentatoin template. + * Attach the sidebar to the documentation template. */ View::composer('docs::template', function($view) { diff --git a/laravel/autoloader.php b/laravel/autoloader.php index 68e423d2..4168e305 100644 --- a/laravel/autoloader.php +++ b/laravel/autoloader.php @@ -40,7 +40,7 @@ class Autoloader { /** * Load the file corresponding to a given class. * - * This method is registerd in the bootstrap file as an SPL auto-loader. + * This method is registered in the bootstrap file as an SPL auto-loader. * * @param string $class * @return void @@ -55,7 +55,7 @@ public static function load($class) return class_alias(static::$aliases[$class], $class); } - // All classes in Laravel are staticly mapped. There is no crazy search + // All classes in Laravel are statically mapped. There is no crazy search // routine that digs through directories. It's just a simple array of // class to file path maps for ultra-fast file loading. elseif (isset(static::$mappings[$class])) @@ -102,7 +102,7 @@ protected static function load_namespaced($class, $namespace, $directory) protected static function load_psr($class, $directory = null) { // The PSR-0 standard indicates that class namespaces and underscores - // should be used to indcate the directory tree in which the class + // should be used to indicate the directory tree in which the class // resides, so we'll convert them to slashes. $file = str_replace(array('\\', '_'), '/', $class); diff --git a/laravel/bundle.php b/laravel/bundle.php index 2259228e..4f44268b 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -66,7 +66,7 @@ public static function register($bundle, $config = array()) // 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. + // way to register mappings without a bootstrap. if (isset($config['autoloads'])) { static::autoloads($bundle, $config); @@ -201,7 +201,7 @@ public static function handles($uri) } /** - * Deteremine if a bundle exists within the bundles directory. + * Determine if a bundle exists within the bundles directory. * * @param string $bundle * @return bool diff --git a/laravel/cli/command.php b/laravel/cli/command.php index 7b4ae3af..f1144738 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -100,7 +100,7 @@ protected static function parse($task) * // Resolve an instance of a task * $task = Command::resolve('application', 'migrate'); * - * // Resolve an instance of a task wtihin a bundle + * // Resolve an instance of a task within a bundle * $task = Command::resolve('bundle', 'foo'); * * diff --git a/laravel/cli/tasks/bundle/bundler.php b/laravel/cli/tasks/bundle/bundler.php index 9d369c21..6fcb93a6 100644 --- a/laravel/cli/tasks/bundle/bundler.php +++ b/laravel/cli/tasks/bundle/bundler.php @@ -135,7 +135,7 @@ protected function get($bundles) $responses[] = $bundle; - // We'll also get the bundle's declared dependenceis so they + // We'll also get the bundle's declared dependencies so they // can be installed along with the bundle, making it easy // to install a group of bundles. $dependencies = $this->get($bundle['dependencies']); diff --git a/laravel/cli/tasks/bundle/providers/provider.php b/laravel/cli/tasks/bundle/providers/provider.php index bf6401f7..c94bde3f 100644 --- a/laravel/cli/tasks/bundle/providers/provider.php +++ b/laravel/cli/tasks/bundle/providers/provider.php @@ -49,7 +49,7 @@ protected function zipball($url, $bundle, $path) // Once we have the latest modified directory, we should be // able to move its contents over into the bundles folder - // so the bundle will be usable by the develoepr. + // so the bundle will be usable by the developer. File::mvdir($latest, $path); File::rmdir($work.'zip'); diff --git a/laravel/cli/tasks/migrate/database.php b/laravel/cli/tasks/migrate/database.php index a6aae9d5..31fcf110 100644 --- a/laravel/cli/tasks/migrate/database.php +++ b/laravel/cli/tasks/migrate/database.php @@ -40,7 +40,7 @@ public function last() $table = $this->table(); // First we need to grab the last batch ID from the migration table, - // as this will allow us to grab the lastest batch of migrations + // as this will allow us to grab the latest batch of migrations // that need to be run for a rollback command. $id = $this->batch(); diff --git a/laravel/cli/tasks/migrate/migrator.php b/laravel/cli/tasks/migrate/migrator.php index 5bf7617b..68235abe 100644 --- a/laravel/cli/tasks/migrate/migrator.php +++ b/laravel/cli/tasks/migrate/migrator.php @@ -206,7 +206,7 @@ public function make($arguments = array()) // Once the migration has been created, we'll return the // migration file name so it can be used by the task - // consumer if necessary for futher work. + // consumer if necessary for further work. return $file; } @@ -223,7 +223,7 @@ protected function stub($bundle, $migration) $prefix = Bundle::class_prefix($bundle); - // The class name is formatted simialrly to tasks and controllers, + // The class name is formatted similarly to tasks and controllers, // where the bundle name is prefixed to the class if it is not in // the default "application" bundle. $class = $prefix.Str::classify($migration); diff --git a/laravel/cookie.php b/laravel/cookie.php index 1f79a69b..52192b67 100644 --- a/laravel/cookie.php +++ b/laravel/cookie.php @@ -77,7 +77,7 @@ public static function put($name, $value, $expiration = 0, $path = '/', $domain // If the secure option is set to true, yet the request is not over HTTPS // we'll throw an exception to let the developer know that they are - // attempting to send a secure cookie over the unsecure HTTP. + // attempting to send a secure cookie over the insecure HTTP. if ($secure and ! Request::secure()) { throw new \Exception("Attempting to set secure cookie over HTTP."); diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 2c28b8f9..82c92bd0 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -746,7 +746,7 @@ public function __call($method, $parameters) $underscored = array('with', 'find'); - // Some methods need to be accessed both staticly and non-staticly so we'll + // Some methods need to be accessed both statically and non-statically so we'll // keep underscored methods of those methods and intercept calls to them // here so they can be called either way on the model instance. if (in_array($method, $underscored)) diff --git a/laravel/database/eloquent/query.php b/laravel/database/eloquent/query.php index 3aee79c9..92caa49c 100644 --- a/laravel/database/eloquent/query.php +++ b/laravel/database/eloquent/query.php @@ -118,7 +118,7 @@ public function hydrate($model, $results) $new = new $class(array(), true); // We need to set the attributes manually in case the accessible property is - // set on the array which will prevent the mass assignemnt of attributes if + // set on the array which will prevent the mass assignment of attributes if // we were to pass them in using the constructor or fill methods. $new->fill_raw($result); diff --git a/laravel/database/query.php b/laravel/database/query.php index 83c92b83..16ff1ecc 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -168,7 +168,7 @@ public function join($table, $column1, $operator = null, $column2 = null, $type // If the column is just a string, we can assume that the join just // has a simple on clause, and we'll create the join instance and - // add the clause automatically for the develoepr. + // add the clause automatically for the developer. else { $join = new Query\Join($type, $table); @@ -869,7 +869,7 @@ public function __call($method, $parameters) } // All of the aggregate methods are handled by a single method, so we'll - // catch them all here and then pass them off to the agregate method + // catch them all here and then pass them off to the aggregate method // instead of creating methods for each one of them. if (in_array($method, array('count', 'min', 'max', 'avg', 'sum'))) { diff --git a/laravel/database/query/grammars/grammar.php b/laravel/database/query/grammars/grammar.php index 65c62cf3..c998aeb2 100644 --- a/laravel/database/query/grammars/grammar.php +++ b/laravel/database/query/grammars/grammar.php @@ -13,7 +13,7 @@ class Grammar extends \Laravel\Database\Grammar { public $datetime = 'Y-m-d H:i:s'; /** - * All of the query componenets in the order they should be built. + * All of the query components in the order they should be built. * * @var array */ @@ -149,7 +149,7 @@ protected function joins(Query $query) // The first clause will have a connector on the front, but it is // not needed on the first condition, so we will strip it off of - // the condition before adding it to the arrya of joins. + // the condition before adding it to the array of joins. $search = array('AND ', 'OR '); $clauses[0] = str_replace($search, '', $clauses[0]); @@ -343,7 +343,7 @@ protected function offset(Query $query) } /** - * Compile a SQL INSERT statment from a Query instance. + * Compile a SQL INSERT statement from a Query instance. * * This method handles the compilation of single row inserts and batch inserts. * @@ -366,7 +366,7 @@ public function insert(Query $query, $values) $columns = $this->columnize(array_keys(reset($values))); // Build the list of parameter place-holders of values bound to the query. - // Each insert should have the same number of bound paramters, so we can + // Each insert should have the same number of bound parameters, so we can // just use the first array of values. $parameters = $this->parameterize(reset($values)); @@ -376,7 +376,7 @@ public function insert(Query $query, $values) } /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values @@ -389,7 +389,7 @@ public function insert_get_id(Query $query, $values, $column) } /** - * Compile a SQL UPDATE statment from a Query instance. + * Compile a SQL UPDATE statement from a Query instance. * * @param Query $query * @param array $values @@ -410,13 +410,13 @@ public function update(Query $query, $values) $columns = implode(', ', $columns); // UPDATE statements may be constrained by a WHERE clause, so we'll run - // the entire where compilation process for those contraints. This is + // the entire where compilation process for those constraints. This is // easily achieved by passing it to the "wheres" method. return trim("UPDATE {$table} SET {$columns} ".$this->wheres($query)); } /** - * Compile a SQL DELETE statment from a Query instance. + * Compile a SQL DELETE statement from a Query instance. * * @param Query $query * @return string diff --git a/laravel/database/query/grammars/postgres.php b/laravel/database/query/grammars/postgres.php index 002b4cc7..6041ae82 100644 --- a/laravel/database/query/grammars/postgres.php +++ b/laravel/database/query/grammars/postgres.php @@ -5,7 +5,7 @@ class Postgres extends Grammar { /** - * Compile a SQL INSERT and get ID statment from a Query instance. + * Compile a SQL INSERT and get ID statement from a Query instance. * * @param Query $query * @param array $values diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index c2ae7455..1ea34a80 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -37,7 +37,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -260,7 +260,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -284,7 +284,7 @@ public function drop_fulltext(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -353,7 +353,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 930c5160..123bc152 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -246,7 +246,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -339,7 +339,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 09102f52..f84f758d 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -214,7 +214,7 @@ public function drop(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -226,7 +226,7 @@ public function drop_unique(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqique key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index 5f756c2e..49cb7db7 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -32,7 +32,7 @@ public function create(Table $table, Fluent $command) } /** - * Geenrate the SQL statements for a table modification command. + * Generate the SQL statements for a table modification command. * * @param Table $table * @param Fluent $command @@ -260,7 +260,7 @@ public function drop_primary(Table $table, Fluent $command) } /** - * Generate the SQL statement for a drop unqiue key command. + * Generate the SQL statement for a drop unique key command. * * @param Table $table * @param Fluent $command @@ -357,7 +357,7 @@ protected function type_float(Fluent $column) } /** - * Generate the data-type definintion for a decimal. + * Generate the data-type definition for a decimal. * * @param Fluent $column * @return string diff --git a/laravel/documentation/bundles.md b/laravel/documentation/bundles.md index 2f72dbb5..674deb25 100644 --- a/laravel/documentation/bundles.md +++ b/laravel/documentation/bundles.md @@ -21,7 +21,7 @@ ## The Basics ## Creating Bundles -The first step in creating a bundle is to create a folder for the bundle within your **bundles** directory. For this example, let's create an "admin" bundle, which could house the administrator back-end to our application. The **application/start.php** file provides some basic configuration that helps to define how our application will run. Likewise we'll create a **start.php** file within our new bundle folder for the same purpose. It is run everytime the bundle is loaded. Let's create it: +The first step in creating a bundle is to create a folder for the bundle within your **bundles** directory. For this example, let's create an "admin" bundle, which could house the administrator back-end to our application. The **application/start.php** file provides some basic configuration that helps to define how our application will run. Likewise we'll create a **start.php** file within our new bundle folder for the same purpose. It is run every time the bundle is loaded. Let's create it: #### Creating a bundle start.php file: diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index 0706b7d9..989570e6 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -223,7 +223,7 @@ ### One-To-Many return $this->has_many('Comment', 'my_foreign_key'); -You may be wondering: _If the dynamic properties return the relationship and require less keystokes, why would I ever use the relationship methods?_ Actually, relationship methods are very powerful. They allow you to continue to chain query methods before retrieving the relationship. Check this out: +You may be wondering: _If the dynamic properties return the relationship and require less keystrokes, why would I ever use the relationship methods?_ Actually, relationship methods are very powerful. They allow you to continue to chain query methods before retrieving the relationship. Check this out: echo Post::find(1)->comments()->order_by('votes', 'desc')->take(10)->get(); diff --git a/laravel/documentation/database/fluent.md b/laravel/documentation/database/fluent.md index 6ab34476..1f726540 100644 --- a/laravel/documentation/database/fluent.md +++ b/laravel/documentation/database/fluent.md @@ -169,7 +169,7 @@ ## Table Joins $join->on('users.id', '=', 'phone.user_id'); $join->or_on('users.id', '=', 'phone.contact_id'); }) - ->get(array('users.email', 'phone.numer')); + ->get(array('users.email', 'phone.number')); ## Ordering Results diff --git a/laravel/documentation/database/schema.md b/laravel/documentation/database/schema.md index 16ed318c..189dcf42 100644 --- a/laravel/documentation/database/schema.md +++ b/laravel/documentation/database/schema.md @@ -13,7 +13,7 @@ ## Contents ## The Basics -The Schema Bulder provides methods for creating and modifying your database tables. Using a fluent syntax, you can work with your tables without using any vendor specific SQL. +The Schema Builder provides methods for creating and modifying your database tables. Using a fluent syntax, you can work with your tables without using any vendor specific SQL. *Further Reading:* diff --git a/laravel/documentation/ioc.md b/laravel/documentation/ioc.md index bd393178..7df9572b 100644 --- a/laravel/documentation/ioc.md +++ b/laravel/documentation/ioc.md @@ -24,7 +24,7 @@ #### Registering a resolver in the IoC container: }); -Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the intial instance is created. Just tell the container the object should be a singleton: +Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the initial instance is created. Just tell the container the object should be a singleton: #### Registering a singleton in the container: diff --git a/laravel/documentation/localization.md b/laravel/documentation/localization.md index c928a49c..cbf4a463 100644 --- a/laravel/documentation/localization.md +++ b/laravel/documentation/localization.md @@ -55,7 +55,7 @@ #### Getting a language line in a given language: ## Place Holders & Replacements -Now, let's work on our welcome message. "Welcome to our website!" is a pretty generic message. It would be helpful to be able to specify the name of the person we are welcoming. But, creating a language line for each user of our application would be time-consuming and ridiculous. Thankfully, you don't have to. You can specify "place-holders" within your language lines. Place-holders are preceeded by a colon: +Now, let's work on our welcome message. "Welcome to our website!" is a pretty generic message. It would be helpful to be able to specify the name of the person we are welcoming. But, creating a language line for each user of our application would be time-consuming and ridiculous. Thankfully, you don't have to. You can specify "place-holders" within your language lines. Place-holders are preceded by a colon: #### Creating a language line with place-holders: diff --git a/laravel/documentation/logging.md b/laravel/documentation/logging.md index c1533387..74678c65 100644 --- a/laravel/documentation/logging.md +++ b/laravel/documentation/logging.md @@ -24,7 +24,7 @@ ## Logging To enable logging, set the **log** option in the error configuration to "true". When enabled, the Closure defined by the **logger** configuration item will be executed when an error occurs. This gives you total flexibility in how the error should be logged. You can even e-mail the errors to your development team! -By default, logs are stored in the **storage/logs** direcetory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages. +By default, logs are stored in the **storage/logs** directory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages. ## The Logger Class diff --git a/laravel/documentation/requests.md b/laravel/documentation/requests.md index 8498b3ed..5a7426e2 100644 --- a/laravel/documentation/requests.md +++ b/laravel/documentation/requests.md @@ -62,7 +62,7 @@ #### Determining if the current request is using HTTPS: // This request is over HTTPS! } -#### Determing if the current request is an AJAX request: +#### Determining if the current request is an AJAX request: if (Request::ajax()) { diff --git a/laravel/documentation/routing.md b/laravel/documentation/routing.md index 18c90671..ba741690 100644 --- a/laravel/documentation/routing.md +++ b/laravel/documentation/routing.md @@ -99,14 +99,14 @@ #### The default 404 event handler: You are free to change this to fit the needs of your application! -*Futher Reading:* +*Further Reading:* - *[Events](/docs/events)* ## Filters -Route filters may be run before or after a route is executed. If a "before" filter returns a value, that value is considered the response to the request and the route is not executed, which is conveniont when implementing authentication filters, etc. Filters are typically defined in **application/routes.php**. +Route filters may be run before or after a route is executed. If a "before" filter returns a value, that value is considered the response to the request and the route is not executed, which is convenient when implementing authentication filters, etc. Filters are typically defined in **application/routes.php**. #### Registering a filter: diff --git a/laravel/documentation/validation.md b/laravel/documentation/validation.md index 4da4683c..e8164109 100644 --- a/laravel/documentation/validation.md +++ b/laravel/documentation/validation.md @@ -344,7 +344,7 @@ #### Specifying a custom error message for a given attribute: However, if you are using many custom error messages, specifying inline may become cumbersome and messy. For that reason, you can specify your custom messages in the **custom** array within the validation language file: -#### Adding custom error messages to the validation langauge file: +#### Adding custom error messages to the validation language file: 'custom' => array( 'email_required' => 'We need to know your e-mail address!', diff --git a/laravel/documentation/views/html.md b/laravel/documentation/views/html.md index d1fcae9b..2dc0c152 100644 --- a/laravel/documentation/views/html.md +++ b/laravel/documentation/views/html.md @@ -15,7 +15,7 @@ ## Content ## Entities -When displaying user input in your Views, it is important to convert all characters which have signifance in HTML to their "entity" representation. +When displaying user input in your Views, it is important to convert all characters which have significance in HTML to their "entity" representation. For example, the < symbol should be converted to its entity representation. Converting HTML characters to their entity representation helps protect your application from cross-site scripting: diff --git a/laravel/documentation/views/templating.md b/laravel/documentation/views/templating.md index 8849f0e1..3887848d 100644 --- a/laravel/documentation/views/templating.md +++ b/laravel/documentation/views/templating.md @@ -10,7 +10,7 @@ ## Contents ## The Basics -Your application probably uses a common layout across most of its pages. Manually creating this layout within every controller action can be a pain. Specifying a controller layout will make your develompent much more enjoyable. Here's how to get started: +Your application probably uses a common layout across most of its pages. Manually creating this layout within every controller action can be a pain. Specifying a controller layout will make your development much more enjoyable. Here's how to get started: #### Specify a "layout" property on your controller: diff --git a/laravel/error.php b/laravel/error.php index 729f632a..ac2e4d15 100644 --- a/laravel/error.php +++ b/laravel/error.php @@ -60,7 +60,7 @@ public static function native($code, $error, $file, $line) { if (error_reporting() === 0) return; - // For a PHP error, we'll create an ErrorExcepetion and then feed that + // For a PHP error, we'll create an ErrorException and then feed that // exception to the exception method, which will create a simple view // of the exception details for the developer. $exception = new \ErrorException($error, $code, 0, $file, $line); @@ -80,7 +80,7 @@ public static function native($code, $error, $file, $line) */ public static function shutdown() { - // If a fatal error occured that we have not handled yet, we will + // If a fatal error occurred that we have not handled yet, we will // create an ErrorException and feed it to the exception handler, // as it will not yet have been handled. $error = error_get_last(); diff --git a/laravel/file.php b/laravel/file.php index efb46dec..f7f71805 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -296,7 +296,7 @@ public static function rmdir($directory, $preserve = false) { // If the item is a directory, we can just recurse into the // function and delete that sub-directory, otherwise we'll - // just deleete the file and keep going! + // just delete the file and keep going! if ($item->isDir()) { static::rmdir($item->getRealPath()); diff --git a/laravel/html.php b/laravel/html.php index da55012a..c8956b1c 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -359,7 +359,7 @@ public static function attributes($attributes) foreach ((array) $attributes as $key => $value) { // For numeric keys, we will assume that the key and the value are the - // same, as this will conver HTML attributes such as "required" that + // same, as this will convert HTML attributes such as "required" that // may be specified as required="required", etc. if (is_numeric($key)) $key = $value; diff --git a/laravel/ioc.php b/laravel/ioc.php index 11292925..b5301e32 100644 --- a/laravel/ioc.php +++ b/laravel/ioc.php @@ -179,7 +179,7 @@ protected static function build($type, $parameters = array()) /** * Resolve all of the dependencies from the ReflectionParameters. * - * @param array $parameterrs + * @param array $parameters * @return array */ protected static function dependencies($parameters) diff --git a/laravel/lang.php b/laravel/lang.php index 8fd5f7ba..fd3bf177 100644 --- a/laravel/lang.php +++ b/laravel/lang.php @@ -134,7 +134,7 @@ public function get($language = null, $default = null) $line = array_get($lines, $line, $default); // If the line is not a string, it probably means the developer asked for - // the entire langauge file and the value of the requested value will be + // the entire language file and the value of the requested value will be // an array containing all of the lines in the file. if (is_string($line)) { diff --git a/laravel/laravel.php b/laravel/laravel.php index a1ca2061..e00ed40e 100644 --- a/laravel/laravel.php +++ b/laravel/laravel.php @@ -54,7 +54,7 @@ |-------------------------------------------------------------------------- | | By setting error reporting to -1, we essentially force PHP to report -| every error, and this is guranteed to show every error on future +| every error, and this is guaranteed to show every error on future | releases of PHP. This allows everything to be fixed early! | */ @@ -143,7 +143,7 @@ |-------------------------------------------------------------------------- | | If a session driver has been configured, we will save the session to -| storage so it is avaiable for the next request. This will also set +| storage so it is available for the next request. This will also set | the session cookie in the cookie jar to be sent to the user. | */ diff --git a/laravel/redis.php b/laravel/redis.php index d00b2f52..02267d32 100644 --- a/laravel/redis.php +++ b/laravel/redis.php @@ -17,7 +17,7 @@ class Redis { protected $port; /** - * The databse number the connection selects on load. + * The database number the connection selects on load. * * @var int */ diff --git a/laravel/response.php b/laravel/response.php index b6fa4d84..338aa0e3 100644 --- a/laravel/response.php +++ b/laravel/response.php @@ -106,7 +106,7 @@ public static function json($data, $status = 200, $headers = array()) * return Response::eloquent($data, 200, array('header' => 'value')); * * - * @param Eloquenet|array $data + * @param Eloquent|array $data * @param int $status * @param array $headers * @return Response diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 7c4888a2..5a93752e 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -303,7 +303,7 @@ public static function controller($controllers, $defaults = 'index', $https = nu { list($bundle, $controller) = Bundle::parse($identifier); - // First we need to replace the dots with slashes in thte controller name + // First we need to replace the dots with slashes in the controller name // so that it is in directory format. The dots allow the developer to use // a cleaner syntax when specifying the controller. We will also grab the // root URI for the controller's bundle. diff --git a/laravel/session/drivers/database.php b/laravel/session/drivers/database.php index c094a91f..d151ee53 100644 --- a/laravel/session/drivers/database.php +++ b/laravel/session/drivers/database.php @@ -84,7 +84,7 @@ public function delete($id) } /** - * Delete all expired sessions from persistant storage. + * Delete all expired sessions from persistent storage. * * @param int $expiration * @return void diff --git a/laravel/session/drivers/driver.php b/laravel/session/drivers/driver.php index 8a54ac98..e5cef1ee 100644 --- a/laravel/session/drivers/driver.php +++ b/laravel/session/drivers/driver.php @@ -63,7 +63,7 @@ public function id() return Str::random(40); } - // We'll containue generating random IDs until we find an ID that is + // We'll continue generating random IDs until we find an ID that is // not currently assigned to a session. This is almost definitely // going to happen on the first iteration. do { diff --git a/laravel/validator.php b/laravel/validator.php index 3290bc17..09eb6f29 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -953,7 +953,7 @@ protected function attribute($attribute) // If no language line has been specified for the attribute, all of // the underscores are removed from the attribute name and that - // will be used as the attribtue name. + // will be used as the attribute name. else { return str_replace('_', ' ', $attribute); diff --git a/paths.php b/paths.php index 3a6622ff..78d5a02f 100644 --- a/paths.php +++ b/paths.php @@ -10,7 +10,7 @@ /* |---------------------------------------------------------------- -| Application Environemtns +| Application Environments |---------------------------------------------------------------- | | Laravel takes a dead simple approach to environments, and we From 3e699a19788854cb103c4e59cfce9cfbc01de30c Mon Sep 17 00:00:00 2001 From: Spir Date: Fri, 27 Jul 2012 18:18:04 +0200 Subject: [PATCH 70/83] Added french translation. Signed-off-by: Spir --- application/language/fr/pagination.php | 19 +++++ application/language/fr/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/fr/pagination.php create mode 100644 application/language/fr/validation.php diff --git a/application/language/fr/pagination.php b/application/language/fr/pagination.php new file mode 100644 index 00000000..30b85534 --- /dev/null +++ b/application/language/fr/pagination.php @@ -0,0 +1,19 @@ + '« Précédent', + 'next' => 'Suivant »', + +); diff --git a/application/language/fr/validation.php b/application/language/fr/validation.php new file mode 100644 index 00000000..f5810be8 --- /dev/null +++ b/application/language/fr/validation.php @@ -0,0 +1,99 @@ + "Le champ :attribute doit être accepté.", + "active_url" => "Le champ :attribute n'est pas une URL valide.", + "after" => "Le champ :attribute doit être une date après :date.", + "alpha" => "Le champ :attribute ne doit contenir que des lettres.", + "alpha_dash" => "Le champ :attribute ne doit contenir que des lettres, nombres et des tirets.", + "alpha_num" => "Le champ :attribute ne doit contenir que des lettres et nombres.", + "before" => "Le champ :attribute doit être une date avant :date.", + "between" => array( + "numeric" => "Le champ :attribute doit être entre :min - :max.", + "file" => "Le champ :attribute doit être entre :min - :max kilo-octets.", + "string" => "Le champ :attribute doit être entre :min - :max caractères.", + ), + "confirmed" => "Le champ :attribute confirmation est différent.", + "different" => "Les champ :attribute et :other doivent être différents.", + "email" => "Le format du champ :attribute est invalide.", + "exists" => "Le champ sélectionné :attribute est invalide.", + "image" => "Le champ :attribute doit être une image.", + "in" => "Le champ sélectionné :attribute est invalide.", + "integer" => "Le champ :attribute doit être un entier.", + "ip" => "Le champ :attribute doit être une adresse IP valide.", + "match" => "Le format du champ :attribute est invalide.", + "max" => array( + "numeric" => "Le :attribute doit être plus petit que :max.", + "file" => "Le :attribute doit être plus petit que :max kilo-octets.", + "string" => "Le :attribute doit être plus petit que :max caractères.", + ), + "mimes" => "Le champ :attribute doit être un fichier de type: :values.", + "min" => array( + "numeric" => "Le champ :attribute doit être au moins :min.", + "file" => "Le champ :attribute doit être au moins :min kilo-octets.", + "string" => "Le champ :attribute doit être au moins :min caractères.", + ), + "not_in" => "Le champ sélectionné :attribute est invalide.", + "numeric" => "Le champ :attribute doit être un nombre.", + "required" => "Le champ :attribute est requis", + "same" => "Le champ :attribute et :other doivent être identique.", + "size" => array( + "numeric" => "Le champ :attribute doit être :size.", + "file" => "Le champ :attribute doit être de :size kilo-octets.", + "string" => "Le champ :attribute doit être de :size caractères.", + ), + "unique" => "Le champ :attribute est déjà utilisé.", + "url" => "Le champ :attribute à un format invalide.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); From 5622f6e35ced71674f85d8c366168bf4711eeaa7 Mon Sep 17 00:00:00 2001 From: Jakobud Date: Fri, 27 Jul 2012 11:28:40 -0600 Subject: [PATCH 71/83] Added basic GitHub contribution docs. --- laravel/documentation/contents.md | 10 ++++++++- laravel/documentation/contrib/github.md | 30 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 laravel/documentation/contrib/github.md diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 14b819a4..7b67f188 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -108,4 +108,12 @@ ### Artisan CLI - [Creating & Running Tasks](/docs/artisan/tasks#creating-tasks) - [Bundle Tasks](/docs/artisan/tasks#bundle-tasks) - [CLI Options](/docs/artisan/tasks#cli-options) -- [Commands](/docs/artisan/commands) \ No newline at end of file +- [Commands](/docs/artisan/commands) + +### Contributing + +- [Coding Standards](docs/contrib/coding) +- [Laravel on GitHub](docs/contrib/github) +- [Command Line](docs/contrib/command-line) +- [TortoiseGit](docs/contrib/tortoisegit) + diff --git a/laravel/documentation/contrib/github.md b/laravel/documentation/contrib/github.md new file mode 100644 index 00000000..3ffa734f --- /dev/null +++ b/laravel/documentation/contrib/github.md @@ -0,0 +1,30 @@ +# Laravel on GitHub + +## Contents + +- [The Basics](#the-basics) +- [Repositories](#repositoriess) +- [Branches](#branches) + + +## The Basics + +Because Laravel's development and source control is done through GitHub, anyone is able to make contributions to it. Anyone can fix bugs, add features or improve the documentation. + +After submitting proposed changes to the project, the Laravel project managers will review the changes and make the decision to commit them to Laravel's core. + + +## Repositories + +Laravel's home on GitHub is at [github.com/laravel](https://github.com/laravel). Laravel has several repositories. For basic contributions, the only repository you need to pay attention to is the **laravel** repository, located at [github.com/laravel/laravel](https://github.com/laravel/laravel). + + +## Branches + +The **laravel** repository has multiple branches, each serving a specific purpose: + +- **master** - This is the Laravel release branch. Active development does not happen on this branch. This branch is only for the most recent, stable Laravel core code. When you download Laravel from [laravel.com](http://laravel.com/), you are downloading directly from this master branch. *Do not make pull requests to this branch.* +- **staging** - I'm not sure what this is for... Last minute testing before pushing develop to master? +- **develop** - This is the working development branch. All proposed code changes and contributions by the community are pulled into this branch. *When you make a pull request to the Laravel project, this is the branch you want to pull-request into.* + +Once certain milestones have been reached and Taylor Otwell and other Laravel project managers are happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use. From ce7de95a1b9b87dd848cfe3212b1ba8dd599e73b Mon Sep 17 00:00:00 2001 From: Norbert Csaba Herczeg Date: Sat, 28 Jul 2012 11:09:29 +0200 Subject: [PATCH 72/83] Added Hungarian language pack Signed-off-by: Norbert Csaba Herczeg --- application/language/hu/pagination.php | 19 +++++ application/language/hu/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/hu/pagination.php create mode 100644 application/language/hu/validation.php diff --git a/application/language/hu/pagination.php b/application/language/hu/pagination.php new file mode 100644 index 00000000..00104344 --- /dev/null +++ b/application/language/hu/pagination.php @@ -0,0 +1,19 @@ + '« Előző', + 'next' => 'Következő »', + +); \ No newline at end of file diff --git a/application/language/hu/validation.php b/application/language/hu/validation.php new file mode 100644 index 00000000..30b2a0ca --- /dev/null +++ b/application/language/hu/validation.php @@ -0,0 +1,99 @@ + "A(z) :attribute el kell legyen fogadva.", + "active_url" => "A :attribute nem valós URL.", + "after" => "A :attribute :date utáni dátum kell legyen.", + "alpha" => "A(z) :attribute csak betűket tartalmazhat.", + "alpha_dash" => "A(z) :attribute betűket, számokat és kötőjeleket tartalmazhat.", + "alpha_num" => "A(z) :attribute csak betűket és számokat tartalmazhat.", + "before" => "A :attribute :date előtti dátum kell legyen.", + "between" => array( + "numeric" => "A(z) :attribute :min - :max közötti érték kell legyen.", + "file" => "A(z) :attribute :min - :max kilobyte között kell legyen.", + "string" => "A(z) :attribute :min - :max karakterhossz között kell legyen", + ), + "confirmed" => "A(z) :attribute megerősítése nem egyezett meg.", + "different" => "A(z) :attribute és :other különböző kell legyen.", + "email" => "A(z) :attribute formátuma nem megfelelő.", + "exists" => "A(z) választott :attribute nem megfelelő.", + "image" => "A(z) :attribute kép kell legyen.", + "in" => "A(z) választott :attribute nem megfelelő.", + "integer" => "A :attribute szám kell legyen.", + "ip" => "A :attribute valós IP cím kell legyen.", + "match" => "A(z) :attribute formátuma nem megfelelő.", + "max" => array( + "numeric" => "A :attribute kevesebb kell legyen, mint :max.", + "file" => "A :attribute kevesebb kell legyen :max kilobytenál.", + "string" => "A :attribute kevesebb karakterből kell álljon, mint :max.", + ), + "mimes" => "A :attribute az alábbi tipusokból való kell legyen :values.", + "min" => array( + "numeric" => "A :attribute legalább :min kell legyen.", + "file" => "A :attribute legalább :min kilobyte kell legyen.", + "string" => "A :attribute legalább :min karakter hosszú kell legyen.", + ), + "not_in" => "A választott :attribute nem megfelelő.", + "numeric" => "A :attribute szám kell legyen.", + "required" => "A(z) :attribute megadása kötelező.", + "same" => "A :attribute és a :other muszáj hogy megegyezzen.", + "size" => array( + "numeric" => "A(z) :attribute :size kell legyen.", + "file" => "A(z) :attribute :size kilobyteos kell legyen.", + "string" => "A(z) :attribute :size karakteres kell legyen.", + ), + "unique" => "A(z) :attribute már foglalt.", + "url" => "A(z) :attribute formátuma nem megfelelő.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file From a497a3efcb95d1b8761c94475f1d2419cffaf814 Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Sat, 28 Jul 2012 13:58:11 +0200 Subject: [PATCH 73/83] changed header to data --- laravel/documentation/views/home.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/laravel/documentation/views/home.md b/laravel/documentation/views/home.md index e74a0c43..fa74b0c2 100644 --- a/laravel/documentation/views/home.md +++ b/laravel/documentation/views/home.md @@ -54,9 +54,10 @@ #### Returning a custom response: return Response::make('Hello World!', 200, $headers); }); -#### Returning a custom response containing a view: +#### Returning a custom response containing a view, with binding data: - return Response::view('home', $headers); + $data = array('foo' => 'bar'); + return Response::view('home', $data); #### Returning a JSON response: @@ -257,4 +258,4 @@ #### Generating a 404 error response: #### Generating a 500 error response: - return Response::error('500'); \ No newline at end of file + return Response::error('500'); From 65ccdef48d9e6338596e826ccb7ce102ce845786 Mon Sep 17 00:00:00 2001 From: BeQuery Date: Sat, 28 Jul 2012 15:18:46 +0200 Subject: [PATCH 74/83] Dutch language pack Added dutch translation --- application/language/nl/pagination.php | 19 +++++ application/language/nl/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/nl/pagination.php create mode 100644 application/language/nl/validation.php diff --git a/application/language/nl/pagination.php b/application/language/nl/pagination.php new file mode 100644 index 00000000..69487a4a --- /dev/null +++ b/application/language/nl/pagination.php @@ -0,0 +1,19 @@ + '« Vorige', + 'next' => 'Volgende »', + +); \ No newline at end of file diff --git a/application/language/nl/validation.php b/application/language/nl/validation.php new file mode 100644 index 00000000..33c702c2 --- /dev/null +++ b/application/language/nl/validation.php @@ -0,0 +1,99 @@ + "De :attribute moet worden geaccepteerd.", + "active_url" => "De :attribute is geen geldige URL.", + "after" => "De :attribute moet een datum zijn na :date.", + "alpha" => "De :attribute mag alleen letters bevatten.", + "alpha_dash" => "De :attribute mag alleen letters, nummers, en strepen bevatten.", + "alpha_num" => "De :attribute mag alleen letters en nummers bevatten", + "before" => "De :attribute moet een datim zijn voor :date.", + "between" => array( + "numeric" => "De :attribute moet tussen :min - :max zijn.", + "file" => "De :attribute moet tussen :min - :max kilobytes zijn.", + "string" => "De :attribute moet tussen :min - :max karakters zijn.", + ), + "confirmed" => "De :attribute bevestiging komt niet overeen.", + "different" => "De :attribute en :other moeten verschillen van elkaar.", + "email" => "De :attribute is ongeldig.", + "exists" => "De geselecteerde :attribute is ongeldig.", + "image" => "De :attribute moet een plaatje zijn.", + "in" => "De geselecteerde :attribute is ongeldig.", + "integer" => "De :attribute moet een heel getal zijn.", + "ip" => "De :attribute moet een geldig IP-adres zijn.", + "match" => "De :attribute formaat is ongeldig.", + "max" => array( + "numeric" => "De :attribute moet minder zijn als :max.", + "file" => "De :attribute moet kleiner zijn als :max kilobytes.", + "string" => "De :attribute moet korter zijn dan :max karakters.", + ), + "mimes" => "De :attribute moet een van de volgende bestandsformaten :values bevatten", + "min" => array( + "numeric" => "De :attribute moet meer zijn als :min.", + "file" => "De :attribute moet groter zijn als :min kilobytes.", + "string" => "De :attribute moet langer zijn dan :min karakters.", + ), + "not_in" => "De geselecteerde :attribute is ongeldig.", + "numeric" => "De :attribute moet een nummer zijn.", + "required" => "De :attribute veld is vereist.", + "same" => "De :attribute en :other moeten overeen komen.", + "size" => array( + "numeric" => "De :attribute moet :size groot zijn.", + "file" => "De :attribute moet :size kilobytes groot zijn.", + "string" => "De :attribute moet :size karakters bevatten.", + ), + "unique" => "De :attribute bestaat al.", + "url" => "De :attribute formaat is ongeldig.", + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute_rule" to name the lines. This helps keep your + | custom validation clean and tidy. + | + | So, say you want to use a custom validation message when validating that + | the "email" attribute is unique. Just add "email_unique" to this array + | with your custom message. The Validator will handle the rest! + | + */ + + 'custom' => array(), + + /* + |-------------------------------------------------------------------------- + | Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as "E-Mail Address" instead + | of "email". Your users will thank you. + | + | The Validator class will automatically search this array of lines it + | is attempting to replace the :attribute place-holder in messages. + | It's pretty slick. We think you'll like it. + | + */ + + 'attributes' => array(), + +); \ No newline at end of file From 0dd1af665fc7f7b96235abc3e8041e872f2a963e Mon Sep 17 00:00:00 2001 From: Tao Wu Date: Sun, 29 Jul 2012 12:44:58 +0200 Subject: [PATCH 75/83] changes binding data variable to an array --- laravel/documentation/views/home.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/laravel/documentation/views/home.md b/laravel/documentation/views/home.md index fa74b0c2..27383562 100644 --- a/laravel/documentation/views/home.md +++ b/laravel/documentation/views/home.md @@ -56,8 +56,7 @@ #### Returning a custom response: #### Returning a custom response containing a view, with binding data: - $data = array('foo' => 'bar'); - return Response::view('home', $data); + return Response::view('home', array('foo' => 'bar')); #### Returning a JSON response: From 5eef0023742f32fb408e8203a3d985bb8e532538 Mon Sep 17 00:00:00 2001 From: apathetic012 Date: Sun, 29 Jul 2012 19:12:44 +0800 Subject: [PATCH 76/83] add output of File::mime() example Signed-off-by: apathetic012 --- laravel/documentation/files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/files.md b/laravel/documentation/files.md index a27d10e5..2a3d055d 100644 --- a/laravel/documentation/files.md +++ b/laravel/documentation/files.md @@ -65,7 +65,7 @@ ## Getting MIME Types #### Getting the MIME type associated with an extension: - echo File::mime('gif'); + echo File::mime('gif'); // outputs 'image/gif' > **Note:** This method simply returns the MIME type defined for the extension in the **application/config/mimes.php** file. From c7890bcdc3fb8febd0664ec98d2e61b68c0b3724 Mon Sep 17 00:00:00 2001 From: J Bruni Date: Sun, 29 Jul 2012 09:01:16 -0300 Subject: [PATCH 77/83] Update laravel/documentation/controllers.md Included missing verb in "Bundles can easily configured" sentence. --- laravel/documentation/controllers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/controllers.md b/laravel/documentation/controllers.md index 220c10af..0f8555f2 100644 --- a/laravel/documentation/controllers.md +++ b/laravel/documentation/controllers.md @@ -49,7 +49,7 @@ ## Controller Routing ## Bundle Controllers -Bundles are Laravel's modular package system. Bundles can easily configured to handle requests to your application. We'll be going over [bundles in more detail](/docs/bundles) in another document. +Bundles are Laravel's modular package system. Bundles can be easily configured to handle requests to your application. We'll be going over [bundles in more detail](/docs/bundles) in another document. Creating controllers that belong to bundles is almost identical to creating your application controllers. Just prefix the controller class name with the name of the bundle, so if your bundle is named "admin", your controller classes would look like this: From 37dbeef2bb15b068ae6bb6bba463848883770a19 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 30 Jul 2012 13:48:55 +0300 Subject: [PATCH 78/83] Use LARAVEL_START constant to calculate request time. Suggested by @Kindari. --- laravel/request.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/laravel/request.php b/laravel/request.php index a37360a2..306a94c1 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -181,20 +181,11 @@ public static function referrer() /** * Get the timestamp of the time when the request was started. * - * The value is actually calculated when this function gets first called. - * * @return int */ public static function time() { - static $time; - - if (!isset($time)) - { - $time = time(); - } - - return $time; + return (int) LARAVEL_START; } /** From 72d091ee5471c08e1649e5561771c9b81eb1c71c Mon Sep 17 00:00:00 2001 From: Jakobud Date: Mon, 30 Jul 2012 10:19:42 -0600 Subject: [PATCH 79/83] Added first draft of command-line contributing docs. Added empty files for coding standards and tortoisegit docs. Adjusted Contributions in the Table of Contents sidebar. Signed-off-by: Jakobud --- laravel/documentation/contents.md | 2 +- laravel/documentation/contrib/coding.md | 0 laravel/documentation/contrib/command-line.md | 123 ++++++++++++++++++ laravel/documentation/contrib/github.md | 4 +- laravel/documentation/contrib/tortoisegit.md | 0 5 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 laravel/documentation/contrib/coding.md create mode 100644 laravel/documentation/contrib/command-line.md create mode 100644 laravel/documentation/contrib/tortoisegit.md diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 7b67f188..288b0b68 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -112,8 +112,8 @@ ### Artisan CLI ### Contributing -- [Coding Standards](docs/contrib/coding) - [Laravel on GitHub](docs/contrib/github) - [Command Line](docs/contrib/command-line) - [TortoiseGit](docs/contrib/tortoisegit) +- [Coding Standards](docs/contrib/coding) diff --git a/laravel/documentation/contrib/coding.md b/laravel/documentation/contrib/coding.md new file mode 100644 index 00000000..e69de29b diff --git a/laravel/documentation/contrib/command-line.md b/laravel/documentation/contrib/command-line.md new file mode 100644 index 00000000..e50e1758 --- /dev/null +++ b/laravel/documentation/contrib/command-line.md @@ -0,0 +1,123 @@ +# Command Line + +## Contents + - [Getting Started](#getting-started) + - [Forking Laravel](#forking-laravel) + - [Cloning Laravel](#cloning-laravel) + - [Creating Branches](#creating-branches) + - [Committing](#committing) + - [Submitting a Pull Request](#submitting-a-pull-request) + - [What's Next?](#whats-next) + + +## Getting Started + +This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/). The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project. + +This tutorial assumes that you have installed [Git](http://git-scm.com/) and that you have created a [GitHub account](https://github.com/signup/free). If you haven't already, look at the documentation for [Laravel on GitHub](/docs/contrib/github) in order to familiarize yourself with Laravel's repositories and branches. + +*[Jason Lewis](http://jasonlewis.me/)'s blog post on [Contributing to a GitHub Project](http://jasonlewis.me/blog/2012/06/how-to-contributing-to-a-github-project) was the inspiration for this tutorial.* + + +## Forking Laravel + +Login to GitHub and visit the [Laravel Repository](https://github.com/laravel/laravel). Click on the **Fork** button. This will create your own fork of Laravel in your own GitHub account. Your Laravel fork will be located at **https://github.com/username/laravel** (your GitHub username will be used in place of *username*). + + +## Cloning Laravel + +Open up the command-line or terminal and make a new directory where you can make development changes to Laravel: + + # mkdir laravel-develop + # cd laravel-develop + +Next, clone the Laravel repository (not your fork you made): + + # git clone https://github.com/laravel/laravel.git . + +The reason you are cloning the original Laravel repository (and not the fork you made) is so you can use it to always have the latest Laravel development code. If you simply clone the fork you made, you would have to re-fork the Laravel repository again every time you want the latest changes to Laravel development code. + +Next, it's time to add the fork you made as a **remote repository**: + + # git remote add fork git@github.com:username/laravel.git + +Remember to replace **username** with your GitHub username. *This is case-sensitive*. You can verify that your fork was added by typing: + + # git remote + +Now you have a pristine clone of the Laravel repository along with your fork as a remote repository. You are ready to begin branching for new features or fixing bugs. + + +## Creating Branches + +First, make sure you are working in the **develop** branch. If you submit changes to the **master** branch, it is unlikely they will be pulled in anytime in the near future. For more information on this, read the documentation for [Laravel on GitHub](/docs/contrib/github). To switch to the develop branch: + + # git checkout develop + +Next, you want to make sure you are up-to-date with the latest Laravel repository. If any new features or bug fixes have been added to the Laravel project since you cloned it, this will ensure that your local repository has all of those changes. This important step is the reason we originally cloned the Laravel repository instead of your own fork. + + # git pull origin develop + +Now you are ready to create a new branch. + +> **Create a new branch for every new feature or bug-fix.** Why? Let's say you make a new branch and add 5 different new features and fix 12 bugs. If one or more of your new features or bug-fixes are rejected by the Laravel team (for whatever reason) your entire pull request will be ignored, even if most of your new features or bug-fixes are perfect. On top of this, separate branches will encourage organization and limit interdependency between new features and bug-fixes that you add. + +When you create a new branch, use a self-descriptive naming convention. For example, if there is a bug in Eloquent that you want to fix, name your branch accordingly: + + # git branch bug/eloquent + # git checkout bug/eloquent + Switched to branch 'bug/eloquent' + +Or if there is a new feature or change to the documentation that you want to make, for example, the localization documentation: + + # git branch feature/localization-docs + # git checkout feature/localization-docs + Switched to branch 'feature/localization-docs' + +Now that you have created your own branch and have switched to it, it's time to make your changes to the code. Add your new feature or fix that bug. + + +## Committing + +Now that you have finished coding and testing your changes, it's time to commit them to your local repository. First, add the files that you changed/added: + + # git add laravel/documentation/localization.md + +Next, commit the changes to the repository: + + # git commit -s -m "I added some more stuff to the Localization documentation." + + - **-s** means that you are signing-off on your commit with your name. This tells the Laravel team know that you personally agree to your code being added to the Laravel core. + - **-m** is the message that goes with your commit. Provide a brief explanation of what you added or changed. + + +## Pushing to your Fork + +Now that your local repository has your committed changes, it's time to push (or sync) your new branch to your fork that is hosted in GitHub: + + # git push fork feature/localization-docs + + +## Submitting a Pull Request + +The final step is to submit a pull request to the Laravel repository. This means that you are requesting that the Laravel team pull and merge your changes to the Laravel core. In your browser, visit your Laravel fork at [https://github.com/username/laravel](https://github.com/username/laravel). Click on **Pull Request**. Next, make sure you choose the proper base and head repositories and branches: + + - **base repo:** laravel/laravel + - **base branch:** develop + - **head repo:** username/laravel + - **head branch:** feature/localization-docs + +Use the form to write a more detailed description of the changes you made and why you made them. Finally, click **Send pull request**. That's it! The changes you made have been submitted to the Laravel team. + + +## What's Next? + +Do you have another feature you want to add or another bug you need to fix? First, make sure you always base your new branch off of the develop branch: + + # git checkout develop + +Then, pull down the latest changes from Laravel's repository: + + # git pull origin develop + +Now you are ready to create a new branch and start coding again! diff --git a/laravel/documentation/contrib/github.md b/laravel/documentation/contrib/github.md index 3ffa734f..5d0003ad 100644 --- a/laravel/documentation/contrib/github.md +++ b/laravel/documentation/contrib/github.md @@ -11,7 +11,7 @@ ## The Basics Because Laravel's development and source control is done through GitHub, anyone is able to make contributions to it. Anyone can fix bugs, add features or improve the documentation. -After submitting proposed changes to the project, the Laravel project managers will review the changes and make the decision to commit them to Laravel's core. +After submitting proposed changes to the project, the Laravel team will review the changes and make the decision to commit them to Laravel's core. ## Repositories @@ -27,4 +27,4 @@ ## Branches - **staging** - I'm not sure what this is for... Last minute testing before pushing develop to master? - **develop** - This is the working development branch. All proposed code changes and contributions by the community are pulled into this branch. *When you make a pull request to the Laravel project, this is the branch you want to pull-request into.* -Once certain milestones have been reached and Taylor Otwell and other Laravel project managers are happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use. +Once certain milestones have been reached and/or Taylor Otwell and the Laravel team is happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use. diff --git a/laravel/documentation/contrib/tortoisegit.md b/laravel/documentation/contrib/tortoisegit.md new file mode 100644 index 00000000..e69de29b From fd6e73aaa726e273c8f6f52d0d9f1e836c0bedee Mon Sep 17 00:00:00 2001 From: Jakobud Date: Mon, 30 Jul 2012 12:12:07 -0600 Subject: [PATCH 80/83] Added TortoiseGit contribution docs. Revised Command-Line contribution docs. Signed-off-by: Jakobud --- laravel/documentation/contrib/command-line.md | 30 +++-- laravel/documentation/contrib/github.md | 5 + laravel/documentation/contrib/tortoisegit.md | 113 ++++++++++++++++++ 3 files changed, 135 insertions(+), 13 deletions(-) diff --git a/laravel/documentation/contrib/command-line.md b/laravel/documentation/contrib/command-line.md index e50e1758..d662e806 100644 --- a/laravel/documentation/contrib/command-line.md +++ b/laravel/documentation/contrib/command-line.md @@ -1,9 +1,10 @@ -# Command Line +# Contributing to Laravel via Command-Line ## Contents - [Getting Started](#getting-started) - [Forking Laravel](#forking-laravel) - [Cloning Laravel](#cloning-laravel) + - [Adding your Fork](#adding-your-fork) - [Creating Branches](#creating-branches) - [Committing](#committing) - [Submitting a Pull Request](#submitting-a-pull-request) @@ -12,11 +13,9 @@ ## Contents ## Getting Started -This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/). The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project. +This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/) via the command-line. The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project. This tutorial is applicable to OSX, Linux and Windows. -This tutorial assumes that you have installed [Git](http://git-scm.com/) and that you have created a [GitHub account](https://github.com/signup/free). If you haven't already, look at the documentation for [Laravel on GitHub](/docs/contrib/github) in order to familiarize yourself with Laravel's repositories and branches. - -*[Jason Lewis](http://jasonlewis.me/)'s blog post on [Contributing to a GitHub Project](http://jasonlewis.me/blog/2012/06/how-to-contributing-to-a-github-project) was the inspiration for this tutorial.* +This tutorial assumes you have installed [Git](http://git-scm.com/) and you have created a [GitHub account](https://github.com/signup/free). If you haven't already, look at the [Laravel on GitHub](/docs/contrib/github) documentation in order to familiarize yourself with Laravel's repositories and branches. ## Forking Laravel @@ -35,13 +34,16 @@ ## Cloning Laravel # git clone https://github.com/laravel/laravel.git . -The reason you are cloning the original Laravel repository (and not the fork you made) is so you can use it to always have the latest Laravel development code. If you simply clone the fork you made, you would have to re-fork the Laravel repository again every time you want the latest changes to Laravel development code. +> **Note**: The reason you are cloning the original Laravel repository (and not the fork you made) is so you can always pull down the most recent changes from the Laravel repository to your local repository. + + +## Adding your Fork Next, it's time to add the fork you made as a **remote repository**: # git remote add fork git@github.com:username/laravel.git -Remember to replace **username** with your GitHub username. *This is case-sensitive*. You can verify that your fork was added by typing: +Remember to replace *username** with your GitHub username. *This is case-sensitive*. You can verify that your fork was added by typing: # git remote @@ -58,22 +60,20 @@ ## Creating Branches # git pull origin develop -Now you are ready to create a new branch. - -> **Create a new branch for every new feature or bug-fix.** Why? Let's say you make a new branch and add 5 different new features and fix 12 bugs. If one or more of your new features or bug-fixes are rejected by the Laravel team (for whatever reason) your entire pull request will be ignored, even if most of your new features or bug-fixes are perfect. On top of this, separate branches will encourage organization and limit interdependency between new features and bug-fixes that you add. - -When you create a new branch, use a self-descriptive naming convention. For example, if there is a bug in Eloquent that you want to fix, name your branch accordingly: +Now you are ready to create a new branch for your new feature or bug-fix. When you create a new branch, use a self-descriptive naming convention. For example, if you are going to fix a bug in Eloquent, name your branch *bug/eloquent*: # git branch bug/eloquent # git checkout bug/eloquent Switched to branch 'bug/eloquent' -Or if there is a new feature or change to the documentation that you want to make, for example, the localization documentation: +Or if there is a new feature to add or change to the documentation that you want to make, for example, the localization documentation: # git branch feature/localization-docs # git checkout feature/localization-docs Switched to branch 'feature/localization-docs' +> **Note:** Create one new branch for every new feature or bug-fix. This will encourage organization, limit interdependency between new features/fixes and will make it easy for the Laravel team to merge your changes into the Laravel core. + Now that you have created your own branch and have switched to it, it's time to make your changes to the code. Add your new feature or fix that bug. @@ -97,6 +97,8 @@ ## Pushing to your Fork # git push fork feature/localization-docs +Your branch has been successfully pushed to your fork on GitHub. + ## Submitting a Pull Request @@ -121,3 +123,5 @@ ## What's Next? # git pull origin develop Now you are ready to create a new branch and start coding again! + +> [Jason Lewis](http://jasonlewis.me/)'s blog post [Contributing to a GitHub Project](http://jasonlewis.me/blog/2012/06/how-to-contributing-to-a-github-project) was the primary inspiration for this tutorial. diff --git a/laravel/documentation/contrib/github.md b/laravel/documentation/contrib/github.md index 5d0003ad..5d9f43e9 100644 --- a/laravel/documentation/contrib/github.md +++ b/laravel/documentation/contrib/github.md @@ -28,3 +28,8 @@ ## Branches - **develop** - This is the working development branch. All proposed code changes and contributions by the community are pulled into this branch. *When you make a pull request to the Laravel project, this is the branch you want to pull-request into.* Once certain milestones have been reached and/or Taylor Otwell and the Laravel team is happy with the stability and additional features of the current development branch, the changes in the **develop** branch are pulled into the **master** branch, thus creating and releasing the newest stable version of Laravel for the world to use. + +*Further Reading* + + - [Contributing to Laravel via Command-Line](docs/contrib/command-line) + - [Contributing to Laravel using TortoiseGit](docs/contrib/tortoisegit) diff --git a/laravel/documentation/contrib/tortoisegit.md b/laravel/documentation/contrib/tortoisegit.md index e69de29b..aa79e8cb 100644 --- a/laravel/documentation/contrib/tortoisegit.md +++ b/laravel/documentation/contrib/tortoisegit.md @@ -0,0 +1,113 @@ +# Contributing to Laravel using TortoiseGit + +## Contents + - [Getting Started](#getting-started) + - [Forking Laravel](#forking-laravel) + - [Cloning Laravel](#cloning-laravel) + - [Adding your Fork](#adding-your-fork) + - [Creating Branches](#creating-branches) + - [Committing](#committing) + - [Submitting a Pull Request](#submitting-a-pull-request) + - [What's Next?](#whats-next) + + +## Getting Started + +This tutorial explains the basics of contributing to a project on [GitHub](https://github.com/) using [TortoiseGit](http://code.google.com/p/tortoisegit/) for Windows. The workflow can apply to most projects on GitHub, but in this case, we will be focused on the [Laravel](https://github.com/laravel/laravel) project. + +This tutorial assumes you have installed TortoiseGit for Windows and you have created a GitHub account. If you haven't already, look at the [Laravel on GitHub](/docs/contrib/github) documentation in order to familiarize yourself with Laravel's repositories and branches. + + +## Forking Laravel + +Login to GitHub and visit the [Laravel Repository](https://github.com/laravel/laravel). Click on the **Fork** button. This will create your own fork of Laravel in your own GitHub account. Your Laravel fork will be located at **https://github.com/username/laravel** (your GitHub username will be used in place of *username*). + + +## Cloning Laravel + +Open up Windows Explorer and create a new directory where you can make development changes to Laravel. + + - Right-click the Laravel directory to bring up the context menu. Click on **Git Clone...** + - Git clone + - **Url:** https://github.com/laravel/laravel.git + - **Directory:** the directory that you just created in the previous step + - Click **OK** + +> **Note**: The reason you are cloning the original Laravel repository (and not the fork you made) is so you can always pull down the most recent changes from the Laravel repository to your local repository. + + +## Adding your Fork + +After the cloning process is complete, it's time to add the fork you made as a **remote repository**. + + - Right-click the Laravel directory and goto **TortoiseGit > Settings** + - Goto the **Git/Remote** section. Add a new remote: + - **Remote**: fork + - **URL**: https://github.com/username/laravel.git + - Click **Add New/Save** + - Click **OK** + +Remember to replace *username* with your GitHub username. *This is case-sensitive*. + + +## Creating Branches + +Now you are ready to create a new branch for your new feature or bug-fix. When you create a new branch, use a self-descriptive naming convention. For example, if you are going to fix a bug in Eloquent, name your branch *bug/eloquent*. Or if you were going to make changes to the localization documentation, name your branch *feature/localization-docs*. A good naming convention will encourage organization and help others understand the purpose of your branch. + + - Right-click the Laravel directory and goto **TortoiseGit > Create Branch** + - **Branch:** feature/localization-docs + - **Base On Branch:** remotes/origin/develop + - **Check** *Track* + - **Check** *Switch to new branch* + - Click **OK** + +This will create your new *feature/localization-docs* branch and switch you to it. + +> **Note:** Create one new branch for every new feature or bug-fix. This will encourage organization, limit interdependency between new features/fixes and will make it easy for the Laravel team to merge your changes into the Laravel core. + +Now that you have created your own branch and have switched to it, it's time to make your changes to the code. Add your new feature or fix that bug. + + +##Committing + +Now that you have finished coding and testing your changes, it's time to commit them to your local repository: + + - Right-click the Laravel directory and goto **Git Commit -> "feature/localization-docs"...** + - Commit + - **Message:** Provide a brief explaination of what you added or changed + - Click **Sign** - This tells the Laravel team know that you personally agree to your code being added to the Laravel core + - **Changes made:** Check all changed/added files + - Click **OK** + + +## Pushing to your Fork + +Now that your local repository has your committed changes, it's time to push (or sync) your new branch to your fork that is hosted in GitHub: + +- Right-click the Laravel directory and goto **Git Sync...** +- Git Syncronization + - **Local Branch:** feature/localization-docs + - **Remote Branch:** leave this blank + - **Remote URL:** fork + - Click **Push** + - When asked for "username:" enter your GitHub *case-sensitive* username + - When asked for "password:" enter your GitHub *case-sensitive* account + +Your branch has been successfully pushed to your fork on GitHub. + + +## Submitting a Pull Request + +The final step is to submit a pull request to the Laravel repository. This means that you are requesting that the Laravel team pull and merge your changes to the Laravel core. In your browser, visit your Laravel fork at [https://github.com/username/laravel](https://github.com/username/laravel). Click on **Pull Request**. Next, make sure you choose the proper base and head repositories and branches: + + - **base repo:** laravel/laravel + - **base branch:** develop + - **head repo:** username/laravel + - **head branch:** feature/localization-docs + +Use the form to write a more detailed description of the changes you made and why you made them. Finally, click **Send pull request**. That's it! The changes you made have been submitted to the Laravel team. + + +## What's Next? + +Do you have another feature you want to add or another bug you need to fix? Just follow the same instructions as before in the [Creating Branches](#creating-branches) section. Just remember to always create a new branch for every new feature/fix and don't forget to always base your new branches off of the *remotes/origin/develop* branch. From 2c7bf657edc2a329c1e284dee5b4fd28d5791bd7 Mon Sep 17 00:00:00 2001 From: Jakobud Date: Mon, 30 Jul 2012 13:32:53 -0600 Subject: [PATCH 81/83] Removed empty Coding Standards doc. Removed Coding Standards from Table of Contents Sidebar. Signed-off-by: Jakobud --- laravel/documentation/contents.md | 2 -- laravel/documentation/contrib/coding.md | 0 2 files changed, 2 deletions(-) delete mode 100644 laravel/documentation/contrib/coding.md diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 288b0b68..2d004260 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -115,5 +115,3 @@ ### Contributing - [Laravel on GitHub](docs/contrib/github) - [Command Line](docs/contrib/command-line) - [TortoiseGit](docs/contrib/tortoisegit) -- [Coding Standards](docs/contrib/coding) - diff --git a/laravel/documentation/contrib/coding.md b/laravel/documentation/contrib/coding.md deleted file mode 100644 index e69de29b..00000000 From 244ecd49fd494d1e0a132c3a6085ca49cd9b8804 Mon Sep 17 00:00:00 2001 From: Tobsn Date: Tue, 31 Jul 2012 09:55:45 +0200 Subject: [PATCH 82/83] Added use Closure to database.php function extend($name, Closure $connector extend uses closure - causes exception on call without use. --- laravel/database.php | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/database.php b/laravel/database.php index 57f8d2c1..c5e28ac2 100644 --- a/laravel/database.php +++ b/laravel/database.php @@ -1,5 +1,6 @@ Date: Tue, 31 Jul 2012 10:04:53 +0200 Subject: [PATCH 83/83] Returning results with SHOW queries reference to #991 --- laravel/database/connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/connection.php b/laravel/database/connection.php index 189d2ca2..0849224d 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -185,7 +185,7 @@ public function query($sql, $bindings = array()) // The result we return depends on the type of query executed against the // database. On SELECT clauses, we will return the result set, for update // and deletes we will return the affected row count. - if (stripos($sql, 'select') === 0) + if (stripos($sql, 'select') === 0 || stripos($sql, 'show') === 0) { return $this->fetch($statement, Config::get('database.fetch')); }