@@ -12,26 +12,26 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Bootstrap |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * <p>Comando para levantar el autoloader</p> |
|
| 17 | - */ |
|
| 18 | - static public function go() |
|
| 19 | - { |
|
| 20 | - // Make everything relative to the root |
|
| 21 | - chdir(dirname(__DIR__)); |
|
| 22 | - // Setup autoloading |
|
| 23 | - require_once( __DIR__ . '/vendor/autoload.php' ); |
|
| 24 | - } |
|
| 25 | - /** |
|
| 26 | - * Carga Archivo de Configuración |
|
| 27 | - * en la seccion de Pruebas. |
|
| 28 | - */ |
|
| 29 | - static public function getConfig() |
|
| 30 | - { |
|
| 31 | - if(file_exists(__DIR__.'/config/local.php')){ |
|
| 32 | - return include __DIR__.'/config/local.php'; |
|
| 33 | - } |
|
| 34 | - return include __DIR__.'/config/production.php'; |
|
| 35 | - } |
|
| 15 | + /** |
|
| 16 | + * <p>Comando para levantar el autoloader</p> |
|
| 17 | + */ |
|
| 18 | + static public function go() |
|
| 19 | + { |
|
| 20 | + // Make everything relative to the root |
|
| 21 | + chdir(dirname(__DIR__)); |
|
| 22 | + // Setup autoloading |
|
| 23 | + require_once( __DIR__ . '/vendor/autoload.php' ); |
|
| 24 | + } |
|
| 25 | + /** |
|
| 26 | + * Carga Archivo de Configuración |
|
| 27 | + * en la seccion de Pruebas. |
|
| 28 | + */ |
|
| 29 | + static public function getConfig() |
|
| 30 | + { |
|
| 31 | + if(file_exists(__DIR__.'/config/local.php')){ |
|
| 32 | + return include __DIR__.'/config/local.php'; |
|
| 33 | + } |
|
| 34 | + return include __DIR__.'/config/production.php'; |
|
| 35 | + } |
|
| 36 | 36 | } |
| 37 | 37 | Bootstrap::go(); |
| 38 | 38 | \ No newline at end of file |
@@ -53,67 +53,67 @@ discard block |
||
| 53 | 53 | * @link https://codeigniter.com/user_guide/database/ |
| 54 | 54 | */ |
| 55 | 55 | class CI_DB_mysqli_driver extends CI_DB_driver { |
| 56 | - /** |
|
| 57 | - * Database driver |
|
| 58 | - * |
|
| 59 | - * @var string |
|
| 60 | - */ |
|
| 61 | - public $dbdriver = 'mysqli'; |
|
| 62 | - /** |
|
| 63 | - * Compression flag |
|
| 64 | - * |
|
| 65 | - * @var bool |
|
| 66 | - */ |
|
| 67 | - public $compress = FALSE; |
|
| 68 | - /** |
|
| 69 | - * DELETE hack flag |
|
| 70 | - * |
|
| 71 | - * Whether to use the MySQL "delete hack" which allows the number |
|
| 72 | - * of affected rows to be shown. Uses a preg_replace when enabled, |
|
| 73 | - * adding a bit more processing to all queries. |
|
| 74 | - * |
|
| 75 | - * @var bool |
|
| 76 | - */ |
|
| 77 | - public $delete_hack = TRUE; |
|
| 78 | - /** |
|
| 79 | - * Strict ON flag |
|
| 80 | - * |
|
| 81 | - * Whether we're running in strict SQL mode. |
|
| 82 | - * |
|
| 83 | - * @var bool |
|
| 84 | - */ |
|
| 85 | - public $stricton; |
|
| 86 | - /** |
|
| 87 | - * Identifier escape character |
|
| 88 | - * |
|
| 89 | - * @var string |
|
| 90 | - */ |
|
| 91 | - protected $_escape_char = '`'; |
|
| 92 | - /** |
|
| 93 | - * MySQLi object |
|
| 94 | - * |
|
| 95 | - * Has to be preserved without being assigned to $conn_id. |
|
| 96 | - * |
|
| 97 | - * @var MySQLi |
|
| 98 | - */ |
|
| 99 | - protected $_mysqli; |
|
| 100 | - /** |
|
| 101 | - * |
|
| 102 | - * @param array $params |
|
| 103 | - */ |
|
| 104 | - public function __construct(array $params) |
|
| 105 | - { |
|
| 106 | - parent::__construct($params); |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * Database connection |
|
| 111 | - * |
|
| 112 | - * @param bool $persistent |
|
| 113 | - * @return object |
|
| 114 | - **/ |
|
| 115 | - public function db_connect($persistent = FALSE) |
|
| 116 | - { |
|
| 56 | + /** |
|
| 57 | + * Database driver |
|
| 58 | + * |
|
| 59 | + * @var string |
|
| 60 | + */ |
|
| 61 | + public $dbdriver = 'mysqli'; |
|
| 62 | + /** |
|
| 63 | + * Compression flag |
|
| 64 | + * |
|
| 65 | + * @var bool |
|
| 66 | + */ |
|
| 67 | + public $compress = FALSE; |
|
| 68 | + /** |
|
| 69 | + * DELETE hack flag |
|
| 70 | + * |
|
| 71 | + * Whether to use the MySQL "delete hack" which allows the number |
|
| 72 | + * of affected rows to be shown. Uses a preg_replace when enabled, |
|
| 73 | + * adding a bit more processing to all queries. |
|
| 74 | + * |
|
| 75 | + * @var bool |
|
| 76 | + */ |
|
| 77 | + public $delete_hack = TRUE; |
|
| 78 | + /** |
|
| 79 | + * Strict ON flag |
|
| 80 | + * |
|
| 81 | + * Whether we're running in strict SQL mode. |
|
| 82 | + * |
|
| 83 | + * @var bool |
|
| 84 | + */ |
|
| 85 | + public $stricton; |
|
| 86 | + /** |
|
| 87 | + * Identifier escape character |
|
| 88 | + * |
|
| 89 | + * @var string |
|
| 90 | + */ |
|
| 91 | + protected $_escape_char = '`'; |
|
| 92 | + /** |
|
| 93 | + * MySQLi object |
|
| 94 | + * |
|
| 95 | + * Has to be preserved without being assigned to $conn_id. |
|
| 96 | + * |
|
| 97 | + * @var MySQLi |
|
| 98 | + */ |
|
| 99 | + protected $_mysqli; |
|
| 100 | + /** |
|
| 101 | + * |
|
| 102 | + * @param array $params |
|
| 103 | + */ |
|
| 104 | + public function __construct(array $params) |
|
| 105 | + { |
|
| 106 | + parent::__construct($params); |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * Database connection |
|
| 111 | + * |
|
| 112 | + * @param bool $persistent |
|
| 113 | + * @return object |
|
| 114 | + **/ |
|
| 115 | + public function db_connect($persistent = FALSE) |
|
| 116 | + { |
|
| 117 | 117 | // Do we have a socket path? |
| 118 | 118 | if ($this->hostname[0] === '/') |
| 119 | 119 | { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | return FALSE; |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | 219 | // -------------------------------------------------------------------- |
| 220 | 220 | |
@@ -225,36 +225,36 @@ |
||
| 225 | 225 | |
| 226 | 226 | // -------------------------------------------------------------------- |
| 227 | 227 | |
| 228 | - /** |
|
| 229 | - * Generate CSV from a query result object |
|
| 230 | - * |
|
| 231 | - * @param object $query Query result object |
|
| 232 | - * @param string $delim Delimiter (default: ,) |
|
| 233 | - * @param string $newline Newline character (default: \n) |
|
| 234 | - * @param string $enclosure Enclosure (default: ") |
|
| 235 | - * @return string |
|
| 236 | - */ |
|
| 237 | - public function csv_from_result($query, $delim = ',', $newline = "\n", $enclosure = '"') |
|
| 238 | - { |
|
| 239 | - if ( ! is_object($query) OR ! method_exists($query, 'list_fields')) { |
|
| 240 | - error_log('You must submit a valid result object'); |
|
| 241 | - } |
|
| 242 | - $out = ''; |
|
| 243 | - // First generate the headings from the table column names |
|
| 244 | - foreach ($query->list_fields() as $name) { |
|
| 245 | - $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim; |
|
| 246 | - } |
|
| 247 | - $out = substr($out, 0, -strlen($delim)).$newline; |
|
| 248 | - // Next blast through the result array and build out the rows |
|
| 249 | - while ($row = $query->unbuffered_row('array')) { |
|
| 250 | - $line = array(); |
|
| 251 | - foreach ($row as $ite) { |
|
| 252 | - $line[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure; |
|
| 253 | - } |
|
| 254 | - $out .= implode($delim, $line).$newline; |
|
| 255 | - } |
|
| 256 | - return $out; |
|
| 257 | - } |
|
| 228 | + /** |
|
| 229 | + * Generate CSV from a query result object |
|
| 230 | + * |
|
| 231 | + * @param object $query Query result object |
|
| 232 | + * @param string $delim Delimiter (default: ,) |
|
| 233 | + * @param string $newline Newline character (default: \n) |
|
| 234 | + * @param string $enclosure Enclosure (default: ") |
|
| 235 | + * @return string |
|
| 236 | + */ |
|
| 237 | + public function csv_from_result($query, $delim = ',', $newline = "\n", $enclosure = '"') |
|
| 238 | + { |
|
| 239 | + if ( ! is_object($query) OR ! method_exists($query, 'list_fields')) { |
|
| 240 | + error_log('You must submit a valid result object'); |
|
| 241 | + } |
|
| 242 | + $out = ''; |
|
| 243 | + // First generate the headings from the table column names |
|
| 244 | + foreach ($query->list_fields() as $name) { |
|
| 245 | + $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim; |
|
| 246 | + } |
|
| 247 | + $out = substr($out, 0, -strlen($delim)).$newline; |
|
| 248 | + // Next blast through the result array and build out the rows |
|
| 249 | + while ($row = $query->unbuffered_row('array')) { |
|
| 250 | + $line = array(); |
|
| 251 | + foreach ($row as $ite) { |
|
| 252 | + $line[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure; |
|
| 253 | + } |
|
| 254 | + $out .= implode($delim, $line).$newline; |
|
| 255 | + } |
|
| 256 | + return $out; |
|
| 257 | + } |
|
| 258 | 258 | |
| 259 | 259 | // -------------------------------------------------------------------- |
| 260 | 260 | |
@@ -60,21 +60,21 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @var string |
| 62 | 62 | */ |
| 63 | - protected $_list_databases = FALSE; |
|
| 63 | + protected $_list_databases = FALSE; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * OPTIMIZE TABLE statement |
| 67 | 67 | * |
| 68 | 68 | * @var string |
| 69 | 69 | */ |
| 70 | - protected $_optimize_table = FALSE; |
|
| 70 | + protected $_optimize_table = FALSE; |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * REPAIR TABLE statement |
| 74 | 74 | * |
| 75 | 75 | * @var string |
| 76 | 76 | */ |
| 77 | - protected $_repair_table = FALSE; |
|
| 77 | + protected $_repair_table = FALSE; |
|
| 78 | 78 | |
| 79 | 79 | // -------------------------------------------------------------------- |
| 80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function __construct(&$db) |
| 88 | 88 | { |
| 89 | - $this->db =& $db; |
|
| 89 | + $this->db = & $db; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // -------------------------------------------------------------------- |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | // Load the Zip class and output it |
| 398 | - $CI =& get_instance(); |
|
| 398 | + $CI = & get_instance(); |
|
| 399 | 399 | $CI->load->library('zip'); |
| 400 | 400 | $CI->zip->add_data($prefs['filename'], $this->_backup($prefs)); |
| 401 | 401 | return $CI->zip->get_zip(); |