Guest User

Untitled

a guest
Jun 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.  
  2.             if($val->run())
  3.             {
  4.                 $config = array('test' => 'vafoor');
  5.  
  6.                 $path = realpath(APPPATH.'config/production/');
  7.  
  8.                 // If file doesn't exists, we will create it!
  9.                 if(!file_exists($path.'/db.php'))
  10.                 {
  11.                     try
  12.                     {
  13.                         File::create($path, 'db.php', null);   
  14.                     }
  15.                     catch (InvalidPathException $e)
  16.                     {
  17.                         // directory can't be written
  18.                     }
  19.                     catch (FileAccessException $e)
  20.                     {
  21.                         // file exists so... we can replace the old config :-)!!
  22.                     }
  23.                 }
  24.  
  25.                 Config::save($path.'/db.php', $config);
Add Comment
Please, Sign In to add comment