Show
Ignore:
Timestamp:
09/02/2007 09:34:20 AM (15 months ago)
Author:
OscarB
Message:

UG updates, added cookie helper, updated installation and configuration, added code rule to css

Location:
trunk/modules/user_guide/views/user_guide
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/user_guide/views/user_guide/content/general/configuration.php

    r454 r469  
    1 Article status [Draft] requires [Writing] Configuring the Framework, add remaining entries 
     1Article status [Draft] requires [Editing] Configuring the Framework, add remaining entries 
    22# Configuration 
    33Kohana adopts the philosophy of *convention* over *configuration*. The goal is to minimize user  configuration. Where configuration is required or enabled, sensible defaults are utilised. 
    44 
    5 System configuration is specified by entries in files located in folder */application/config/*. 
     5System configuration is specified by entries in files located in folder */application/config/* 
    66 
    77Configuration files are ordinary text files with a default *php* file extension.  
    88 
    9 The primary configuration file is <file>/application/config/config</file> System wide configuration is 
     9The primary configuration file is <file>application/config/config</file> System wide configuration is 
    1010specified here and is required for every new installation. 
    1111 
     
    1515### Base URL 
    1616Specifies the url which points to the base or root of your application.  
    17 Format: 
    18 <pre>config item                domain name             /[subdirectory/]</pre> 
     17<pre> 
     18base_url                        domain name/[subdirectory/] 
    1919<code> 
    2020$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/kohana/'; 
    2121</code> 
     22</pre> 
    2223*base_url* is **mandatory** and requires a correct server domain that **must** terminate with a "**/**" 
    2324 
    2425### Front Controller 
    25 Specifies the name of the system *Front Controller*, usually <file>index</file>, but may be renamed. 
    26 Format: 
    27 <pre>config item                [front controller name]</pre> 
     26Specifies the name of the system <definition>Front Controller</definition>, usually <file>index</file>, but may be renamed. 
     27<pre> 
     28index_page                      [front controller name] 
    2829<code> 
    2930$config['index_page'] = 'index.php'; 
    3031</code> 
    31 *index_page* is **optional**. If your web server supports dynamic url re-writing. The front controller 
    32 may be dynamically removed fron the uri path. Set this item to blank if you are using re-writes. 
     32</pre> 
     33*index_page* is **optional**. If your web server supports dynamic URL re-writing. The front controller 
     34may be dynamically removed fron the URI path. Set this item to blank if you are using re-writes. 
    3335 
    34 ### Url Suffix 
    35 Specifies the suffix which should be dynamically added to the uri path. 
    36 Format: 
    37 <pre>*url_suffix*               [suffix]</pre> 
     36### URL Suffix 
     37Specifies the suffix which should be dynamically added to the URI path. 
     38<pre> 
     39url_suffix              [suffix] 
    3840<code> 
    3941$config['url_suffix'] = '.html'; 
    4042</code> 
    41 *url_suffix* is **optional** You may specify any valid extension as a suffix. Set to blank to remove. 
     43</pre> 
     44*url_suffix* is **optional**. You may specify any valid extension as a suffix. Set to blank to remove. 
    4245 
    4346### Permitted URI Characters 
    4447Specifies the characters which the system will allow as part of a uniform resource indicator. 
    45 Format: 
    46 <pre>*permitted_uri_chars*              character set</pre> 
     48<pre> 
     49permitted_uri_chars             character set 
    4750<code> 
    4851$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; 
    4952</code> 
    50 *permitted_uri_chars* is **mandatory** A minimal character set must be specified or the system cannot function. 
     53</pre> 
     54*permitted_uri_chars* is **mandatory**. A minimal character set must be specified or the system cannot function. 
    5155 
    5256**Security Note:** It is recommended that the default character set be used, to secure the system against 
    53 hacking attempts. Additional characters may be configured, but please be aware of the security implication.  
     57hacking attempts. Additional characters may be configured, but please be aware of the security implication. 
     58 
     59### Locale 
     60Specifies the system locale using the standard two letter abbreviation. 
     61<pre> 
     62locale                  international language abbreviation 
     63<code> 
     64$config['locale'] = 'en'; 
     65</code> 
     66</pre> 
     67*locale* is **mandatory**. Kohana default is English. 
     68 
     69### Include Paths 
     70Specifies additional locations the system should search for resources.  
     71<pre> 
     72include_paths                   [file path names] 
     73<code> 
     74$config['include_paths'] = array 
     75( 
     76        'modules/user_guide' 
     77); 
     78</code> 
     79</pre> 
     80*include_paths* is **optional**. Kohana will always search the application path first, then any defined 
     81include paths, and finally the system path. Primary resources are libraries, helpers and views. 
     82 
     83### Enable Hooks 
     84Specifies the enabling of system Hooks   
     85<pre> 
     86enable_hooks                    boolean 
     87<code> 
     88$config['enable_hooks'] = FALSE; 
     89</code> 
     90</pre> 
     91*enable_hooks* is **mandatory**. By default Hooks are disabled. If you plan to add to hooks into your 
     92application, you will activate them by setting this entry to *TRUE*. 
     93 
     94### SubClass Prefix 
     95Specifies the prefix for user extensions to Core Kohana classes. 
     96<pre> 
     97subclass_prefix                 prefix_ 
     98<code> 
     99$config['subclass_prefix'] = 'MY_'; 
     100</code> 
     101</pre> 
     102*subclass_prefix* is **mandatory**. Core class extensions must be prefixed.  
     103By convention the prefix "My_" is used. You may change this prefix, provided it terminates with an *underscore*. If you are not extending Core classes, you may safely leave the default setting. 
     104 
     105### Timezone 
     106Specifies an standard international timezone for the system. 
     107<pre> 
     108timezone                        [zone/location] 
     109<code> 
     110$config['timezone'] = ''; 
     111</code> 
     112</pre> 
     113*timezone* is **optional**. By default, the setting is blank and Kohana will use the timezone supplied by 
     114PHP on the server. An example timezone would be "Africa/Johannesburg". 
     115 
     116## Autoloader Entries 
     117To maintain a small footprint, resources are manually loaded in your Controller. In Applications where 
     118a resource is utilised across many Controllers, you may specify that Kohana automatically loads the resource and makes it available to all Controllers. 
     119  
     120Such resources would typically be databases, libraries (session), and helpers (url). 
     121<pre> 
     122resource type                   [resource name[,resource name&hellip;]] 
     123<code> 
     124$config['libraries'] = 'session, encrypt'; 
     125</code> 
     126</pre> 
     127Note: If you are specifying that a resource is autoloaded, you still need to ensure that the resource is 
     128correctly configured, via it's own configuration file. For example, if you autoload the Cookie Helper, 
     129then you must check that cookies are correctly configured for your system in <file>application/config/cookie</file> 
     130 
     131## Configuration Files 
     132The following files are used for Class configuration. 
     133 
     134* <file>application/config/cookie</file> configures Cookies, used by the [Cookie helper](<?php echo url::base(TRUE).'user_guide/helpers/cookie' ?>) class. 
     135* <file>application/config/database</file> configures Databases, used by the Database class. 
     136* <file>application/config/encryption</file> configures Encryption, used by the Encryption class. 
     137* <file>application/config/log</file> configures Logging, used by the Log class. 
     138* <file>application/config/pagination</file> configures Pagination, used by the Pagination class. 
     139* <file>application/config/routes</file> configures Routing, used by the Routing class. 
     140* <file>application/config/session</file> configures Sessions, used by the Session class. 
     141 
     142 
     143<p></p> 
     144*[PHP]: PHP Hypertext Processor 
     145*[URI]: Uniform Resource Indicator 
     146*[URL]: Uniform Resource Locator 
  • trunk/modules/user_guide/views/user_guide/content/kohana/installation.php

    r447 r469  
    55If you are new to Kohana, we suggest following the steps below: 
    66 
    7 1. Unzip the Kohana package you downloaded, into a temporary directory. (Eg. /kohana) 
     71. Unzip the Kohana package you downloaded, into a temporary directory. (Eg. */kohana*) 
    882. Prepare a place on your web server to upload the Kohana files to. 
    99    * Examples: 
    10     * /var/www/html (Using the web server *DOCUMENT ROOT*) 
    11     * /var/www/html/kohana (Using a sub-directory of root) 
     10    * */var/www/html* (Using the web server *DOCUMENT ROOT*) 
     11    * */var/www/html/kohana* (Using a sub-directory of root) 
    12123. Using an FTP client, upload the Kohana files to your web server. 
    1313    * Your server directory should now contain the following files and folders<br /> 
    14 <code> 
    15             index.php <br /> 
    16                   -- application<br /> 
    17                   -- modules<br /> 
    18                   -- system 
    19 </code> 
    20 4. Using a Text Editor, open the file <file>/application/config/config</file> 
     14        <code> 
     15        index.php<br /> 
     16          -- application<br /> 
     17          -- modules<br /> 
     18          -- system 
     19        </code> 
     204. Using a Text Editor, open the file <file>application/config/config</file> 
    2121    * Set the configuration item *base_url* to the name of the directory you uploaded Kohana into 
    2222    * Examples: 
    23                 1. The sub directory *kohana* of the server named *localhost*<br /> 
    24 <code> 
    25 $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/kohana/';<br /> 
    26 can be accessed via this url: http://localhost/kohana 
    27 </code> 
    28                 2. The *DOCUMENT ROOT* of the server named *example.com*<br /> 
    29 <code> 
    30 $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/';<br /> 
    31 can be accessed via this url: http://example.com 
    32 </code> 
     23                1. The sub directory *kohana* of the server named *localhost* can be accessed via this URL: http://localhost/kohana 
     24    <code> 
     25        $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/kohana/'; 
     26    </code> 
     27                2. The *DOCUMENT ROOT* of the server named *example.com* can be accessed via this URL: http://example.com 
     28    <code> 
     29        $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/'; 
     30    </code> 
    33315. Test your Installation 
    3432    * Open your favourite web browser and point it at the URL defined in *base_url* 
    35         * Your should now be viewing the "Welcome page" of the Kohana User Guide, on your server 
     33        * You should now be viewing the "Welcome page" of the Kohana User Guide, on your server. 
    3634 
    3735 
    3836**Congratulations!** <br /> 
    3937You can explore your new Kohana Framework by reading the User Guide, a good place 
    40 to start would be [Getting Started](<?php echo url::base().'user_guide/kohana/starting'?>) 
     38to start would be [Getting Started](<?php echo url::base(TRUE).'user_guide/kohana/starting'?>) 
    4139 
    4240## Experiencing Problems? 
    4341If you were not able to view the Kohana User Guide on your server after installing, we recommend 
    44 reading the [Toubleshooting](<?php echo url::base().'user_guide/troubleshoot'?>) page of the user  
     42reading the [Toubleshooting](<?php echo url::base(TRUE).'user_guide/troubleshoot'?>) page of the user  
    4543guide for more help. 
    4644 
  • trunk/modules/user_guide/views/user_guide/css/layout.php

    r461 r469  
    4141#body ul { list-style: circle; } 
    4242#body li { padding: 0.1em 0; } 
     43#body code { background: #eee; font-size: 1.1em; border: dotted 1px; padding: 0.5em; font-family: monospace; display: block; } 
    4344#footer { padding: 0 1em; background: #fff; line-height: 2em; } 
    4445#loading { position: absolute; top: 0; right: 0; z-index: 9999; width: 32px; height: 32px; background: transparent url(spinner.gif) center center no-repeat; } 
  • trunk/modules/user_guide/views/user_guide/menu.php

    r458 r469  
    4545        'Helpers' => array 
    4646        ( 
     47                'Cookie', 
    4748                'File', 
    4849                'Html',