-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help Wanted : SlimFramework 3 #311
Comments
Today I'm having something like this (not finished). Which work well but I'm still facing the same (cache?) issue. <?php
namespace Boostrap;
use Interop\Http\Server\RequestHandlerInterface;
use PHPPM\Bootstraps\ApplicationEnvironmentAwareInterface;
use PHPPM\Bootstraps\BootstrapInterface;
use PHPPM\Bootstraps\HooksInterface;
use PHPPM\Bootstraps\RequestClassProviderInterface;
use Psr\Http\Message\ServerRequestInterface;
use Slim\App;
use Slim\Container;
use Slim\Http\Response;
class SlimBootstrap implements ApplicationEnvironmentAwareInterface, RequestHandlerInterface
{
protected $appenv;
protected $debug = false;
/**
* @var App
*/
protected $app;
public function initialize($appenv, $debug)
{
$this->appenv = $appenv;
$this->debug = $debug;
$app = new App($this->getContainer());
include 'app/routes.php';
include 'app/middlewares.php';
$this->app = $app;
}
private function getContainer()
{
$logger = function($container) {
$logger = new Logger(getenv('APP_NAME') ?? 'Slim');
$logger->pushHandler(new RotatingFileHandler('/log.txt'));
return $logger;
};
return new Container([
'settings' => [
'displayErrorDetails' => ($this->appenv !== 'prod')
],
'logger' => $logger
]);
}
public function handle(ServerRequestInterface $request)
{
$response = $this->app->process(
$request,
new Response());
return $response;
}
} For testing, I tried unsetting |
It might help asking at the Slim repo/forums. |
Slim 3 supports PSR-7, right? Anyone successful running Slim 3 with PHP-PM without any bridge? |
If it does we still need a way to pass the request into the framework. The base repo has 2 middleware bridges for that purpose but- looking at the code above- interacting with Slim takes more and we'll require Slim kx to implement it. |
Hi,
I'm trying to build a SlimFramework Bridge for PPM. For now I'm able to run it, but I'm having issues with caching.
First, I don't know how to manage request caching. If I run a request that could change over the time, I will always have the same result.
Next is for JWT protected requests. If I run a protected request without my token in the header. I obviously get a
401 Unauthorized
response. So I run another request on the same path but, this time, with a JWT, I get the ressources I asked for. For now it's absolutely legit.Let's run a third request, still on the same path but without JWT. I expect another 401 error. But no, I get the ressource I asked for, without authentication.
Can someone give help to destroy data between requests ?
Obviously when finished I'll push it to PPM Github
The text was updated successfully, but these errors were encountered: