Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After a <strong>VERY LONG TIME</strong> of searching I finally found a solution to my little problem.</p> <p>Here is a step by step tutorial on how to load your own custom error pages with Kohana 3.2:</p> <ol> <li>Change the environment variable in the bootstrap.</li> </ol> <p>Here you have multiple options:</p> <p>a. Do what they say in the <a href="http://kohanaframework.org/3.2/guide/kohana/bootstrap" rel="nofollow">documentation of the bootstrap.php</a>:</p> <pre><code>/** * Set the environment status by the domain. */ if (strpos($_SERVER['HTTP_HOST'], 'kohanaphp.com') !== FALSE) { // We are live! Kohana::$environment = Kohana::PRODUCTION; // Turn off notices and strict errors error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT); } </code></pre> <p>b. Or just add those two lines without the "if":</p> <pre><code>Kohana::$environment = Kohana::PRODUCTION; error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT); </code></pre> <p>c. I have not try this way but in the new bootstrap.php you have this code:</p> <pre><code>/** * Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied. * * Note: If you supply an invalid environment name, a PHP warning will be thrown * saying "Couldn't find constant Kohana::&lt;INVALID_ENV_NAME&gt;" */ if (isset($_SERVER['KOHANA_ENV'])) { Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); } </code></pre> <p>I assume that you could just give the value "production" to "$_SERVER['KOHANA_ENV']" before those lines.</p> <p>Again, like I said I haven't tried it, but it should work.</p> <p>I personally just commented out those lines of codes.</p> <p>2 Now you need to add a few configurations in a "ini.php" file, or in the "bootstra.php" file.</p> <pre><code>&lt;?php defined('SYSPATH') or die('No direct script access.'); /** * Turn errors into exceptions. */ Kohana::$errors = true; /** * Custom exception handler. */ restore_exception_handler(); set_exception_handler(array('Exception_Handler', 'handler')); /** * Error route. */ Route::set('error', 'error/&lt;action&gt;(/&lt;message&gt;)', array('action' =&gt; '[0-9]++', 'message' =&gt; '.+')) -&gt;defaults(array( 'controller' =&gt; 'exception_handler' )); </code></pre> <p>This is what was missing and made it to hard. For the rest you can easily just follow Kohana3.2 documentation or you can get the module that I added to a repo in GitHub: <a href="https://github.com/jnbdz/Kohana-error" rel="nofollow">https://github.com/jnbdz/Kohana-error</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload