Phalcon Framework 3.2.4

PDOException: SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres"

/data/html/newcms/application/common/models/ModelBase.php (81)
#0PDO->__construct(pgsql:host=19.81.9.139;port=5432;dbname=collectclient, postgres, 1191331xxxUUZZbb, Array([3] => 2))
#1Phalcon\Db\Adapter\Pdo->connect(Array([host] => 19.81.9.139, [port] => 5432, [username] => postgres, [password] => 1191331xxxUUZZbb, [dbname] => collectclient))
#2Phalcon\Db\Adapter\Pdo\Postgresql->connect(Array([host] => 19.81.9.139, [port] => 5432, [username] => postgres, [password] => 1191331xxxUUZZbb, [dbname] => collectclient))
#3Phalcon\Db\Adapter\Pdo->__construct(Array([host] => 19.81.9.139, [port] => 5432, [username] => postgres, [password] => 1191331xxxUUZZbb, [dbname] => collectclient))
/data/html/newcms/application/common/models/ModelBase.php (81)
<?php
namespace Baseapp\Models;
 
use \Phalcon\Mvc\Model;
 
class ModelBase extends Model
{
    protected $error;
    public $tableName = '';
 
    public function initialize()
    {
        error_reporting(E_ERROR);
    }
 
    /**
     * 获取错误信息
     * @return string 错误信息
     */
    public function getError()
    {
        return is_array($this->error) ? implode('', $this->error) : $this->error;
    }
 
    /**
     * 获取SQL执行情况
     * @return array
     */
    public function getSQLStatement()
    {
        $profiles = \Phalcon\DI::getDefault()->get('profiler')->getProfiles();
        $statement = array();
        if (is_array($profiles)) {
            foreach ($profiles as $profile) {
                $statement['sql'] = $profile->getSQLStatement();
                $statement['start_time'] = $profile->getInitialTime();
                $statement['final_time'] = $profile->getFinalTime();
                $statement['total_time'] = $profile->getTotalElapsedSeconds();
            }
        }
        return $statement;
    }
 
 
    /**
     * 设置数据源连接
     */
    public function setDataConnect($dbsource)
    {
        $connectionService = $this->createConnection($dbsource);
        $connectionService && $this->setConnectionService($connectionService);
        return $this;
    }
 
    /**
     * 创建连接
     * @param int $dbsource_id 数据源ID
     * @param boolean $returnConnection 返回连接
     */
    public static function createConnection($dbsource, $returnConnection = false)
    {
        $di = \Phalcon\DI::getDefault();
        $connect_name = 'dbSource' . $dbsource['source_id'];
        if (!$dbsource) {
            return false;
        }
        $config = $di->get('config');
        try {
            $di->set($connect_name, function () use ($dbsource, $config) {
                $dbtype = $dbsource['dbtype'];
                unset($dbsource['dbtype'], $dbsource['source_id'], $dbsource['guid'], $dbsource['site_id'], $dbsource['title']);
 
                switch ($dbtype) {
                    case 'mysql':
                        // $charset = $this->config->database->charset;
                        $connection = new \Phalcon\Db\Adapter\Pdo\Mysql($dbsource);
                        break;
                    case 'postgresql':
 
                        $params['schema'] = $config->database->schema;
                        $connection = new \Phalcon\Db\Adapter\Pdo\Postgresql($dbsource);
                        break;
                    case 'oracle':
                        $params['charset'] = $config->database->charset;
                        $connection = new \Phalcon\Db\Adapter\Pdo\Oracle($dbsource);
                        break;
                    case 'sqlite':
                        $connection = new \Phalcon\Db\Adapter\Pdo\Sqlite($dbsource);
                        break;
                }
                return $connection;
            });
            return $returnConnection ? @$di->get($connect_name) : $connect_name;
        } catch (\PDOException $e) {
            return false;
        }
    }
 
