HEX
Server: Apache/2
System: Linux server-27-254-144-72.da.direct 5.10.0-33-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64
User: pokaorgani (1114)
PHP: 8.1.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/pokaorgani/public_html/wp-content/plugins/gallery-by-supsystic/vendor/Rsc/Mvc/Model.php
<?php


class RscSgg_Mvc_Model
{

    /**
     * @var wpdb
     */
    protected $db;

    /**
     * Constructor
     */
    public function __construct()
    {
        global $wpdb;

        $this->db = $wpdb;
    }

    /**
     * Do query with the dbDelta function
     * @param string $query MySQL query
     * @return mixed
     */
    public function delta($query)
    {
        if (!function_exists('dbDelta')) {
            require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        }

        return @dbDelta($query);
    }

    /**
     * Returns an instance of Query Builder
     * @return BarsMaster_ChainQueryBuilder
     */
    public function getQueryBuilder()
    {
        return new BarsMaster_ChainQueryBuilder();
    }

    /**
     * Returns an instance of Wpdb
     * @return \wpdb
     */
    public function getDb()
    {
        return $this->db;
    }

    /**
     * Returns the database connection resource if it is accessible
     * @return null|resource
     */
    public function getDatabaseHandler()
    {
        if ($this->isAccessibleDbConnection()) {
            return $this->db->dbh;
        }

        return null;
    }

    /**
     * Checks whether the table is exists
     * @param string $table The name of the table
     * @return bool TRUE if the table is exists, FALSE otherwise
     */
    public function isTableExists($table)
    {
        return ($this->db->get_var(sprintf('SHOW TABLES LIKE %s', $table)) == $table);
    }

    /**
     * Checks whether we can access to the database connection
     * @return bool TRUE if we can, FALSE otherwise
     */
    public function isAccessibleDbConnection()
    {
        if (!method_exists($this->db, '__get')) {
            return false;
        }

        if (!is_resource($this->db->dbh)) {
            return false;
        }

        return true;
    }
}