Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Conversation

@cordoval
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#9339
LicenseMIT
Doc PRna

Copy link
Member

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

Copy link
ContributorAuthor

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) {}

Copy link
Member

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)

Copy link
ContributorAuthor

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

Copy link
Contributor

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
Copy link
ContributorAuthor

@stof regarding the implementation ofisUrl is there a similar situation elsewhere on symfony so i can learn from it and implement it in the right way?

@stof
Copy link
Member

@staabm gave the right answer: silencing the E_WARNING and dealing with thefalse return value

@cordoval
Copy link
ContributorAuthor

ping@fabpot

Copy link
Member

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.

Copy link
Contributor

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
Copy link
ContributorAuthor

ping@fabpot:shipit: ? or do you think we should bent the behavior to break default for overriding save on images that are urls?

@fabpot
Copy link
Member

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.

pamiland others added2 commitsDecember 30, 2013 07:16
…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
Copy link
ContributorAuthor

:shipit: boss

👶

@cordoval
Copy link
ContributorAuthor

closing this to put it into 2.3

@cordoval
Copy link
ContributorAuthor

closed in favor of#9899

fabpot added a commit that referenced this pull requestDec 30, 2013
… (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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@cordoval@stof@fabpot@staabm@sstok@pamil

[8]ページ先頭

©2009-2025 Movatter.jp