-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
515 changed files
with
242,153 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | ||
|
||
class MY_Output extends CI_Output | ||
{ | ||
function encode_output($output, $type) | ||
{ | ||
switch($type) | ||
{ | ||
case 'json': | ||
$this->set_content_type('text/json'); | ||
return json_encode($output); | ||
break; | ||
|
||
default: | ||
print_r(func_get_args()); | ||
break; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
function quick_html_escape($input, $ignore = array()) | ||
{ | ||
if(is_array($input) || is_object($input)) | ||
{ | ||
$input = (array)$input; | ||
foreach($input as $key => $value) | ||
if(!in_array($key, $ignore)) | ||
$input[$key] = quick_html_escape($value); | ||
|
||
return $input; | ||
} | ||
else | ||
return htmlentities($input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -852,4 +852,4 @@ private function _parse_segments($segments) | |
|
||
} | ||
|
||
/* End of file Tags.php */ | ||
/* End of file Tags.php */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
RewriteEngine on | ||
RewriteRule ^$ /a3m_peanutbutter/index.php [L] | ||
RewriteCond $1 !^(index\.php|resource|system|user_guide|robots\.txt|favicon\.ico) | ||
RewriteRule ^(.*)$ /a3m_peanutbutter/index.php/$1 [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
class Auth_install | ||
{ | ||
function __construct() | ||
{ | ||
$this->CI =& get_instance(); | ||
$this->CI->load->database(); | ||
$this->CI->load->dbforge(); | ||
} | ||
|
||
function install() | ||
{ | ||
$this->install_tables(); | ||
$this->install_data(); | ||
} | ||
|
||
function install_tables() | ||
{ | ||
$tables = include dirname(__file__).'/default_tables.php'; | ||
|
||
foreach($tables as $name => $table) | ||
{ | ||
$meta = array(); | ||
|
||
if(isset($table['META'])) | ||
{ | ||
$meta = $table['META']; | ||
unset($table['META']); | ||
} | ||
|
||
$this->CI->dbforge->add_field($table); | ||
|
||
if(isset($meta['KEYS'])) | ||
foreach($meta['KEYS'] as $field => $keytype) | ||
switch($keytype) | ||
{ | ||
case 'PRIMARY': | ||
$this->CI->dbforge->add_key($field, true); | ||
break; | ||
|
||
case 'UNIQUE': | ||
case 'KEY': | ||
$this->CI->dbforge->add_key($field) | ||
break; | ||
} | ||
|
||
|
||
$this->CI->dbforge->create_table($name); | ||
|
||
unset($meta); | ||
} | ||
} | ||
|
||
function install_data() | ||
{ | ||
$data = include dirname(__file__).'/default_data.php'; | ||
|
||
foreach($data as $tablename => $table) | ||
$this->CI->db->insert_batch($tablename, $table); | ||
} | ||
|
||
function uninstall() | ||
{ | ||
$this->backup(); | ||
$this->uninstall_data(); | ||
$this->uninstall_tables(); | ||
} | ||
|
||
function uninstall_tables() | ||
{ | ||
$tables = include dirname(__file__).'/default_tables.php'; | ||
|
||
foreach($tables as $tablename => $_) | ||
$this->CI->dbforge->drop_table($tablename); | ||
} | ||
|
||
function uninstall_data() | ||
{ | ||
$tables = include dirname(__file__).'/default_tables.php'; | ||
|
||
foreach($tables as $tablename => $_) | ||
$this->CI->db->truncate($tablename); | ||
} | ||
|
||
function backup() | ||
{ | ||
$this->CI->load->dbutil(); | ||
|
||
$backup =& $this->CI->dbutil->backup(); | ||
/* | ||
$this->CI->load->helper('file'); | ||
write_file(dirname(__file__).'/backup.gz', $backup); | ||
*/ | ||
$this->load->helper('download'); | ||
force_download('backup.gz', $backup); | ||
} | ||
} |
Oops, something went wrong.