public function action_index()
 {
     // Check to see if the config exsists
     if (file_exists(APPPATH . 'config/production/db.php') === true) {
         // Check to make sure DB tables exists
         if (DBUtil::table_exists('urls') && DBUtil::table_exists('users_groups') && DBUtil::table_exists('url_stats') && DBUtil::table_exists('settings')) {
             // return Controller_Install::force_login();
             Response::Redirect('/login');
         }
     } else {
         if (Input::Method() === 'POST') {
             // $database = Input::Post('database');
             // $old_database = Input::Post('old_database');
             // MAKE CONFIG
             if (Controller_Install::create_db_config()) {
                 if (Controller_Install::create_tables()) {
                     Controller_Install::force_login();
                 } else {
                     Session::Set('error', 'You cannot have the same database names for upgrade, please change database names!');
                     return Response::forge(View::forge('install/index'));
                 }
             }
         } else {
             $data = null;
             if (file_exists(DOCROOT . 'assets/cache') === true) {
                 $data['public_cache'] = File::get_permissions(DOCROOT . 'assets/cache');
             }
             if (file_exists(APPPATH . 'config/production') === true) {
                 $data['config'] = File::get_permissions(APPPATH . 'config/production');
             }
             if (file_exists(APPPATH . 'cache') === true) {
                 $data['cache'] = File::get_permissions(APPPATH . 'cache');
             }
         }
         return Response::forge(View::forge('install/index', $data));
     }
 }
Example #2
0
 public function get_permissions($path)
 {
     return \File::get_permissions($path, $this);
 }