Skip to content

Commit

Permalink
Update install.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ahcor authored Feb 27, 2017
1 parent fd4f22a commit 40ee862
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
//Configurations - you can change...
$name = 'Router';
$file = 'Router.php';
$configPath = defined('_CONFIG') ? _CONFIG : dirname(dirname(dirname(__DIR__))).'/Config/';
$configPath = defined('_CONFIG') ? _CONFIG.'Router/' : dirname(dirname(dirname(__DIR__))).'/Config/Router/';

//Checkin
if (is_file($configPath.$file)) {
return "\n--- $name configuration file already exists!";
}
if (!is_dir($configPath)) {
return "\n\n--- Configuration file for $name not instaled!\n\n";
@mkdir($configPath, '0777', true);
@chmod($configPath, $perm);
if (!is_writable($configPath)) {
return "\n\n--- Configuration file for $name not instaled!\n\n";
}
}

//Gravando o arquivo de configuração no CONFIG da aplicação
file_put_contents($configPath.$file,
file_get_contents(__DIR__.'/config.php'));
//Copiando o arquivo de configuração para o CONFIG da aplicação
copy(__DIR__.'/Config', $configPath.$file);

//Return to application installer
return "\n--- $name instaled!";

0 comments on commit 40ee862

Please sign in to comment.