From 2eaa4074ea007cec58a802f591b4641b043213d1 Mon Sep 17 00:00:00 2001
From: Greg Aker
Date: Tue, 21 Dec 2010 11:44:08 -0600
Subject: Moving system/{logs,cache} to the application directory.
---
application/cache/.htaccess | 1 +
application/cache/index.html | 10 ++++++++++
application/logs/index.html | 10 ++++++++++
system/cache/.htaccess | 1 -
system/cache/index.html | 10 ----------
system/core/Output.php | 4 ++--
system/libraries/Log.php | 19 +++++++++----------
system/logs/index.html | 10 ----------
user_guide/changelog.html | 1 +
9 files changed, 33 insertions(+), 33 deletions(-)
create mode 100644 application/cache/.htaccess
create mode 100644 application/cache/index.html
create mode 100644 application/logs/index.html
delete mode 100644 system/cache/.htaccess
delete mode 100644 system/cache/index.html
delete mode 100644 system/logs/index.html
diff --git a/application/cache/.htaccess b/application/cache/.htaccess
new file mode 100644
index 000000000..3418e55a6
--- /dev/null
+++ b/application/cache/.htaccess
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
diff --git a/application/cache/index.html b/application/cache/index.html
new file mode 100644
index 000000000..c942a79ce
--- /dev/null
+++ b/application/cache/index.html
@@ -0,0 +1,10 @@
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
\ No newline at end of file
diff --git a/application/logs/index.html b/application/logs/index.html
new file mode 100644
index 000000000..c942a79ce
--- /dev/null
+++ b/application/logs/index.html
@@ -0,0 +1,10 @@
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
\ No newline at end of file
diff --git a/system/cache/.htaccess b/system/cache/.htaccess
deleted file mode 100644
index 3418e55a6..000000000
--- a/system/cache/.htaccess
+++ /dev/null
@@ -1 +0,0 @@
-deny from all
\ No newline at end of file
diff --git a/system/cache/index.html b/system/cache/index.html
deleted file mode 100644
index c942a79ce..000000000
--- a/system/cache/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- 403 Forbidden
-
-
-
-Directory access is forbidden.
-
-
-
\ No newline at end of file
diff --git a/system/core/Output.php b/system/core/Output.php
index 0b708e110..c83b90f00 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -347,7 +347,7 @@ class CI_Output {
$CI =& get_instance();
$path = $CI->config->item('cache_path');
- $cache_path = ($path == '') ? BASEPATH.'cache/' : $path;
+ $cache_path = ($path == '') ? APPPATH.'cache/' : $path;
if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
{
@@ -395,7 +395,7 @@ class CI_Output {
*/
function _display_cache(&$CFG, &$URI)
{
- $cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path');
+ $cache_path = ($CFG->item('cache_path') == '') ? APPPATH.'cache/' : $CFG->item('cache_path');
// Build the file path. The file name is an MD5 hash of the full URI
$uri = $CFG->item('base_url').
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index 6d44cfa4b..cb160a934 100644
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -26,11 +26,11 @@
*/
class CI_Log {
- var $log_path;
- var $_threshold = 1;
- var $_date_fmt = 'Y-m-d H:i:s';
- var $_enabled = TRUE;
- var $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
+ protected $_log_path;
+ protected $_threshold = 1;
+ protected $_date_fmt = 'Y-m-d H:i:s';
+ protected $_enabled = TRUE;
+ protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
/**
* Constructor
@@ -39,9 +39,9 @@ class CI_Log {
{
$config =& get_config();
- $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/';
+ $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/';
- if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path))
+ if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path))
{
$this->_enabled = FALSE;
}
@@ -64,13 +64,12 @@ class CI_Log {
*
* Generally this function will be called using the global log_message() function
*
- * @access public
* @param string the error level
* @param string the error message
* @param bool whether the error is a native PHP error
* @return bool
*/
- function write_log($level = 'error', $msg, $php_error = FALSE)
+ public function write_log($level = 'error', $msg, $php_error = FALSE)
{
if ($this->_enabled === FALSE)
{
@@ -84,7 +83,7 @@ class CI_Log {
return FALSE;
}
- $filepath = $this->log_path.'log-'.date('Y-m-d').EXT;
+ $filepath = $this->_log_path.'log-'.date('Y-m-d').EXT;
$message = '';
if ( ! file_exists($filepath))
diff --git a/system/logs/index.html b/system/logs/index.html
deleted file mode 100644
index c942a79ce..000000000
--- a/system/logs/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- 403 Forbidden
-
-
-
-Directory access is forbidden.
-
-
-
\ No newline at end of file
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 68abaff27..251f6fbd9 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -69,6 +69,7 @@ Hg Tag:
Plugins have been removed, in favor of Helpers. The CAPTCHA plugin has been converted to a Helper and documented. The JavaScript calendar plugin was removed due to the ready availability of great JavaScript calendars, particularly with jQuery.
Added new special Library type: Drivers.
Moved the application folder outside of the system folder.
+ Moved system/cache and system/logs directories to the application directory.
Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per "index" file basis.
Added the ability to set config values (or override config values) directly from data set in the main index.php file. This allows a single application to be used with multiple front controllers, each having its own config values.
Added $config['directory_trigger'] to the config file so that a controller sub-directory can be specified when running _GET strings instead of URI segments.
--
cgit v1.2.3-24-g4f1b