proxitok/helpers/Settings.php

22 lines
602 B
PHP
Raw Normal View History

<?php
namespace Helpers;
class Settings {
2022-01-06 23:13:51 +00:00
const PROXY = ['proxy-host', 'proxy-port', 'proxy-username', 'proxy-password'];
static public function get(string $name): string {
if (isset($_COOKIE[$name]) && !empty($_COOKIE[$name])) {
return $_COOKIE[$name];
}
return '';
}
static public function exists(string $name): bool {
return isset($_COOKIE[$name]);
}
static public function set(string $name, string $value) {
2022-01-06 23:28:28 +00:00
setcookie($name, $value, time()+60*60*24*30, Misc::getSubDir(), '', isset($_SERVER['HTTPS']), true);
}
};