From ee0dc502edfd4276dbaec645f4fc4ec8d268329d Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Fri, 21 Sep 2018 11:50:21 -0700 Subject: [PATCH] Fix user guide errors --- .../source => contributing}/DCO.rst | 0 user_guide_src/source/changelog.rst | 110 ++++++++++++------ user_guide_src/source/conf.py | 4 +- .../source/general/configuration.rst | 2 +- user_guide_src/source/general/modules.rst | 2 +- .../source/general/view_renderer.rst | 4 + user_guide_src/source/helpers/url_helper.rst | 1 - user_guide_src/source/index.rst | 9 +- user_guide_src/source/intro/psr.rst | 3 +- user_guide_src/source/libraries/images.rst | 2 +- .../source/libraries/incomingrequest.rst | 30 ++--- user_guide_src/source/libraries/message.rst | 1 + user_guide_src/source/libraries/request.rst | 5 +- user_guide_src/source/libraries/response.rst | 1 + user_guide_src/source/libraries/sessions.rst | 6 +- user_guide_src/source/libraries/time.rst | 12 +- user_guide_src/source/testing/controllers.rst | 2 +- user_guide_src/source/testing/overview.rst | 13 +-- 18 files changed, 127 insertions(+), 80 deletions(-) rename {user_guide_src/source => contributing}/DCO.rst (100%) diff --git a/user_guide_src/source/DCO.rst b/contributing/DCO.rst similarity index 100% rename from user_guide_src/source/DCO.rst rename to contributing/DCO.rst diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 4e08f510ec95..7d6c12df4d60 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -2,66 +2,104 @@ Change Log ########## -Version 4.0-Pre-Alpha1 -====================== +Version |version| +================= **Rewrite of the CodeIgniter framework** Release Date: Not Released New core classes: - - CodeIgniter (bootstrap) - Common (shared functions) - ComposerScripts (integrate third party tools) - Controller (base controller) - Model (base model) + - Entity (entity encapsulation) New packages: - - - Autoloader \\ AutoLoader, FileLocator - - CLI \\ CLI - - Commands \\ MigrationsCommand - - Config \\ AutoloadConfig, BaseConfig, DotEnv, Routes + - API + - \\ ResponseTrait + - Autoloader + - \\ AutoLoader, FileLocator + - CLI + - \\ BaseCommand, CLI, CommandRunner, Console + - Cache + - \\ CacheFactory, CacheInterface + - \\ Handlers ... Dummy, File, Memcached, Predis, Redis, Wincache + - Commands + - \\ Help, ListCommands + - \\ Database \\ CreateMigration, MigrateCurrent, MigrateLatest, MigrateRefresh, + MigrateRollback, MigrateStatus, MigrateVersion, Seed + - \\ Server \\ Serve + - \\ Sessions \\ CreateMigration + - \\ Utilities \\ Namespaces, Routes + - Config + - \\ AutoloadConfig, BaseConfig, BaseService, Config, DotEnv, ForeignCharacters, + Routes, Services, View - Database - - - \\ BaseBuilder, BaseConnection, BaseResult, BaseUtils, Config, - ConnectionInterface, Database, Forge, Migration, MigrationRunner, Query, + - \\ BaseBuilder, BaseConnection, BasePreparedQuery, BaseResult, BaseUtils, Config, + ConnectionInterface, Database, Forge, Migration, MigrationRunner, PreparedQueryInterface, Query, QueryInterface, ResultInterface, Seeder - - \\ MySQLi \\ Builder, Connection, Forge, Result - - \\ Postgre \\ Builder, Connection, Forge, Result, Utils - + - \\ MySQLi \\ Builder, Connection, Forge, PreparedQuery, Result + - \\ Postgre \\ Builder, Connection, Forge, PreparedQuery, Result, Utils + - \\ SQLite3 \\ Builder, Connection, Forge, PreparedQuery, Result, Utils - Debug - - - \\ CustomExceptions, Exceptions, Iterator, Timer, Toolbar - - Kint \\ Kint **third party** - + - \\ Exceptions, Iterator, Timer, Toolbar + - \\ Toolbar \\ Collectors... + - Email + - \\ Email + - Events + - \\ Events + - Files + - \\ File + - Filters + - \\ FilterInterface, Filters + - Format + - \\ FormatterInterface, JSONFormatter, XMLFormatter - HTTP - - \\ CLIRequest, CURLRequest, ContentSecurityPolicy, Header, IncomingRequest, Message, Negotiate, Request, RequestInterface, - Response, ResponseInterface, URI + Response, ResponseInterface, URI, UserAgent - \\ Files \\ FileCollection, UploadedFile, UploadedFileInterface - - - Helpers ... uri - - Events \\ Events + - Helpers + - ... array, cookie, date, filesystem, form, html, inflector, number, + security, text, url + - Honeypot + - \\ Honeypot + - I18n + - \\ Time, TimeDifference + - Images + - \\ Image, ImageHandlerInterface + - \\ Handlers ... Base, GD, ImageMagick + - Language + - \\ Language - Log - - Logger, LoggerAwareTrait - - \\ Handlers \\ BaseHandler, ChromeLoggerHandler, FileHandler, HandlerInterface - - Psr \\ Log **third party** - - - Router \\ RouteCollection, RouteCollectionInterface, Router, RouterInterface - - Security \\ Security + - \\ Handlers ... Base, ChromeLogger, File, HandlerInterface + - Pager + - \\ Pager, PagerInterface, PagerRenderer + - Router + - \\ RouteCollection, RouteCollectionInterface, Router, RouterInterface + - Security + - \\ Security - Session - - \\ Session, SessionInterface - - \\ Handlers \\ BaseHandler, FileHandler, MemcachedHandler, RedisHandler - - - Test \\ CIDatabaseTestCase, CIUnitTestCase, ReflectionHelper + - \\ Handlers ... Base, File, Memcached, Redis + - Test + - \\ CIDatabaseTestCase, CIUnitTestCase, FeatureResponse, FeatureTestCase, ReflectionHelper + - \\ Filters \\ CITestStreamFilter + - ThirdParty (bundled) + - \\ Kint (for \\Debug) + - \\ PSR \\ Log (for \\Log) + - \\ ZendEscaper \\ Escaper (for \\View) + - Throttle + - \\ Throttler, ThrottlerInterface + - Typography + - \\ Typography + - Validation + - \\ CreditCardRules, FileRules, FormatRules, Rules, Validation, ValidationInterface - View - - - Zend \\ Escaper, Exception \\ ... **third party** - - RendererInterface, View + - \\ Cell, Filters, Parser, Plugins, RendererInterface, View User Guide adapted or rewritten. diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index 0eab82bf3a16..287d1042cc73 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -48,9 +48,9 @@ # built documents. # # The short X.Y version. -version = '4.0.0' +version = '4.0-dev' # The full version, including alpha/beta/rc tags. -release = '4.0.0-dev' +release = '4.0.0-not' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/user_guide_src/source/general/configuration.rst b/user_guide_src/source/general/configuration.rst index 3e97a4ecd088..f06d0a2265fe 100644 --- a/user_guide_src/source/general/configuration.rst +++ b/user_guide_src/source/general/configuration.rst @@ -170,6 +170,7 @@ held instead:: then the result would be the same as above. .. _registrars: + Registrars ========== @@ -222,4 +223,3 @@ by treating `RegionalSalesModel` as a "registrar". The resulting configuration p $target = 45; $campaign = "Winter Wonderland"; - diff --git a/user_guide_src/source/general/modules.rst b/user_guide_src/source/general/modules.rst index fbd00c4fd9e1..4811fb3431cd 100644 --- a/user_guide_src/source/general/modules.rst +++ b/user_guide_src/source/general/modules.rst @@ -68,7 +68,7 @@ configured to make integrating modules into your applications simpler by automat file types, including: - :doc:`Events ` -- :ref:`registrars` +- :doc:`Registrars ` - :doc:`Route files ` - :doc:`Services ` diff --git a/user_guide_src/source/general/view_renderer.rst b/user_guide_src/source/general/view_renderer.rst index 231b4ef57ba5..22c8faffeed4 100644 --- a/user_guide_src/source/general/view_renderer.rst +++ b/user_guide_src/source/general/view_renderer.rst @@ -101,6 +101,7 @@ Class Reference .. php:class:: CodeIgniter\\View\\View .. php:method:: render($view[, $options[, $saveData=false]]]) + :noindex: :param string $view: File name of the view source :param array $options: Array of options, as key/value pairs @@ -113,6 +114,7 @@ Class Reference echo $view->render('myview'); .. php:method:: renderString($view[, $options[, $saveData=false]]]) + :noindex: :param string $view: Contents of the view to render, for instance content retrieved from a database :param array $options: Array of options, as key/value pairs @@ -130,6 +132,7 @@ Class Reference appropriately! .. php:method:: setData([$data[, $context=null]]) + :noindex: :param array $data: Array of view data strings, as key/value pairs :param string $context: The context to use for data escaping. @@ -147,6 +150,7 @@ Class Reference until the view is rendered. .. php:method:: setVar($name[, $value=null[, $context=null]]) + :noindex: :param string $name: Name of the view data variable :param mixed $value: The value of this view data diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index 30cbc90a56d4..bf46fff4cdcb 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -95,7 +95,6 @@ The following functions are available: viewed. .. note:: Calling this function is the same as doing this:: - base_url(uri_string()); .. php:function:: previous_url([$returnObject = false]) diff --git a/user_guide_src/source/index.rst b/user_guide_src/source/index.rst index b5637ecd8865..8631d54afd40 100644 --- a/user_guide_src/source/index.rst +++ b/user_guide_src/source/index.rst @@ -2,9 +2,6 @@ CodeIgniter4 User Guide ####################### -- :doc:`License Agreement ` -- :doc:`Change Log ` - .. contents:: :local: :depth: 2 @@ -92,3 +89,9 @@ Testing :titlesonly: testing/index + +.. toctree:: + :hidden: + + license + changelog diff --git a/user_guide_src/source/intro/psr.rst b/user_guide_src/source/intro/psr.rst index bbcbb5133309..04a0fbaa0680 100644 --- a/user_guide_src/source/intro/psr.rst +++ b/user_guide_src/source/intro/psr.rst @@ -9,7 +9,8 @@ status of our compliance with the various accepted, and some draft, proposals. **PSR-1: Basic Coding Standard** -This recommendation covers basic class, method, and file-naming standards. Our :doc:`style guide ` +This recommendation covers basic class, method, and file-naming standards. Our +`style guide _` meets PSR-1 and adds its own requirements on top of it. **PSR-2: Coding Style Guide** diff --git a/user_guide_src/source/libraries/images.rst b/user_guide_src/source/libraries/images.rst index a09fa0f080ca..cd7519445ba1 100644 --- a/user_guide_src/source/libraries/images.rst +++ b/user_guide_src/source/libraries/images.rst @@ -14,7 +14,7 @@ actions: The following image libraries are supported: GD/GD2, and ImageMagick. .. contents:: -:local: + :local: ********************** Initializing the Class diff --git a/user_guide_src/source/libraries/incomingrequest.rst b/user_guide_src/source/libraries/incomingrequest.rst index 278a45ff9ff0..e4ac5ca1ed3d 100644 --- a/user_guide_src/source/libraries/incomingrequest.rst +++ b/user_guide_src/source/libraries/incomingrequest.rst @@ -314,8 +314,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getVar([$index = null[, $filter = null[, $flags = null]]]) :param string $index: The name of the variable/key to look for. - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_REQUEST if no parameters supplied, otherwise the REQUEST value if found, or null if not :rtype: mixed|null @@ -351,8 +351,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getGet([$index = null[, $filter = null[, $flags = null]]]) :param string $index: The name of the variable/key to look for. - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_GET if no parameters supplied, otherwise the GET value if found, or null if not :rtype: mixed|null @@ -361,8 +361,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getPost([$index = null[, $filter = null[, $flags = null]]]) :param string $index: The name of the variable/key to look for. - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_POST if no parameters supplied, otherwise the POST value if found, or null if not :rtype: mixed|null @@ -371,8 +371,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getPostGet([$index = null[, $filter = null[, $flags = null]]]) :param string $index: The name of the variable/key to look for. - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_POST if no parameters supplied, otherwise the POST value if found, or null if not :rtype: mixed|null @@ -385,8 +385,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getGetPost([$index = null[, $filter = null[, $flags = null]]]) :param string $index: The name of the variable/key to look for. - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_POST if no parameters supplied, otherwise the POST value if found, or null if not :rtype: mixed|null @@ -399,8 +399,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getCookie([$index = null[, $filter = null[, $flags = null]]]) :param mixed $index: COOKIE name - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_COOKIE if no parameters supplied, otherwise the COOKIE value if found or null if not :rtype: mixed @@ -420,8 +420,8 @@ The methods provided by the parent classes that are available are: .. php:method:: getServer([$index = null[, $filter = null[, $flags = null]]]) :param mixed $index: Value name - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_SERVER item value if found, NULL if not :rtype: mixed @@ -438,7 +438,7 @@ The methods provided by the parent classes that are available are: .. php:method:: getUserAgent([$filter = null]) - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. :returns: The User Agent string, as found in the SERVER data, or null if not found. :rtype: mixed diff --git a/user_guide_src/source/libraries/message.rst b/user_guide_src/source/libraries/message.rst index 3e4adffe4e7d..909b7ff8ba11 100644 --- a/user_guide_src/source/libraries/message.rst +++ b/user_guide_src/source/libraries/message.rst @@ -118,6 +118,7 @@ Class Reference en, en-US .. php:method:: setHeader([$name[, $value]]) + :noindex: :param string $name: The name of the header to set the value for. :param mixed $value: The value to set the header to. diff --git a/user_guide_src/source/libraries/request.rst b/user_guide_src/source/libraries/request.rst index b96dddce38e4..9d38e3ca5ad1 100644 --- a/user_guide_src/source/libraries/request.rst +++ b/user_guide_src/source/libraries/request.rst @@ -73,10 +73,11 @@ Class Reference echo $request->getMethod(); // Outputs: post .. php:method:: getServer([$index = null[, $filter = null[, $flags = null]]]) + :noindex: :param mixed $index: Value name - :param int $filter: The type of filter to apply. A list of filters can be found `here `_. - :param int $flags: Flags to apply. A list of flags can be found `here `_. + :param int $filter: The type of filter to apply. A list of filters can be found `here `__. + :param int $flags: Flags to apply. A list of flags can be found `here `__. :returns: $_SERVER item value if found, NULL if not :rtype: mixed diff --git a/user_guide_src/source/libraries/response.rst b/user_guide_src/source/libraries/response.rst index 8a53b02e6c7b..5f2e5f9c5d56 100644 --- a/user_guide_src/source/libraries/response.rst +++ b/user_guide_src/source/libraries/response.rst @@ -347,6 +347,7 @@ The methods provided by the parent class that are available are: $response->setLastModified(DateTime::createFromFormat('u', $time)); .. php:method:: send() + :noindex: :returns: The current response instance. :rtype: CodeIgniter\HTTP\Response diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index d510b8e59a48..d98d27967463 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -176,8 +176,8 @@ you need it. You can simply assign data to the ``$_SESSION`` array, as with any other variable. Or as a property of ``$session``. -userdata method is deprecated. - That however passing an array containing your new sessiondata to the +The former userdata method is deprecated, +but you can pass an array containing your new session data to the ``set()`` method:: $session->set($array); @@ -193,7 +193,7 @@ an example:: $session->set($newdata); -If you want to add sessiondata one value at a time, ``set()`` also +If you want to add session data one value at a time, ``set()`` also supports this syntax:: $session->set('some_name', 'some_value'); diff --git a/user_guide_src/source/libraries/time.rst b/user_guide_src/source/libraries/time.rst index b1d880aa0b81..a174aad09865 100644 --- a/user_guide_src/source/libraries/time.rst +++ b/user_guide_src/source/libraries/time.rst @@ -26,8 +26,8 @@ be any string that PHP's strtotime function can parse:: $myTime = new Time('now'); You can pass in strings representing the timezone and the locale in the second and parameters, respectively. Timezones -can be any supported by PHP's `DateTimeZone `_ class. The locale can be -any supported by PHP's `Locale `_ class. If no locale or timezone is +can be any supported by PHP's `DateTimeZone `__ class. The locale can be +any supported by PHP's `Locale `__ class. If no locale or timezone is provided, the application defaults will be used. :: @@ -154,8 +154,8 @@ toLocalizedString() ------------------- This is the localized version of DateTime's format() method. Instead of using the values you might be familiar with, though, -you must use values acceptable to the `IntlDateFormatter `_ class. -A full listing of values can be found `here `_. +you must use values acceptable to the `IntlDateFormatter `__ class. +A full listing of values can be found `here `__. :: $time = Time::parse('March 9, 2016 12:00:00', 'America/Chicago'); @@ -303,7 +303,7 @@ Returns boolean true if the Time instance is in UTC time:: getTimezone() ------------- -Returns a new `DateTimeZone `_ object set the timezone of the Time +Returns a new `DateTimeZone `__ object set the timezone of the Time instance:: $tz = Time::now()->getTimezone(); @@ -315,7 +315,7 @@ instance:: getTimezoneName() ----------------- -Returns the full `timezone string `_ of the Time instance:: +Returns the full `timezone string `__ of the Time instance:: echo Time::now('America/Chicago')->getTimezoneName(); // America/Chicago echo Time::now('Europe/London')->timezoneName; // Europe/London diff --git a/user_guide_src/source/testing/controllers.rst b/user_guide_src/source/testing/controllers.rst index 5d7c9a393d45..e38c46f27c10 100644 --- a/user_guide_src/source/testing/controllers.rst +++ b/user_guide_src/source/testing/controllers.rst @@ -8,7 +8,7 @@ Often times, using the `Feature Testing tools `_ will be simpl case you need it. .. note:: Because the entire framework has not been bootstrapped, there will be times when you cannot test a controller -this way. + this way. The Helper Trait ================ diff --git a/user_guide_src/source/testing/overview.rst b/user_guide_src/source/testing/overview.rst index aa2f18542fc7..5827eaf27490 100644 --- a/user_guide_src/source/testing/overview.rst +++ b/user_guide_src/source/testing/overview.rst @@ -17,18 +17,18 @@ System Setup Installing phpUnit ================== -CodeIgniter uses `phpUnit `_ as the basis for all of its testing. There are two ways to install +CodeIgniter uses `phpUnit `__ as the basis for all of its testing. There are two ways to install phpUnit to use within your system. Composer -------- -The recommended method is to install it in your project using `Composer `_. While it's possible +The recommended method is to install it in your project using `Composer `__. While it's possible to install it globally we do not recommend it, since it can cause compatibility issues with other projects on your system as time goes on. Ensure that you have Composer installed on your system. From the project root (the directory that contains the -application and system directories) type the followin from the command line:: +application and system directories) type the following from the command line:: > composer require --dev phpunit/phpunit @@ -40,7 +40,7 @@ tests for this project by typing:: Phar ---- -The other option is to download the .phar file from the `phpUnit `_ site. +The other option is to download the .phar file from the `phpUnit `__ site. This is standalone file that should be placed within your project root. @@ -52,9 +52,9 @@ this file should be done in a separate file so that it doesn't get overwritten b to ``phpunit.xml`` will create a file that phpUnit will use instead of the original file. -======================== +************************ Testing Your Application -======================== +************************ PHPUnit Configuration ===================== @@ -232,4 +232,3 @@ An example demonstrating this inside one of your test cases:: $expected = "first.\n"; $this->assertEquals($expected, CITestStreamFilter::$buffer); } -