Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 548109c

Browse files
committed
Renamed URL to URI
1 parent 81c51b3 commit 548109c

File tree

5 files changed

+41
-41
lines changed

5 files changed

+41
-41
lines changed

bundles/routing_auto/conflict_resolvers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ it finds a path which *doesn't* exist.
2222
.. code-block:: yaml
2323
2424
stdClass:
25-
url_schema: /cmf/blog
25+
uri_schema: /cmf/blog
2626
conflict_resolver: auto_increment
2727
2828
.. code-block:: xml
2929
3030
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
31-
<mapping class="stdClass" url-schema="/cmf/blog">
31+
<mapping class="stdClass" uri-schema="/cmf/blog">
3232
<conflict-resolver name="auto_increment" />
3333
</mapping>
3434
</auto-mapping>
@@ -44,13 +44,13 @@ This is the default action.
4444
.. code-block:: yaml
4545
4646
stdClass:
47-
url_schema: /cmf/blog
47+
uri_schema: /cmf/blog
4848
conflict_resolver: throw_exception
4949
5050
.. code-block:: xml
5151
5252
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
53-
<mapping class="stdClass" url-schema="/cmf/blog">
53+
<mapping class="stdClass" uri-schema="/cmf/blog">
5454
<conflict-resolver name="throw_exception" />
5555
</mapping>
5656
</auto-mapping>

bundles/routing_auto/customization.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Token Providers
1010
~~~~~~~~~~~~~~~
1111

1212
The goal of a ``TokenProvider`` class is to provide values for tokens in the
13-
URL schema. Such values can be derived form the object for which the route
13+
URI schema. Such values can be derived form the object for which the route
1414
is being generated, or from the environment (e.g. the you could use the
1515
current locale in the route).
1616

@@ -21,14 +21,14 @@ The following token provider will simply provide the value "foobar"::
2121

2222
use Symfony\Cmf\Component\RoutingAuto\TokenProviderInterface;
2323
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
24-
use Symfony\Cmf\Component\RoutingAuto\UrlContext;
24+
use Symfony\Cmf\Component\RoutingAuto\UriContext;
2525

2626
class FoobarTokenProvider implements TokenProviderInterface
2727
{
2828
/**
2929
* {@inheritDoc}
3030
*/
31-
public function provideValue(UrlContext $urlContext, $options)
31+
public function provideValue(UriContext $uriContext, $options)
3232
{
3333
return 'foobar';
3434
}
@@ -52,7 +52,7 @@ To use the path provider you must register it in the container and add the
5252
acme_cms.token_provider.foobar:
5353
class: Acme\CmsBundle\RoutingAuto\PathProvider\FoobarTokenProvider
5454
tags:
55-
- { name: cmf_routing_auto.token_provider, alias: "foobar"}
55+
- { name: cmf_routing_auto.token_provider, alias: "foobar" }
5656
5757
.. code-block:: xml
5858
@@ -84,20 +84,20 @@ Conflict Resolvers
8484
Conflict resolvers decide what happens if a generated route already exists in
8585
the route repository and is not related to the context object.
8686

87-
The following example will append an unique string to the URL to resolve a
87+
The following example will append an unique string to the URI to resolve a
8888
conflict::
8989

9090
namespace Symfony\Cmf\Component\RoutingAuto\ConflictResolver;
9191

9292
use Symfony\Cmf\Component\RoutingAuto\ConflictResolverInterface;
93-
use Symfony\Cmf\Component\RoutingAuto\UrlContext;
93+
use Symfony\Cmf\Component\RoutingAuto\UriContext;
9494
use Symfony\Cmf\Component\RoutingAuto\Adapter\AdapterInterface;
9595

9696
class UniqidConflictResolver implements ConflictResolverInterface
9797
{
98-
public function resolveConflict(UrlContext $urlContext)
98+
public function resolveConflict(UriContext $uriContext)
9999
{
100-
$url = $urlContext->getUrl();
100+
$uri = $uriContext->getUri();
101101
return sprintf('%s-%s', uniqid());
102102
}
103103
}
@@ -139,15 +139,15 @@ Defunct Route Handlers
139139
~~~~~~~~~~~~~~~~~~~~~~
140140

141141
Defunct Route Handlers decide what happens to old routes when an object is
142-
updated and its generated URL changes.
142+
updated and its generated URI changes.
143143

144144
They are not all-together trivial - the following handler removes old routes and is
145145
the default handler::
146146

147147
namespace Symfony\Cmf\Component\RoutingAuto\DefunctRouteHandler;
148148

149149
use Symfony\Cmf\Component\RoutingAuto\DefunctRouteHandlerInterface;
150-
use Symfony\Cmf\Component\RoutingAuto\UrlContextCollection;
150+
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
151151
use Symfony\Cmf\Component\RoutingAuto\Adapter\AdapterInterface;
152152

153153
class RemoveDefunctRouteHandler implements DefunctRouteHandlerInterface
@@ -159,13 +159,13 @@ the default handler::
159159
$this->adapter = $adapter;
160160
}
161161

