diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-08-22 18:08:48 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-08-22 18:15:50 +0200 |
commit | d87e4e2881d4cfa17dfd0445fae1fa881d5707c0 (patch) | |
tree | 55a93216930b43242fc5b513fc12e45c8bb580e8 /application/core | |
parent | 203f824ae5a9ec4a979542f4eb9e09fcb07cb36c (diff) |
Deduplicate initialisation code in controllers
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/core')
-rw-r--r-- | application/core/MY_Controller.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php new file mode 100644 index 000000000..278768ad2 --- /dev/null +++ b/application/core/MY_Controller.php @@ -0,0 +1,36 @@ +<?php +/* + * Copyright 2009-2013 Florian "Bluewind" Pritz <bluewind@server-speed.net> + * + * Licensed under AGPLv3 + * (see COPYING for full license text) + * + */ + +class MY_Controller extends CI_Controller { + public $data = array(); + public $var; + + private $json_enabled_functions = array( + ); + + function __construct() + { + parent::__construct(); + + $this->var = new StdClass(); + + $this->load->library('migration'); + if ( ! $this->migration->current()) { + show_error($this->migration->error_string()); + } + + $old_path = getenv("PATH"); + putenv("PATH=$old_path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"); + + mb_internal_encoding('UTF-8'); + $this->load->helper(array('form', 'filebin')); + + $this->data['title'] = "FileBin"; + } +} |