Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Filesystem | WCM] added condition ifUrl to avoid filemtime on url resources#9863
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Filesystem | WCM] added condition ifUrl to avoid filemtime on url resources#9863
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cordoval commentedDec 26, 2013
| Q | A |
|---|---|
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #9339 |
| License | MIT |
| Doc PR | na |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
parse_url does not throw any exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@stof I am remitting myself to the documentation
/** * (PHP 4, PHP 5)<br/> * Parse a URL and return its components * @link http://php.net/manual/en/function.parse-url.php * @param string $url <p> * The URL to parse. Invalid characters are replaced by * _. * </p> * @param int $component [optional] <p> * Specify one of PHP_URL_SCHEME, * PHP_URL_HOST, PHP_URL_PORT, * PHP_URL_USER, PHP_URL_PASS, * PHP_URL_PATH, PHP_URL_QUERY * or PHP_URL_FRAGMENT to retrieve just a specific * URL component as a string. * </p> * @return mixed On seriously malformed URLs, parse_url may return * false and emit a E_WARNING. Otherwise an associative * array is returned, whose components may be (at least one): * scheme - e.g. http * host * port * user * pass * path * query - after the question mark ? * fragment - after the hashmark # * </p> * <p> * If the component parameter is specified a * string is returned instead of an array. */functionparse_url ($url,$component =null) {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
yeah, it emits aE_WARNING, not an exception. Your code is relying on the error handler of the Debug component being registered to turn it into an exception. this is not how the symfony codebase deals with warnings (it potentially means that the code will behave differently in prod when you don't convert them into exceptions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@stof what should i use then to detect is an url then? just wondering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe use@parse_url
cordoval commentedDec 26, 2013
@stof regarding the implementation of |
stof commentedDec 27, 2013
@staabm gave the right answer: silencing the E_WARNING and dealing with the |
cordoval commentedDec 27, 2013
ping@fabpot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think there is a much simpler approach that does not use the evil@ operator:
returnnull !==parse_url($file,PHP_URL_HOST);
So, this can be inlined instead of creating an additional method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
just tested it locally..@fabpot is right... this will not emit a warning on invalid input string, therefore works without@.
(as long as the input isnull or astring)
cordoval commentedDec 27, 2013
ping@fabpot |
fabpot commentedDec 27, 2013
The override parameter allows to avoid the copy when the origin file is the same as the target one. As we cannot do this check for URLs, and because copying did not work before anyway, I would prefer to always copy the file. |
…re's no lib-intl (pamil)This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closessymfony#9896).Discussion----------[Intl] Skip tests that need full lib-intl when there's no lib-intl| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |`NumberFormatter::formatCurrency` executes indirectly `Symfony\Component\Intl\ResourceBundle\Reader::read()`, which has `$bundle = new \ResourceBundle($locale, $path)` - there's Fatal Error if `\ResourceBundle` isn't found. Added availability to run unit tests if `lib-intl` isn't installed.Commits-------6614b66 Skips test that need full lib-intl.
cordoval commentedDec 30, 2013
👶 |
cordoval commentedDec 30, 2013
closing this to put it into 2.3 |
cordoval commentedDec 30, 2013
closed in favor of#9899 |
… (cordoval)This PR was merged into the 2.3 branch.Discussion----------[Filesystem | WCM] 9339 fix stat on url for filesystem copy| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#9339| License | MIT| Doc PR | nasupersedes#9863Commits-------4fba412 adjusted behavior to always copy override on url files