diff --git a/src/Illuminate/Database/Connectors/MySqlConnector.php b/src/Illuminate/Database/Connectors/MySqlConnector.php
index b1804ec8855e..22d9405e7bd2 100755
--- a/src/Illuminate/Database/Connectors/MySqlConnector.php
+++ b/src/Illuminate/Database/Connectors/MySqlConnector.php
@@ -36,6 +36,16 @@ public function connect(array $config)
$connection->prepare($names)->execute();
+ // Next, we will check to see if a timezone has been specified in this config
+ // and if it has we will issue a statement to modify the timezone with the
+ // database. Setting this DB timezone is an optional configuration item.
+ if (isset($config['timezone']))
+ {
+ $connection->prepare(
+ 'set time_zone="'.$config['timezone'].'"'
+ )->execute();
+ }
+
// If the "strict" option has been configured for the connection we'll enable
// strict mode on all of these tables. This enforces some extra rules when
// using the MySQL database system and is a quicker way to enforce them.
diff --git a/src/Illuminate/Database/Console/Migrations/StatusCommand.php b/src/Illuminate/Database/Console/Migrations/StatusCommand.php
index c575112f8b98..393343cd194e 100644
--- a/src/Illuminate/Database/Console/Migrations/StatusCommand.php
+++ b/src/Illuminate/Database/Console/Migrations/StatusCommand.php
@@ -56,7 +56,7 @@ public function fire()
foreach ($this->getAllMigrationFiles() as $migration)
{
- $migrations[] = in_array($migration, $ran) ? ['✔', $migration] : ['✗', $migration];
+ $migrations[] = in_array($migration, $ran) ? ['Y', $migration] : ['N', $migration];
}
if (count($migrations) > 0)
diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
index 0c147c0bfdbb..4b01fc28e2be 100755
--- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
+++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -167,6 +167,24 @@ public function get($columns = array('*'))
return $this->related->newCollection($models);
}
+
+ /**
+ * Get a paginator for the "select" statement.
+ *
+ * @param int $perPage
+ * @param array $columns
+ * @return \Illuminate\Pagination\Paginator
+ */
+ public function paginate($perPage = null, $columns = array('*'))
+ {
+ $this->query->addSelect($this->getSelectColumns($columns));
+
+ $paginator = $this->query->paginate($perPage, $columns);
+
+ $this->hydratePivotRelation($paginator->items());
+
+ return $paginator;
+ }
/**
* Hydrate the pivot table relationship on the models.
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php
index f860283d36a2..279a0f538ff3 100755
--- a/src/Illuminate/Database/Query/Builder.php
+++ b/src/Illuminate/Database/Query/Builder.php
@@ -174,8 +174,9 @@ class Builder {
'=', '<', '>', '<=', '>=', '<>', '!=',
'like', 'not like', 'between', 'ilike',
'&', '|', '^', '<<', '>>',
- 'rlike', 'regexp', 'not regexp',
- '~', '~*', '!~', '!~*',
+ 'rlike', 'regexp', 'not regexp',
+ '~', '~*', '!~', '!~*', 'similar to',
+ 'not similar to',
);
/**
diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php
index 6a5a35cc9672..9d80af83faa4 100755
--- a/src/Illuminate/Foundation/Application.php
+++ b/src/Illuminate/Foundation/Application.php
@@ -877,40 +877,40 @@ public function setLocale($locale)
public function registerCoreContainerAliases()
{
$aliases = array(
- 'app' => ['Illuminate\Foundation\Application', 'Illuminate\Contracts\Container\Container', 'Illuminate\Contracts\Foundation\Application'],
- 'artisan' => ['Illuminate\Console\Application', 'Illuminate\Contracts\Console\Application'],
- 'auth' => 'Illuminate\Auth\AuthManager',
- 'auth.driver' => ['Illuminate\Auth\Guard', 'Illuminate\Contracts\Auth\Guard'],
+ 'app' => ['Illuminate\Foundation\Application', 'Illuminate\Contracts\Container\Container', 'Illuminate\Contracts\Foundation\Application'],
+ 'artisan' => ['Illuminate\Console\Application', 'Illuminate\Contracts\Console\Application'],
+ 'auth' => 'Illuminate\Auth\AuthManager',
+ 'auth.driver' => ['Illuminate\Auth\Guard', 'Illuminate\Contracts\Auth\Guard'],
'auth.password.tokens' => 'Illuminate\Auth\Passwords\TokenRepositoryInterface',
- 'blade.compiler' => 'Illuminate\View\Compilers\BladeCompiler',
- 'cache' => ['Illuminate\Cache\CacheManager', 'Illuminate\Contracts\Cache\Factory'],
- 'cache.store' => ['Illuminate\Cache\Repository', 'Illuminate\Contracts\Cache\Repository'],
- 'config' => ['Illuminate\Config\Repository', 'Illuminate\Contracts\Config\Repository'],
- 'cookie' => ['Illuminate\Cookie\CookieJar', 'Illuminate\Contracts\Cookie\Factory', 'Illuminate\Contracts\Cookie\QueueingFactory'],
- 'encrypter' => ['Illuminate\Encryption\Encrypter', 'Illuminate\Contracts\Encryption\Encrypter'],
- 'db' => 'Illuminate\Database\DatabaseManager',
- 'events' => ['Illuminate\Events\Dispatcher', 'Illuminate\Contracts\Events\Dispatcher'],
- 'files' => 'Illuminate\Filesystem\Filesystem',
- 'filesystem' => 'Illuminate\Contracts\Filesystem\Factory',
- 'filesystem.disk' => 'Illuminate\Contracts\Filesystem\Filesystem',
- 'filesystem.cloud' => 'Illuminate\Contracts\Filesystem\Cloud',
- 'hash' => 'Illuminate\Contracts\Hashing\Hasher',
- 'translator' => ['Illuminate\Translation\Translator', 'Symfony\Component\Translation\TranslatorInterface'],
- 'log' => ['Illuminate\Log\Writer', 'Illuminate\Contracts\Logging\Log', 'Psr\Log\LoggerInterface'],
- 'mailer' => ['Illuminate\Mail\Mailer', 'Illuminate\Contracts\Mail\Mailer', 'Illuminate\Contracts\Mail\MailQueue'],
- 'paginator' => 'Illuminate\Pagination\Factory',
- 'auth.password' => ['Illuminate\Auth\Passwords\PasswordBroker', 'Illuminate\Contracts\Auth\PasswordBroker'],
- 'queue' => ['Illuminate\Queue\QueueManager', 'Illuminate\Contracts\Queue\Factory', 'Illuminate\Contracts\Queue\Monitor'],
- 'queue.connection' => 'Illuminate\Contracts\Queue\Queue',
- 'redirect' => 'Illuminate\Routing\Redirector',
- 'redis' => ['Illuminate\Redis\Database', 'Illuminate\Contracts\Redis\Database'],
- 'request' => 'Illuminate\Http\Request',
- 'router' => ['Illuminate\Routing\Router', 'Illuminate\Contracts\Routing\Registrar'],
- 'session' => 'Illuminate\Session\SessionManager',
- 'session.store' => ['Illuminate\Session\Store', 'Symfony\Component\HttpFoundation\Session\SessionInterface'],
- 'url' => ['Illuminate\Routing\UrlGenerator', 'Illuminate\Contracts\Routing\UrlGenerator'],
- 'validator' => ['Illuminate\Validation\Factory', 'Illuminate\Contracts\Validation\Factory'],
- 'view' => ['Illuminate\View\Factory', 'Illuminate\Contracts\View\Factory'],
+ 'blade.compiler' => 'Illuminate\View\Compilers\BladeCompiler',
+ 'cache' => ['Illuminate\Cache\CacheManager', 'Illuminate\Contracts\Cache\Factory'],
+ 'cache.store' => ['Illuminate\Cache\Repository', 'Illuminate\Contracts\Cache\Repository'],
+ 'config' => ['Illuminate\Config\Repository', 'Illuminate\Contracts\Config\Repository'],
+ 'cookie' => ['Illuminate\Cookie\CookieJar', 'Illuminate\Contracts\Cookie\Factory', 'Illuminate\Contracts\Cookie\QueueingFactory'],
+ 'encrypter' => ['Illuminate\Encryption\Encrypter', 'Illuminate\Contracts\Encryption\Encrypter'],
+ 'db' => 'Illuminate\Database\DatabaseManager',
+ 'events' => ['Illuminate\Events\Dispatcher', 'Illuminate\Contracts\Events\Dispatcher'],
+ 'files' => 'Illuminate\Filesystem\Filesystem',
+ 'filesystem' => 'Illuminate\Contracts\Filesystem\Factory',
+ 'filesystem.disk' => 'Illuminate\Contracts\Filesystem\Filesystem',
+ 'filesystem.cloud' => 'Illuminate\Contracts\Filesystem\Cloud',
+ 'hash' => 'Illuminate\Contracts\Hashing\Hasher',
+ 'translator' => ['Illuminate\Translation\Translator', 'Symfony\Component\Translation\TranslatorInterface'],
+ 'log' => ['Illuminate\Log\Writer', 'Illuminate\Contracts\Logging\Log', 'Psr\Log\LoggerInterface'],
+ 'mailer' => ['Illuminate\Mail\Mailer', 'Illuminate\Contracts\Mail\Mailer', 'Illuminate\Contracts\Mail\MailQueue'],
+ 'paginator' => 'Illuminate\Pagination\Factory',
+ 'auth.password' => ['Illuminate\Auth\Passwords\PasswordBroker', 'Illuminate\Contracts\Auth\PasswordBroker'],
+ 'queue' => ['Illuminate\Queue\QueueManager', 'Illuminate\Contracts\Queue\Factory', 'Illuminate\Contracts\Queue\Monitor'],
+ 'queue.connection' => 'Illuminate\Contracts\Queue\Queue',
+ 'redirect' => 'Illuminate\Routing\Redirector',
+ 'redis' => ['Illuminate\Redis\Database', 'Illuminate\Contracts\Redis\Database'],
+ 'request' => 'Illuminate\Http\Request',
+ 'router' => ['Illuminate\Routing\Router', 'Illuminate\Contracts\Routing\Registrar'],
+ 'session' => 'Illuminate\Session\SessionManager',
+ 'session.store' => ['Illuminate\Session\Store', 'Symfony\Component\HttpFoundation\Session\SessionInterface'],
+ 'url' => ['Illuminate\Routing\UrlGenerator', 'Illuminate\Contracts\Routing\UrlGenerator'],
+ 'validator' => ['Illuminate\Validation\Factory', 'Illuminate\Contracts\Validation\Factory'],
+ 'view' => ['Illuminate\View\Factory', 'Illuminate\Contracts\View\Factory'],
);
foreach ($aliases as $key => $aliases)
diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php
index 510c7c826626..8d8e7150f063 100644
--- a/src/Illuminate/Foundation/Exceptions/Handler.php
+++ b/src/Illuminate/Foundation/Exceptions/Handler.php
@@ -46,6 +46,17 @@ public function report(Exception $e)
$this->log->error((string) $e);
}
+ /**
+ * Determine if the exception should be reported.
+ *
+ * @param \Exception $e
+ * @return bool
+ */
+ public function shouldReport(Exception $e)
+ {
+ return ! $this->shouldntReport($e);
+ }
+
/**
* Determine if the exception is in the "do not report" list.
*
diff --git a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
index cdb6e547ab3c..ad9f34e6f8ad 100644
--- a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
+++ b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php
@@ -4,6 +4,13 @@
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
class EventServiceProvider extends ServiceProvider {
+
+ /**
+ * The event handler mappings for the application.
+ *
+ * @var array
+ */
+ protected $listen = [];
/**
* The subscriber classes to register.
diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php
index ba13b85c23be..c23f5fffa45e 100755
--- a/src/Illuminate/Routing/Router.php
+++ b/src/Illuminate/Routing/Router.php
@@ -248,7 +248,7 @@ public function controller($uri, $controller, $names = array())
}
$routable = (new ControllerInspector)
- ->getRoutable($prepended, $uri);
+ ->getRoutable($prepended, $uri);
// When a controller is routed using this method, we use Reflection to parse
// out all of the routable methods for the controller, then register each
@@ -478,7 +478,7 @@ protected function createRoute($methods, $uri, $action)
}
$route = $this->newRoute(
- $methods, $uri = $this->prefix($uri), $action
+ $methods, $this->prefix($uri), $action
);
// If we have groups that need to be merged, we will merge them now after this
@@ -682,9 +682,9 @@ protected function runRouteWithinStack(Route $route, Request $request)
$middleware = $this->gatherRouteMiddlewares($route);
return (new Pipeline($this->container))
- ->send($request)
- ->through($middleware)
- ->then(function($request) use ($route)
+ ->send($request)
+ ->through($middleware)
+ ->then(function($request) use ($route)
{
return $this->prepareResponse(
$request,