// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (Exception $e) {
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
}
}
// Here we will run this query. If an exception occurs we'll determine if it was
// caused by a connection that has been lost. If that is the cause, we'll try
// to re-establish connection and re-run the query with a fresh connection.
try {
$result = $this->runQueryCallback($query, $bindings, $callback);
} catch (QueryException $e) {
$result = $this->handleQueryException(
$e, $query, $bindings, $callback
);
}
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
return $statement->fetchAll();
});
}
/**
* Run a select statement against the database and returns a generator.
*
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->connection()->$method(...$parameters);
}
}
$seconds = $s . 'seconds';
}
if($d == 0 && $h == 0 && $m == 0 && $s == 0) {
return redirect()->route('not-found');
}
app('db')->select("INSERT IGNORE INTO `links` (`uri`) VALUES (?)", [$param]);
$time = $days . $hours . $minutes . $seconds;
$timer = strtotime($time) - time();
function getTitle($n, $t, $spell = NULL) {
if($n <= 0) return '';
if($spell) {
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed $value
* @return mixed
*/
public static function unwrapIfClosure($value)
{
return $value instanceof Closure ? $value() : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
*
* @throws \InvalidArgumentException
*/
public function call($callback, array $parameters = [], $defaultMethod = null)
{
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
}
/**
* Get a closure to resolve the given type from the container.
*
*/
protected function callControllerCallable(callable $callable, array $parameters = [])
{
try {
return $this->prepareResponse(
$this->call($callable, $parameters)
);
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
return $this->callLumenControllerWithMiddleware(
$instance, $method, $routeInfo, $middleware
);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
}
/**
if (! method_exists($instance = $this->make($controller), $method)) {
throw new NotFoundHttpException;
}
if ($instance instanceof LumenController) {
return $this->callLumenController($instance, $method, $routeInfo);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
foreach ($action as $value) {
if ($value instanceof Closure) {
$callable = $value->bindTo(new RoutingClosure);
return $this->callActionOnArrayBasedRoute($this['request']->route());
}));
}
return $this->prepareResponse(
$this->callActionOnArrayBasedRoute($routeInfo)
);
}
/**
* Call the Closure or invokable on the array based route.
case Dispatcher::NOT_FOUND:
throw new NotFoundHttpException;
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->handleFoundRoute($routeInfo);
}
}
/**
* Handle a route found by the dispatcher.
if (isset($this->router->getRoutes()[$method.$pathInfo])) {
return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
}
return $this->handleDispatcherResponse(
$this->createDispatcher()->dispatch($method, $pathInfo)
);
});
} catch (Throwable $e) {
return $this->prepareResponse($this->sendExceptionToHandler($e));
}
->send($this->make('request'))
->through($middleware)
->then($then);
}
return $then($this->make('request'));
}
/**
* Prepare the response for sending.
*
}
return $this->handleDispatcherResponse(
$this->createDispatcher()->dispatch($method, $pathInfo)
);
});
} catch (Throwable $e) {
return $this->prepareResponse($this->sendExceptionToHandler($e));
}
}
* @param \Symfony\Component\HttpFoundation\Request|null $request
* @return void
*/
public function run($request = null)
{
$response = $this->dispatch($request);
if ($response instanceof SymfonyResponse) {
$response->send();
} else {
echo (string) $response;
<?php
$app = require __DIR__.'/bootstrap/app.php';
$app->run();
// For select statements, we'll simply execute the query and return an array
// of the database result set. Each element in the array will be a single
// row from the database table, and will either be an array or objects.
$statement = $this->prepared(
$this->getPdoForSelect($useReadPdo)->prepare($query)
);
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
// For select statements, we'll simply execute the query and return an array
// of the database result set. Each element in the array will be a single
// row from the database table, and will either be an array or objects.
$statement = $this->prepared(
$this->getPdoForSelect($useReadPdo)->prepare($query)
);
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
{
// To execute the statement, we'll simply call the callback, which will actually
// run the SQL against the PDO connection. Then we can calculate the time it
// took to execute and log the query SQL, bindings and time in our memory.
try {
return $callback($query, $bindings);
}
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
// Here we will run this query. If an exception occurs we'll determine if it was
// caused by a connection that has been lost. If that is the cause, we'll try
// to re-establish connection and re-run the query with a fresh connection.
try {
$result = $this->runQueryCallback($query, $bindings, $callback);
} catch (QueryException $e) {
$result = $this->handleQueryException(
$e, $query, $bindings, $callback
);
}
$this->bindValues($statement, $this->prepareBindings($bindings));
$statement->execute();
return $statement->fetchAll();
});
}
/**
* Run a select statement against the database and returns a generator.
*
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->connection()->$method(...$parameters);
}
}
$seconds = $s . 'seconds';
}
if($d == 0 && $h == 0 && $m == 0 && $s == 0) {
return redirect()->route('not-found');
}
app('db')->select("INSERT IGNORE INTO `links` (`uri`) VALUES (?)", [$param]);
$time = $days . $hours . $minutes . $seconds;
$timer = strtotime($time) - time();
function getTitle($n, $t, $spell = NULL) {
if($n <= 0) return '';
if($spell) {
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed $value
* @return mixed
*/
public static function unwrapIfClosure($value)
{
return $value instanceof Closure ? $value() : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
*
* @throws \InvalidArgumentException
*/
public function call($callback, array $parameters = [], $defaultMethod = null)
{
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
}
/**
* Get a closure to resolve the given type from the container.
*
*/
protected function callControllerCallable(callable $callable, array $parameters = [])
{
try {
return $this->prepareResponse(
$this->call($callable, $parameters)
);
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
return $this->callLumenControllerWithMiddleware(
$instance, $method, $routeInfo, $middleware
);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
}
/**
if (! method_exists($instance = $this->make($controller), $method)) {
throw new NotFoundHttpException;
}
if ($instance instanceof LumenController) {
return $this->callLumenController($instance, $method, $routeInfo);
} else {
return $this->callControllerCallable(
[$instance, $method], $routeInfo[2]
);
}
protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
foreach ($action as $value) {
if ($value instanceof Closure) {
$callable = $value->bindTo(new RoutingClosure);
return $this->callActionOnArrayBasedRoute($this['request']->route());
}));
}
return $this->prepareResponse(
$this->callActionOnArrayBasedRoute($routeInfo)
);
}
/**
* Call the Closure or invokable on the array based route.
case Dispatcher::NOT_FOUND:
throw new NotFoundHttpException;
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->handleFoundRoute($routeInfo);
}
}
/**
* Handle a route found by the dispatcher.
if (isset($this->router->getRoutes()[$method.$pathInfo])) {
return $this->handleFoundRoute([true, $this->router->getRoutes()[$method.$pathInfo]['action'], []]);
}
return $this->handleDispatcherResponse(
$this->createDispatcher()->dispatch($method, $pathInfo)
);
});
} catch (Throwable $e) {
return $this->prepareResponse($this->sendExceptionToHandler($e));
}
->send($this->make('request'))
->through($middleware)
->then($then);
}
return $then($this->make('request'));
}
/**
* Prepare the response for sending.
*
}
return $this->handleDispatcherResponse(
$this->createDispatcher()->dispatch($method, $pathInfo)
);
});
} catch (Throwable $e) {
return $this->prepareResponse($this->sendExceptionToHandler($e));
}
}
* @param \Symfony\Component\HttpFoundation\Request|null $request
* @return void
*/
public function run($request = null)
{
$response = $this->dispatch($request);
if ($response instanceof SymfonyResponse) {
$response->send();
} else {
echo (string) $response;
<?php
$app = require __DIR__.'/bootstrap/app.php';
$app->run();
[2/2]
QueryException
|
---|
Illuminate\Database\QueryException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'conterwtools_timer_cl0ck.links' doesn't exist (SQL: INSERT IGNORE INTO `links` (`uri`) VALUES (100069933376-hours-timer)) at /home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:703 at Illuminate\Database\Connection->runQueryCallback('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:663) at Illuminate\Database\Connection->run('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:367) at Illuminate\Database\Connection->select('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/illuminate/database/DatabaseManager.php:388) at Illuminate\Database\DatabaseManager->__call('select', array('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/app/Http/Controllers/MainController.php:135) at App\Http\Controllers\MainController->withParam('100069933376-hours-timer') (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/conterwtools/timerclock.net/vendor/illuminate/container/Util.php:40) at Illuminate\Container\Util::unwrapIfClosure(object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), array(object(MainController), 'withParam'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call(object(Application), array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer'), null) (/home/conterwtools/timerclock.net/vendor/illuminate/container/Container.php:653) at Illuminate\Container\Container->call(array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389) at Laravel\Lumen\Application->callControllerCallable(array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:355) at Laravel\Lumen\Application->callLumenController(object(MainController), 'withParam', array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329) at Laravel\Lumen\Application->callControllerAction(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282) at Laravel\Lumen\Application->callActionOnArrayBasedRoute(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:267) at Laravel\Lumen\Application->handleFoundRoute(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request)) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429) at Laravel\Lumen\Application->sendThroughPipeline(array(), object(Closure)) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175) at Laravel\Lumen\Application->dispatch(null) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/home/conterwtools/timerclock.net/index.php:5) |
[1/2]
PDOException
|
---|
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'conterwtools_timer_cl0ck.links' doesn't exist at /home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:359 at PDO->prepare('INSERT IGNORE INTO `links` (`uri`) VALUES (?)') (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:359) at Illuminate\Database\Connection->Illuminate\Database\{closure}('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:696) at Illuminate\Database\Connection->runQueryCallback('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:663) at Illuminate\Database\Connection->run('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/database/Connection.php:367) at Illuminate\Database\Connection->select('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/illuminate/database/DatabaseManager.php:388) at Illuminate\Database\DatabaseManager->__call('select', array('INSERT IGNORE INTO `links` (`uri`) VALUES (?)', array('100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/app/Http/Controllers/MainController.php:135) at App\Http\Controllers\MainController->withParam('100069933376-hours-timer') (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/conterwtools/timerclock.net/vendor/illuminate/container/Util.php:40) at Illuminate\Container\Util::unwrapIfClosure(object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), array(object(MainController), 'withParam'), object(Closure)) (/home/conterwtools/timerclock.net/vendor/illuminate/container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call(object(Application), array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer'), null) (/home/conterwtools/timerclock.net/vendor/illuminate/container/Container.php:653) at Illuminate\Container\Container->call(array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389) at Laravel\Lumen\Application->callControllerCallable(array(object(MainController), 'withParam'), array('param' => '100069933376-hours-timer')) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:355) at Laravel\Lumen\Application->callLumenController(object(MainController), 'withParam', array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329) at Laravel\Lumen\Application->callControllerAction(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282) at Laravel\Lumen\Application->callActionOnArrayBasedRoute(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:267) at Laravel\Lumen\Application->handleFoundRoute(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse(array(1, array('uses' => 'App\\Http\\Controllers\\MainController@withParam'), array('param' => '100069933376-hours-timer'))) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request)) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429) at Laravel\Lumen\Application->sendThroughPipeline(array(), object(Closure)) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175) at Laravel\Lumen\Application->dispatch(null) (/home/conterwtools/timerclock.net/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/home/conterwtools/timerclock.net/index.php:5) |