Code Duplication    Length = 3-3 lines in 5 locations

modules/payment/libraries/Payment.php 1 location

@@ 73-75 (lines=3) @@
70
        $driver = 'Payment_'.ucfirst($this->config['driver']).'_Driver';
71
72
        // Load the driver
73
        if (! Kohana::auto_load($driver)) {
74
            throw new Kohana_Exception('core.driver_not_found', $this->config['driver'], get_class($this));
75
        }
76
77
        // Get the driver specific settings
78
        $this->config = array_merge($this->config, Kohana::config('payment.'.$this->config['driver']));

system/libraries/Cache.php 1 location

@@ 75-77 (lines=3) @@
72
        $driver = 'Cache_'.ucfirst($this->config['driver']).'_Driver';
73
74
        // Load the driver
75
        if (! Kohana::auto_load($driver)) {
76
            throw new Kohana_Exception('core.driver_not_found', $this->config['driver'], get_class($this));
77
        }
78
79
        // Initialize the driver
80
        $this->driver = new $driver($this->config['params']);

system/libraries/Database.php 1 location

@@ 181-183 (lines=3) @@
178
        $driver = 'Database_'.ucfirst($this->config['connection']['type']).'_Driver';
179
180
        // Load the driver
181
        if (! Kohana::auto_load($driver)) {
182
            throw new Kohana_Database_Exception('core.driver_not_found', $this->config['connection']['type'], get_class($this));
183
        }
184
185
        // Initialize the driver
186
        $this->driver = new $driver($this->config);

system/libraries/Image.php 1 location

@@ 115-117 (lines=3) @@
112
        $driver = 'Image_'.ucfirst($this->config['driver']).'_Driver';
113
114
        // Load the driver
115
        if (! Kohana::auto_load($driver)) {
116
            throw new Kohana_Exception('core.driver_not_found', $this->config['driver'], get_class($this));
117
        }
118
119
        // Initialize the driver
120
        $this->driver = new $driver($this->config['params']);

system/libraries/Session.php 1 location

@@ 115-117 (lines=3) @@
112
            $driver = 'Session_'.ucfirst(Session::$config['driver']).'_Driver';
113
114
            // Load the driver
115
            if (! Kohana::auto_load($driver)) {
116
                throw new Kohana_Exception('core.driver_not_found', Session::$config['driver'], get_class($this));
117
            }
118
119
            // Initialize the driver
120
            Session::$driver = new $driver();