# CEDAR Version

$Global:version = "2025r3"

# Versions

$Global:PHP_VERSION = "8.3"
$Global:PHP_VERSION_FULL = "8.3.12"
$Global:POWERSHELL_VERSION = "7.3.0"
$Global:SchemaZenVersion = "1.4"

# Paths

$Global:ROOT = Resolve-Path -LiteralPath "$PSScriptRoot/.." | Resolve-Path
$Global:PHPdir = "$Env:Programfiles\PHP\v$PHP_VERSION"
$Global:PHPexe = "$PHPdir\php.exe"
$Global:CEDAR = "$ROOT\cedar.ps1"
$Global:InstalledPHPexe = ""
try {
    $Global:InstalledPHPexe  = Get-Command php | Select-Object -ExpandProperty Path
} catch {
    write-host "Warning: No PHP installation detected"
}

$Env:COMPOSER_BINARY="$ROOT/Var/composer.phar"
$Env:COMPOSER="$ROOT/composer.json"

# EXEs
$Global:IISexe = "$ENV:SystemRoot\system32\inetsrv\appcmd"
$Global:GITexe = "$Env:Programfiles/Git/bin/git.exe"
$Global:SchemaZen = "$ROOT\Var\SchemaZen.exe"
$Global:ZIPexe = "$Env:Programfiles/7-Zip/7z.exe"

$Global:CedarReleases = "https://releases.cedarportal.co.uk"

# User

$Global:IsAdministrator = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
