PHP Classes

File: htdocs/class/libraries/vendor/geekwright/regdom/bin/reloadpsl

Recommend this page to a friend!
  Classes of Michael Beck   Xoops 2.5   htdocs/class/libraries/vendor/geekwright/regdom/bin/reloadpsl   Download  
File: htdocs/class/libraries/vendor/geekwright/regdom/bin/reloadpsl
Role: Example script
Content type: text/plain
Description: Example script
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change:
Date: 7 years ago
Size: 759 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

/*
 * This file is part of https://github.com/geekwright/RegDom
 *
 * Clear all Public Suffix Data and load a fresh copy from publicsuffix.org
 */

function includeIfExists($file)
{
    if (
file_exists($file)) {
        return include
$file;
    }
}

if ((!
$loader = includeIfExists(__DIR__.'/../autoload.php'))
    && (!
$loader = includeIfExists(__DIR__.'/../../../autoload.php')))
{
    die(
"You must set up the project dependencies, run composer install\n");
}

use
Geekwright\RegDom\PublicSuffixList;

// force fetch of the PSL
$psl = new \Geekwright\RegDom\PublicSuffixList();
$psl->clearDataDirectory();
$psl->getTree();
// once more to build local copy cache
$psl = new \Geekwright\RegDom\PublicSuffixList();
$psl->getTree();