File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ abstract class REST_Controller extends CI_Controller
7474 */
7575 protected $ _post_args = array ();
7676
77+ /**
78+ * The insert_id of the log entry (if we have one)
79+ *
80+ * @var string
81+ */
82+ protected $ _insert_id = '' ;
83+
7784 /**
7885 * The arguments for the PUT request method
7986 *
@@ -742,7 +749,7 @@ protected function _detect_lang()
742749 */
743750 protected function _log_request ($ authorized = FALSE )
744751 {
745- return $ this ->rest ->db ->insert (config_item ('rest_logs_table ' ), array (
752+ $ status = $ this ->rest ->db ->insert (config_item ('rest_logs_table ' ), array (
746753 'uri ' => $ this ->uri ->uri_string (),
747754 'method ' => $ this ->request ->method ,
748755 'params ' => $ this ->_args ? (config_item ('rest_logs_json_params ' ) ? json_encode ($ this ->_args ) : serialize ($ this ->_args )) : null ,
@@ -751,6 +758,9 @@ protected function _log_request($authorized = FALSE)
751758 'time ' => function_exists ('now ' ) ? now () : time (),
752759 'authorized ' => $ authorized
753760 ));
761+
762+ $ this ->_insert_id = $ this ->rest ->db ->insert_id ();
763+ return $ statusl
754764 }
755765
756766 /**
You can’t perform that action at this time.
0 commit comments