    /*
     * 检测数据库连接信息
     * @param array $params 数据库连接信息
     * @return boolean 连接成功返回true,失败返回错误信息
     */
    public static function testConnect($params = array())
    {
        try {
            $type = $params['dbtype'];
            $config = \Phalcon\DI::getDefault()->get('config');
            unset($params['dbtype']);
            switch ($type) {
                case 'mysql':
                    // $charset = $config->database->charset;
                    $connection = new \Phalcon\Db\Adapter\Pdo\Mysql($params);
                    break;
                case 'postgresql':
                    $params['schema'] = $config->database->schema;
                    $connection = new \Phalcon\Db\Adapter\Pdo\Postgresql($params);
                    break;
                case 'oracle':
                    $params['charset'] = $config->database->charset;
                    $connection = new \Phalcon\Db\Adapter\Pdo\Oracle($params);
                    break;
                case 'sqlite':
                    $connection = new \Phalcon\Db\Adapter\Pdo\Sqlite($params);
                    break;
                case 'mssql':
                    $connection = mssql_connect($params['host'], $params['username'], $params['password']);
                    if (!mssql_select_db($params['dbname'], $connection)) {
                        return false;
                    }
                    break;
                case 'sybase':
                    $connection = @sybase_connect($params['host'], $params['username'], $params['password']);
                    if (!$connection) {
                        return false;
                    }
                    break;
            }
            return $connection ? true : false;
        } catch (\PDOException $e) {
            $error = (string)$e->getMessage();
            return $error;
        }
    }
 
    /**
     * 单条插入,批量插入建议使用addAll方法
     * @param array $data 键值数组
     * @return int/boolean 成功返回插入ID值,失败返回false
     */
    public function add($data)
    {
        $columns = $this->getColumns();
        $fieldnames = $columns['names'];
        $this->primary = $primaryKey = $columns['primary'];
        $fields = array_intersect($fieldnames, array_keys($data));
        if (empty($fields)) {
            $this->error = 'There is no available fields!';
            return false;
        }
        $sql = array();
        foreach ($fields as $field) {
            $sql[$field] = $data[$field];
        }
        try {
            $connection = $this->getWriteConnection();
            $db_type = $connection->getType();
            $tablename = ($db_type == 'oci') ? strtoupper($this->getSource()) : $this->getSource();
            ($db_type == 'oci') && ($fields = array_map('strtoupper', $fields));
            $result = $connection->insert($tablename, array_values($sql), $fields);
            if (!$result) {
                $this->error = $connection->getErrorInfo();
            } else {
                $lastInsertId = $this->lastInsertId();
                // 当无法取得lastInsertId时,返回true,表示插入操作执行成功
                $result = $lastInsertId ? $lastInsertId : true;
            }
        } catch (\PDOException $ex) {
            $this->error = $ex->getMessage();
        }
        return $result ? $result : false;
    }
 
    /**
     * 批量插入
     * @param array $data 二维数组
     * @return boolean 成功返回true,失败返回false
     */
    public function addAll($data)
    {
        $firstRow = reset($data);
        if (!is_array($firstRow)) {
            return $this->add($data);
        }
        $columns = $this->getColumns();
        $fieldnames = $columns['names'];
        $this->primary = $columns['primary'];
 
        $fields = array_intersect($fieldnames, array_keys($firstRow));
        if (empty($fields)) {
            $this->error = 'There is no available fields!';
            return false;
        }
        $unseted = array_diff($columns['required'], $fields);
        if (sizeof($unseted)) {
            $this->error = 'Fields (' . implode(',', $unseted) . ') is required';
            return false;
        }
 
        //判断数据库类型。使用不同的拼凑方式
        $connection = $this->getWriteConnection();
        if ($connection->getType() == 'oci') {
            $num = 1;
            $data_count = count($data);
            foreach ($data as $row) {
                $value = array();
                foreach ($fields as $fieldname) {
                    $value[] = $this->sqlValidateValue($row[$fieldname]);
                }
 
                if ($data_count == $num) {
                    $values .= 'select ' . implode(',', $value) . ' from dual ';
                } else {
                    $values .= 'select ' . implode(',', $value) . ' from dual union all ';
                }
                $num++;
            }
            $sql = 'INSERT INTO ' . $this->getSource() . ' (' . implode(',', $fields) . ') ' . $values;
 
        } else {
            $values = array();
            foreach ($data as $row) {
                $value = array();
                foreach ($fields as $fieldname) {
                    $value[] = $this->sqlValidateValue($row[$fieldname]);
                }
                $values[] = '(' . implode(',', $value) . ')';
            }
            $sql = 'INSERT INTO ' . $this->getSource() . ' (' . implode(',', $fields) . ') VALUES ' . implode(',', $values);
 
        }
 
        try {
            $result = $connection->execute($sql);
            $result || ($this->error = implode('', $connection->getErrorInfo()));
        } catch (\PDOException $e) {
            $this->error = $e->getMessage();
        }
        return $result ? $connection->affectedRows() : false;
    }
 
