* @param int $code Error code.
*/
protected function onConnectionError($message, $code = 0)
{
CommunicationException::handle(
new ConnectionException($this, "$message [{$this->getParameters()}]", $code)
);
}
/**
* Helper method to handle protocol errors.
{
$socket = $this->getResource();
$chunk = fgets($socket);
if ($chunk === false || $chunk === '') {
$this->onConnectionError('Error while reading line from the server.');
}
$prefix = $chunk[0];
$payload = substr($chunk, 1, -2);
/**
* {@inheritdoc}
*/
public function readResponse(CommandInterface $command)
{
return $this->read();
}
/**
* Helper method to handle connection errors.
*
*/
public function executeCommand(CommandInterface $command)
{
$this->writeRequest($command);
return $this->readResponse($command);
}
/**
* {@inheritdoc}
*/
*/
public function connect()
{
if (parent::connect() && $this->initCommands) {
foreach ($this->initCommands as $command) {
$response = $this->executeCommand($command);
if ($response instanceof ErrorResponseInterface && $command->getId() === 'CLIENT') {
// Do nothing on CLIENT SETINFO command failure
} elseif ($response instanceof ErrorResponseInterface) {
$this->onConnectionError("`{$command->getId()}` failed: {$response->getMessage()}", 0);
{
if (isset($this->resource)) {
return $this->resource;
}
$this->connect();
return $this->resource;
}
/**
*
* @param string $buffer Representation of a command in the Redis wire protocol.
*/
protected function write($buffer)
{
$socket = $this->getResource();
while (($length = strlen($buffer)) > 0) {
$written = is_resource($socket) ? @fwrite($socket, $buffer) : false;
if ($length === $written) {
foreach ($arguments as $argument) {
$arglen = strlen(strval($argument));
$buffer .= "\${$arglen}\r\n{$argument}\r\n";
}
$this->write($buffer);
}
}
/**
* {@inheritdoc}
*/
public function executeCommand(CommandInterface $command)
{
$this->writeRequest($command);
return $this->readResponse($command);
}
/**
/**
* {@inheritdoc}
*/
public function executeCommand(CommandInterface $command)
{
$response = $this->connection->executeCommand($command);
if ($response instanceof ResponseInterface) {
if ($response instanceof ErrorResponseInterface) {
$response = $this->onErrorResponse($command, $response);
}
* {@inheritdoc}
*/
public function __call($commandID, $arguments)
{
return $this->executeCommand(
$this->createCommand($commandID, $arguments)
);
}
/**
* {@inheritdoc}
*/
public function command($method, array $parameters = [])
{
$start = microtime(true);
$result = $this->client->{$method}(...$parameters);
$time = round((microtime(true) - $start) * 1000, 2);
if (isset($this->events)) {
$this->event(new CommandExecuted(
{
if (static::hasMacro($method)) {
return $this->macroCall($method, $parameters);
}
return $this->command($method, $parameters);
}
}
* @param string|array $key
* @return mixed
*/
public function get($key)
{
$value = $this->connection()->get($this->prefix.$key);
return ! is_null($value) ? $this->unserialize($value) : null;
}
/**
{
if (is_array($key)) {
return $this->many($key);
}
$value = $this->store->get($this->itemKey($key));
// If we could not find the cache value, we will fire the missed event and get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (is_null($value)) {
* @param array|string $key
* @return bool
*/
public function has($key): bool
{
return ! is_null($this->get($key));
}
/**
* Determine if an item doesn't exist in the cache.
*
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->store()->$method(...$parameters);
}
}
$providers = [];
$namespaces = [];
$cachekey_namespaces = 'plugin_namespaces';
$cachekey_providers = 'plugin_providers';
if (cache()->has($cachekey_namespaces) && cache()->has($cachekey_providers)) {
$providers = cache($cachekey_providers);
if (!is_array($providers) || empty($providers)) {
$providers = [];
}
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 ...$args
* @return mixed
*/
public static function unwrapIfClosure($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $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.
*
$this->buildStack[] = $className;
$pushedToBuildStack = true;
}
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
if ($pushedToBuildStack) {
array_pop($this->buildStack);
}
protected function bootProvider(ServiceProvider $provider)
{
$provider->callBootingCallbacks();
if (method_exists($provider, 'boot')) {
$this->call([$provider, 'boot']);
}
$provider->callBootedCallbacks();
}
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
}
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$app->boot();
}
}
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
Cache::get($cacheKey);
*/
$response = tap($kernel->handle(
$request = Request::capture()
))->send();
$kernel->terminate($request, $response);
ConnectionException
|
---|
Predis\Connection\ConnectionException: Error while reading line from the server. [tcp://127.0.0.1:6379] at /home/samsung2/public_html/vendor/predis/predis/src/Connection/AbstractConnection.php:144 at Predis\Connection\AbstractConnection->onConnectionError('Error while reading line from the server.') (/home/samsung2/public_html/vendor/predis/predis/src/Connection/StreamConnection.php:291) at Predis\Connection\StreamConnection->read() (/home/samsung2/public_html/vendor/predis/predis/src/Connection/AbstractConnection.php:132) at Predis\Connection\AbstractConnection->readResponse(object(RawCommand)) (/home/samsung2/public_html/vendor/predis/predis/src/Connection/AbstractConnection.php:124) at Predis\Connection\AbstractConnection->executeCommand(object(RawCommand)) (/home/samsung2/public_html/vendor/predis/predis/src/Connection/StreamConnection.php:232) at Predis\Connection\StreamConnection->connect() (/home/samsung2/public_html/vendor/predis/predis/src/Connection/AbstractConnection.php:169) at Predis\Connection\AbstractConnection->getResource() (/home/samsung2/public_html/vendor/predis/predis/src/Connection/StreamConnection.php:265) at Predis\Connection\StreamConnection->write('*2 $3 GET $41 samsungazetesicom:cache:plugin_namespaces ') (/home/samsung2/public_html/vendor/predis/predis/src/Connection/StreamConnection.php:372) at Predis\Connection\StreamConnection->writeRequest(object(GET)) (/home/samsung2/public_html/vendor/predis/predis/src/Connection/AbstractConnection.php:122) at Predis\Connection\AbstractConnection->executeCommand(object(GET)) (/home/samsung2/public_html/vendor/predis/predis/src/Client.php:381) at Predis\Client->executeCommand(object(GET)) (/home/samsung2/public_html/vendor/predis/predis/src/Client.php:336) at Predis\Client->__call('get', array('plugin_namespaces')) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:116) at Illuminate\Redis\Connections\Connection->command('get', array('plugin_namespaces')) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:229) at Illuminate\Redis\Connections\Connection->__call('get', array('plugin_namespaces')) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:62) at Illuminate\Cache\RedisStore->get('plugin_namespaces') (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:99) at Illuminate\Cache\Repository->get('plugin_namespaces') (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:70) at Illuminate\Cache\Repository->has('plugin_namespaces') (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:408) at Illuminate\Cache\CacheManager->__call('has', array('plugin_namespaces')) (/home/samsung2/public_html/te/base/src/Providers/PluginServiceProvider.php:81) at TE\Base\Providers\PluginServiceProvider->boot() (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41) at Illuminate\Container\Util::unwrapIfClosure(object(Closure)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), array(object(PluginServiceProvider), 'boot'), object(Closure)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call(object(Application), array(object(PluginServiceProvider), 'boot'), array(), null) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:661) at Illuminate\Container\Container->call(array(object(PluginServiceProvider), 'boot')) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:929) at Illuminate\Foundation\Application->bootProvider(object(PluginServiceProvider)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:910) at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(object(PluginServiceProvider), 34) at array_walk(array(object(EventServiceProvider), object(LogServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(ParallelTestingServiceProvider), object(FoundationServiceProvider), object(NotificationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ViewServiceProvider), object(MarkdownServiceProvider), object(ServiceProvider), object(ServiceProvider), object(ServiceProvider), object(TextToSpeechServiceProvider), object(CorsServiceProvider), object(ImageServiceProvider), object(FormBuilderServiceProvider), object(ImpersonateServiceProvider), object(SanctumServiceProvider), object(ServiceProvider), object(ExcelServiceProvider), object(PurifierServiceProvider), object(ServiceProvider), object(TermwindServiceProvider), object(AmpServiceProvider), object(BackupServiceProvider), object(CacheServiceProvider), object(SettingsServiceProvider), object(PluginServiceProvider), object(BaseServiceProvider), object(CommandServiceProvider), object(EventServiceProvider), object(SupportServiceProvider), object(RouteServiceProvider), object(BladeServiceProvider), object(ViewComposerServiceProvider), object(CountriesServiceProvider), object(FormServiceProvider), object(BreadcrumbsServiceProvider), object(BigdataServiceProvider), object(CategoryServiceProvider), object(ContactServiceProvider), object(DashboardServiceProvider), object(LogViewerServiceProvider), object(MaintenanceModeServiceProvider), object(MediaServiceProvider), object(MemberServiceProvider), object(MenuServiceProvider), object(MobileServiceProvider), object(MobileappServiceProvider), object(PageServiceProvider), object(RedirectionServiceProvider), object(SeoHelperServiceProvider), object(ShortcodeServiceProvider), object(SitemapServiceProvider), object(SlugServiceProvider), object(TableServiceProvider), object(RouteServiceProvider), object(ThemeServiceProvider), object(UsersServiceProvider), object(WidgetServiceProvider), object(ZiggyServiceProvider), object(HtmlServiceProvider), object(HtmlServiceProvider), object(ButtonsServiceProvider), object(DataTablesServiceProvider), object(AppServiceProvider), object(AuthServiceProvider), object(EventServiceProvider), object(RouteServiceProvider), object(CacheServiceProvider), object(RedisServiceProvider), object(CommandServiceProvider)), object(Closure)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:911) at Illuminate\Foundation\Application->boot() (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17) at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(object(Application)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:242) at Illuminate\Foundation\Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders')) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176) at Illuminate\Foundation\Http\Kernel->bootstrap() (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:160) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request)) (/home/samsung2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134) at Illuminate\Foundation\Http\Kernel->handle(object(Request)) (/home/samsung2/public_html/public/index.php:73) |