In my installs.php application in CodeIgniter, I would like to check if two files exist and install them accordingly.
Where, if the files exist, then they will be updated, otherwise go to step 1.
Is there a better and safer way?
$admin = dirname(FCPATH) . '/admin/config/database.php'; $catalog = dirname(FCPATH) . '/catalog/config/database.php'; if (file_exists($admin, $catalog)) { $route['default_controller'] = "upgrade/index"; $route['404_override'] = ''; } else { $route['default_controller'] = "step_1/index"; $route['404_override'] = ''; }
source share