    /**
     * 获取字段信息
     * @param bool $nocache 强制更新缓存
     * @return array 包含字段信息的数组
     */
    public function getColumns($nocache = false) {
        static $columns = array();
        $this->tableName && $this->setSource($this->tableName);
        $this->tableName || ($this->tableName = $this->getSource());
        if($columns[$this->tableName] && $nocache === false) return $columns[$this->tableName];
        $connection_service = $this->getReadConnectionService();
        $cache_key = $connection_service . '_' . $this->tableName . '.cloumns.cache';
        $cache = \Phalcon\DI::getDefault()->get('cache');
        $columns[$this->tableName] = $cache->get($cache_key);
        if($columns[$this->tableName] === null || $nocache === true) {
            
            $connection = $this->getReadConnection();
            if($connection->getType() == 'oci') {
                $columns[$this->tableName] = $this->_oci_columns();
            } else {
                $fields = $names = $required = $columns[$this->tableName] = array();
                $rows = $connection->describeColumns($this->tableName);
                if(is_array($rows) && sizeof($rows)) {
                    foreach($rows as $row) {
                        $isPrimary = $row->isPrimary();
                        $name = strtolower($row->getName());
                        $col = array(
                            'name'      => $name,
                            'type'      => $row->getType(),
                            'size'      => $row->getSize(),
                            'notnull'   => $row->isNotNull(),
                            'numeric'   => $row->isNumeric(),
                            'default'   => $row->getDefault(),
                            'primary'   => $isPrimary,
                        );
                        $fields[$name] = $col;
                        $names[] = $col['name'];
                        $isPrimary && ($this->primary = $col['name']);
                        ($col['notnull'] && is_null($col['default'])) && ($required[] = $col['name']);
                    }
 
                    $columns[$this->tableName] = array(
                        'fields'    => $fields,
                        'names'     => $names,
                        'required'  => $required,
                        'primary'   => $this->primary
                    );
                }
            }
            if($columns[$this->tableName]) {
                $cache->save($cache_key, $columns[$this->tableName]);
            }
        }
        return $columns[$this->tableName];
    }
 
    public function sqlValidateValue($var) {
        $var = $this->sqlEscape($var);
        if (is_null($var)) {
            return 'NULL';
        } else if (is_string($var)) {
            return "'" . $var . "'";
        } else {
            return (is_bool($var)) ? intval($var) : $var;
        }
    }
 
    public function sqlEscape($string) {
        $db_type = $this->getReadConnection()->getType();
        if ($db_type == 'pgsql') {
            return pg_escape_string($string);
        } else if ($db_type == 'oci') {
            return str_replace(array("'", "\0"), array("''", ''), $string);
        } else {
            return mysql_real_escape_string($string);
        }
    }
}
#4Baseapp\Models\ModelBase->Baseapp\Models\{closure}()
#5Phalcon\Di\Service->resolve(null, Object(Phalcon\Di\FactoryDefault))
#6Phalcon\Di->get(dbSource13, null)
#7Phalcon\Di->getShared(dbSource13)
#8Phalcon\Mvc\Model\Manager->_getConnection(Object(Baseapp\Models\SgsDepartments: 16), Array([baseapp\models\nodes] => dbSource4, [baseapp\models\sgsdepartments] => dbSource13))
#9Phalcon\Mvc\Model\Manager->getReadConnection(Object(Baseapp\Models\SgsDepartments: 16))
#10Phalcon\Mvc\Model->getReadConnection()
#11Phalcon\Mvc\Model\MetaData\Strategy\Introspection->getMetaData(Object(Baseapp\Models\SgsDepartments: 16), Object(Phalcon\Di\FactoryDefault))
#12Phalcon\Mvc\Model\MetaData->_initialize(Object(Baseapp\Models\SgsDepartments: 16), baseapp\models\sgsdepartments-zf_departments, zf_departments, )
#13Phalcon\Mvc\Model\MetaData->readMetaData(Object(Baseapp\Models\SgsDepartments: 16))
#14Phalcon\Mvc\Model\MetaData->hasAttribute(Object(Baseapp\Models\SgsDepartments: 16), code)
#15Phalcon\Mvc\Model\Query->_getQualified(Array([type] => 355, [name] => code))
#16Phalcon\Mvc\Model\Query->_getExpression(Array([type] => 355, [name] => code), true)
#17Phalcon\Mvc\Model\Query->_getExpression(Array([type] => 61, [left] => Array([type] => 355, [name] => code), [right] => Array([type] => 260, [value] => 007208162)))
#18Phalcon\Mvc\Model\Query->_prepareSelect()
#19Phalcon\Mvc\Model\Query->parse()
#20Phalcon\Mvc\Model\Query->execute()
#21Phalcon\Mvc\Model::findFirst(Array([0] => code ='007208162', [order] => orderby ASC,id ASC))
/data/html/newcms/application/common/models/SgsDepartments.php (69)
<?php
namespace Baseapp\Models;
 
