Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions user_guide_src/renumerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$sectionContent = file_get_contents($sectionInfo->getPathname());

// Match all includes
preg_match_all("~\\.\\. literalinclude:: {$sectionName}\\/(.+)\\.php(\n[ ]*:lines: 2\\-)?~", $sectionContent, $matches);
preg_match_all("~\\.\\. literalinclude:: {$sectionName}\\/(.+)\\.php~", $sectionContent, $matches);
$includeStrings = $matches[0];
$exampleNames = $matches[1];

Expand Down Expand Up @@ -81,7 +81,7 @@
rename($sectionFolder . '/' . $prefix . $exampleName . '.php', $sectionFolder . '/' . $newName . '.php');

// Fix include link
$sectionContent = preg_replace(preg_quote(str_replace($exampleName, $prefix . $exampleName, $includeStrings[$exampleIndex]), '~'), str_replace($exampleName, $newName, $includeStrings[$exampleIndex]), $sectionContent, 1, $count);
$sectionContent = preg_replace('~'.preg_quote(str_replace($exampleName, $prefix . $exampleName, $includeStrings[$exampleIndex]), '~').'~', str_replace($exampleName, $newName, $includeStrings[$exampleIndex]), $sectionContent, 1, $count);
}

// Write new content to rst
Expand Down
10 changes: 5 additions & 5 deletions user_guide_src/source/changelogs/v4.0.0-alpha.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,20 @@ PRs merged:
- #1316 Refactor TimeTest
- #1314 Fix & expand Honeypot & its tests
- #1313 Clean exception
- #1311 Entities store an original stack of values to compare against so we d
- #1311 Entities store an original stack of values to compare against so we d...
- #1306 Testing3/http
- #1305 Change chdir('public') to chdir($public)
- #1304 Refactor script name stripping in parseRequestURI()
- #1303 Testing/http
- #1302 ExceptionNo Formatter defined for mime type ''
- #1302 Exception: No Formatter defined for mime type ''
- #1300 Allow redirect with Query Vars from the current request.
- #1295 Fix grammar in front controller comment.
- #1294 Updated final tutorial page. Fixes #1292
- #1291 Allows extending of helpers. Fixes #1264
- #1286 Cookies
- #1285 Ensure current HTTP verb routes are matched prior to any * matched ro
- #1285 Ensure current HTTP verb routes are matched prior to any * matched ro...
- #1283 Entities
- #1282 system/Test/FeatureTestCase::setupRequest(), minor fixes phpdoc block
- #1282 system/Test/FeatureTestCase::setupRequest(), minor fixes phpdoc block...
- #1281 Tut
- #1280 Add contributing reference to user guide
- #1273 Fix/timing
Expand All @@ -193,6 +193,6 @@ PRs merged:
- #1266 Adjusting the release build scripts
- #1265 WIP Fix docs re PHP server
- #1245 Fix #1244 (form_hidden declaration)
- #1239 Unsolicited PRI changed the download method to testable.
- #1239 [Unsolicited PR] I changed the download method to testable.
- #1217 Optional parameter for resetSelect() call in Builder's countAll();
- #1209 Fix undefined function xml_convert at Database\BaseUtils
2 changes: 1 addition & 1 deletion user_guide_src/source/changelogs/v4.0.0-beta.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ PRs merged:
- #1839 Dont replace slashes with backslashes in the to route
- #1836 Test: Improve View\View coverage
- #1831 Fix some PHPDoc comments error
- #1829 Improve: Models now require a primary key. This is partially to keep the code
- #1829 Improve: Models now require a primary key. This is partially to keep the code ...
- #1828 Fix: Remove bootstrap styles from validation views.
- #1827 Fix: Adding include method to View library to render view partials... views.
- #1823 Docs: Remove legacy Bootstrap references in Pagination class
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/changelogs/v4.0.0-beta.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ PRs merged:
- #2005 Plugin closures docs update and test
- #2004 Allow hasChanged() without parameter
- #2002 Entity Refactor
- #1999 use CodeIgniter\Controller; not needed since Home Controller extends
- #1999 use CodeIgniter\Controller; not needed since Home Controller extends ...
- #1996 Attempting to fix CURLRequest debug issue. #1994
- #e21823 Corrected docs for parser plugins. Closes #1995
- #1989 argument set() must by type of string - cannot agree
Expand Down
1 change: 0 additions & 1 deletion user_guide_src/source/cli/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ the CLI as easily as you would create any other route. Instead of using the ``ge
works exactly like a normal route definition:

.. literalinclude:: cli/002.php
:lines: 2-

For more information, see the :doc:`Routes </incoming/routing>` page.

Expand Down
6 changes: 0 additions & 6 deletions user_guide_src/source/cli/cli_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Commands can also be ran from within your own code. This is most often done with
but they can be used at any time. You do this by using the ``command()`` function. This function is always available.

.. literalinclude:: cli_commands/001.php
:lines: 2-

The only argument is string that is the command called and any parameters. This appears exactly as you would call
it from the command line.
Expand Down Expand Up @@ -127,15 +126,13 @@ any CLI arguments after the command name for your use. If the CLI string was::
Then **foo** is the command name, and the ``$params`` array would be:

