Kohana v3.3.5
This commit is contained in:
@@ -52,7 +52,7 @@ You can add conditional statements to make the bootstrap have different values b
|
||||
/**
|
||||
* Set the environment status by the domain.
|
||||
*/
|
||||
if (strpos($_SERVER['HTTP_HOST'], 'kohanaphp.com') !== FALSE)
|
||||
if (strpos($_SERVER['HTTP_HOST'], 'kohanaframework.org') !== FALSE)
|
||||
{
|
||||
// We are live!
|
||||
Kohana::$environment = Kohana::PRODUCTION;
|
||||
@@ -66,7 +66,7 @@ if (strpos($_SERVER['HTTP_HOST'], 'kohanaphp.com') !== FALSE)
|
||||
... [trimmed]
|
||||
*/
|
||||
Kohana::init(array(
|
||||
'base_url' => Kohana::$environment === Kohana::PRODUCTION ? '/' : '/kohanaphp.com/',
|
||||
'base_url' => Kohana::$environment === Kohana::PRODUCTION ? '/' : '/kohanaframework.org/',
|
||||
'caching' => Kohana::$environment === Kohana::PRODUCTION,
|
||||
'profile' => Kohana::$environment !== Kohana::PRODUCTION,
|
||||
'index_file' => FALSE,
|
||||
|
@@ -16,7 +16,7 @@ Every application follows the same flow:
|
||||
* Includes each module's `init.php` file, if it exists.
|
||||
* The `init.php` file can perform additional environment setup, including adding routes.
|
||||
10. [Route::set] is called multiple times to define the [application routes](routing).
|
||||
11. [Request::instance] is called to start processing the request.
|
||||
11. [Request::factory] is called to start processing the request.
|
||||
1. Checks each route that has been set until a match is found.
|
||||
2. Creates the controller instance and passes the request to it.
|
||||
3. Calls the [Controller::before] method.
|
||||
@@ -24,4 +24,4 @@ Every application follows the same flow:
|
||||
5. Calls the [Controller::after] method.
|
||||
* The above 5 steps can be repeated multiple times when using [HMVC sub-requests](requests).
|
||||
3. Application flow returns to index.php
|
||||
12. The main [Request] response is displayed
|
||||
12. The main [Request] response is displayed
|
||||
|
@@ -34,15 +34,27 @@ Kohana::init(array(
|
||||
));
|
||||
~~~
|
||||
|
||||
- Make sure the `application/cache` and `application/logs` directories are writable by the web server.
|
||||
- List your trusted hosts. Open `application/config/url.php` and add regex patterns of the hosts you expect your application to be accessible from.
|
||||
|
||||
[!!] Do not forget to escape your dots (.) as these are regex patterns. These patterns should always fully match, as they are prepended with `^` and appended with `$`.
|
||||
~~~
|
||||
sudo chmod -R a+rwx application/cache
|
||||
sudo chmod -R a+rwx application/logs
|
||||
return array(
|
||||
'trusted_hosts' => array(
|
||||
'example\.org',
|
||||
'.*\.example\.org',
|
||||
),
|
||||
);
|
||||
~~~
|
||||
|
||||
- Define a salt for the `Cookie` class.
|
||||
~~~
|
||||
Cookie::$salt = [really-long-cookie-salt-here]
|
||||
Cookie::$salt = 'some-really-long-cookie-salt-here';
|
||||
~~~
|
||||
|
||||
- Make sure the `application/cache` and `application/logs` directories are writable by the web server.
|
||||
~~~
|
||||
sudo chmod -R a+rwx application/cache
|
||||
sudo chmod -R a+rwx application/logs
|
||||
~~~
|
||||
|
||||
[!!] Make sure to use a unique salt for your application and never to share it. Take a look at the [Cookies](cookies) page for more information on how cookies work in Kohana. If you do not define a `Cookie::$salt` value, Kohana will throw an exception when it encounters any cookie on your domain.
|
||||
|
@@ -20,6 +20,7 @@
|
||||
- [Error Handling](errors)
|
||||
- [Tips & Common Mistakes](tips)
|
||||
- [Upgrading from v3.2](upgrading)
|
||||
- [Upgrading from v3.3.3.1](upgrading-from-3-3-3-1)
|
||||
- Basic Usage
|
||||
- [Debugging](debugging)
|
||||
- [Loading Classes](autoloading)
|
||||
|
@@ -55,7 +55,7 @@ You can also have a controller extend another controller to share common things,
|
||||
|
||||
Every controller has the `$this->request` property which is the [Request] object that called the controller. You can use this to get information about the current request, as well as set the response body via `$this->response->body($ouput)`.
|
||||
|
||||
Here is a partial list of the properties and methods available to `$this->request`. These can also be accessed via `Request::instance()`, but `$this->request` is provided as a shortcut. See the [Request] class for more information on any of these.
|
||||
Here is a partial list of the properties and methods available to `$this->request`. See the [Request] class for more information on any of these.
|
||||
|
||||
Property/method | What it does
|
||||
--- | ---
|
||||
|
@@ -182,6 +182,7 @@ First, we need a [View] that contains the HTML form, which will be placed in `ap
|
||||
<?php foreach ($errors as $message): ?>
|
||||
<li><?php echo $message ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<dl>
|
||||
|
@@ -1,17 +0,0 @@
|
||||
# Tutorials
|
||||
|
||||
## Tutorials in this guide
|
||||
|
||||
## Tutorials written elsewhere
|
||||
|
||||
### Ellisgl's KO3 tutorial on dealtaker.com:
|
||||
|
||||
1. [Install and Basic Usage](http://www.dealtaker.com/blog/2009/11/20/kohana-php-3-0-ko3-tutorial-part-1/)
|
||||
2. [Views](http://www.dealtaker.com/blog/2009/12/07/kohana-php-3-0-ko3-tutorial-part-2/)
|
||||
3. [Controllers](http://www.dealtaker.com/blog/2009/12/30/kohana-php-3-0-ko3-tutorial-part-3/)
|
||||
4. [Models](http://www.dealtaker.com/blog/2010/02/01/kohana-php-3-0-ko3-tutorial-part-4/)
|
||||
5. [Subrequests](http://www.dealtaker.com/blog/2010/02/25/kohana-php-3-0-ko3-tutorial-part-5/)
|
||||
6. [Routes](http://www.dealtaker.com/blog/2010/03/03/kohana-php-3-0-ko3-tutorial-part-6/)
|
||||
7. [Helpers](http://www.dealtaker.com/blog/2010/03/26/kohana-php-3-0-ko3-tutorial-part-7/)
|
||||
8. [Modules](http://www.dealtaker.com/blog/2010/04/30/kohana-php-3-0-ko3-tutorial-part-8/)
|
||||
9. [Vendor Libraries](http://www.dealtaker.com/blog/2010/06/02/kohana-php-3-0-ko3-tutorial-part-9/)
|
@@ -1,7 +0,0 @@
|
||||
Making a template driven site.
|
||||
|
||||
<http://kerkness.ca/wiki/doku.php?id=template-site:create_the_template>
|
||||
|
||||
<http://kerkness.ca/wiki/doku.php?id=template-site:extending_the_template_controller>
|
||||
|
||||
<http://kerkness.ca/wiki/doku.php?id=template-site:basic_page_controller>
|
@@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
<http://kerkness.ca/wiki/doku.php?id=routing:static_pages>
|
||||
|
||||
<http://kerkness.ca/wiki/doku.php?id=routing:multi-language_with_a_route>
|
23
system/guide/kohana/upgrading-from-3-3-3-1.md
Normal file
23
system/guide/kohana/upgrading-from-3-3-3-1.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Upgrading from 3.3.3.1
|
||||
|
||||
Minor version upgrades are usually done in a drop-in fashion. Unfortunately, however, upgrading from 3.3.3.1 to 3.3.4 needs a little configuration. This is because a [security disclosure from HP Fortify](https://github.com/kohana/kohana/issues/74), that unveiled a serious [host header attack](https://github.com/kohana/core/issues/613) vulnerability.
|
||||
|
||||
[!!] You *might* still be able to have a drop-in upgrade, in case you have set the `base_url` in the [Kohana::init] call to an absolute URL. We advise you however that you follow the step below to make your application secure, in case some day you decide to change your `base_url` to a relative URL.
|
||||
|
||||
## Trusted Hosts
|
||||
|
||||
You need to setup a list of trusted hosts. Trusted hosts are hosts that you expect your application to be accessible from.
|
||||
|
||||
Open `application/config/url.php` and add regex patterns of these hosts. An example is given hereunder:
|
||||
|
||||
~~~
|
||||
return array(
|
||||
'trusted_hosts' => array(
|
||||
'example\.org',
|
||||
'.*\.example\.org',
|
||||
),
|
||||
);
|
||||
~~~
|
||||
|
||||
[!!] Do not forget to escape your dots (.) as these are regex patterns. These patterns should always fully match, as they are prepended with `^` and appended with `$`.
|
||||
|
Reference in New Issue
Block a user