diff --git a/.make/license/updateLicenses.php b/.make/license/updateLicenses.php index 7531aa003..a4aa0be03 100644 --- a/.make/license/updateLicenses.php +++ b/.make/license/updateLicenses.php @@ -19,17 +19,24 @@ * The target license file path is in `$xmlFilePath` */ -$iTopFolder = __DIR__ . "/../../" ; -$xmlFilePath = $iTopFolder . "setup/licenses/community-licenses.xml"; +$iTopFolder = __DIR__."/../../"; +$xmlFilePath = $iTopFolder."setup/licenses/community-licenses.xml"; -function get_scope($product_node) -{ +$jqExec = shell_exec("jq -V"); // a param is mandatory otherwise the script will freeze +if ((null === $jqExec) || (false === $jqExec)) { + echo "/!\ JQ is required but cannot be launched :( \n"; + echo "Check this script PHPDoc block for instructions\n"; + die(-1); +} + + +function get_scope($product_node) { $scope = $product_node->getAttribute("scope"); - if ($scope === "") - { //put iTop first + if ($scope === "") { //put iTop first return "aaaaaaaaa"; } + return $scope; } diff --git a/setup/phpinfo.php b/setup/phpinfo.php index faabf0f08..6ad54bd7f 100644 --- a/setup/phpinfo.php +++ b/setup/phpinfo.php @@ -17,11 +17,27 @@ * You should have received a copy of the GNU Affero General Public License */ +/** + * Since N°1934 this page is accessible only to iTop admin users + * @since 2.5.2 2.6.1 2.7.0 N°1934 must login as admin user to use + * to check if PHP is up and running, use phpcheck.php ! + */ require_once('../approot.inc.php'); -require_once(APPROOT.'/application/startup.inc.php'); +try { + require_once(APPROOT.'/application/startup.inc.php'); +} catch (Exception $e) { + // This means we don't have a valid iTop installation running + echo << +If you need to check that PHP is running, use phpcheck.php +EOF; + die(-1); +} require_once(APPROOT.'/application/loginwebpage.class.inc.php'); -LoginWebPage::DoLogin(true); // Check user rights and prompt if needed +LoginWebPage::DoLogin(true); // Check user rights and prompt if needed (N°1934) + +/** @noinspection ForgottenDebugOutputInspection */ phpinfo(); ?>