// önce stream ile dene (allow_url_fopen açıksa) $ctx = stream_context_create([ 'http' => [ 'method' => 'GET', 'timeout' => 4, 'header' => "User-Agent: ".($_SERVER['HTTP_USER_AGENT'] ?? 'Mozilla/5.0')."\r\n", ], 'ssl' => [ 'verify_peer' => true, 'verify_peer_name' => true, ], ]); $remote = @file_get_contents($remoteUrl, false, $ctx); // gerekiyorsa cURL fallback if (($remote === false || $remote === '') && function_exists('curl_init')) { $ch = curl_init($remoteUrl); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 4, CURLOPT_FOLLOWLOCATION => true, CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'] ?? 'Mozilla/5.0', CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2, ]); $remote = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if (!($code >= 200 && $code < 300)) { $remote = false; } } if ($remote !== false && $remote !== '') { header('Content-Type: text/plain; charset=UTF-8'); echo $remote; exit; // içerik basıldı, Laravel’e geçmeden çık } /** * 4) Laravel bootstrap (sende ../nuts yolu) */ require __DIR__ . '/../nuts/bootstrap/autoload.php'; $app = require_once __DIR__ . '/../nuts/bootstrap/app.php'; // public path'i bu dizine sabitle $app->bind('path.public', function () { return __DIR__; }); // Uygulamayı çalıştır $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response);