.. literalinclude:: cli_commands/003.php
:lines: 2-

This can also be accessed through the :doc:`CLI </cli/cli_library>` library, but this already has your command removed
from the string. These parameters can be used to customize how your scripts behave.

Our demo command might have a ``run`` method something like:

.. literalinclude:: cli_commands/004.php
:lines: 2-

***********
BaseCommand
Expand All @@ -155,7 +152,6 @@ be familiar with when creating your own commands. It also has a :doc:`Logger </g
This method allows you to run other commands during the execution of your current command:

.. literalinclude:: cli_commands/005.php
:lines: 2-

.. php:method:: showError(Throwable $e)

Expand All @@ -164,7 +160,6 @@ be familiar with when creating your own commands. It also has a :doc:`Logger </g
A convenience method to maintain a consistent and clear error output to the CLI:

.. literalinclude:: cli_commands/006.php
:lines: 2-

.. php:method:: showHelp()

Expand All @@ -178,4 +173,3 @@ be familiar with when creating your own commands. It also has a :doc:`Logger </g
A method to calculate padding for $key => $value array output. The padding can be used to output a will formatted table in CLI:

.. literalinclude:: cli_commands/007.php
:lines: 2-
2 changes: 1 addition & 1 deletion user_guide_src/source/cli/cli_commands/006.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

try {
. . .
// ...
} catch (\Exception $e) {
$this->showError($e);
}
4 changes: 2 additions & 2 deletions user_guide_src/source/cli/cli_commands/007.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
}

// Output will be
-n Set migration namespace
-r override file
// -n Set migration namespace
// -r override file
23 changes: 1 addition & 22 deletions user_guide_src/source/cli/cli_library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,34 @@ handled with the ``prompt()`` or ``promptByKey()`` method.
You can provide a question by passing it in as the first parameter:

.. literalinclude:: cli_library/002.php
:lines: 2-

You can provide a default answer that will be used if the user just hits enter by passing the default in the
second parameter:

.. literalinclude:: cli_library/003.php
:lines: 2-

You can restrict the acceptable answers by passing in an array of allowed answers as the second parameter:

.. literalinclude:: cli_library/004.php
:lines: 2-

Finally, you can pass :ref:`validation <validation>` rules to the answer input as the third parameter:

.. literalinclude:: cli_library/005.php
:lines: 2-

Validation rules can also be written in the array syntax.:
Validation rules can also be written in the array syntax:

.. literalinclude:: cli_library/006.php
:lines: 2-

**promptByKey()**

Predefined answers (options) for prompt sometimes need to be described or are too complex to select via their value.
``promptByKey()`` allows the user to select an option by its key instead of its value:

.. literalinclude:: cli_library/007.php
:lines: 2-

Named keys are also possible:

.. literalinclude:: cli_library/008.php
:lines: 2-

Finally, you can pass :ref:`validation <validation>` rules to the answer input as the third parameter, the acceptable answers are automatically restricted to the passed options.

Expand All @@ -82,18 +75,15 @@ or a complex table of information that wraps to the user's terminal window. At t
method which takes the string to output as the first parameter:

.. literalinclude:: cli_library/009.php
:lines: 2-

You can change the color of the text by passing in a color name as the second parameter:

.. literalinclude:: cli_library/010.php
:lines: 2-

This could be used to differentiate messages by status, or create 'headers' by using a different color. You can
even set background colors by passing the color name in as the third parameter:

.. literalinclude:: cli_library/011.php
:lines: 2-

The following foreground colors are available:

Expand Down Expand Up @@ -134,7 +124,6 @@ the same line, from different calls. This is especially helpful when you want to
print "Done" on the same line:

.. literalinclude:: cli_library/012.php
:lines: 2-

**color()**

Expand All @@ -144,7 +133,6 @@ an EOL after printing. This allows you to create multiple outputs on the same ro
it inside of a ``write()`` method to create a string of a different color inside:

.. literalinclude:: cli_library/013.php
:lines: 2-

This example would write a single line to the window, with ``fileA`` in yellow, followed by a tab, and then
``/path/to/file`` in white text.
Expand All @@ -157,7 +145,6 @@ for errors so they don't have to sift through all of the information, only the a
exactly as you would the ``write()`` method:

.. literalinclude:: cli_library/014.php
:lines: 2-

**wrap()**

Expand All @@ -166,23 +153,20 @@ This might be useful when displaying a list of options with descriptions that yo
window and not go off screen:

.. literalinclude:: cli_library/015.php
:lines: 2-

By default, the string will wrap at the terminal width. Windows currently doesn't provide a way to determine
the window size, so we default to 80 characters. If you want to restrict the width to something shorter that
you can be pretty sure fits within the window, pass the maximum line-length as the second parameter. This
will break the string at the nearest word barrier so that words are not broken.

.. literalinclude:: cli_library/016.php
:lines: 2-

You may find that you want a column on the left of titles, files, or tasks, while you want a column of text
on the right with their descriptions. By default, this will wrap back to the left edge of the window, which
doesn't allow things to line up in columns. In cases like this, you can pass in a number of spaces to pad
every line after the first line, so that you will have a crisp column edge on the left:

.. literalinclude:: cli_library/017.php
:lines: 2-

Would create something like this:

Expand All @@ -200,7 +184,6 @@ Would create something like this:
The ``newLine()`` method displays a blank line to the user. It does not take any parameters:

.. literalinclude:: cli_library/018.php
:lines: 2-

**clearScreen()**

Expand All @@ -209,7 +192,6 @@ simply insert 40 blank lines since Windows doesn't support this feature. Windows
this:

.. literalinclude:: cli_library/019.php
:lines: 2-

**showProgress()**

Expand All @@ -227,12 +209,10 @@ The percent complete and the length of the display will be determined based on t
pass ``false`` as the first parameter and the progress bar will be removed.

.. literalinclude:: cli_library/020.php
:lines: 2-

**table()**

.. literalinclude:: cli_library/021.php
:lines: 2-

.. code-block:: none

Expand All @@ -249,4 +229,3 @@ Waits a certain number of seconds, optionally showing a wait message and
waiting for a key press.

.. literalinclude:: cli_library/022.php
:lines: 2-
6 changes: 0 additions & 6 deletions user_guide_src/source/cli/cli_request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,31 @@ Additional Accessors
Returns an array of the command line arguments deemed to be part of a path:

.. literalinclude:: cli_request/001.php
:lines: 2-

**getPath()**

Returns the reconstructed path as a string:

.. literalinclude:: cli_request/002.php
:lines: 2-

**getOptions()**

Returns an array of the command line arguments deemed to be options:

.. literalinclude:: cli_request/003.php
:lines: 2-

**getOption($which)**

Returns the value of a specific command line argument deemed to be an option:

.. literalinclude:: cli_request/004.php
:lines: 2-

**getOptionString()**

Returns the reconstructed command line string for the options:

.. literalinclude:: cli_request/005.php
:lines: 2-

Passing ``true`` to the first argument will try to write long options using two dashes:

.. literalinclude:: cli_request/006.php
:lines: 2-
3 changes: 0 additions & 3 deletions user_guide_src/source/concepts/autoloader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ etc. The ``psr4`` array in the configuration file allows you to map the namespac
those classes can be found in:

.. literalinclude:: autoloader/001.php
:lines: 2-

The key of each row is the namespace itself. This does not need a trailing slash. If you use double-quotes
to define the array, be sure to escape the backward slash. That means that it would be ``My\\App``,
Expand All @@ -53,7 +52,6 @@ You may change this namespace by editing the **/app/Config/Constants.php** file
new namespace value under the ``APP_NAMESPACE`` setting:

.. literalinclude:: autoloader/002.php
:lines: 2-

You will need to modify any existing files that are referencing the current namespace.

Expand All @@ -69,7 +67,6 @@ by not hitting the file-system with extra ``is_file()`` calls. You can use the c
third-party libraries that are not namespaced:

.. literalinclude:: autoloader/003.php
:lines: 2-

The key of each row is the name of the class that you want to locate. The value is the path to locate it at.

Expand Down
5 changes: 0 additions & 5 deletions user_guide_src/source/concepts/factories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ the common path structure for namespaces and folders, Factories know that the mo
and classes are found within **Models**, so you can request a model by its shorthand base name:

.. literalinclude:: factories/001.php
:lines: 2-

Or you could also request a specific class:

.. literalinclude:: factories/002.php
:lines: 2-

Next time you ask for the same class anywhere in your code, ``Factories`` will be sure
you get back the instance as before:

.. literalinclude:: factories/003.php
:lines: 2-

Factory Parameters
==================
Expand All @@ -50,7 +47,6 @@ your app uses a separate database for authentication and you want to be sure tha
to access user records always go through that connection:

.. literalinclude:: factories/004.php
:lines: 2-

Now any time the ``UserModel`` is loaded from ``Factories`` it will in fact be returning a
class instance that uses the alternate database connection.
Expand Down Expand Up @@ -108,7 +104,6 @@ supply the desired array of options using the ``setOptions()`` method and they w
merged with the default values and stored for the next call:

.. literalinclude:: factories/006.php
:lines: 2-

Parameter Options
-----------------
Expand Down
2 changes: 0 additions & 2 deletions user_guide_src/source/concepts/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ abstracts them so that you have a consistent, simple interface to them. The :doc
is an object-oriented representation of the HTTP request. It provides everything you need:

.. literalinclude:: http/001.php
:lines: 2-

The request class does a lot of work in the background for you, that you never need to worry about.
The ``isAJAX()`` and ``isSecure()`` methods check several different methods to determine the correct answer.
Expand All @@ -82,6 +81,5 @@ CodeIgniter also provides a :doc:`Response class </outgoing/response>` that is a
of the HTTP response. This gives you an easy and powerful way to construct your response to the client:

.. literalinclude:: http/002.php
:lines: 2-

In addition, the Response class allows you to work the HTTP cache layer for the best performance.
Loading