require 'vendor/autoload.php'; require 'classes/MyInsta.php'; $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); use MetzWeb\Instagram\Instagram; use MetzWeb\Instagram\MyInsta; $instagram = new MyInsta(getenv('INSTAGRAM_API_KEY')); $instagram = new MyInsta(array('apiKey' => getenv('INSTAGRAM_API_KEY'), 'apiSecret' => getenv('INSTAGRAM_API_SECRET'), 'apiCallback' => getenv('SITE_URL') . '/follows.php')); ORM::configure('mysql:host=localhost;dbname=' . getenv('DB_NAME')); ORM::configure('username', getenv('DB_USER')); ORM::configure('password', getenv('DB_PASSWORD')); if (!isset($_SESSION['access_token']) && !isset($_GET['code'])) { echo "<a href='{$instagram->getLoginUrl()}'>Войти через инстаграм</a>"; } if (isset($_GET['code'])) { $data = $instagram->getOAuthToken($_GET['code']); $_SESSION['access_token'] = $data->access_token; header('Location: ' . getenv('SITE_URL') . '/follows.php'); exit; } ?> <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <style> body { text-align: center; color: #333; padding-top: 40px;