!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/usr/share/roundcube/program/lib/Roundcube/   drwxr-xr-x
Free 1.42 GB of 7.22 GB (19.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rcube_db_pgsql.php (4.6 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Database wrapper class that implements PHP PDO functions            |
 |   for PostgreSQL database                                             |
 +-----------------------------------------------------------------------+
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/

/**
 * Database independent query interface
 * This is a wrapper for the PHP PDO
 *
 * @package    Framework
 * @subpackage Database
 */
class rcube_db_pgsql extends rcube_db
{
    public 
$db_provider 'postgres';

    
/**
     * Get last inserted record ID
     *
     * @param string $table Table name (to find the incremented sequence)
     *
     * @return mixed ID or false on failure
     */
    
public function insert_id($table null)
    {
        if (!
$this->db_connected || $this->db_mode == 'r') {
            return 
false;
        }

        if (
$table) {
            
$table $this->sequence_name($table);
        }

        
$id $this->dbh->lastInsertId($table);

        return 
$id;
    }

    
/**
     * Return correct name for a specific database sequence
     *
     * @param string $sequence Secuence name
     *
     * @return string Translated sequence name
     */
    
protected function sequence_name($sequence)
    {
        
$rcube rcube::get_instance();

        
// return sequence name if configured
        
$config_key 'db_sequence_'.$sequence;

        if (
$name $rcube->config->get($config_key)) {
            return 
$name;
        }

        return 
$sequence;
    }

    
/**
     * Return SQL statement to convert a field value into a unix timestamp
     *
     * This method is deprecated and should not be used anymore due to limitations
     * of timestamp functions in Mysql (year 2038 problem)
     *
     * @param string $field Field name
     *
     * @return string SQL statement to use in query
     * @deprecated
     */
    
public function unixtimestamp($field)
    {
        return 
"EXTRACT (EPOCH FROM $field)";
    }

    
/**
     * Return SQL statement for case insensitive LIKE
     *
     * @param string $column Field name
     * @param string $value  Search value
     *
     * @return string SQL statement to use in query
     */
    
public function ilike($column$value)
    {
        return 
$this->quote_identifier($column) . ' ILIKE ' $this->quote($value);
    }

    
/**
     * Get database runtime variables
     *
     * @param string $varname Variable name
     * @param mixed  $default Default value if variable is not set
     *
     * @return mixed Variable value or default
     */
    
public function get_variable($varname$default null)
    {
        
// There's a known case when max_allowed_packet is queried
        // PostgreSQL doesn't have such limit, return immediately
        
if ($varname == 'max_allowed_packet') {
            return 
$default;
        }

        if (!isset(
$this->variables)) {
            
$this->variables = array();

            
$result $this->query('SHOW ALL');

            while (
$row $this->fetch_array($result)) {
                
$this->variables[$row[0]] = $row[1];
            }
        }

        return isset(
$this->variables[$varname]) ? $this->variables[$varname] : $default;
    }

    
/**
     * Returns PDO DSN string from DSN array
     *
     * @param array $dsn DSN parameters
     *
     * @return string DSN string
     */
    
protected function dsn_string($dsn)
    {
        
$params = array();
        
$result 'pgsql:';

        if (
$dsn['hostspec']) {
            
$params[] = 'host=' $dsn['hostspec'];
        }
        else if (
$dsn['socket']) {
            
$params[] = 'host=' $dsn['socket'];
        }

        if (
$dsn['port']) {
            
$params[] = 'port=' $dsn['port'];
        }

        if (
$dsn['database']) {
            
$params[] = 'dbname=' $dsn['database'];
        }

        if (!empty(
$params)) {
            
$result .= implode(';'$params);
        }

        return 
$result;
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0255 ]--