$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response,1);
if ($json === null
&& json_last_error() !== JSON_ERROR_NONE) {
$int_data = str_replace(['\\"','\\'], '', $int_data);
$json = json_decode($int_data,1);
}
return $json;
}
public function slug2text($var){
protected function registerErrorHandling()
{
error_reporting(-1);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
$this->handleError($level, $message, $file, $line);
});
set_exception_handler(function ($e) {
$this->handleException($e);
});
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response,1);
if ($json === null
&& json_last_error() !== JSON_ERROR_NONE) {
$int_data = str_replace(['\\"','\\'], '', $int_data);
$json = json_decode($int_data,1);
}
return $json;
}
public function slug2text($var){
}
}
return $data;
}
function getData($ytid){
$result = $this->http2api('video',['url'=>'https://www.youtube.com/watch?v='.$ytid]);
return $result;
}
function cleanText($str){
$str = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) {
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UTF-16BE');
Storage::disk('local')->put($fileName, implode("\n", array_filter(array_unique($file))));
}
return $file;
}
public function download($ytid,$slug){
$data = ['related'=>array_reverse($this->Yt->trending()),'info'=>($this->Yt->getData($ytid))];
return view('downloads',compact('data'));
}
//
}
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;
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$app->run();
ErrorException
|
---|
ErrorException: Undefined variable: int_data at /www/wwwroot/mobilagu.com/app/Utils/Youtube.php:32 at Laravel\Lumen\Application->handleError() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php:47) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/www/wwwroot/mobilagu.com/app/Utils/Youtube.php:32) at App\Utils\Youtube->http2api() (/www/wwwroot/mobilagu.com/app/Utils/Youtube.php:152) at App\Utils\Youtube->getData() (/www/wwwroot/mobilagu.com/app/Http/Controllers/PageController.php:98) at App\Http\Controllers\PageController->download() (/www/wwwroot/mobilagu.com/vendor/illuminate/container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/www/wwwroot/mobilagu.com/vendor/illuminate/container/Util.php:40) at Illuminate\Container\Util::unwrapIfClosure() (/www/wwwroot/mobilagu.com/vendor/illuminate/container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/www/wwwroot/mobilagu.com/vendor/illuminate/container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call() (/www/wwwroot/mobilagu.com/vendor/illuminate/container/Container.php:653) at Illuminate\Container\Container->call() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389) at Laravel\Lumen\Application->callControllerCallable() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:355) at Laravel\Lumen\Application->callLumenController() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329) at Laravel\Lumen\Application->callControllerAction() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282) at Laravel\Lumen\Application->callActionOnArrayBasedRoute() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:267) at Laravel\Lumen\Application->handleFoundRoute() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429) at Laravel\Lumen\Application->sendThroughPipeline() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175) at Laravel\Lumen\Application->dispatch() (/www/wwwroot/mobilagu.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/www/wwwroot/mobilagu.com/public/index.php:28) |