
&"$PSScriptRoot\vars.ps1"
&"$PSScriptRoot\vars-config.ps1"

# Composer INSTALL
&"$ROOT\Scripts\check-dep.ps1"
&"$PHPexe" "$ROOT/Var/composer.phar" install --working-dir="$ROOT/Var/" --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader --prefer-dist


@(
'vendor\ezyang\htmlpurifier\library\HTMLPurifier\DefinitionCache'
) | ForEach-Object {
    Write-Host $_
    $path = "$ROOT/$_"
    $acl = Get-Acl $path
    ForEach ($usr in $CEDAR_INSTALL_USERS)
    {
        $a = New-Object System.Security.AccessControl.FileSystemAccessRule($usr, "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
        $acl.AddAccessRule($a)
    }
    $acl.SetAccessRuleProtection($false,$true)
    Set-Acl $path $acl
}