class SgsDepartments extends ModelBase
{
    private static $cache_key = 'cache_sgsdepartments.cache';
 
    public function getSource()
    {
        $guid = 'sgs';
        $dbsource = Dbsources::findFirst("guid = '" . $guid . "'");
        if (!$dbsource) {
            return false;
        }
        $this->setDataConnect($dbsource->toArray());
 
        return "zf_departments";
    }
 
    /**
     * 获取所有部门信息
     * @return array 部门信息数组
     */
    public static function getDepartments()
    {
        $cache = \Phalcon\DI::getDefault()->get('cache');
        $departments = $cache->get(self::$cache_key);
        if ($departments === null) {
            $sd = new SgsDepartments();
            $departments = $sd->getSubDepartments();
            $cache->save(self::$cache_key, $departments);
        }
        return $departments;
    }
 
    /**
     * 查找指定$parent_id的下级部门
     * @param int $parent_id 上级部门ID
     * @param boolean $sub 是否列出所有下级部门
     * @return array 部门数组
     */
    public function getSubDepartments($parent_id = 0, $sub = true)
    {
        $departments = array();
        $rows = SgsDepartments::find(array('parent_id=' . intval($parent_id), 'order' => 'orderby ASC,id ASC'))->toArray();
        if (empty($rows)) {
            return $departments;
        }
        foreach ($rows as $row) {
            if ($sub !== false) {
                $level = ($sub === true) ? 0 : intval($sub);
                $subs = SgsDepartments::getSubDepartments($row['id'], $level + 1);
                $row['level'] = $level;
                $row['subs'] = $subs;
            }
            $departments[$row['id']] = $row;
            if ($sub === false) {
                continue;
            }
            foreach ($subs as $sub) {
                $departments[$sub['id']] = $sub;
            }
        }
        return $departments;
    }
 
    public function getDeptBycode($dept_code)
    {
        $rows = SgsDepartments::findFirst(array("code ='" . $dept_code . "'", 'order' => 'orderby ASC,id ASC'));
        if ($rows) {
            return $rows;
        } else {
            return '';
        }
    }
}
#22Baseapp\Models\SgsDepartments::getDeptBycode(007208162)
/data/html/newcms/application/frontend/controllers/SgsController.php (93)
<?php
namespace Baseapp\Frontend\Controllers;
 
use Baseapp\Includes\Functions;
use Baseapp\Models\SgsCatalogs;
use Baseapp\Models\SgsDatamodel;
use Baseapp\Models\SgsDepartments;
use Baseapp\Models\SgsGatherCf;
use Baseapp\Models\SgsGatherXk;
 
class SgsController extends ControllerBase
{
 
    public $source_db;
    public $gx_code = array(
        '441402' => '441402',
        '441421' => '441421',
        '441481' => '441481',
        '441426' => '441426',
        '441427' => '441427',
        '441422' => '441422',
        '441423' => '441423',
        '441424' => '441424',
        '007214503' => '007214503',
        '007211468' => '007211468',
        '007217501' => '007217501',
        '007221260' => '007221260',
        '007224488' => '007224488',
        '007227873' => '007227873',
        '007214503' => '007214503',
        '007235371' => '007235371',
    );
 
