<commit_before><?php
/**
 * p01-contact - A simple contact forms manager
 *
 * @package p01contact
 * @link https://github.com/nliautaud/p01contact
 * @author <NAME>
 */
namespace P01C;

require_once 'P01contact_Session.php';
require_once 'P01contact_Form.php';
require_once 'vendor/spyc.php';

class P01contact
{
    public $version;
    public $default_lang;
    private $config;
    private $langs;

    public function __construct()
    {
        define('P01C\VERSION', '1.1.4');
        $this->version = VERSION;

        define('P01C\SERVERNAME', $_SERVER['SERVER_NAME']);
        define('P01C\SERVERPORT', $_SERVER['SERVER_PORT']);
        define('P01C\HTTPS', !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
        define('P01C\PORT', SERVERPORT && SERVERPORT != 80 && SERVERPORT != 443 ? ':'.SERVERPORT : '');
        define('P01C\PROTOCOL', HTTPS || SERVERPORT == 443 ? 'https' : 'http');
        define('P01C\SERVER', PROTOCOL . '://' . SERVERNAME . PORT);
        define('P01C\PAGEURI', $_SERVER['REQUEST_URI']);
        define('P01C\PAGEURL', SERVER . PAGEURI);

        define('P01C\PATH', dirname(dirname(__FILE__)) . '/');
        define('P01C\RELPATH', substr(PATH, strlen($_SERVER['DOCUMENT_ROOT'])));

        define('P01C\LANGSPATH', PATH . 'lang/');
        define('P01C\TPLPATH', PATH . 'src/templates/');<commit_msg>define relpath with script_name and included_files<commit_after><?php
/**
 * p01-contact - A simple contact forms manager
 *
 * @package p01contact
 * @link https://github.com/nliautaud/p01contact
 * @author <NAME>
 */
namespace P01C;

require_once 'P01contact_Session.php';
require_once 'P01contact_Form.php';
require_once 'vendor/spyc.php';

class P01contact
{
    public $version;
    public $default_lang;
    private $config;
    private $langs;

    public function __construct()
    {
        define('P01C\VERSION', '1.1.4');
        $this->version = VERSION;

        define('P01C\SERVERNAME', $_SERVER['SERVER_NAME']);
        define('P01C\SERVERPORT', $_SERVER['SERVER_PORT']);
        define('P01C\SCRIPTNAME', $_SERVER['SCRIPT_NAME']);
        define('P01C\SCRIPTPATH', get_included_files()[0]);

        define('P01C\HTTPS', !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
        define('P01C\PORT', SERVERPORT && SERVERPORT != 80 && SERVERPORT != 443 ? ':'.SERVERPORT : '');
        define('P01C\PROTOCOL', HTTPS || SERVERPORT == 443 ? 'https' : 'http');
        define('P01C\SERVER', PROTOCOL . '://' . SERVERNAME . PORT);
        define('P01C\PAGEURI', $_SERVER['REQUEST_URI']);
        define('P01C\PAGEURL', SERVER . PAGEURI);

        define('P01C\PATH', dirname(__DIR__) . '/');
        define('P01C\ROOT', str_replace(SCRIPTNAME,'', SCRIPTPATH));
        define('P01C\RELPATH', str_replace(ROOT, '', PATH));

        define('P01C\LANGSPATH', PATH . 'lang/');
        define('P01C\TPLPATH', PATH . 'src/templates/');
{'fraction_non_alphanumeric': 0.18351155570886513, 'fraction_numerical': 0.03759917212832011, 'mean_word_length': 3.4891640866873064, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4529221', 'n_tokens_mistral': 1039, 'n_tokens_neox': 969, 'n_words': 169}