From 8fc80c47d9be83ead817986066bb385f0deeaf2c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 6 Jun 2012 12:20:30 +0300 Subject: [PATCH 01/24] Avoid unnecessary end() in Table::command() function. --- laravel/database/schema/table.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/laravel/database/schema/table.php b/laravel/database/schema/table.php index 570c5405..c0a2894e 100644 --- a/laravel/database/schema/table.php +++ b/laravel/database/schema/table.php @@ -393,9 +393,7 @@ protected function command($type, $parameters = array()) { $parameters = array_merge(compact('type'), $parameters); - $this->commands[] = new Fluent($parameters); - - return end($this->commands); + return $this->commands[] = new Fluent($parameters); } /** From 605be704ff1f0e537d7433f60405b2377a04c36b Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 6 Jun 2012 12:23:00 +0300 Subject: [PATCH 02/24] Avoid unnecessary end() in Table::column() function. --- laravel/database/schema/table.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/laravel/database/schema/table.php b/laravel/database/schema/table.php index c0a2894e..ba187df5 100644 --- a/laravel/database/schema/table.php +++ b/laravel/database/schema/table.php @@ -407,9 +407,7 @@ protected function column($type, $parameters = array()) { $parameters = array_merge(compact('type'), $parameters); - $this->columns[] = new Fluent($parameters); - - return end($this->columns); + return $this->columns[] = new Fluent($parameters); } } \ No newline at end of file From 7ead1796d08efe02fb2d5874affa06193c572c23 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 6 Jun 2012 12:33:50 +0300 Subject: [PATCH 03/24] Apply prefix to foreign key's "on" attribute, too. --- laravel/database/schema/grammars/grammar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/schema/grammars/grammar.php b/laravel/database/schema/grammars/grammar.php index 1d3390a1..da93aa64 100644 --- a/laravel/database/schema/grammars/grammar.php +++ b/laravel/database/schema/grammars/grammar.php @@ -21,7 +21,7 @@ public function foreign(Table $table, Fluent $command) // command is being executed and the referenced table are wrapped. $table = $this->wrap($table); - $on = $this->wrap($command->on); + $on = $this->wrap_table($command->on); // Next we need to columnize both the command table's columns as well as // the columns referenced by the foreign key. We'll cast the referenced From 67ac2f2f9a3c925f04040c5672aa54a74703e01b Mon Sep 17 00:00:00 2001 From: Jesse O'Brien Date: Wed, 6 Jun 2012 15:10:06 -0400 Subject: [PATCH 04/24] Default was never returned. If no IP was found it returns NULL. While unit testing I found that providing a default IP address to Request::ip() returns NULL in a CLI environment. --- laravel/request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel/request.php b/laravel/request.php index 510f64eb..84763449 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -102,7 +102,8 @@ public static function spoofed() */ public static function ip($default = '0.0.0.0') { - return value(static::foundation()->getClientIp(), $default); + $client_ip = static::foundation()->getClientIp(); + return $client_ip === NULL ? $default : $client_ip; } /** From ac8bd0829ecbb1b7313937cc64624a1a0340656c Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Mon, 11 Jun 2012 20:00:46 +0200 Subject: [PATCH 05/24] Fix for https://github.com/laravel/laravel/issues/789 --- laravel/database/eloquent/model.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 2c28b8f9..2ad1c72b 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -253,7 +253,27 @@ public static function all() */ public function _with($includes) { - $this->includes = (array) $includes; + $includes = (array) $includes; + + $all_includes = array(); + + foreach($includes as $include) + { + $nested = explode('.', $include); + + $inc = array(); + + foreach($nested as $relation) + { + $inc[] = $relation; + + $all_includes[] = implode('.', $inc); + } + + } + + //remove duplicates and reset the array keys. + $this->includes = array_values(array_unique($all_includes)); return $this; } From 06d7abc2d4b1137b2e4a9d40ba8d71cdb571272a Mon Sep 17 00:00:00 2001 From: dlabs88 Date: Tue, 12 Jun 2012 04:00:15 +0300 Subject: [PATCH 06/24] Route::get('admin', array('before' => 'auth', function() {})); forgot the last ) --- laravel/documentation/auth/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/auth/usage.md b/laravel/documentation/auth/usage.md index e02747a0..8a9a0650 100644 --- a/laravel/documentation/auth/usage.md +++ b/laravel/documentation/auth/usage.md @@ -63,7 +63,7 @@ ## Protecting Routes To protect a route, simply attach the **auth** filter: - Route::get('admin', array('before' => 'auth', function() {}); + Route::get('admin', array('before' => 'auth', function() {})); > **Note:** You are free to edit the **auth** filter however you like. A default implementation is located in **application/routes.php**. From ac2e7c6a2d2afa47f420715dca056ec6135403fd Mon Sep 17 00:00:00 2001 From: Stefan Neubig Date: Thu, 14 Jun 2012 01:33:56 +0300 Subject: [PATCH 07/24] Fixed namespace issue when registering a session driver with the extend closure --- laravel/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/session.php b/laravel/session.php index b5b833fa..81e4e131 100644 --- a/laravel/session.php +++ b/laravel/session.php @@ -1,4 +1,4 @@ - Date: Fri, 15 Jun 2012 10:29:09 +0930 Subject: [PATCH 08/24] Can now check for existance of named views. Signed-off-by: Jason Lewis --- laravel/view.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/laravel/view.php b/laravel/view.php index f97b3dee..b4304889 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -118,6 +118,11 @@ public function __construct($view, $data = array()) */ public static function exists($view, $return_path = false) { + if(starts_with($view, 'name: ')) + { + $view = static::$names[substr($view, 6)]; + } + list($bundle, $view) = Bundle::parse($view); $view = str_replace('.', '/', $view); From a5cc8616fcfa2c1b5f5066cc76cc3f690303f31a Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Sat, 16 Jun 2012 10:29:45 +0930 Subject: [PATCH 09/24] Fix bug where error is shown when named view isn't set. Signed-off-by: Jason Lewis --- laravel/view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/view.php b/laravel/view.php index b4304889..9a375073 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -118,9 +118,9 @@ public function __construct($view, $data = array()) */ public static function exists($view, $return_path = false) { - if(starts_with($view, 'name: ')) + if (starts_with($view, 'name: ') and array_key_exists($name = substr($view, 6), static::$names)) { - $view = static::$names[substr($view, 6)]; + $view = static::$names[$name]; } list($bundle, $view) = Bundle::parse($view); From e3317324b0cd69c025acc2c33d898017a4cb61ce Mon Sep 17 00:00:00 2001 From: Dayle Rees Date: Sat, 16 Jun 2012 11:42:25 +0100 Subject: [PATCH 10/24] added clear() method to the input class Signed-off-by: Dayle Rees --- laravel/documentation/input.md | 8 +++++++- laravel/input.php | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/laravel/documentation/input.md b/laravel/documentation/input.md index 14221ecd..4387721e 100644 --- a/laravel/documentation/input.md +++ b/laravel/documentation/input.md @@ -145,4 +145,10 @@ #### Merging new data into the current input: #### Replacing the entire input array with new data: - Input::merge(array('doctor' => 'Bones', 'captain' => 'Kirk')); \ No newline at end of file + Input::merge(array('doctor' => 'Bones', 'captain' => 'Kirk')); + +## Clearing Input + +To clear all input data for the current request, using the `clear()` method, for example: + + Input::clear(); \ No newline at end of file diff --git a/laravel/input.php b/laravel/input.php index 6a28b17f..8d712871 100644 --- a/laravel/input.php +++ b/laravel/input.php @@ -287,4 +287,13 @@ public static function replace(array $input) Request::foundation()->request->replace($input); } + /** + * Clear the input for the current request. + * @return void + */ + public static function clear() + { + Request::foundation()->request->replace(array()); + } + } \ No newline at end of file From e0d491cb150f034b048233c71160dffe300a3d45 Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Sat, 16 Jun 2012 19:46:50 -0700 Subject: [PATCH 11/24] Added UNSIGNED to mysql grammar inrementer() Added UNSIGNED to the mysql grammar file because auto increment fields only run upwards, it's a waste of space to provide negative values by the default SIGNED state of INT. --- laravel/database/schema/grammars/mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index c2ae7455..d0ba45ad 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -143,7 +143,7 @@ protected function incrementer(Table $table, Fluent $column) { if ($column->type == 'integer' and $column->increment) { - return ' AUTO_INCREMENT PRIMARY KEY'; + return ' UNSIGNED AUTO_INCREMENT PRIMARY KEY'; } } From 139abb2e230c3c6232ea7a7ba6594174a930309b Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Sat, 16 Jun 2012 19:56:36 -0700 Subject: [PATCH 12/24] German Translation Added German translation as good as it gets ;) --- application/language/de/pagination.php | 19 +++++ application/language/de/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/de/pagination.php create mode 100644 application/language/de/validation.php diff --git a/application/language/de/pagination.php b/application/language/de/pagination.php new file mode 100644 index 00000000..9fd96322 --- /dev/null +++ b/application/language/de/pagination.php @@ -0,0 +1,19 @@ + '« Zurück', + 'next' => 'Weiter »', + +); \ No newline at end of file diff --git a/application/language/de/validation.php b/application/language/de/validation.php new file mode 100644 index 00000000..adc2b625 --- /dev/null +++ b/application/language/de/validation.php @@ -0,0 +1,99 @@ + ":attribute muss akzeptiert werden.", + "active_url" => ":attribute ist keine korrekte URL.", + "after" => ":attribute muss ein Datum nach :date sein.", + "alpha" => ":attribute darf nur Buchstaben beinhalten.", + "alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestriche bestehen.", + "alpha_num" => ":attribute sollte nur aus Buchstaben und Nummern bestehen.", + "before" => ":attribute muss ein Datum vor :date sein.", + "between" => array( + "numeric" => ":attribute muss zwischen :min und :max sein.", + "file" => ":attribute muss zwischen :min und :max Kilobytes sein.", + "string" => ":attribute muss zwischen :min und :max Zeichen sein.", + ), + "confirmed" => "Die Bestätigung für :attribute stimmt nicht überein.", + "different" => ":attribute und :other müssen verschieden sein.", + "email" => "Das Format fü :attribute ist ungültig.", + "exists" => "Die selektierte :attribute ist ungültig.", + "image" => ":attribute muss ein Bild sein.", + "in" => "Die selektierte :attribute ist ungültig.", + "integer" => ":attribute muss eine Ganzzahl sein.", + "ip" => ":attribute muss eine gültige IP sein.", + "match" => ":attribute hat ein ungültiges format.", + "max" => array( + "numeric" => ":attribute muss kleiner sein als :max.", + "file" => ":attribute muss kleiner sein :max Kilobytes.", + "string" => ":attribute muss kürzer sein als :max Zeichen.", + ), + "mimes" => ":attribute muss eine Datei sein des Formats: :values.", + "min" => array( + "numeric" => ":attribute muss größer sein als :min.", + "file" => ":attribute muss größer sein als :min Kilobytes.", + "string" => ":attribute muss länger sein als :min Zeichen.", + ), + "not_in" => "Die selektierte :attribute ist ungültig.", + "numeric" => ":attribute muss eine Nummer sein.", + "required" => "Das :attribute Feld muss aufgefüllt sein.", + "same" => ":attribute und :other müssen übereinstimmen.", + "size" => array( + "numeric" => ":attribute muss :size sein.", + "file" => ":attribute muss :size Kilobyte sein.", + "string" => ":attribute muss :size Zeichen sein.", + ), + "unique" => ":attribute ist schon vergeben.", + "url" => "Das Format fü :attribute ist ungültig.", + + /* + |-------------------------------------------------------------------------- + | 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 37321136e47d7d1ff8018d8734f792c13bd6f8a9 Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Mon, 18 Jun 2012 02:08:12 -0700 Subject: [PATCH 13/24] fixed missed umlauts --- application/language/de/validation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/de/validation.php b/application/language/de/validation.php index adc2b625..7651b104 100644 --- a/application/language/de/validation.php +++ b/application/language/de/validation.php @@ -46,8 +46,8 @@ ), "mimes" => ":attribute muss eine Datei sein des Formats: :values.", "min" => array( - "numeric" => ":attribute muss größer sein als :min.", - "file" => ":attribute muss größer sein als :min Kilobytes.", + "numeric" => ":attribute muss größer sein als :min.", + "file" => ":attribute muss größer sein als :min Kilobytes.", "string" => ":attribute muss länger sein als :min Zeichen.", ), "not_in" => "Die selektierte :attribute ist ungültig.", From b6cc836bf4f3efc06bfc4f7d6ca26c73c9f932e6 Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Tue, 19 Jun 2012 01:58:14 +0930 Subject: [PATCH 14/24] Added an @break to blade to break out of loops. Signed-off-by: Jason Lewis --- laravel/blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/blade.php b/laravel/blade.php index c362d57b..0deed20e 100644 --- a/laravel/blade.php +++ b/laravel/blade.php @@ -278,7 +278,7 @@ protected static function compile_structure_openings($value) */ protected static function compile_structure_closings($value) { - $pattern = '/(\s*)@(endif|endforeach|endfor|endwhile)(\s*)/'; + $pattern = '/(\s*)@(endif|endforeach|endfor|endwhile|break)(\s*)/'; return preg_replace($pattern, '$1$3', $value); } From c6ebf685bfa7cc788ddfbb2ab54805c6f2b376a4 Mon Sep 17 00:00:00 2001 From: Tobias Orterer Date: Mon, 18 Jun 2012 21:55:35 -0700 Subject: [PATCH 15/24] Added important note about @layout on first line leads to confusion if not pointed out. --- laravel/documentation/views/templating.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/laravel/documentation/views/templating.md b/laravel/documentation/views/templating.md index 8849f0e1..a2273c19 100644 --- a/laravel/documentation/views/templating.md +++ b/laravel/documentation/views/templating.md @@ -164,6 +164,8 @@ ## Blade Layouts The profile view will automatically use the "master" template thanks to Blade's **@layout** expression. +**Important:** The **@layout** call must always be on the very first line of the file, with no leading whitespaces or newline breaks. + Sometimes you may want to only append to a section of a layout rather than overwrite it. For example, consider the navigation list in our "master" layout. Let's assume we just want to append a new list item. Here's how to do it: @layout('master') From ec4556321d955a4123fc56c1185b26a34bcc6c21 Mon Sep 17 00:00:00 2001 From: SonicHedgehog Date: Wed, 20 Jun 2012 13:01:52 +0300 Subject: [PATCH 16/24] Fixed typo --- 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 66601ef8..26197736 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -194,7 +194,7 @@ public function query($sql, $bindings = array()) return $statement->rowCount(); } // For insert statements that use the "returning" clause, which is allowed - // by databsae systems such as Postgres, we need to actually return the + // by database systems such as Postgres, we need to actually return the // real query result so the consumer can get the ID. elseif (stripos($sql, 'insert') === 0 and stripos($sql, 'returning') !== false) { From ec0128be8f23af403f1a7cf966dd96867fc6baec Mon Sep 17 00:00:00 2001 From: Noor Alhiraki Date: Wed, 20 Jun 2012 16:18:16 +0300 Subject: [PATCH 17/24] fixed optgroup closing tag --- laravel/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/form.php b/laravel/form.php index de2954b1..5fa6d129 100644 --- a/laravel/form.php +++ b/laravel/form.php @@ -427,7 +427,7 @@ protected static function optgroup($options, $label, $selected) $html[] = static::option($value, $display, $selected); } - return ''.implode('', $html).''; + return ''.implode('', $html).''; } /** From 5c274ed7177977e156b01dd6f7d03a37c5a5dd52 Mon Sep 17 00:00:00 2001 From: Tobsn Date: Fri, 22 Jun 2012 03:03:03 -0700 Subject: [PATCH 18/24] Environments Typo --- paths.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 36226b99bcaa469579dd13692b4c172085f0748a Mon Sep 17 00:00:00 2001 From: Tobsn Date: Fri, 22 Jun 2012 03:09:50 -0700 Subject: [PATCH 19/24] fixed link for query builder /query -> /fluent thanks to @NXB --- 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 0706b7d9..c2afc7a2 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -65,7 +65,7 @@ ## Retrieving Models echo $user->email; } -Of course, retrieving an entire table isn't very helpful. Thankfully, **every method that is available through the fluent query builder is available in Eloquent**. Just begin querying your model with a static call to one of the [query builder](/docs/database/query) methods, and execute the query using the **get** or **first** method. The get method will return an array of models, while the first method will return a single model: +Of course, retrieving an entire table isn't very helpful. Thankfully, **every method that is available through the fluent query builder is available in Eloquent**. Just begin querying your model with a static call to one of the [query builder](/docs/database/fluent) methods, and execute the query using the **get** or **first** method. The get method will return an array of models, while the first method will return a single model: $user = User::where('email', '=', $email)->first(); From 8d13bf9c5a8c2b70143f88af7c13818849452c46 Mon Sep 17 00:00:00 2001 From: Dayle Rees Date: Fri, 22 Jun 2012 16:25:50 +0100 Subject: [PATCH 20/24] removing unsigned from mysql grammer due to bug Signed-off-by: Dayle Rees --- laravel/database/schema/grammars/mysql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index d0ba45ad..2f390f08 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -143,7 +143,7 @@ protected function incrementer(Table $table, Fluent $column) { if ($column->type == 'integer' and $column->increment) { - return ' UNSIGNED AUTO_INCREMENT PRIMARY KEY'; + return ' AUTO_INCREMENT PRIMARY KEY'; } } @@ -418,4 +418,4 @@ protected function type_blob(Fluent $column) return 'BLOB'; } -} \ No newline at end of file +} From ed4a6973f8fa733ed0ac6b48c9f4eeaae25f5bf5 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 23 Jun 2012 01:22:58 +0300 Subject: [PATCH 21/24] Fix some bugs and inconsistencies in the German validation translation. --- application/language/de/validation.php | 56 +++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/application/language/de/validation.php b/application/language/de/validation.php index 7651b104..87189410 100644 --- a/application/language/de/validation.php +++ b/application/language/de/validation.php @@ -19,48 +19,48 @@ */ "accepted" => ":attribute muss akzeptiert werden.", - "active_url" => ":attribute ist keine korrekte URL.", - "after" => ":attribute muss ein Datum nach :date sein.", + "active_url" => ":attribute ist keine gültige URL.", + "after" => ":attribute muss ein Datum nach dem :date sein.", "alpha" => ":attribute darf nur Buchstaben beinhalten.", - "alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestriche bestehen.", + "alpha_dash" => ":attribute sollte nur aus Buchstaben, Nummern und Bindestrichen bestehen.", "alpha_num" => ":attribute sollte nur aus Buchstaben und Nummern bestehen.", - "before" => ":attribute muss ein Datum vor :date sein.", + "before" => ":attribute muss ein Datum vor dem :date sein.", "between" => array( - "numeric" => ":attribute muss zwischen :min und :max sein.", - "file" => ":attribute muss zwischen :min und :max Kilobytes sein.", - "string" => ":attribute muss zwischen :min und :max Zeichen sein.", + "numeric" => ":attribute muss zwischen :min und :max liegen.", + "file" => ":attribute muss zwischen :min und :max Kilobytes groß sein.", + "string" => ":attribute muss zwischen :min und :max Zeichen lang sein.", ), - "confirmed" => "Die Bestätigung für :attribute stimmt nicht überein.", + "confirmed" => ":attribute stimmt nicht mit der Bestätigung überein.", "different" => ":attribute und :other müssen verschieden sein.", - "email" => "Das Format fü :attribute ist ungültig.", - "exists" => "Die selektierte :attribute ist ungültig.", + "email" => ":attribute ist keine gültige Email-Adresse.", + "exists" => "Der gewählte Wert für :attribute ist ungültig.", "image" => ":attribute muss ein Bild sein.", - "in" => "Die selektierte :attribute ist ungültig.", - "integer" => ":attribute muss eine Ganzzahl sein.", - "ip" => ":attribute muss eine gültige IP sein.", - "match" => ":attribute hat ein ungültiges format.", + "in" => "Der gewählte Wert für :attribute ist ungültig.", + "integer" => ":attribute muss eine ganze Zahl sein.", + "ip" => ":attribute muss eine gültige IP-Adresse sein.", + "match" => ":attribute hat ein ungültiges Format.", "max" => array( - "numeric" => ":attribute muss kleiner sein als :max.", - "file" => ":attribute muss kleiner sein :max Kilobytes.", - "string" => ":attribute muss kürzer sein als :max Zeichen.", + "numeric" => ":attribute muss kleiner als :max sein.", + "file" => ":attribute muss kleiner als :max Kilobytes groß sein.", + "string" => ":attribute muss kürzer als :max Zeichen sein.", ), - "mimes" => ":attribute muss eine Datei sein des Formats: :values.", + "mimes" => ":attribute muss den Dateityp :values haben.", "min" => array( - "numeric" => ":attribute muss größer sein als :min.", - "file" => ":attribute muss größer sein als :min Kilobytes.", - "string" => ":attribute muss länger sein als :min Zeichen.", + "numeric" => ":attribute muss größer als :min sein.", + "file" => ":attribute muss größer als :min Kilobytes groß sein.", + "string" => ":attribute muss länger als :min Zeichen sein.", ), - "not_in" => "Die selektierte :attribute ist ungültig.", - "numeric" => ":attribute muss eine Nummer sein.", - "required" => "Das :attribute Feld muss aufgefüllt sein.", + "not_in" => "Der gewählte Wert für :attribute ist ungültig.", + "numeric" => ":attribute muss eine Zahl sein.", + "required" => ":attribute muss aufgefüllt sein.", "same" => ":attribute und :other müssen übereinstimmen.", "size" => array( - "numeric" => ":attribute muss :size sein.", - "file" => ":attribute muss :size Kilobyte sein.", - "string" => ":attribute muss :size Zeichen sein.", + "numeric" => ":attribute muss gleich :size sein.", + "file" => ":attribute muss :size Kilobyte groß sein.", + "string" => ":attribute muss :size Zeichen lang sein.", ), "unique" => ":attribute ist schon vergeben.", - "url" => "Das Format fü :attribute ist ungültig.", + "url" => "Das Format von :attribute ist ungültig.", /* |-------------------------------------------------------------------------- From 5a4d622bb71482631d2b142163d6b9601162b289 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Sat, 23 Jun 2012 14:32:27 -0300 Subject: [PATCH 22/24] Fix small typo in validation docs. --- 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 49401439..4da4683c 100644 --- a/laravel/documentation/validation.md +++ b/laravel/documentation/validation.md @@ -12,7 +12,7 @@ ## Contents ## The Basics -Almost every interactive web application needs to validate data. For instance, a registration form probably requires the password to be confirmed. Maybe the e-mail address must be unique. Validating data can be a cumbersome process. Thankfully, it isn't in Laravel. The Validator class provides as awesome array of validation helpers to make validating your data a breeze. Let's walk through an example: +Almost every interactive web application needs to validate data. For instance, a registration form probably requires the password to be confirmed. Maybe the e-mail address must be unique. Validating data can be a cumbersome process. Thankfully, it isn't in Laravel. The Validator class provides an awesome array of validation helpers to make validating your data a breeze. Let's walk through an example: #### Get an array of data you want to validate: From 5d06f92421653de0aea7147c714acd1f781a84d8 Mon Sep 17 00:00:00 2001 From: Noor Alhiraki Date: Mon, 25 Jun 2012 01:50:59 +0300 Subject: [PATCH 23/24] Added Arabic translation. Signed-off-by: Noor Alhiraki --- application/language/ar/pagination.php | 19 +++++ application/language/ar/validation.php | 99 ++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 application/language/ar/pagination.php create mode 100644 application/language/ar/validation.php diff --git a/application/language/ar/pagination.php b/application/language/ar/pagination.php new file mode 100644 index 00000000..37135719 --- /dev/null +++ b/application/language/ar/pagination.php @@ -0,0 +1,19 @@ + '→ السابق', + 'next' => 'التالي ←', + +); \ No newline at end of file diff --git a/application/language/ar/validation.php b/application/language/ar/validation.php new file mode 100644 index 00000000..cb15db34 --- /dev/null +++ b/application/language/ar/validation.php @@ -0,0 +1,99 @@ + "القيمة :attribute يجب أن تكون مقبولة.", + "active_url" => "القيمة :attribute تمثل عنوان موقع إنترنت غير صحيح.", + "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 يجب أن تمثل عنوان بروتوكول إنترنت صحيح.", + "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 From d08db5c26bb0a078463370dd1a3af85d086690d0 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 25 Jun 2012 13:45:29 +0200 Subject: [PATCH 24/24] added server configuration to install docs --- laravel/documentation/contents.md | 1 + laravel/documentation/install.md | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 1d5ce11e..5a512ad1 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -4,6 +4,7 @@ ### General - [Installation & Setup](/docs/install) - [Requirements](/docs/install#requirements) - [Installation](/docs/install#installation) + - [Server Configuration: Why Public?](/docs/install#server-configuration) - [Basic Configuration](/docs/install#basic-configuration) - [Environments](/docs/install#environments) - [Cleaner URLs](/docs/install#cleaner-urls) diff --git a/laravel/documentation/install.md b/laravel/documentation/install.md index 12f12951..b3312366 100644 --- a/laravel/documentation/install.md +++ b/laravel/documentation/install.md @@ -4,6 +4,7 @@ ## Contents - [Requirements](#requirements) - [Installation](#installation) +- [Server Configuration: Why Public?](#server-configuration) - [Basic Configuration](#basic-configuration) - [Environments](#environments) - [Cleaner URLs](#cleaner-urls) @@ -37,8 +38,30 @@ ### Problems? If you are having problems installing, try the following: -- Make sure the **public** directory is the document root of your web server. +- 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. +- Verify that your storage folder and the folders within in are writable by your web server. + + +## Server Configuration: Why Public? + +Like most web-development frameworks, Laravel is designed to protect your application code, bundles, and local storage by placing only files that are necessarily public in the web server's DocumentRoot. This prevents some types of server misconfiguration from making your code (including database passwords and other configuration data) accessible through the web server. It's best to be safe. + +In this example let's imagine that we installed Laravel to the directory **/Users/JonSnow/Sites/MySite**. + +A very basic example of an Apache VirtualHost configuration for MySite might look like this. + + + DocumentRoot /Users/JonSnow/Sites/MySite/public + ServerName mysite.local + + +Notice that while we installed to **/Users/JonSnow/Sites/MySite** our DocumentRoot points to **/Users/JonSnow/Sites/MySite/public**. + +Pointing the DocumentRoot to the public folder is a commonly used best-practice. However, you may need to use Laravel on a host that does not allow you to update your DocumentRoot. This is possible, but before resigning to this option it's best to contact your host and verify that you are unable to change your DocumentRoot to increase the security of your application. + +More information about how to use the public folder can be found on the [Laravel Forums](http://forums.laravel.com/viewtopic.php?pid=10023#p10023). + ## Basic Configuration @@ -70,7 +93,7 @@ ## Environments ); -In this example, the local **URL** option will override the **URL** option in **application/config/application.php**. Notice that you only need to specify the options you wish to override. +In this example, the local **URL** option will override the **URL** option in **application/config/application.php**. Notice that you only need to specify the options you wish to override. Isn't it easy? Of course, you are free to create as many environments as you wish!