Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Optionally track controller and action #3

Closed
adamthehutt opened this issue Mar 24, 2011 · 2 comments
Closed

Optionally track controller and action #3

adamthehutt opened this issue Mar 24, 2011 · 2 comments

Comments

@adamthehutt
Copy link

Exceptional uses the controller and action parameters as part of the data it uses to group exceptions. For this and other reasons, it would be nice to be able to track that information when applicable. I've made a few small changes (quasi-diff below) to support this, which you might consider adding to the official distribution. With this change, one can simply assign Exceptional::$controller and/or Exceptional::$action to have that data passed along to the service.

exceptional.php: 
+    static $controller = "";
+    static $action = "";

exceptional/exceptional/data.php:
         $data["request"] = array(
             "url" => "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]",
-            "controller" => "",
-            "action" => "",
+            "controller" => Exceptional::$controller,
+            "action" => Exceptional::$action,
             "parameters" => $params,
             "request_method" => strtolower($_SERVER["REQUEST_METHOD"]),
             "remote_ip" => $_SERVER["REMOTE_ADDR"],
@ankane
Copy link
Owner

ankane commented Apr 9, 2011

Great suggestion Adam! It's been added to the latest commit.

@ankane ankane closed this as completed Apr 9, 2011
@tjchambers
Copy link

In researching another issue I noted that my $controller was not being passed to Exceptional. Turns out while the and/or was mentioned in the issues above, implementation of this require BOTH ACTION AND CONTROLLER to be specified. Specifying one without the other does not pass either.

It seems logical that this should allow passing either $controller or $action individually if either are set. I say this because I am using them as a tracking device for the package the error originated from and only need one set (could set the other with a dummy value but...).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants