# ==============================================================================
#                      phpQ ENTERPRISE PROTECTION SUITE v1.2.0
#                   MASTER PROJECT CONFIGURATION & SECURITY SPEC
#                           (protect.txt / project.txt)
# ==============================================================================
# Quick Usage:
#   - On Linux:   /usr/local/bin/phpq protect.txt
#   - On Windows: phpQ.exe protect.txt
# ==============================================================================


# ==============================================================================
# 1. PROJECT IDENTIFICATION
# ==============================================================================
[project]
# Unique project identifier (Alphanumeric, no spaces, no special characters)
id = MY_AWESOME_PROJECT_2026

# Secret Project Key: used to derive AES-256-GCM encryption keys & HMAC-SHA256 signatures.
# Keep this key safe and confidential to issue license files (web.lic) in the future!
key = 7f8a9b2c3d4e5f601a2b3c4d5e6f7081a9b8c7d6e5f40312

# Cross-File Binding Lock:
# When set to true, files within this project can only include/require each other if they share the same Project ID.
# Prevents unauthorized extraction or transplantation of individual encoded scripts into external systems.
lock = true


# ==============================================================================
# 2. SOURCE & TARGET PATHS
# ==============================================================================
[paths]
# Directory containing unencoded PHP source code (relative or absolute path)
source = ./source

# Output directory for protected / compiled distribution files
target = ./dist_protected


# ==============================================================================
# 3. CODE OBFUSCATION & OPTIMIZATION
# ==============================================================================
[options]
# Multi-layered Abstract Syntax Tree (AST) obfuscation: mangles local variables, flattens control flow
obfuscate = true

# Strips all source code comments, PHPDocs, and redundant whitespace to safeguard intellectual property
strip_comments = true


# ==============================================================================
# 4. ADVANCED COMPILER OPTIONS
# ==============================================================================
[advanced_options]
# Enable parsing of legacy ASP tags <% %> (Default: false)
asp_tags = false

# Enable parsing of PHP short open tags <? ?> (Default: true)
short_tags = true

# Do not automatically inject loader verification bootstrap header into encoded files (Default: false)
# If set to true, you must ensure the phpQ Loader extension is pre-loaded by php.ini on the server.
dont_integrate_loader = false

# Report strict PHP syntax warnings (E_STRICT) during compilation (Default: true)
report_e_strict = true

# Report deprecated PHP syntax warnings (E_DEPRECATED) during compilation (Default: false)
report_e_deprecated = false

# Terminate compilation immediately upon encountering syntax errors (Default: true)
stop_on_errors = true

# Preserve original file modification timestamps (mtime) on output files (Default: true)
keep_mtime = true

# Preserve PHPDoc comment blocks (/** ... */) (Default: false - stripped for maximum security)
keep_doc_comments = false

# Incremental Build mode:
# Only re-encodes PHP files modified since the last build run, optimizing CI/CD build speed for large repos.
only_changed = false


# ==============================================================================
# 5. BRANDING, COPYRIGHT HEADERS & CUSTOM MESSAGES
# ==============================================================================
[custom_code]
# Custom copyright banner or security notice placed at the top of protected files (Leave blank if not needed)
custom_header_code = // Protected by phpQ Enterprise Suite v1.2.0 - All Rights Reserved.

# Custom PHP code or message displayed when the server lacks the required phpQ Loader extension
loader_not_installed_error = echo "Error: phpQ Loader extension is not installed on this server. Please contact system administrator.
"; exit(1);

# Embedded copyright / license metadata embedded inside encrypted binaries
license_custom_text = Copyright (C) 2026 Enterprise Solutions Corp - Licensed Software

# Error message displayed if real-time NTP network time verification fails (when check_date_ntp is enabled)
online_error_message = echo "Error: This application requires an active internet connection for real-time license verification.
"; exit(1);


# ==============================================================================
# 6. LICENSE BINDING & EXPIRATION LOCKS
# ==============================================================================
[lock_options]
# Enforce mandatory offline license verification (web.lic) to run (true/false)
lock_to_license = false

# Filename of the cryptographic license to search for in application path (Default: web.lic or key.lic)
license_file_name = web.lic

# Hardcoded absolute expiration timestamp (Format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)
# Uncomment to enable:
# expiration_date = 2026-12-31

# Relative expiration period calculated from build timestamp (e.g. 30 days, 365 days)
# expire_in_days = 365


# ==============================================================================
# 7. DOMAIN NAME RESTRICTIONS
# ==============================================================================
[domain_locks]
# List of authorized domain names (One domain per line; wildcard * supported):
# myclient.com
# *.myclient.com
# localhost
# 127.0.0.1

# Bypass domain restriction when executing scripts via Command Line Interface (CLI / Cron) (Recommended: true)
ignore_domain_cli = true

# Derive encryption key directly from authorized domain (Only applicable when single domain is specified)
encrypt_with_domain = false


# ==============================================================================
# 8. IP ADDRESS RESTRICTIONS
# ==============================================================================
[ip_locks]
# List of authorized IPv4/IPv6 addresses or CIDR blocks (One IP per line):
# 192.168.1.100
# 10.0.0.0/24

# Bypass IP check when running via CLI
ignore_ip_cli = true

# Derive encryption key directly from server IP
encrypt_with_ip = false


# ==============================================================================
# 9. HARDWARE LOCK (MACHINE ID BINDING)
# ==============================================================================
[machine_locks]
# Cryptographic SHA-256 Machine ID uniquely bound to CPU, Motherboard, and Storage UUID.
# Retrieve target server Machine ID via: php -r "echo phpq_machine_id();"
# b857dbc162a4e36aca703dcd3008336b324e60bb87306f285090285c7b9829b1

# Derive encryption key directly from hardware Machine ID
encrypt_with_machine_id = false


# ==============================================================================
# 10. REAL-TIME NTP TIME INTEGRITY VERIFICATION
# ==============================================================================
[ntp_time]
# Public NTP time servers to verify real-world time (prevents system clock tampering)
server = pool.ntp.org
server = time.google.com
server = time.windows.com

# Enable online time integrity check via NTP protocol (Default: false)
check_date_ntp = false

# Require continuous active internet connection for application to run (Default: false)
work_online_only = false


# ==============================================================================
# 11. INJECTED RUNTIME CONSTANTS
# Automatically injected into PHP runtime environment when application executes
# ==============================================================================
[constants]
# CONSTANT_NAME = VALUE
# APP_PROTECTED = true
# LICENSE_EDITION = Enterprise
# MAX_TENANTS = 100


# ==============================================================================
# 12. FILE ENCODING RULES
# All matching files will be converted into encrypted bytecode and AST-obfuscated
# ==============================================================================
[encode]
*.php
*.phtml


# ==============================================================================
# 13. RAW ASSET COPY RULES
# Non-executable assets, templates, and media copied 1:1 without alteration
# ==============================================================================
[copy]
.htaccess
robots.txt
composer.json
package.json
*.blade.php
public/*
assets/*
views/*
templates/*


# ==============================================================================
# 14. EXCLUSION & IGNORE RULES
# VCS metadata, temporary files, logs, and sensitive developer config files to exclude
# ==============================================================================
[ignore]
.git
.svn
.idea
.vscode
node_modules/*
storage/logs/*
storage/framework/cache/*
storage/framework/views/*
tests/*
*.log
*.tmp
*.bak
*.sql
*.zip
*.tar.gz
*.tgz
project.txt
protect.txt
protect_full_option.txt
