xabbuh
Repos
228
Followers
435
Following
7

Provides additional data mappers that ease the use of the Symfony Form component with rich models.

209
9

OAuth1 authentication for the HTTPlug library.

5
1

basic PHP client for the Panda encoding service

12
5

The Symfony PHP framework

27460
8580

The Symfony documentation

1988
4728

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2739
695

Events

issue comment
ContainerConfigurator does not support xml

If this was meant as a bug report, I think you need to provide more details (especially how to reproduce and how not supported XML is related to a YAML file that could not be found).

Created at 2 hours ago
issue comment
[Messenger] Pass sender details to SendMessageToTransportsEvent

I don't think so. Let's close here.

Created at 9 hours ago
closed issue
[Messenger] Pass sender details to SendMessageToTransportsEvent

| Q | A | ------------ | --- | Feature PR | symfony/symfony#40152 | PR author(s) | @Jeroeny | Merged in | 6.2

Created at 9 hours ago
closed issue
[Last-Modified + Expires] inexplicable NGINX proxy behavior

Symfony version(s) affected

5.4.*

Description

NGINX Proxy return expires: -1 (not NGINX bug)

expires: -1 
pragma: no-cache 

But Symfony send to NGINX actual data

Expires: Thu, 08 Sep 2022 20:09:52 GMT
Content-Type: image/png
Cache-Control: public
Date: Thu, 08 Sep 2022 20:09:22 GMT 

Controller action

        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content); 
        return $response;

Simple php code - NO Bugs

<?php
$file = 'image.png';
header("Cache-Control: public");
header('Date: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 10));

header("Content-Type: image/png");
    
readfile($file);

How to reproduce

Let's make sure that this is a mistake in Symphony

version: "3.4"

services:
  php-app:
    image: php:7.4-fpm
    restart: always
    volumes:
      - ../docker/php:/var/www/html
    command:
      - bash
      - "-c"
      - php -S 0.0.0.0:80
    expose:
      - "80"
    ports:
      - "8088:80"

  proxy-nginx:
    image: nginx:latest
    restart: always
    volumes:
      - ../docker/nginx/server.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "8002:80"

/docker/php contain:

  • index.php
  • image.png

index.php content

<?php
$file = 'image.png';
header("Cache-Control: public");
header('Date: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 10));

header("Content-Type: image/png");

readfile($file);

server.conf content

upstream backend {
    server php-app;
}

proxy_cache_path  /tmp/nginx-cache
    levels=1:2
    keys_zone=CACHE_DEFAULT:15m
    inactive=7d
    max_size=10m;

server {
    listen 80;
    server_name  _;

    root  /app/public;
    index index.php;

    location / {
        proxy_cache CACHE_DEFAULT;
        proxy_pass http://backend;
    }
}

Response Headers

http://127.0.0.1:8002

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:27:36 GMT
Content-Type: image/png
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Expires: Fri, 09 Sep 2022 00:27:46 GMT

BUG Where

Create new Symfony project. Create Controller


<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;

class TestController extends AbstractController
{
    /**
     * @Route("/test1", name="app_test1")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test1(): BinaryFileResponse
    {
        return new BinaryFileResponse(__DIR__.'/image.png');
    }

    /**
     * @Route("/test2", name="app_test2")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test2(): Response
    {
        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content);
        return $response;
    }

    /**
     * @Route("/test3", name="app_test3")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test3(): Response
    {
        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content);
        $response->setLastModified(\DateTime::createFromFormat('U', time()));
        return $response;
    }
}

Response Headers

test1

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:39:03 GMT
Content-Type: image/png
Content-Length: 6838
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Last-Modified: Thu, 08 Sep 2022 21:37:40 GMT
Expires: Fri, 09 Sep 2022 00:39:13 GMT
X-Debug-Token: 95e9eb
X-Debug-Token-Link: http://backend/_profiler/95e9eb
X-Robots-Tag: noindex
Accept-Ranges: bytes

test2

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:39:39 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
pragma: no-cache
expires: -1 <==================================== BUG!
X-Debug-Token: a53ba9
X-Debug-Token-Link: http://backend/_profiler/a53ba9
X-Robots-Tag: noindex

test3

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:40:23 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Last-Modified: Fri, 09 Sep 2022 00:40:23 GMT
Expires: Fri, 09 Sep 2022 00:40:33 GMT
X-Debug-Token: 076823
X-Debug-Token-Link: http://backend/_profiler/076823
X-Robots-Tag: noindex

Possible Solution

[Last-Modified + Expires] I do not understand how these two headers are connected, but without Last-Modified a bug appears

Created at 9 hours ago
closed issue
[Last-Modified + Expires] inexplicable NGINX proxy behavior

Symfony version(s) affected

5.4.*

Description

NGINX Proxy return expires: -1 (not NGINX bug)

expires: -1 
pragma: no-cache 

But Symfony send to NGINX actual data

Expires: Thu, 08 Sep 2022 20:09:52 GMT
Content-Type: image/png
Cache-Control: public
Date: Thu, 08 Sep 2022 20:09:22 GMT 

Controller action

        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content); 
        return $response;

Simple php code - NO Bugs

<?php
$file = 'image.png';
header("Cache-Control: public");
header('Date: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 10));

header("Content-Type: image/png");
    
readfile($file);

How to reproduce

Let's make sure that this is a mistake in Symphony

version: "3.4"

services:
  php-app:
    image: php:7.4-fpm
    restart: always
    volumes:
      - ../docker/php:/var/www/html
    command:
      - bash
      - "-c"
      - php -S 0.0.0.0:80
    expose:
      - "80"
    ports:
      - "8088:80"

  proxy-nginx:
    image: nginx:latest
    restart: always
    volumes:
      - ../docker/nginx/server.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "8002:80"

/docker/php contain:

  • index.php
  • image.png

index.php content

<?php
$file = 'image.png';
header("Cache-Control: public");
header('Date: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 10));

header("Content-Type: image/png");

readfile($file);

server.conf content

upstream backend {
    server php-app;
}

proxy_cache_path  /tmp/nginx-cache
    levels=1:2
    keys_zone=CACHE_DEFAULT:15m
    inactive=7d
    max_size=10m;

server {
    listen 80;
    server_name  _;

    root  /app/public;
    index index.php;

    location / {
        proxy_cache CACHE_DEFAULT;
        proxy_pass http://backend;
    }
}

Response Headers

http://127.0.0.1:8002

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:27:36 GMT
Content-Type: image/png
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Expires: Fri, 09 Sep 2022 00:27:46 GMT

BUG Where

Create new Symfony project. Create Controller


<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;

class TestController extends AbstractController
{
    /**
     * @Route("/test1", name="app_test1")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test1(): BinaryFileResponse
    {
        return new BinaryFileResponse(__DIR__.'/image.png');
    }

    /**
     * @Route("/test2", name="app_test2")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test2(): Response
    {
        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content);
        return $response;
    }

    /**
     * @Route("/test3", name="app_test3")
     * @Cache(expires="+10 sec", public=true)
     */
    public function test3(): Response
    {
        $content = file_get_contents(__DIR__.'/image.png');
        $response = new Response($content);
        $response->setLastModified(\DateTime::createFromFormat('U', time()));
        return $response;
    }
}

Response Headers

test1

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:39:03 GMT
Content-Type: image/png
Content-Length: 6838
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Last-Modified: Thu, 08 Sep 2022 21:37:40 GMT
Expires: Fri, 09 Sep 2022 00:39:13 GMT
X-Debug-Token: 95e9eb
X-Debug-Token-Link: http://backend/_profiler/95e9eb
X-Robots-Tag: noindex
Accept-Ranges: bytes

test2

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:39:39 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
pragma: no-cache
expires: -1 <==================================== BUG!
X-Debug-Token: a53ba9
X-Debug-Token-Link: http://backend/_profiler/a53ba9
X-Robots-Tag: noindex

test3

Server: nginx/1.23.1
Date: Fri, 09 Sep 2022 00:40:23 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Host: backend
X-Powered-By: PHP/7.4.30
Cache-Control: public
Last-Modified: Fri, 09 Sep 2022 00:40:23 GMT
Expires: Fri, 09 Sep 2022 00:40:33 GMT
X-Debug-Token: 076823
X-Debug-Token-Link: http://backend/_profiler/076823
X-Robots-Tag: noindex

Possible Solution

[Last-Modified + Expires] I do not understand how these two headers are connected, but without Last-Modified a bug appears

Created at 9 hours ago
issue comment
[Last-Modified + Expires] inexplicable NGINX proxy behavior

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.

Created at 9 hours ago
issue comment
[HttpKernel] Use Accept-Language header even if there are no enabled lo…

If this something that needs to be documented?

Created at 3 days ago
issue comment
php freezes in test environment

Can you create a small example application that allows to reproduce your issue?

Created at 4 days ago
delete branch
xabbuh delete branch debug-deprecations
Created at 1 week ago
pull request closed
debug deprecations

| Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |

Created at 1 week ago
issue comment
debug deprecations

see DaveRandom/LibDNS#26

Created at 1 week ago

debug deprecations

Created at 1 week ago

debug deprecations

Created at 1 week ago
issue comment
[HttpFoundation] Extract request matchers for better reusability

Does this need to be documented?

Created at 1 week ago
delete branch
xabbuh delete branch psalm
Created at 1 week ago
pull request closed
use a stable Psalm release

| Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |

Created at 1 week ago
pull request opened
use a stable Psalm release

| Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |

Created at 1 week ago

use a stable Psalm release

Created at 1 week ago