94 Commits

Author SHA1 Message Date
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
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
c4e782725c Fixed cache key collision in yii\web\UrlManager::createUrl()
Closes #10935
2016-03-09 00:01:31 +02:00
fecd4dcfa5 10739 - Multiple slashes at the end of route should not be accepted as valid url 2016-02-05 16:38:49 +03:00
4a1a0fb4d8 FIX rule for camelCase controllerName
<controller:\w+>s
if use this variant of rule  you cant get controller with camelCase name as  camel-case
2015-12-09 23:57:01 +02:00
cd87d67f34 Global DOCS update: ~~~ replaced with ``` 2015-12-02 23:15:28 +02:00
703f374a85 Fixes #9596: Fixed \yii\web\UrlManager::createAbsoluteUrl(['site/index', '#' => 'testHash']) losing hash 2015-09-05 11:40:45 +03:00
854e186210 fixed caching issue with UrlManager::createUrl
this fix will skip the cache in case we encounter a situation which can
not easily be cached.

fixes #9091
2015-08-03 00:31:59 +02:00
ebc089e6c2 Fixes #8194: Caching of the matched rules added to yii\web\UrlManager::createUrl() 2015-05-03 22:03:42 -04:00
792746883e urlManager: ensure route is trimmed by / on empty pattern
fixes #6717
2015-01-01 17:06:12 +01:00
be2828d593 Fixes #5484: Fixed potential string suffix detection failure on 5.5.11 2014-10-11 09:35:55 -04:00
48821a8c2c Update UrlManager.php 2014-09-04 22:27:23 +03:00
a20f82dcfa Fixes #4919 2014-09-04 20:44:36 +04:00
3a1e0f3a5c property codestyle framework 2014-07-30 00:21:31 +02:00
1f31f27787 phpdoc 2014-07-29 22:19:14 +02:00
07f01bcf2b Used substr_compare instead of substr when we don't care about result 2014-07-23 16:37:49 +04:00
e5a87af234 Fixes #4331: yii\helpers\Url now uses UrlManager to determine base URL when generating URLs 2014-07-17 21:51:37 -04:00
0c14f47f9a Fixes #3793: Changed inline autocomplete hints style to get more IDEs support 2014-06-20 17:40:00 +04:00
8ac309849d Url encoding for the route param added 2014-05-28 13:07:33 +03:00
520011fff6 Fixes #3088: The debug and gii modules will manage their own URL rules now 2014-04-17 20:42:50 -04:00
507a6f1068 Added yii\web\UrlManager::addRules() to simplify adding new URL rules 2014-04-17 20:03:42 -04:00
76402ea079 Fixed UrlManager rules caching 2014-04-04 13:27:20 +06:00
bf3c75147d reverted breaking PHPdoc codestyle changes
issue #2852
2014-03-23 20:51:09 +01:00
6e8c460273 Fixes #2724: consistent use of absolute and relative routes. 2014-03-22 20:17:31 -04:00