From 40ee862c2b23c8f6ce014690804241524d199316 Mon Sep 17 00:00:00 2001 From: Seu Rocha Date: Mon, 27 Feb 2017 20:07:21 -0300 Subject: [PATCH] Update install.php --- install.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install.php b/install.php index de24371..466cf37 100644 --- a/install.php +++ b/install.php @@ -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!";