Show
Ignore:
Timestamp:
01/21/2008 10:33:19 AM (12 months ago)
Author:
Geert
Message:

Kohana::auto_load() now throws an exception if the needed file does not exist.

This fixes proper exception handling on all the driver based libraries: Archive, Cache, Database, Image, Payment and Session.
See for example: http://trac.kohanaphp.com/browser/trunk/system/libraries/Session.php?rev=1745#L63

Also changed code and lang files to be more consistent.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Archive.php

    r1481 r1772  
    3232                { 
    3333                        // Set driver name 
    34                         $driver = 'Archive_'.ucfirst($type).'_Driver'; 
     34                        $driver = 'Archive_'.ucfirst(strtolower($type)).'_Driver'; 
    3535 
    36                         // Manually call auto-loading, for proper exception handling 
     36                        // Manually autoload so that exceptions can be caught 
    3737                        Kohana::auto_load($driver); 
    38  
    39                         // Initialize the driver 
    40                         $this->driver = new $driver(); 
    4138                } 
    4239                catch (Kohana_Exception $exception) 
     
    4441                        throw new Kohana_Exception('archive.driver_not_supported', $type); 
    4542                } 
     43 
     44                // Initialize the driver 
     45                $this->driver = new $driver(); 
    4646 
    4747                // Validate the driver