PHP code example of deployecommerce / magento2-csp-parser

1. Go to this page and download the library: Download deployecommerce/magento2-csp-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deployecommerce / magento2-csp-parser example snippets


$xml = file_get_contents('csp_whitelist.xml');

$parser = new \DeployEcommerce\Csp\Parser\Magento2CspParser();
$policies = $parser->parse($xml);