diff --git a/user_guide_src/source/database/model.rst b/user_guide_src/source/database/model.rst index 8ec681ff155d..5e7b6292b4c8 100644 --- a/user_guide_src/source/database/model.rst +++ b/user_guide_src/source/database/model.rst @@ -147,14 +147,14 @@ are: datetime, date, or int (a PHP timestamp). **$validationRules** -Contains either an array of validation rules as described in :ref:`_validation-array` +Contains either an array of validation rules as described in :ref:`validation-array` or a string containing the name of a validation group, as described in the same section. Described in more detail below. **$validationMessages** Contains an array of custom error messages that should be used during validation, as -described in :ref:`_validation-custom-errors`. Described in more detail below. +described in :ref:`validation-custom-errors`. Described in more detail below. **$skipValidation** diff --git a/user_guide_src/source/libraries/index.rst b/user_guide_src/source/libraries/index.rst index 631e17944061..146671e02d87 100644 --- a/user_guide_src/source/libraries/index.rst +++ b/user_guide_src/source/libraries/index.rst @@ -20,6 +20,7 @@ Library Reference security sessions throttler + typography uploaded_files uri validation diff --git a/user_guide_src/source/libraries/sessions.rst b/user_guide_src/source/libraries/sessions.rst index 166469813c1e..c9ec0aed21af 100644 --- a/user_guide_src/source/libraries/sessions.rst +++ b/user_guide_src/source/libraries/sessions.rst @@ -458,7 +458,7 @@ Preference Default Options everything properly. In addition to the values above, the cookie and native drivers apply the -following configuration values shared by the :doc:`Input ` and +following configuration values shared by the :doc:`IncomingRequest ` and :doc:`Security ` classes: ================== =============== =========================================================================== diff --git a/user_guide_src/source/test/cli.rst b/user_guide_src/source/test/cli.rst deleted file mode 100644 index a8e62f509508..000000000000 --- a/user_guide_src/source/test/cli.rst +++ /dev/null @@ -1,195 +0,0 @@ -CLI Class -########## - -Class CLI - -Tools to interact with that request since CLI requests are not -static like HTTP requests might be. - -Portions of this code were initially from the FuelPHP Framework, -version 1.7.x, and used here under the MIT license they were -originally made available under. - -http://fuelphp.com - - -.. php:class:: CodeIgniter\\CLI\\CLI - - .. php:method:: init ( ) - - - - Static "constructor". - - - .. php:method:: input ( [ string $prefix ] ) - - :param string $prefix: - - - Get input from the shell, using readline or the standard STDIN - - Named options must be in the following formats: - php index.php user -v --v -name=John --name=John - - - - - .. php:method:: prompt ( ) - - - - Asks the user for input. This can have either 1 or 2 arguments. - - Usage: - - // Waits for any key press - CLI::prompt(); - - // Takes any input - $color = CLI::prompt('What is your favorite color?'); - - // Takes any input, but offers default - $color = CLI::prompt('What is your favourite color?', 'white'); - - // Will only accept the options in the array - $ready = CLI::prompt('Are you ready?', array('y','n')); - - - - .. php:method:: write ( string $text [ string $foreground [, string $background ]] ) - - :param string $text: - :param string $foreground: - :param string $background: - - - Outputs a string to the cli. If you send an array it will implode them - with a line break. - - - - .. php:method:: error ( string $text [ string $foreground [, string $background ]] ) - - :param string $text: - :param string $foreground: - :param string $background: - - - Outputs an error to the CLI using STDERR instead of STDOUT - - - - .. php:method:: beep ( [ int $num ] ) - - :param int $num: - - - Beeps a certain number of times. - - - - .. php:method:: wait ( int $seconds [ bool $countdown ] ) - - :param int $seconds: - :param bool $countdown: - - - Waits a certain number of seconds, optionally showing a wait message and - waiting for a key press. - - - - .. php:method:: isWindows ( ) - - - - if operating system === windows - - - .. php:method:: newLine ( [ int $num ] ) - - :param int $num: - - - Enter a number of empty lines - - - - - .. php:method:: clearScreen ( ) - - - - Clears the screen of output - - - - .. php:method:: color ( string $text string $foreground [ string $background [, string $format ]] ) - - :param string $text: - :param string $foreground: - :param string $background: - :param string $format: - - - Returns the given text with the correct color codes for a foreground and - optionally a background color. - - - - - .. php:method:: getWidth ( [ int $default ] ) - - :param int $default: - - - Attempts to determine the width of the viewable CLI window. - This only works on \*nix-based systems, so return a sane default - for Windows environments. - - - - - .. php:method:: getHeight ( [ int $default ] ) - - :param int $default: - - - Attempts to determine the height of the viewable CLI window. - This only works on \*nix-based systems, so return a sane default - for Windows environments. - - - - - .. php:method:: showProgress ( [ int $thisStep [, int $totalSteps ]] ) - - :param int $thisStep: - :param int $totalSteps: - - - Displays a progress bar on the CLI. You must call it repeatedly - to update it. Set $thisStep = false to erase the progress bar. - - - - .. php:method:: wrap ( [ string $string [, int $max [, int $pad_left ]]] ) - - :param string $string: - :param int $max: - :param int $pad_left: - - - Takes a string and writes it to the command line, wrapping to a maximum - width. If no maximum width is specified, will wrap to the window's max - width. - - If an int is passed into $pad_left, then all strings after the first - will padded with that many spaces to the left. Useful when printing - short descriptions that need to start on an existing line. - - - - - diff --git a/user_guide_src/source/test/incoming_request.rst b/user_guide_src/source/test/incoming_request.rst deleted file mode 100644 index 5b8cdcacbb75..000000000000 --- a/user_guide_src/source/test/incoming_request.rst +++ /dev/null @@ -1,394 +0,0 @@ -IncomingRequest Class -###################### - -Class IncomingRequest - -Represents an incoming, getServer-side HTTP request. - -Per the HTTP specification, this interface includes properties for -each of the following: - -- Protocol version -- HTTP method -- URI -- Headers -- Message body - -Additionally, it encapsulates all data as it has arrived to the -application from the CGI and/or PHP environment, including: - -- The values represented in $_SERVER. -- Any cookies provided (generally via $_COOKIE) -- Query string arguments (generally via $_GET, or as parsed via parse_str()) -- Upload files, if any (as represented by $_FILES) -- Deserialized body binds (generally from $_POST) - - -.. php:class:: CodeIgniter\\HTTP\\IncomingRequest - - Implements: CodeIgniter\HTTP\RequestInterface - - .. php:method:: __construct ( $config [ $uri [, $body ]] ) - - :param $config: - :param $uri: - :param $body: - - - - - - .. php:method:: isCLI ( ) - - :returns: - :rtype: bool - - Determines if this request was made from the command line (CLI). - - - - .. php:method:: isAJAX ( ) - - :returns: - :rtype: bool - - Test to see if a request contains the HTTP_X_REQUESTED_WITH header. - - - - .. php:method:: getGet ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from GET data. - - - - - .. php:method:: getPost ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from POST. - - - - - .. php:method:: getPostGet ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from POST data with fallback to GET. - - - - - .. php:method:: getGetPost ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from GET data with fallback to POST. - - - - - .. php:method:: getCookie ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from the COOKIE array. - - - - - .. php:method:: getUserAgent ( [ $filter ] ) - - :param $filter: - - - Fetch the user agent string - - - - .. php:method:: setCookie ( $name [ $value [, $expire [, $domain [, $path [, $prefix [, $secure [, $httponly ]]]]]]] ) - - :param $name: - :param $value: - :param $expire: - :param $domain: - :param $path: - :param $prefix: - :param $secure: - :param $httponly: - - - Set a cookie - - Accepts an arbitrary number of binds (up to 7) or an associateive - array in the first parameter containing all the values. - - - - .. php:method:: isSecure ( ) - - :returns: - :rtype: bool - - Attempts to detect if the current connection is secure through - a few different methods. - - - - .. php:method:: getFiles ( ) - - :returns: - :rtype: array - - Returns an array of all files that have been uploaded with this - request. Each file is represented by an UploadedFile instance. - - - - .. php:method:: getFile ( string $fileID ) - - :param string $fileID: - - - Retrieves a single file by the name of the input field used - to upload it. - - - - - .. php:method:: detectPath ( $protocol ) - - :param $protocol: - - - Based on the URIProtocol Config setting, will attempt to - detect the path portion of the current URI. - - - - - .. php:method:: negotiate ( string $type array $supported [ bool $strictMatch ] ) - - :param string $type: - :param array $supported: - :param bool $strictMatch: - - - Provides a convenient way to work with the Negotiate class - for content negotiation. - - - - - .. php:method:: getIPAddress ( ) - - :returns: - :rtype: string - - Gets the user's IP address. - - - - .. php:method:: isValidIP ( string $ip [ string $which ] ) - - :param string $ip: - :param string $which: - :returns: - :rtype: bool - - Validate an IP address - - - - - .. php:method:: getMethod ( [ $upper ] ) - - :param $upper: - :returns: - :rtype: string - - Get the request method. - - - - - .. php:method:: getServer ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from the $_SERVER array. - - - - .. php:method:: getEnv ( [ $index [, $filter ]] ) - - :param $index: - :param $filter: - - - Fetch an item from the $_ENV array. - - - - .. php:method:: getBody ( ) - - - - Returns the Message's body. - - - - .. php:method:: setBody ( &$data ) - - :param $data: - :returns: - :rtype: self - - Sets the body of the current message. - - - - - .. php:method:: populateHeaders ( ) - - - - Populates the $headers array with any headers the getServer knows about. - - - .. php:method:: getHeaders ( ) - - :returns: - :rtype: array - - Returns an array containing all headers. - - - - .. php:method:: getHeader ( $name ) - - :param $name: - - - Returns a single header object. If multiple headers with the same - name exist, then will return an array of header objects. - - - - - .. php:method:: hasHeader ( $name ) - - :param $name: - :returns: - :rtype: bool - - Determines whether a header exists. - - - - - .. php:method:: getHeaderLine ( string $name ) - - :param string $name: - :returns: - :rtype: string - - Retrieves a comma-separated string of the values for a single header. - - This method returns all of the header values of the given - case-insensitive header name as a string concatenated together using - a comma. - - NOTE: Not all header values may be appropriately represented using - comma concatenation. For such headers, use getHeader() instead - and supply your own delimiter when concatenating. - - - - - .. php:method:: setHeader ( string $name $value ) - - :param string $name: - :param $value: - :returns: - :rtype: self - - Sets a header and it's value. - - - - - .. php:method:: removeHeader ( string $name ) - - :param string $name: - :returns: - :rtype: self - - Removes a header from the list of headers we track. - - - - - .. php:method:: appendHeader ( string $name $value ) - - :param string $name: - :param $value: - :returns: - :rtype: self - - Adds an additional header value to any headers that accept - multiple values (i.e. are an array or implement ArrayAccess) - - - - - .. php:method:: prependHeader ( string $name $value ) - - :param string $name: - :param $value: - :returns: - :rtype: self - - Adds an additional header value to any headers that accept - multiple values (i.e. are an array or implement ArrayAccess) - - - - - .. php:method:: getProtocolVersion ( ) - - :returns: - :rtype: string - - Returns the HTTP Protocol Version. - - - - .. php:method:: setProtocolVersion ( string $version ) - - :param string $version: - :returns: - :rtype: self - - Sets the HTTP protocol version. - - - - -