HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/telefon-sex/admin/libraries/test.class.php
<?php
/**
 * Server Test Class
 * @access public
 */
class imTest {
    const PHP_MIN_VERSION = '7.1.0';

    /**
     * Utility that combine a series of paths
     * @method pathCombine
     * @param  {array}  $paths The array with the elements of the path
     * @return {string} The path created combining the elements of the array
     */
    public static function testPathCombine($paths = array())
    {
        $s = array();
        foreach ($paths as $path) {
            if (strlen($path)) {
                $s[] = trim($path, "/\\ ");
            }
        }
        return implode("/", $s);
    }

    /*
     * Session check
     */
    public static function session_test()
    {
        if (!isset($_SESSION))
            return false;
        $_SESSION['imAdmin_test'] = "test_message";
        return ($_SESSION['imAdmin_test'] == "test_message");
    }

    /*
     * Writable files check
     */
    public static function writable_folder_test($dir)
    {
        if (!file_exists($dir) && $dir != "" && $dir != "./.")
            @mkdir($dir, 0777, true);

        $fp = @fopen(imTest::testPathCombine(array($dir, "imAdmin_test_file")), "w");
        if (!$fp)
            return false;
        if (@fwrite($fp, "test") === false)
            return false;
        @fclose($fp);
        if (!@file_exists(imTest::testPathCombine(array($dir, "imAdmin_test_file"))))
            return false;
        @unlink(imTest::testPathCombine(array($dir, "imAdmin_test_file")));
        return true;
    }

    /*
     * PHP Version check
     */
    public static function php_version_test()
    {
        if (!function_exists("version_compare") || version_compare(PHP_VERSION, self::PHP_MIN_VERSION) < 0)
            return false;
        return true;
    }

    /*
     * MySQL Connection check
     */
    public static function mysql_test($db)
    {
        if (!$db->testConnection())
            return false;
        $db->closeConnection();
        return true;
    }

}
// End of file