#!/bin/bash
# TemseeEdu School Edition — YAKPRO obfuscation build script
# Requires: composer require naneau/php-obfuscator (dev dependency)

# Assuming yakpro-po is installed globally or in vendor/bin
YAKPRO_PATH="./yakpro-po/yakpro-po.php"

if [ ! -f "$YAKPRO_PATH" ]; then
    echo "yakpro-po not found at $YAKPRO_PATH. Using global yakpro-po instead."
    YAKPRO_PATH="yakpro-po"
fi

echo "Starting obfuscation with YAKPRO-PO..."

$YAKPRO_PATH \
    --scramble-variable-name \
    --scramble-function-name \
    --scramble-class-name \
    --strip-indentation \
    --no-obfuscate-string-literal \
    --output-path ./dist/school-edition/ \
    ./app/

echo "Obfuscation complete!"