    public $db_config = array(
        'dbtype' => '',
        'host' => '',
        'dbname' => '',
        'username' => '',
        'password' => '',
        'other' => array('charset' => 'utf8')
    );
 
    public function initDb()
    {
        $dbsource = \Baseapp\Models\Dbsources::findFirst('guid="sgs"');
        if (!$dbsource) {
            return false;
        }
        $this->db_config['dbtype'] = $dbsource->dbtype;
        $this->db_config['host'] = $dbsource->host;
        $this->db_config['dbname'] = $dbsource->dbname;
        $this->db_config['username'] = $dbsource->username;
        $this->db_config['password'] = $dbsource->password;
        $this->source_db = Functions::instance()->db_connection($this->db_config['dbtype'], $this->db_config['host'], $this->db_config['username'], $this->db_config['password'], $this->db_config['dbname'], $this->db_config['other']);
    }
 
    public function initialize()
    {
        global $site_id;
 
//        $this->view->setVar('catalogs', \Baseapp\Models\Catalogs::find(array('import=1', 'order' => 'orderby asc')));
//
        \Baseapp\Library\Node::instance()->frontend_init($site_id);
        $node_ids = array(14, 64, 166, 292, 293);
 
        if ($node_ids) {
            foreach ($node_ids as $node_id) {
                $node = \Baseapp\Library\Node::instance()->getNodeInfo($node_id);
                $node['url'] = \Baseapp\Library\Cms::instance()->getNodeUrl($node, $site_id);
                $node['is_on'] = false;
                if ($node['node_code'] == 'zwgk') {
                    $node['is_on'] = true;
                }
                $node_list[$node_id] = $node;
            }
            $this->view->setVar('node_list', $node_list);
        }
        parent::initialize();
    }
 
 
    public function deptindexAction()
    {
        global $dept_id;
        global $site_id;
        $department_code = $this->request->get('deptId', 'string', '');
        $department_code || $department_code = $dept_id;
        if (!$department_code) {
            return $this->dispatcher->forward($this->error_forward);
        }
 
        $type = $this->request->get('type', 'string', 'xzxk');
        $department = SgsDepartments::getDeptBycode($department_code);
 
        $conditions = "department_code = '" . $department_code . "'";
 
    $xk_total = SgsGatherXk::count(array($conditions));
        $cf_total = SgsGatherCf::count(array($conditions));
 
        $this->view->setVars(array(
            'department_code' => $department_code,
            'department' => $department->toArray(),
            'type' => $type,
            'cf_total' => $cf_total,
            'xk_total' => $xk_total
        ));
        $this->view->pick('sgs/deptindex');
    }
 
    public function deptlistsAction()
    {
        $type = $this->request->get('type', 'string', 'xzxk');
        $type = Functions::instance()->checkSql($type);
        $page = $this->request->get('page', 'int', 1); // 当前第几页
        $page = $page < 1 ? 1 : $page;
        $pagesize = $this->request->get('pagesize', 'int', 10); // 每页条数
 
        $offset = ($page - 1) * $pagesize;
        if ($type == 'xzxk') {
            $model = new SgsGatherXk();
            $check_ok = true;
        } elseif ($type == 'xzcf') {
            $model = new SgsGatherCf();
            $check_ok = true;
        }
 
        if ($check_ok) {
            $conditions = '1=1';
            //查询条件
            //部门查询
            $department_code = $this->request->get('deptId', 'string', '');
            $department_code = Functions::instance()->checkSql($department_code);
            if ($department_code) {
                $conditions .= " AND department_code = '" . $department_code . "'";
            }
            $keyword = $this->request->get('keyWord', 'string', '');
            $keyword = Functions::instance()->checkSql($keyword);
            if ($keyword) {
                $conditions .= " AND title like '%" . $keyword . "%'";
            }
 
            $list = $model->find(array($conditions, 'columns' => 'xdr_mc,title,cid,model_code,ordertime', 'limit' => array("number" => $pagesize, "offset" => $offset), 'order' => 'ordertime desc'));
            $count = $model->count(array($conditions));
        }
 
        $max_len = 40;
        if (count($list)) {
            foreach ($list as $info) {
                $info = $info->toArray();
                $xdr_mc = ' 【' . $info['xdr_mc'] . '】';
                $len = \Baseapp\Includes\Tool::length_cn($xdr_mc);
                $title = \Baseapp\Includes\Tool::truncate_cn($info['title'], $max_len - $len);
                $info['title'] = $title . $xdr_mc;
                $lists[] = $info;
            }
            $list = new \Phalcon\Config($lists);
        }
        $this->view->setVars(array(
            'list' => $list,
            'total' => $count,
            'totalpage' => ceil($count / $pagesize),
            'pagesize' => $pagesize,
            'page' => $page,
            'type' => $type,
            'depid' => $department_code,
            'keyword' => $keyword,
        ));
    }
 
