{
    "version": "2.4.1-5.4",
    "description": "A popular general-purpose scripting language that is especially suited to web development. (version 5.4)",
    "homepage": "https://xdebug.org/",
    "license": {
        "identifier": "Xdebug-1.01",
        "url": "https://xdebug.org/license.php"
    },
    "notes": [
        "Xdebug is already enabled if PHP 5.4 was installed through scoop!",
        "Otherwise add '$dir\\php_xdebug.dll' to your php.ini"
    ],
    "architecture": {
        "64bit": {
            "url": "https://xdebug.org/files/php_xdebug-2.4.1-5.4-vc9-x86_64.dll#/php_xdebug.dll",
            "hash": "a6a21283ee4ebab8f0908b1212c1baca8f373a66e57cb09b2ad78a8f596eb5cd"
        },
        "32bit": {
            "url": "https://xdebug.org/files/php_xdebug-2.4.1-5.4-vc9.dll#/php_xdebug.dll",
            "hash": "4da7460ac71b1d3dbdf3253d6105af7f8cc5a800c90ee21adaafa63f54b60c07"
        }
    },
    "post_install": [
        "$config = @(",
        "    \"zend_extension=$dir\\php_xdebug.dll\",",
        "    \"[xdebug]\",",
        "    \"xdebug.remote_enable=on\",",
        "    \"xdebug.remote_autostart=on\",",
        "    \"xdebug.remote_connect_back=on\"",
        ") -join \"`n\"",
        "$php = $app -Split '-' | Select-Object -First 1",
        "$configUpdated = $false",
        "foreach ($phpGlobal in @($false, $true)) {",
        "    if (installed $php $phpGlobal) {",
        "        $configPath = \"$(persistdir $php $phpGlobal)\\cli\\conf.d\\xdebug.ini\"",
        "        if(-not (Test-Path -Path $configPath)) {",
        "            $configUpdated = $true",
        "            ensure (Split-Path $configPath -Parent) | Out-Null",
        "            Write-Host \"Enabling extension $configPath\"",
        "            Add-Content -Value $config -Path $configPath",
        "        }",
        "        break",
        "    }",
        "}",
        "if(-not $configUpdated) {",
        "    Write-Host -ForegroundColor Yellow \"You may need to manually enable php_xdebug.dll. Add the following:`n\"",
        "    Write-Host -ForegroundColor Cyan \"$config`n`n\"",
        "}"
    ],
    "checkver": {
        "url": "https://xdebug.org/download/historical",
        "regex": "php_xdebug-([\\d.]+-5.4)-vc9-x86_64.dll"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://xdebug.org/files/php_xdebug-$version-vc9-x86_64.dll#/php_xdebug.dll"
            },
            "32bit": {
                "url": "https://xdebug.org/files/php_xdebug-$version-vc9.dll#/php_xdebug.dll"
            }
        },
        "hash": {
            "url": "https://xdebug.org/download/historical",
            "regex": "([a-fA-F0-9]{64}).+?$basename"
        }
    }
}
