Skip to content

Doctrine File Upload example uses __DIR__ #3363

Closed
@oscargala

Description

@oscargala

One of the SensioLabs Insight checks for the use of absolute path constants like DIR and FILE.

In the Doctrine File Upload example DIR is being used:
https://github.com/symfony/symfony-docs/blob/2.4/cookbook/doctrine/file_uploads.rst

   protected function getUploadRootDir()
    {
        // the absolute directory path where uploaded
        // documents should be saved
        return __DIR__.'/../../../../web/'.$this->getUploadDir();
    }

I don't have a fix myself yet. Maybe someone else knows the best way to remove DIR from this class?

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