Thanks to visit codestin.com
Credit goes to github.com

Skip to content

In Kernel.php line 704: [ErrorException] Warning: unlink(/home/dev/prj/var/cache/de_/ContainerNipRDo8.legacy) #26158

@lemenendez

Description

@lemenendez
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version 4.0.4

In some cases the @ unlink php function breaks the execution of the code instead of returning false.
I am using php 7.2

When was trying to use the console, suddendly I start getting errors about the imposibily to @ unlink a certain file under the cache folder because it does not exists.

So what I did was to modify these lines of code in order to use the console

Kernel.php

instead of @Unlink(dirname($dir.$file).'.legacy');
line: 703
if (file_exists(dirname($dir.$file).'.legacy')) @Unlink(dirname($dir.$file).'.legacy');


Filesystem.php 184
elseif (file_exists($file) && !@Unlink($file) )

Checking the file befor unlink did the trick in both cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions