diff --git a/setup/applicationinstaller.class.inc.php b/setup/applicationinstaller.class.inc.php index eb10afd42..418ec49be 100644 --- a/setup/applicationinstaller.class.inc.php +++ b/setup/applicationinstaller.class.inc.php @@ -426,6 +426,11 @@ class ApplicationInstaller chmod($sTargetPath, 0755); } } + else if (substr($sTargetPath, 0, strlen(APPROOT)) == APPROOT) + { + // If the directory is under the root folder - as expected - let's clean-it before compiling + SetupUtils::tidydir($sTargetPath); + } $oFactory = new ModelFactory($aDirsToScan); $aModules = $oFactory->FindModules(); diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index 43d7ec397..07e4e6656 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -64,7 +64,13 @@ class SetupUtils static function CheckPHPVersion() { $aResult = array(); - + + // For log file(s) + if (!is_dir(APPROOT.'log')) + { + @mkdir(APPROOT.'log'); + } + SetupPage::log('Info - CheckPHPVersion'); if (version_compare(phpversion(), self::PHP_MIN_VERSION, '>=')) { @@ -74,6 +80,11 @@ class SetupUtils { $aResult[] = new CheckResult(CheckResult::ERROR, "Error: The current PHP Version (".phpversion().") is lower than the minimum version required to run ".ITOP_APPLICATION.", which is (".self::PHP_MIN_VERSION.")"); } + + // Check the common directories + $aWritableDirsErrors = self::CheckWritableDirs(array('log', 'env-production', 'conf', 'data')); + $aResult = array_merge($aResult, $aWritableDirsErrors); + $aMandatoryExtensions = array('mysqli', 'iconv', 'simplexml', 'soap', 'hash', 'json', 'session', 'pcre', 'dom'); $aOptionalExtensions = array('mcrypt' => 'Strong encryption will not be used.', 'ldap' => 'LDAP authentication will be disabled.'); @@ -196,7 +207,7 @@ class SetupUtils if ($iMaxPostSize <= $iMaxUploadSize) { - $aResult[] = new CheckResult(CheckResult::WARNING, "post_max_size (".ini_get('post_max_size').") in php.ini should be bigger than upload_max_filesize (".ini_get('upload_max_filesize').") otherwise you cannot upload files of the maximun size."); + $aResult[] = new CheckResult(CheckResult::WARNING, "post_max_size (".ini_get('post_max_size').") in php.ini should be strictly greater than upload_max_filesize (".ini_get('upload_max_filesize').") otherwise you cannot upload files of the maximum size."); } @@ -603,7 +614,7 @@ class SetupUtils $oPage->add(''); $oPage->add(''); $oPage->add(''); - $oPage->add(''); + $oPage->add(''); $oPage->add('
Server Name:E.g. "localhost", "dbserver.mycompany.com" or "192.142.10.23"
Login:The account must have the following privileges on the database: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, CREATE VIEW, SUPER, TRIGGER
Password:
Password:
'); $oPage->add(''); $oPage->add(''); @@ -1183,15 +1194,15 @@ EOF $sFullPath = APPROOT.$sDir; if (is_dir($sFullPath) && !is_writable($sFullPath)) { - $aNonWritableDirs[APPROOT.$sDir] = new CheckResult(CheckResult::ERROR, "The directory '".APPROOT.$sDir."' exists but is not writable for the application."); + $aNonWritableDirs[APPROOT.$sDir] = new CheckResult(CheckResult::ERROR, "The directory '".APPROOT.$sDir."' exists but is not writable for the application."); } else if (file_exists($sFullPath) && !is_dir($sFullPath)) { - $aNonWritableDirs[APPROOT.$sDir] = new CheckResult(CheckResult::ERROR, "A file with the same name as '".APPROOT.$sDir."' exists."); + $aNonWritableDirs[APPROOT.$sDir] = new CheckResult(CheckResult::ERROR, ITOP_APPLICATION." needs the directory '".APPROOT.$sDir."' to be writable. However file named '".APPROOT.$sDir."' already exists."); } else if (!is_dir($sFullPath) && !is_writable(APPROOT)) { - $aNonWritableDirs[APPROOT] = new CheckResult(CheckResult::ERROR, "The directory '".APPROOT."' is not writable, the application cannot create the directory '$sDir' inside it."); + $aNonWritableDirs[APPROOT.$sDir] = new CheckResult(CheckResult::ERROR, ITOP_APPLICATION." needs the directory '".APPROOT.$sDir."' to be writable. The directory '".APPROOT.$sDir."' does not exist and '".APPROOT."' is not writable, the application cannot create the directory '$sDir' inside it."); } } return $aNonWritableDirs; diff --git a/setup/wizardsteps.class.inc.php b/setup/wizardsteps.class.inc.php index 3449028da..b3d4aeea8 100644 --- a/setup/wizardsteps.class.inc.php +++ b/setup/wizardsteps.class.inc.php @@ -670,7 +670,7 @@ class WizStepLicense extends WizardStep $oPage->add('