Update lib/Doctrine/DBAL/Types/BlobType.php #231

Merged
merged 1 commit into from May 9, 2013

Projects

None yet

4 participants

@mikemeier

If allow_url_fopen isnt enabled, fopen will return false.

@mikemeier mikemeier Update lib/Doctrine/DBAL/Types/BlobType.php
If allow_url_fopen isnt enabled, fopen will return false.
cd2117a
@doctrinebot

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DBAL-388

@Ocramius
Doctrine member

@mikemeier the description of the PR you made is exactly the test case that you should add...

@mikemeier

@Ocramius thats right. but i've no idea how to simulate "allow_url_fopen" off on a test-case.

PS: Why transfering the blob into a resource stream? I think the whole blob is already in memory... (base64)

@Ocramius
Doctrine member

@mikemeier this is not an fopen on a remote URI, it's a data URI, so I'm not even sure that the resource can ever be null

@mikemeier

@Ocramius tested on a linux server with php 5.3: allow_url_fopen was off. result: fopen returned false. i dont think php try to understand what happens really in fopen command. if allow_url_fopen is off, fopen isnt allowed.

@Ocramius
Doctrine member

Interesting... so a data URI doesn't work with that setting... @mikemeier, did you check if there's a PHP bug on http://bugs.php.net/ for this?

Anyway, you're right: this cannot really be tested since allow_url_fopen is a PHP_INI_SYSTEM setting.

What about writing a test that is skipped if this directive is set to off?

@beberlei beberlei merged commit 487c506 into doctrine:master May 9, 2013

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment