116 Commits

Author SHA1 Message Date
97a4d711ec Merge branch 'master' into sync-master-2052. 2025-04-26 19:03:07 -04:00
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
20d6c65db2 Merge branch 'master' into sync-to-master. 2024-03-20 06:11:31 -03:00
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
be70b23398 Merge branch 'master' into sync-to-2-branch 2024-01-03 12:51:59 -03:00
c7b4b1dcdd Get rid of deprecation warnings for trim() [PHP8.3] (#20090) 2024-01-03 10:54:59 +03:00
c9c100acd7 Remove deprecated method className() for branch 2.2. (#19894) 2023-07-16 21:45:39 +08:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
a6dba47963 Fix #18590: Fix yii\web\UrlManager to instantiate cache only when it's actually needed 2021-04-10 13:02:23 +03:00
03befccd48 Fix #18487: Allow creating URLs for non-GET-verb rules 2021-01-26 14:47:53 +03:00
fbd7eded2d Bug #17933: Log warning instead of erroring when URLManager is unable to initialize cache 2020-03-26 23:21:35 +03:00
ec089fea5a Fix #16721: Use Instance::ensure() to initialize UrlManager::$cache 2020-02-23 16:02:27 +03:00
c776cf6240 Update UrlManager.php (#17102)
change >>'POST <controller:[\w-]+>s' => '<controller>/create'<< to >>'POST <controller:[\w-]+>' => '<controller>/create'<<
In POST we don't have 's' so  '<controller>/create but not '<controller>s/create
2019-02-05 23:08:32 +03:00
1a74b3d4f8 [minor] SCA with Php Inspections (EA Ultimate) (#15871)
* Php Inspections (EA Ultimate): use type casting where applicable

* Php Inspections (EA Ultimate): use constants where applicable

* Php Inspections (EA Ultimate): CS

* Php Inspections (EA Ultimate): address some of one-time used variables

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): revert a constant usage

* Php Inspections (EA Ultimate): revert sequential assignments

* Php Inspections (EA Ultimate): build is green again

* Php Inspections (EA Ultimate): revert array_merge tweaks

* Php Inspections (EA Ultimate): revert BC-incompatible one-time used variable tweak

* Update description [skip ci]

* Php Inspections (EA Ultimate): CS
2018-03-12 01:37:19 +03:00
ef8f6172bb Added a note about URLManager cache duration
https://github.com/yiisoft/yii2/pull/13426#issuecomment-366078957
issue #13426
2018-02-16 04:34:38 +01:00
2e8b6e5c80 Added ruleConfig to UrlManager::setBuiltRulesCache() to fix tests 2018-02-16 00:12:14 +02:00
9323817a53 Refactored code, added tests 2018-02-15 23:14:52 +02:00
a2f9ff8aac Merge branch 'master' into yuriystovbur-13425-fix-url-rules-cache 2018-02-15 21:52:25 +02:00
e6f5c46cdc Fixes #15633: Deprecate some things going away/changing in 2.1
- Deprecated `yii\base\BaseObject::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading
- Deprecated XCache and Zend data cache support as caching backends
- Deprecated `yii\BaseYii::powered()` method
- Added `yii\base\InvalidArgumentException` and deprecated `yii\base\InvalidParamException`
- Added `yii\BaseYii::debug()` and deprecated `yii\BaseYii::trace()`
2018-02-11 01:48:29 +03:00
87369f4e58 Conflict resolved 2017-11-03 19:01:22 +00:00
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
f7fb7cdd87 Fixes #14022: Added posibility to use aliases in yii\web\UrlManager::setBaseUrl() (#14540) 2017-07-31 13:32:08 +02:00
6d2e0aff82 Fixes #14406: Fixed caching rules in yii\web\UrlManager with different ruleConfig configuration 2017-07-19 23:45:03 +03:00
fe8a0a6a2e Enable no_useless_else rule in php-cs-fixer (#14420) 2017-07-10 11:26:21 +03:00
cb53b2feec Fixes #14081: Added yii\caching\CacheInterface to make custom cache extensions adoption easier 2017-06-11 19:18:33 +03:00
daa8b67c7b Fixes #13350, #14094, #11288
- Bug #13350: Fixed bug with incorrect caching of `yii\web\UrlRule::createUrl()` results in `yii\web\UrlManager`.
- Bug #14094: Fixed bug when single `yii\web\UrlManager::createUrl()` call my result multiple calls of `yii\web\UrlRule::createUrl()` for the same rule.
- Enh #11288: Added support for caching of `yii\web\UrlRule::createUrl()` results in `yii\web\UrlManager` for rules with defaults.
2017-05-10 12:30:43 +03:00
e82b40abee avoid duplicate slashes on empty values
fixes #13522
close #13525
2017-02-08 09:41:04 +01:00
c19b2f7dc8 release version 2.0.11 2017-02-01 17:46:29 +01:00
f9e83008f4 Prefer strpos to substr 2017-01-31 13:42:37 +01:00
c641513583 Implementation of support UrlRule with relative host definition
close #12697
fixes #12691
2017-01-31 13:42:31 +01:00
8faedcbd7c Refactored UrlManagerTest to cover more use cases
UrlManager is a complex class with a large bunch of options that needs
to be tested
and we had a few regressions in the past even though there are already a
lot of tests
covering it. Test coverage measured by lines does not help us determine
how good it is tested,
we need test coverage for every major path through the code.

I have refactored the UrlManager tests to reflect the different options
and cases to
have a better overview of which cases are covered and which are not.

UrlManager has two main operation modes:

- "default" url format, which is the simple case. These are covered by
  methods in `UrlManagerTest`.

- "pretty" url format. This is the complex case, which involves UrlRules
  and url parsing.
  I have created two separate classes for this case:
  Url creation for "pretty" url format is covered by
`UrlManagerCreateUrlTest`.
  Url parsing for "pretty" url format is covered by
`UrlManagerParseUrlTest`.

Each of the test classes have a `getUrlManager` method that creates a
UrlManager instance
with a specific configuration and certain variations in options.
It is also tested that options that are not relevant in a certain
operation mode have no effect on the result.

To make sure to not remove tests that have existed before, here is a map
of where code has been moved.
The following test methods existed in the [old test
class](4187718c14/tests/framework/web/UrlManagerTest.php):

- `testCreateUrl()` split between UrlManagerTest and
  UrlManagerCreateUrlTest variations should all be covered by
`variationsProvider()`.
- `testCreateUrlWithNullParams()` covered by UrlManagerCreateUrlTest by
  `testWithNullParams()`
- `testCreateUrlWithEmptyPattern()`
- `testCreateAbsoluteUrl()` covered in UrlManagerCreateUrlTest by new
  tests via `variationsProvider()`.
- `testCreateAbsoluteUrlWithSuffix()` covered in UrlManagerCreateUrlTest
  by `testAbsolutePatterns`.

- `testParseRequest()` covered by UrlManagerParseUrlTest, UrlNormalizer
  related parts moved to UrlNormalizerTest.
- `testParseRESTRequest()` moved to UrlManagerParseUrlTest
- `testHash()` covered in different tests in UrlManagerCreateUrlTest.
- `testMultipleHostsRules($host)` kept as is.

Before:

    $ vendor/bin/phpunit tests/framework/web/UrlManagerTest.php
    ...
    OK (12 tests, 89 assertions)

After:

    $ vendor/bin/phpunit tests/framework/web/UrlManager*.php
    ...
    OK (72 tests, 648 assertions)
2017-01-31 02:38:35 +01:00
be4ebdd049 Fixes #13134: Added logging URL rules (bashkarev) 2017-01-27 19:03:45 +03:00
46e7faddd0 Modify URL Rules caching #13425 2017-01-23 17:42:23 +00:00
6de6e0f895 Cache dynamically added rules with yii\web\UrlManager::addRules() #13425 2017-01-22 17:33:59 +00:00
2d91723934 Add support for creating protocol-relative URLs.
Improve phpdoc for protocol-relative URL creation.
Remove useless `is_string()` check.
2016-11-29 09:53:51 +02:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
32f4dc8997 Fixes #5385: links created from classes to corresponding guide articles (#12920) 2016-11-04 18:55:14 +03:00
7ca2260702 UrlManager::normalizer creation fixed 2016-10-04 17:02:57 +03:00
ee8a8e90f8 update urlnormalizer docs 2016-09-15 14:52:32 +02:00
bda1dbe004 Fix unit test 2016-09-13 12:33:07 +03:00
821f035c90 UrlManager::normalizer disabled by default 2016-09-13 12:21:40 +03:00
8142de23d4 Improve normalizer for URL manager 2016-08-30 21:25:23 +02:00
a7f63b6da3 Add normalizer for URL manager. 2016-08-30 21:22:58 +02:00
731769241b release version 2.0.8 2016-04-28 16:50:20 +02:00
396bd9f714 Fixes #10309: Extracted yii\web\UrlManager rule cache key into $cacheKey protected property 2016-04-27 00:58:12 +03:00
f75f453ec4 Fixes #10475: Extracted getUrlFromCache() and setRuleToCache() protected methods from yii\web\UrlManager::createUrl() 2016-04-27 00:54:30 +03:00
9c1fa3f745 allow resetting properties in UrlManager, same as Request
fixes #11336
2016-04-21 14:07:09 +02:00
d3b5f4a284 Fixes #3656: Encode / in "r" query parameter in docs as it really is 2016-03-15 21:52:41 +03:00
e4d9ed5182 code style fix 2016-03-09 10:17:41 +02:00