    public function getItems($column, $code)
    {
        $datamodel = SgsDatamodel::findFirst(array("name ='" . $code . "'"));
        $sql = 'SELECT * FROM zf_datamodel_fields where model_id=' . $datamodel->id . ' order by orderby asc';
        $rows = $this->source_db->fetchAll($sql);
        foreach ($rows as $var) {
            unset($var['id']);
            $items[$var['name']] = $var;
        }
        $added = array_diff($column, array_keys($items));
        if (is_array($added) && sizeof($added)) {
            foreach ($added as $fieldname) {
                if (in_array($fieldname,
                    array('id', 'catid', 'userid', 'department_code', 'addtime', 'signid', 'status', 'reporttime'))) {
                    continue;
                }
                $items[$fieldname] = array(
                    'name' => $fieldname,
                    'model_name' => $model_name
                );
            }
        }
        return $items;
    }
 
    public function contentAction()
    {
        $code = $this->request->get('code', 'string', '');
        $id = $this->request->get('id', 'int', 0);
 
        if (!$code || !$id) {
            return false;
        }
 
        $this->initDb();
        $table = 'zf_c_' . $code;
        $sql = 'SELECT * FROM ' . $table . ' where id=' . $id;
        $info = $this->source_db->fetchOne($sql);
 
        $info || $this->error('指定的信息不存在');
        $field_list = $this->getItems(array_keys($info), $code);
 
        $data = $this->cleanData($field_list, $info);
 
        $this->view->setVar('data', $data);
 
        if (strpos($code, 'xk') !== false) {
            $this->view->pick('sgs/content_xk');
        }
 
        if (strpos($code, 'cf') !== false) {
            $this->view->pick('sgs/content_cf');
        }
    }
 
    public function cleanData($field_list, $data)
    {
        foreach ($field_list as $filed_name => $filed_info) {
            $value = $filed_info['clean_method'] ? call_user_func_array(array($this, $filed_info['clean_method']), array($data, $filed_name)) : $data[$filed_name];
            $clean_data[$filed_name] = $value;
        }
        $clean_data['signid'] = $data['signid'];
        return $clean_data;
    }
 
    public function cleandate($data, $filed_name)
    {
        if (!$data[$filed_name]) {
            return '';
        }
 
        $replace = array('年', '月', '.', '-', '/');
        $str_time = str_replace($replace, '/', $data[$filed_name]);
        $str_time = str_replace('日', '', $str_time);
        $sjc_time = strtotime($str_time);
        if ($sjc_time >= 4102329600 || $sjc_time < 0) {
            return '长期';
        } else {
            return date("Y/m/d", $sjc_time);
        }
    }
 
    public function cleansjc($data, $filed_name)
    {
        if ($data['reporttime']) {
            return date("Y/m/d", $data['reporttime']);
        }
        return '';
    }
 
    public function cleandqzt($data, $filed_name)
    {
        $value = trim($data[$filed_name]);
        if (!$value) {
            return '正常';
        }
 
        if (is_numeric($value)) {
            switch ($value) {
                case 0:
                    return "正常";
                    break;
                case 1:
                    return "撤销";
                    break;
                case 2:
                    return "异议";
                    break;
            }
        }
 
        if (strpos($value, "正常") !== false) {
            return "正常";
        }
        if (strpos($value, "撤销") !== false) {
            return "撤销";
        }
        if (strpos($value, "异议") !== false) {
            return "异议";
        }
 
        return 3;
    }
}
#23Baseapp\Frontend\Controllers\SgsController->deptindexAction()
#24Phalcon\Dispatcher->callActionMethod(Object(Baseapp\Frontend\Controllers\SgsController), deptindexAction, Array())
#25Phalcon\Dispatcher->dispatch()
#26Phalcon\Mvc\Application->handle()
/data/html/newcms/website/mzsghj/index.php (26)
<?php
 
