diff --git a/lib/user-manager.sh b/lib/user-manager.sh index c860456..85d095a 100755 --- a/lib/user-manager.sh +++ b/lib/user-manager.sh @@ -7,9 +7,9 @@ # Source dependencies if [ -z "$TOOLKIT_BASE_DIR" ]; then - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - source "$SCRIPT_DIR/common-functions.sh" - source "$SCRIPT_DIR/system-detect.sh" + _LIB_SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + source "$_LIB_SRCDIR/common-functions.sh" + source "$_LIB_SRCDIR/system-detect.sh" fi # Initialize temp session directory if not set diff --git a/modules/performance/php-optimizer.sh b/modules/performance/php-optimizer.sh index 35dc71d..5324405 100755 --- a/modules/performance/php-optimizer.sh +++ b/modules/performance/php-optimizer.sh @@ -4,12 +4,12 @@ # Part of Server Toolkit - Phase 3: Main Interactive Script # Source required libraries -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)" -source "$SCRIPT_DIR/lib/php-detector.sh" 2>/dev/null || { echo "ERROR: php-detector.sh not found"; exit 1; } -source "$SCRIPT_DIR/lib/php-analyzer.sh" 2>/dev/null || { echo "ERROR: php-analyzer.sh not found"; exit 1; } -source "$SCRIPT_DIR/lib/php-config-manager.sh" 2>/dev/null || { echo "ERROR: php-config-manager.sh not found"; exit 1; } -source "$SCRIPT_DIR/lib/system-detect.sh" 2>/dev/null || { echo "ERROR: system-detect.sh not found"; exit 1; } -source "$SCRIPT_DIR/lib/user-manager.sh" 2>/dev/null || { echo "ERROR: user-manager.sh not found"; exit 1; } +PHP_TOOLKIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)" +source "$PHP_TOOLKIT_DIR/lib/php-detector.sh" || { echo "ERROR: php-detector.sh not found"; exit 1; } +source "$PHP_TOOLKIT_DIR/lib/php-analyzer.sh" || { echo "ERROR: php-analyzer.sh not found"; exit 1; } +source "$PHP_TOOLKIT_DIR/lib/php-config-manager.sh" || { echo "ERROR: php-config-manager.sh not found"; exit 1; } +source "$PHP_TOOLKIT_DIR/lib/system-detect.sh" || { echo "ERROR: system-detect.sh not found"; exit 1; } +source "$PHP_TOOLKIT_DIR/lib/user-manager.sh" || { echo "ERROR: user-manager.sh not found"; exit 1; } # Color codes (using safe echo -e) RED='\033[0;31m' @@ -1109,7 +1109,7 @@ restore_configurations() { main() { # Detect system - detect_system + initialize_system_detection # Check if running as root if [ "$EUID" -ne 0 ]; then