Skip to content
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

Doctrine File Upload example uses __DIR__ #3363

Closed
oscargala opened this issue Dec 18, 2013 · 1 comment
Closed

Doctrine File Upload example uses __DIR__ #3363

oscargala opened this issue Dec 18, 2013 · 1 comment

Comments

@oscargala
Copy link

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?

weaverryan added a commit that referenced this issue Jan 21, 2014
…ordoval)

This PR was merged into the 2.3 branch.

Discussion
----------

doctrine file upload example uses dir -- caution added

| Q             | A                   |
| ---           | ---                 |
| Doc fix?      | yes                 |
| New docs?     | no                  |
| Applies to    | 2.3+                |
| Fixed tickets | #3363               |
| License       | CC-ASA 3.0 Unported |

 Sent using [Gush](https://github.com/cordoval/gush)

Commits
-------

1620ed8 3363-doctrine-file-upload-example-uses-dir
@weaverryan
Copy link
Member

We've added a note. Really, we may just need to bite the bullet and rewrite this whole entry to use listeners, which are the better approach. See #2346

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants