'INTRODU_AICI_LINKUL_TAU_DE_SCULE', // Înlocuiește cu linkul tău de la scule (dacă îl ai) 'evomag_cache.xml' => 'https://api.2performant.com/feed/b8b798ffc.xml' ]; $successCount = 0; foreach ($feeds as $cacheFile => $xmlUrl) { // Dacă linkul nu este completat sau e placeholder, sărim peste el if (empty($xmlUrl) || strpos($xmlUrl, 'INTRODU_AICI') !== false) { continue; } $localPath = $_SERVER['DOCUMENT_ROOT'] . '/' . $cacheFile; $fp = fopen($localPath, 'w+'); if ($fp) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $xmlUrl); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'); curl_setopt($ch, CURLOPT_TIMEOUT, 180); $executed = curl_exec($ch); curl_close($ch); fclose($fp); if ($executed) { $successCount++; } } } echo "Actualizarea feed-urilor s-a finalizat! (Sursa actualizate: $successCount)"; ?>