Ensure All commands are executed within the update and setup scripts directory

This commit is contained in:
johnnyq 2024-12-07 15:53:17 -05:00
parent 2cf2545f32
commit c4870e49cf
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,9 @@
//php setup_cli.php --help
//php setup_cli.php --host=localhost --username=itflow --password=secret --database=itflow --base-url=example.com/itflow --locale=en_US --timezone=UTC --currency=USD --company-name="My Company" --country="United States" --user-name="John Doe" --user-email="john@example.com" --user-password="admin123" --non-interactive
// Change to the directory of this script so that all shell commands run here
chdir(__DIR__);
// Ensure we're running from command line
if (php_sapi_name() !== 'cli') {
die("This setup script must be run from the command line.\n");

View File

@ -1,6 +1,9 @@
#!/usr/bin/env php
<?php
// Change to the directory of this script so that all shell commands run here
chdir(__DIR__);
// Ensure script is run only from the CLI
if (php_sapi_name() !== 'cli') {
die("This script can only be run from the command line.\n");