diff options
| author | nashe <contact@nashe.fr> | 2015-08-11 12:04:53 +0200 |
|---|---|---|
| committer | nashe <contact@nashe.fr> | 2015-08-11 12:04:53 +0200 |
| commit | b84b865d45b00600d982fef18991398cb655c7e9 (patch) | |
| tree | 5f3d0432facd74395d029c480bb79d9e0669eb01 /install.php | |
| parent | f2788a4ed2eae7f0056ab200b8fc787ed20a32da (diff) | |
| download | planet-b84b865d45b00600d982fef18991398cb655c7e9.tar planet-b84b865d45b00600d982fef18991398cb655c7e9.tar.gz planet-b84b865d45b00600d982fef18991398cb655c7e9.tar.bz2 planet-b84b865d45b00600d982fef18991398cb655c7e9.tar.xz planet-b84b865d45b00600d982fef18991398cb655c7e9.zip | |
Clean code
Replace dirname(__FILE__) by __DIR__.
Diffstat (limited to 'install.php')
| -rwxr-xr-x | install.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/install.php b/install.php index addf819..e0c23bd 100755 --- a/install.php +++ b/install.php @@ -1,6 +1,6 @@ <?php -require_once dirname(__FILE__) . '/app/app.php'; +require_once __DIR__ . '/app/app.php'; // This is an helper function returning an html table row to avoid code duplication function installStatus($str, $msg, $result) { @@ -9,8 +9,8 @@ function installStatus($str, $msg, $result) { } // If the password and config files exist, moonmoon is already installed -if (file_exists(dirname(__FILE__) . '/custom/config.yml') - && file_exists(dirname(__FILE__) . '/admin/inc/pwd.inc.php')) { +if (file_exists(__DIR__ . '/custom/config.yml') + && file_exists(__DIR__ . '/admin/inc/pwd.inc.php')) { $status = 'installed'; } elseif (isset($_REQUEST['url'])) { $save = array(); @@ -29,10 +29,10 @@ if (file_exists(dirname(__FILE__) . '/custom/config.yml') ); $CreatePlanetConfig = new PlanetConfig($config); - $save['config'] = file_put_contents(dirname(__FILE__).'/custom/config.yml', $CreatePlanetConfig->toYaml()); + $save['config'] = file_put_contents(__DIR__.'/custom/config.yml', $CreatePlanetConfig->toYaml()); //Save password - $save['password'] = file_put_contents(dirname(__FILE__).'/admin/inc/pwd.inc.php', '<?php $login="admin"; $password="'.md5($_REQUEST['password']).'"; ?>'); + $save['password'] = file_put_contents(__DIR__.'/admin/inc/pwd.inc.php', '<?php $login="admin"; $password="'.md5($_REQUEST['password']).'"; ?>'); if (0 != ($save['config'] + $save['password'])) { $status = 'installed'; @@ -58,7 +58,7 @@ if (file_exists(dirname(__FILE__) . '/custom/config.yml') // We now test that all required files are writable foreach ($tests as $v) { - if(is_writable(dirname(__FILE__) . $v)) { + if(is_writable(__DIR__ . $v)) { $strInstall .= installStatus("<code>$v</code> is writable", 'OK', true); } else { $strInstall .= installStatus("<code>$v</code> is writable", 'FAIL',false); |
