Skip to content

Commit c53aef0

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
2 parents 2114443 + 4a4f55b commit c53aef0

File tree

3 files changed

+39
-18
lines changed

3 files changed

+39
-18
lines changed

user_guide_src/source/general/environments.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ The simplest method to set the variable is in your :doc:`.env file </general/con
4848
Apache
4949
------
5050

51-
This server variable can be set in your ``.htaccess`` file or Apache
52-
config using `SetEnv <https://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv>`_.
51+
This server variable can be set in your **.htaccess** file or Apache
52+
config using `SetEnv <https://httpd.apache.org/docs/2.4/mod/mod_env.html#setenv>`_.
5353

5454
.. code-block:: apache
5555
@@ -58,11 +58,11 @@ config using `SetEnv <https://httpd.apache.org/docs/2.2/mod/mod_env.html#setenv>
5858
5959
.. _environment-nginx:
6060

61-
nginx
61+
Nginx
6262
-----
6363

64-
Under nginx, you must pass the environment variable through the ``fastcgi_params``
65-
in order for it to show up under the `$_SERVER` variable. This allows it to work on the
64+
Under Nginx, you must pass the environment variable through the ``fastcgi_params``
65+
in order for it to show up under the ``$_SERVER`` variable. This allows it to work on the
6666
virtual-host level, instead of using `env` to set it for the entire server, though that
6767
would work fine on a dedicated server. You would then modify your server config to something
6868
like:
@@ -80,7 +80,7 @@ like:
8080
}
8181
}
8282
83-
Alternative methods are available for nginx and other servers, or you can
83+
Alternative methods are available for Nginx and other servers, or you can
8484
remove this logic entirely and set the constant based on the server's IP address
8585
(for instance).
8686

@@ -102,17 +102,17 @@ a fresh install:
102102
* production.php
103103
* testing.php
104104

105-
Effects On Default Framework Behavior
105+
Effects on Default Framework Behavior
106106
=====================================
107107

108-
There are some places in the CodeIgniter system where the ENVIRONMENT
108+
There are some places in the CodeIgniter system where the ``ENVIRONMENT``
109109
constant is used. This section describes how default framework behavior
110110
is affected.
111111

112112
Error Reporting
113113
---------------
114114

115-
Setting the ENVIRONMENT constant to a value of ``development`` will cause
115+
Setting the ``ENVIRONMENT`` constant to a value of ``development`` will cause
116116
all PHP errors to be rendered to the browser when they occur.
117117
Conversely, setting the constant to ``production`` will disable all error
118118
output. Disabling error reporting in production is a

user_guide_src/source/libraries/uri.rst

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ The Current URI
3131
---------------
3232

3333
Many times, all you really want is an object representing the current URL of this request.
34-
You can use one of the functions available in the **url_helper**:
34+
You can use one of the functions available in the :doc:`../helpers/url_helper`:
3535

3636
.. literalinclude:: uri/004.php
3737

3838
You must pass ``true`` as the first parameter, otherwise, it will return the string representation of the current URL.
39+
3940
This URI is based on the path (relative to your ``baseURL``) as determined by the current request object and
40-
your settings in ``Config\App`` (baseURL, indexPage, and forceGlobalSecureRequests).
41+
your settings in ``Config\App`` (``baseURL``, ``indexPage``, and ``forceGlobalSecureRequests``).
4142
Assuming that you're in a controller that extends ``CodeIgniter\Controller`` you can get this relative path:
4243

4344
.. literalinclude:: uri/005.php
@@ -95,7 +96,7 @@ If you do not want to display the port, pass in ``true`` as the only parameter:
9596

9697
.. note:: If the current port is the default port for the scheme it will never be displayed.
9798

98-
Userinfo
99+
UserInfo
99100
--------
100101

101102
The userinfo section is simply the username and password that you might see with an FTP URI. While you can get
@@ -138,31 +139,51 @@ can be used to manipulate it:
138139
Query
139140
-----
140141

141-
The query variables can be manipulated through the class using simple string representations. Query values can only
142+
The query data can be manipulated through the class using simple string representations.
143+
144+
Getting/Setting Query
145+
^^^^^^^^^^^^^^^^^^^^^
146+
147+
Query values can only
142148
be set as a string currently.
143149

144150
.. literalinclude:: uri/017.php
145151

152+
The ``setQuery()`` method overwrite any existing query variables.
153+
146154
.. note:: Query values cannot contain fragments. An InvalidArgumentException will be thrown if it does.
147155

156+
Setting Query from Array
157+
^^^^^^^^^^^^^^^^^^^^^^^^
158+
148159
You can set query values using an array:
149160

150161
.. literalinclude:: uri/018.php
151162

152-
The ``setQuery()`` and ``setQueryArray()`` methods overwrite any existing query variables. You can add a value to the
163+
The ``setQueryArray()`` method overwrite any existing query variables.
164+
165+
Adding Query Value
166+
^^^^^^^^^^^^^^^^^^
167+
168+
You can add a value to the
153169
query variables collection without destroying the existing query variables with the ``addQuery()`` method. The first
154170
parameter is the name of the variable, and the second parameter is the value:
155171

156172
.. literalinclude:: uri/019.php
157173

158-
**Filtering Query Values**
174+
Filtering Query Values
175+
^^^^^^^^^^^^^^^^^^^^^^
159176

160177
You can filter the query values returned by passing an options array to the ``getQuery()`` method, with either an
161178
*only* or an *except* key:
162179

163180
.. literalinclude:: uri/020.php
164181

165182
This only changes the values returned during this one call. If you need to modify the URI's query values more permanently,
183+
184+
Changing Query Values
185+
^^^^^^^^^^^^^^^^^^^^^
186+
166187
you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actual object's query variable collection:
167188

168189
.. literalinclude:: uri/021.php
@@ -174,7 +195,7 @@ you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actua
174195
Fragment
175196
--------
176197

177-
Fragments are the portion at the end of the URL, preceded by the pound-sign (#). In HTML URLs these are links
198+
Fragments are the portion at the end of the URL, preceded by the pound-sign (``#``). In HTML URLs these are links
178199
to an on-page anchor. Media URI's can make use of them in various other ways.
179200

180201
.. literalinclude:: uri/022.php

user_guide_src/source/libraries/uri/016.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
$uri = new \CodeIgniter\HTTP\URI('http://www.example.com/some/path');
44

5-
echo $uri->getPath(); // 'some/path'
6-
echo $uri->setPath('another/path')->getPath(); // 'another/path'
5+
echo $uri->getPath(); // '/some/path'
6+
echo $uri->setPath('/another/path')->getPath(); // '/another/path'

0 commit comments

Comments
 (0)