Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
41
application/core/MY_Controller.php
Normal file
41
application/core/MY_Controller.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class MY_Controller extends CI_Controller
|
||||
{
|
||||
protected $rtn = ['ok' => true, 'msg' => ''];
|
||||
protected $classes = [];
|
||||
|
||||
/**
|
||||
* MY_Controller constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// var_dump(get_cookie('bs_admin'));die;
|
||||
if (!get_cookie('bs_admin')) {
|
||||
redirect('/');
|
||||
}
|
||||
// $this->load->database();
|
||||
}
|
||||
|
||||
public function getPage($func_name)
|
||||
{
|
||||
return strtolower(get_class($this)) . DIRECTORY_SEPARATOR . strtolower($func_name);
|
||||
}
|
||||
|
||||
protected function &getClass($package, $class, $args = array())
|
||||
{
|
||||
if (empty($this->classes[$package . $class]))
|
||||
$this->classes[$package . $class] = $this->classloader->load($package, $class, $args);
|
||||
return $this->classes[$package . $class];
|
||||
}
|
||||
|
||||
protected function response($body)
|
||||
{
|
||||
$this->output
|
||||
->set_status_header(200)
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($body));
|
||||
}
|
||||
}
|
||||
28
application/core/MY_Model.php
Normal file
28
application/core/MY_Model.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Jeonghwa Koo
|
||||
* Date: 2016-11-07
|
||||
* Time: 오후 9:54
|
||||
*/
|
||||
class MY_Model extends CI_Model
|
||||
{
|
||||
protected $db_session = [];
|
||||
protected $date;
|
||||
/**
|
||||
* MY_Model constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->date = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
protected function & getSession($config) {
|
||||
if(!isset($this->db_session[$config]))
|
||||
$this->db_session[$config] = $this->load->database($config, true) or die('Database Connection isn\'t established');
|
||||
return $this->db_session[$config];
|
||||
}
|
||||
}
|
||||
11
application/core/index.html
Normal file
11
application/core/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user