/**
 * 首页(index.php)
 *
 * @package     utab
 * @category    Running
 *
 */
error_reporting(E_ALL & ~E_NOTICE);
ini_set('default_charset', 'UTF-8');    //网站设置默认编码为UTF-8
ini_set("session.cookie_httponly", 1);
header('X-Frame-Options:SAMEORIGIN');
require_once 'config.php';
try {
    if (!defined('ROOT_PATH'))
  {
        define('ROOT_PATH', dirname(dirname(dirname(__FILE__))));
        define('WEB_PATH', dirname(dirname(__FILE__)));
    }
 
    require_once ROOT_PATH . '/application/Bootstrap.php';
 
    $app = new \Bootstrap(new \Phalcon\DI\FactoryDefault());
 
    echo $app->handle()->getContent();
    
} catch (\Phalcon\Exception $e) {
    Bootstrap::log($e);
} catch (\PDOException $e) {
    Bootstrap::log($e);
} catch (\Exception $e) {
    Bootstrap::log($e);
}
?>
KeyValue
_url/sgs/deptindex
KeyValue
USERwww
HOME/home/www
HTTP_IF_MODIFIED_SINCESun, 19 Nov 2017 05:03:37 GMT
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT_ENCODINGx-gzip, gzip, deflate
HTTP_HOSTwww.mzghj.gov.cn
REDIRECT_STATUS200
SERVER_NAMEwww.mzghj.gov.cn
SERVER_PORT80
SERVER_ADDR19.82.127.113
REMOTE_PORT37456
REMOTE_ADDR54.234.45.10
SERVER_SOFTWAREnginx/1.12.1
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.0
DOCUMENT_ROOT/data/html/newcms/website/mzsghj
DOCUMENT_URI/index.php
REQUEST_URI/sgs/deptindex
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/sgs/deptindex&
SCRIPT_FILENAME/data/html/newcms/website/mzsghj/index.php
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1516631850.9547
REQUEST_TIME1516631850
#Path
0/data/html/newcms/website/mzsghj/index.php
1/data/html/newcms/website/mzsghj/config.php
2/data/html/newcms/application/Bootstrap.php
3/data/html/newcms/application/common/config/config.php
4/data/html/newcms/application/common/includes/Constants.php
5/data/html/newcms/application/frontend/Module.php
6/data/html/newcms/application/common/smarty/Smarty.class.php
7/data/html/newcms/application/common/smarty/sysplugins/smarty_internal_data.php
8/data/html/newcms/application/common/smarty/sysplugins/smarty_internal_templatebase.php
9/data/html/newcms/application/common/smarty/sysplugins/smarty_internal_template.php
10/data/html/newcms/application/common/smarty/sysplugins/smarty_resource.php
11/data/html/newcms/application/common/smarty/sysplugins/smarty_internal_resource_file.php
12/data/html/newcms/application/common/smarty/sysplugins/smarty_cacheresource.php
13/data/html/newcms/application/common/smarty/sysplugins/smarty_internal_cacheresource_file.php
14/data/html/newcms/application/common/includes/MobileDetect.php
15/data/html/newcms/application/frontend/controllers/SgsController.php
16/data/html/newcms/application/frontend/controllers/ControllerBase.php
17/data/html/newcms/application/common/library/Node.php
18/data/html/newcms/application/common/library/Auth.php
19/data/html/newcms/application/common/library/Cache.php
20/data/html/newcms/application/common/models/Nodes.php
21/data/html/newcms/application/common/library/Cms.php
22/data/html/newcms/application/common/includes/Functions.php
23/data/html/newcms/application/common/models/SgsDepartments.php
24/data/html/newcms/application/common/models/ModelBase.php
25/data/html/newcms/application/common/models/Dbsources.php
Memory
Usage4194304