Пример #1
0
$password = '******';
$bdd = getConnection();
$_TABLES = null;
if (!is_null($bdd)) {
    $_TABLES = getStructure();
} else {
    echo "Connection BDD Error \n";
}
if (!is_null($bdd) && !is_null($_TABLES)) {
    set_time_limit(0);
    $website = new Website($bdd, $_TABLES);
    $websites = $website->getWebsites();
    if (!is_null($websites)) {
        foreach ($websites as $key_website => $value_website) {
            $website_category = new WebsiteCategory($bdd, $_TABLES);
            $website_categories = $website_category->getWebsiteCategories($value_website->id);
            $url = $value_website->url;
            $file = $value_website->file;
            // Try to load json config
            $config = null;
            $json = file_get_contents(dirname(dirname(dirname(__FILE__))) . '/' . $file);
            if ($json !== false) {
                // if Valid Config
                $config = json_decode($json);
            } else {
                // Invalid Config
                echo "Website File Not Found \n";
            }
            if (!is_null($website_categories)) {
                foreach ($website_categories as $key_website_category => $value_website_category) {
                    $article = new Article($bdd, $_TABLES);