diff --git a/application/language/ru/pagination.php b/application/language/ru/pagination.php new file mode 100644 index 00000000..0ac9e0a3 --- /dev/null +++ b/application/language/ru/pagination.php @@ -0,0 +1,19 @@ + '← Назад', + 'next' => 'Вперёд →', + +); \ No newline at end of file diff --git a/application/language/ru/validation.php b/application/language/ru/validation.php new file mode 100644 index 00000000..e8ee3a13 --- /dev/null +++ b/application/language/ru/validation.php @@ -0,0 +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(), + +); \ No newline at end of file diff --git a/application/views/error/404.php b/application/views/error/404.php index 9b9bf55b..9540e357 100644 --- a/application/views/error/404.php +++ b/application/views/error/404.php @@ -1,92 +1,113 @@ - - - + + + + + Error 404 - Not Found + + - - -
+ a:hover + { + color:#72ADD4; + } + + + +
+
+

Server Error: 404 (Not Found)

+
+

What does this mean?

@@ -99,5 +120,6 @@ Perhaps you would like to go to our ?

- +
+ \ No newline at end of file diff --git a/application/views/error/500.php b/application/views/error/500.php index 4dcd92ad..b70bb609 100644 --- a/application/views/error/500.php +++ b/application/views/error/500.php @@ -1,92 +1,113 @@ - - - + + + + + Error 500 - Internal Server Error + + - - -
+ a:hover + { + color:#72ADD4; + } + + + +
+
+

Server Error: 500 (Internal Server Error)

+
+

What does this mean?

@@ -99,5 +120,6 @@ Perhaps you would like to go to our ?

- +
+ \ No newline at end of file diff --git a/laravel/cache/drivers/memcached.php b/laravel/cache/drivers/memcached.php index 4601e385..aeedc088 100644 --- a/laravel/cache/drivers/memcached.php +++ b/laravel/cache/drivers/memcached.php @@ -1,11 +1,11 @@ -key = $key; $this->memcache = $memcache; @@ -68,7 +68,7 @@ protected function retrieve($key) */ public function put($key, $value, $minutes) { - $this->memcache->set($this->key.$key, $value, 0, $minutes * 60); + $this->memcache->set($this->key.$key, $value, $minutes * 60); } /** diff --git a/laravel/documentation/changes.md b/laravel/documentation/changes.md index de952506..5f35fcbd 100644 --- a/laravel/documentation/changes.md +++ b/laravel/documentation/changes.md @@ -33,6 +33,8 @@ ## Laravel 3.2 - [Added `unless` structure to Blade template engine](/docs/views/templating#blade-unless). - [Added Blade comments](/docs/views/templating#blade-comments). - [Added simpler environment management](/docs/install#environments). +- Added `View::exists` method. +- Use [Memcached](http://php.net/manual/en/book.memcached.php) API instead of older [Memcache](http://php.net/manual/en/book.memcache.php) API. - Added support for bundles outside of the bundle directory. - Added support for DateTime database query bindings. - Migrated to the Symfony HttpFoundation component for core request / response handling. diff --git a/laravel/documentation/views/home.md b/laravel/documentation/views/home.md index b2b6b3f3..f96d25f9 100644 --- a/laravel/documentation/views/home.md +++ b/laravel/documentation/views/home.md @@ -39,6 +39,10 @@ #### Returning the view from a controller: return View::make('home.index'); }); +#### Determining if a view exists: + + $exists = View::exists('home.index'); + Sometimes you will need a little more control over the response sent to the browser. For example, you may need to set a custom header on the response, or change the HTTP status code. Here's how: #### Returning a custom response: diff --git a/laravel/memcached.php b/laravel/memcached.php index 626d8ae6..91e7270e 100644 --- a/laravel/memcached.php +++ b/laravel/memcached.php @@ -5,7 +5,7 @@ class Memcached { /** * The Memcached connection instance. * - * @var Memcache + * @var Memcached */ protected static $connection; @@ -40,11 +40,11 @@ public static function connection() */ protected static function connect($servers) { - $memcache = new \Memcache; + $memcache = new \Memcached; foreach ($servers as $server) { - $memcache->addServer($server['host'], $server['port'], true, $server['weight']); + $memcache->addServer($server['host'], $server['port'], $server['weight']); } if ($memcache->getVersion() === false) diff --git a/laravel/view.php b/laravel/view.php index 50d7a4d5..f95b8f33 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -110,12 +110,13 @@ public function __construct($view, $data = array()) } /** - * Get the path to a given view on disk. + * Determine if the given view exists. * - * @param string $view - * @return string + * @param string $view + * @param boolean $return_path + * @return string|bool */ - protected function path($view) + public static function exists($view, $return_path = false) { list($bundle, $view) = Bundle::parse($view); @@ -127,6 +128,22 @@ protected function path($view) $path = Event::first(static::loader, array($bundle, $view)); if ( ! is_null($path)) + { + return $return_path ? $path : true; + } + + return false; + } + + /** + * Get the path to a given view on disk. + * + * @param string $view + * @return string + */ + protected function path($view) + { + if ($path = $this->exists($view,true)) { return $path; }