Close #5330
diff --git a/system/core/Loader.php b/system/core/Loader.php
index fe2d437..9813e99 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -303,6 +303,8 @@
{
throw new RuntimeException($app_path."Model.php exists, but doesn't declare class CI_Model");
}
+
+ log_message('info', 'CI_Model class loaded');
}
elseif ( ! class_exists('CI_Model', FALSE))
{
@@ -317,6 +319,8 @@
{
throw new RuntimeException($app_path.$class.".php exists, but doesn't declare class ".$class);
}
+
+ log_message('info', config_item('subclass_prefix').'Model class loaded');
}
}
@@ -350,7 +354,9 @@
}
$this->_ci_models[] = $name;
- $CI->$name = new $model();
+ $model = new $model();
+ $CI->$name = $model;
+ log_message('info', 'Model "'.get_class($model).'" initialized');
return $this;
}
diff --git a/system/core/Model.php b/system/core/Model.php
index c809e7b..691053a 100644
--- a/system/core/Model.php
+++ b/system/core/Model.php
@@ -49,18 +49,6 @@
class CI_Model {
/**
- * Class constructor
- *
- * @return void
- */
- public function __construct()
- {
- log_message('info', 'Model Class Initialized');
- }
-
- // --------------------------------------------------------------------
-
- /**
* __get magic
*
* Allows models to access CI's loaded classes using the same
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 1641f7c..1c35d90 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -11,6 +11,7 @@
- Updated :doc:`Form Validation Library <libraries/form_validation>` rule ``valid_email`` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
- Updated :doc:`Email Library <libraries/email>` to use ``INTL_IDNA_VARIANT_UTS46`` for non-ASCII domain names.
+ - Updated :doc:`Loader Library <libraries/loader>` method ``model()`` to log both ``CI_Model`` class loading and individual models' initialization.
- Deprecated usage of :doc:`CAPTCHA Helper <helpers/captcha_helper>` function :php:func:`create_captcha()` with parameters other than ``$data``.
Bug fixes for 3.1.7