162-
public function handleDefunctRoutes(UrlContextCollection $urlContextCollection)
162+
public function handleDefunctRoutes(UriContextCollection $uriContextCollection)
163163
{
164-
$referringAutoRouteCollection = $this->adapter->getReferringAutoRoutes($urlContextCollection->getSubjectObject());
164+
$referringAutoRouteCollection = $this->adapter->getReferringAutoRoutes($uriContextCollection->getSubjectObject());
165165

166166
foreach ($referringAutoRouteCollection as $referringAutoRoute) {
167-
if (false === $urlContextCollection->containsAutoRoute($referringAutoRoute)) {
168-
$newRoute = $urlContextCollection->getAutoRouteByTag($referringAutoRoute->getAutoRouteTag());
167+
if (false === $uriContextCollection->containsAutoRoute($referringAutoRoute)) {
168+
$newRoute = $uriContextCollection->getAutoRouteByTag($referringAutoRoute->getAutoRouteTag());
169169

170170
$this->adapter->migrateAutoRouteChildren($referringAutoRoute, $newRoute);
171171
$this->adapter->removeAutoRoute($referringAutoRoute);

bundles/routing_auto/defunct_route_handlers.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Defunct Route Handlers
66

77
.. _routingauto_customization_defunctroutehandlers:
88

9-
When an already-persisted document is updated and the URL generated by the
9+
When an already-persisted document is updated and the URI generated by the
1010
RoutingAuto system is changed, a *new* route is always created. Defunct route
1111
handlers decide what to do with the *old* routes.
1212

@@ -21,13 +21,13 @@ action.
2121
.. code-block:: yaml
2222
2323
stdClass:
24-
url_schema: /cmf/blog
24+
uri_schema: /cmf/blog
2525
defunct_route_handler: remove
2626
2727
.. code-block:: xml
2828
2929
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
30-
<mapping class="stdClass" url-schema="/cmf/blog">
30+
<mapping class="stdClass" uri-schema="/cmf/blog">
3131
<defunct-route-handler name="remove" />
3232
</mapping>
3333
</auto-mapping>
@@ -53,13 +53,13 @@ path.
5353
.. code-block:: yaml
5454
5555
stdClass:
56-
url_schema: /cmf/blog
56+
uri_schema: /cmf/blog
5757
defunct_route_handler: leave_redirect
5858
5959
.. code-block:: xml
6060
6161
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
62-
<mapping class="stdClass" url-schema="/cmf/blog">
62+
<mapping class="stdClass" uri-schema="/cmf/blog">
6363
<defunct-route-handler name="leave_redirect" />
6464
</mapping>
6565
</auto-mapping>

bundles/routing_auto/introduction.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RoutingAutoBundle
66
=================
77

88
The RoutingAutoBundle allows you to automatically persist routes when
9-
documents are persisted based on URL schemas and contextual information.
9+
documents are persisted based on URI schemas and contextual information.
1010

1111
This implies a separation of the ``Route`` and ``Content`` documents. If your
1212
needs are simple this bundle may not be for you and you should have a look at
@@ -28,7 +28,7 @@ content documents - a category and the topics. These documents are called
2828
If you create a new category with the title "My New Category", the
2929
RoutingAutoBundle will automatically create the route
3030
``/forum/my-new-cateogry``. For each new ``Topic`` it could create a route
31-
like ``/forum/my-new-category/my-new-topic``. This URL resolves to a special
31+
like ``/forum/my-new-category/my-new-topic``. This URI resolves to a special
3232
type of route that is called an *auto route*.
3333

3434
By default, when you update a content document that has an auto route, the
@@ -49,13 +49,13 @@ pattern ``/forum/my-new-forum/{topic}``, which could be handled by a controller.
4949
Why not just do that?
5050

5151
#. By having a route for each page in the system, the application has a
52-
knowledge of which URLs are accessible. This can be very useful, for
52+
knowledge of which URIs are accessible. This can be very useful, for
5353
example, when specifying endpoints for menu items that are used when generating
5454
a site map;
5555
#. By separating the route from the content you allow the route to be
5656
customized independently of the content, for example, a topic may have
57-
the same title as another topic but might need a different URL;
58-
#. Separate route documents are translateable - this means you can have a URL
57+
the same title as another topic but might need a different URI;
58+
#. Separate route documents are translateable - this means you can have a URI
5959
for *each language*, "/welcome" and "/bienvenue" would each reference the
6060
same document in English and French respectively. This would be difficult
6161
if the slug was embedded in the content document;
@@ -67,12 +67,12 @@ Usage
6767
-----
6868

6969
Imagine you have a fictional forum application and that you want to access the
70-
forum topic with the following fictional URL:
70+
forum topic with the following fictional URI:
7171

7272
- ``https://mywebsite.com/my-forum/drinks/coffee``
7373

74-
The RoutingAutoBundle uses a URL schema to define how routes are generated. A
75-
schema for the above URL would look like this (the bundle does not care about
74+
The RoutingAutoBundle uses a URI schema to define how routes are generated. A
75+
schema for the above URI would look like this (the bundle does not care about
7676
the host or protocol):
7777

7878
- ``/my-forum/{category}/{title}``
@@ -98,7 +98,7 @@ document could be defined as follows:
9898
9999
# src/Acme/ForumBundle/Resources/config/routing_auto.yml
100100
Acme\ForumBundle\Document\Topic:
101-
url_schema: /my-forum/{category}/{title}
101+
uri_schema: /my-forum/{category}/{title}
102102
token_providers:
103103
category: [content_method, {method: getCategoryTitle, slugify: true} ]
104104
title: [content_method, {method: getTitle} ] # slugify is true by default
@@ -108,7 +108,7 @@ document could be defined as follows:
108108
<?xml version="1.0" ?>
109109
<!-- src/Acme/ForumBundle/Resources/config/routing_auto.xml -->
110110
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
111-
<mapping class="Acme\ForumBundle\Document\Topic" url-schema="/my-forum/{category}/{title}">
111+
<mapping class="Acme\ForumBundle\Document\Topic" uri-schema="/my-forum/{category}/{title}">
112112
<token-provider token="category" name="content_method">
113113
<option name="method">getCategoryName</option>
114114
<option name="slugify">true</option>
@@ -155,7 +155,7 @@ idea.
155155

156156
This is just a basic example. You can also configure what should happen when
157157
a route already exists (confict resolution) and what to do with old routes
158-
when the generated URL is changed (defunct route handling).
158+
when the generated URI is changed (defunct route handling).
159159

160160
Read more
161161
---------

bundles/routing_auto/token_providers.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Token Providers
55
---------------
66

7-
Token providers provide values for the tokens specified in the URL schemas.
7+
Token providers provide values for the tokens specified in the URI schemas.
88

99
content_method
1010
~~~~~~~~~~~~~~
@@ -26,7 +26,7 @@ Options
2626
2727
# src/Acme/ForumBundle/Resources/config/routing_auto.yml
2828
Acme\ForumBundle\Document\Topic:
29-
url_schema: /my-forum/{title}
29+
uri_schema: /my-forum/{title}
3030
token_providers:
3131
title: [content_method, {method: getTitle} ]
3232
@@ -35,7 +35,7 @@ Options
3535
<?xml version="1.0" ?>
3636
<!-- src/Acme/ForumBundle/Resources/config/routing_auto.xml -->
3737
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
38-
<mapping class="Acme\ForumBundle\Document\Topic" url-schema="/my-forum/{title}">
38+
<mapping class="Acme\ForumBundle\Document\Topic" uri-schema="/my-forum/{title}">
3939
<token-provider token="category" name="content_method">
4040
<option name="method">getCategoryName</option>
4141
</token-provider>
@@ -64,7 +64,7 @@ object provided by a designated method on the content document.
6464
6565
# src/Acme/ForumBundle/Resources/config/routing_auto.yml
6666
Acme\ForumBundle\Document\Topic:
67-
url_schema: /blog/{date}/my-post
67+
uri_schema: /blog/{date}/my-post
6868
token_providers:
6969
date: [content_datetime, {method: getDate} ]
7070
@@ -73,7 +73,7 @@ object provided by a designated method on the content document.
7373
<?xml version="1.0" ?>
7474
<!-- src/Acme/ForumBundle/Resources/config/routing_auto.xml -->
7575
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
76-
<mapping class="Acme\ForumBundle\Document\Topic" url-schema="/blog/{date}/my-post">
76+
<mapping class="Acme\ForumBundle\Document\Topic" uri-schema="/blog/{date}/my-post">
7777
<token-provider token="date" name="content_datetime">
7878
<option name="method">getDate</option>
7979
</token-provider>
@@ -103,7 +103,7 @@ feature.
103103
104104
# src/Acme/ForumBundle/Resources/config/routing_auto.yml
105105
Acme\ForumBundle\Document\Topic:
106-
url_schema: /blog/{locale}/my-post
106+
uri_schema: /blog/{locale}/my-post
107107
token_providers:
108108
locale: [content_locale ]
109109
@@ -112,7 +112,7 @@ feature.
112112
<?xml version="1.0" ?>
113113
<!-- src/Acme/ForumBundle/Resources/config/routing_auto.xml -->
114114
<auto-mapping xmlns="http://cmf.symfony.com/schema/routing_auto">
115-
<mapping class="Acme\ForumBundle\Document\Topic" url-schema="/blog/{locale}/my-post">
115+
<mapping class="Acme\ForumBundle\Document\Topic" uri-schema="/blog/{locale}/my-post">
116116
<token-provider token="locale" name="content_locale" />
117117
</mapping>
118118
</auto-mapping>

0 commit comments

Comments
 (0)