Coder Social home page Coder Social logo

slimphp-bridge's People

Contributors

bmack avatar davidsteeb avatar dogawaf avatar s3b0 avatar spoonerweb avatar thomashempel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

slimphp-bridge's Issues

New Tag to checkout w/o @dev in v12.4

Hi, @bmack as mentioned on T3DD it'd be great to have a new tag to avoid nasty @dev composer requirements in TYPO3 CMS 12.4 LTS production systems. Afais everything is up and running, only tag is missing and eventually merge of latest PR.
Thanks in advance!

Handling of slim exception

Hi hi

If I call a non existing route, Slim throws a HttpNotFoundException, but TYPO3 does not catch it, and the client finally gets a 500.

I would like to better handle Slim errors, maybe like that:

// in \B13\SlimPhp\Middleware\SlimInitiator::process

try {
    return $app->handle($request);
} catch (HttpException $e) {
    $errorController = GeneralUtility::makeInstance(ErrorController::class);
    
    return match ($e->getCode()) {
        503 => $errorController->unavailableAction($request, $e->getMessage()),
        500 => $errorController->internalErrorAction($request, $e->getMessage()),
        404 => $errorController->pageNotFoundAction($request, $e->getMessage()),
        403 => $errorController->accessDeniedAction($request, $e->getMessage()),
        default => throw $e,
    };
}

It's better because the configured TYPO3 errorHandlers will be triggered.
One thing it's not cool, it is that the content-type of the request is not properly detected (html response instead of a json response).

What do you think @bmack ?

TYPO3 v12 with ExtbaseBridge throws an exception

Exception:
Call to a member function getSetupArray() on null in /var/www/html/src/autotypo/vendor/typo3/cms-extbase/Classes/Configuration/FrontendConfigurationManager.php line 193

Configuration:

services:
VENDOR\Myext\Controller\TestController:
public: true

Middlewares in route config: only B13\SlimPhp\Middleware\ExtbaseBridge

The Attribute "frontend.typoscript" is not set at this moment

TYPO3 v12 [dev-main] TypeError

strtolower(): Argument #1 ($string) must be of type string, TYPO3\CMS\Core\Localization\Locale given

in vendor/b13/slimphp-bridge/src/Service/RequestedLanguageToSiteLanguageResolverService.php line 36

is thrown, if B13\SlimPhp\Middleware\PreferredClientLanguageSelector middleware is set.
This is caused by resolved https://forge.typo3.org/issues/99812.

A type-cast to string is required.

[$locale] = explode('.', strtolower((string)$language->getLocale()));

TYPO3 10.4 and guzzlehttp/psr7 1.x

Hello

On a TYPO3 10.4, I've just updated b13/slimphp-bridge to 0.4.0 with composer update -W b13/slimphp-bridge.
The version of slim raised (because of -W) from 4.8.1 to 4.10.0, but this new version of slim does not autodetect guzzlehttp/psr7 1.x anymore.

(1/1) RuntimeException
Could not detect any PSR-17 ResponseFactory implementations. Please install a supported implementation in order to use `AppFactory::create()`. See https://github.com/slimphp/Slim/blob/4.x/README.md for a list of supported implementations.

I had to require sapphirecat/slim4-http-interop-adapter in order to get things right again.
See their README for a detailed explanation.

Because typo3/cms-core 10.4 requires guzzlehttp/psr7:^1.8.5 (11.5+ allows guzzlehttp/psr7:^1.8.5 || ^2.1.2), I think sapphirecat/slim4-http-interop-adapter should also require for b13/slimphp-bridge

Adding robots.txt leads to error 404

Having the following site config, leads to an "#404 Slim\Exception\HttpNotFoundException" error

routes:
  -
    prefix: /api
    groups:
      -
        routePath: /v1/de
        routes:
          -
            methods:
              - get
            routePath: /locations
            callback: 'Cp\WmdTemplate\Controller\AjaxController:filteredLocationsAction'
  -
    route: robots.txt
    type: staticText
    content: "User-agent: *\r\nDisallow: /typo3/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"

PHP 8 compatibility

I run a TYPO3 V11 on aPHP 8.1 machine, and tried to port my REST API to the slimphp-bridge.

Unfortunatly the user version nyholm/psr7-server is quite old and is not compatible with PHP 8. As far as I can see, the lib is used in the unit tests.

Would it be possible to raise the version of nyholm/psr7-server to at least 1.0.1 which added PHP 8 support?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.