Log message #4209627

# At Username Text
# Oct 18th 2019, 18:52 daniel.upshaw Sorry, hmm
# Oct 18th 2019, 18:52 daniel.upshaw Oh
# Oct 18th 2019, 18:52 daniel.upshaw @ron.rattie Probably should be `class AuditTrailsController`
# Oct 18th 2019, 18:52 slackebot1 <ron.rattie>
# Oct 18th 2019, 18:52 ron.rattie Okay.. updated the routes to use scope instead of get and I see these:
# Oct 18th 2019, 18:51 daniel.upshaw @ndm, looks like a handy CLI function, nice
# Oct 18th 2019, 18:21 ndm You probably have other routes that are catching the URL. Use the routes shell (`bin/cake routes`) to get a list of routes in the connected order.
# Oct 18th 2019, 18:18 slackebot1 'MspPivotActivityLogDetails' ] ] ); $this->set('logs', $query); }
# Oct 18th 2019, 18:18 ron.rattie namespace AuditTrails\Controller; use AuditTrails\Controller\AppController; use Cake\ORM\TableRegistry; class LogsController extends AppController { public function index() { $AuditTrailsLog = TableRegistry::getTableLocator()->get('AuditTrails.MspPivotActivityLog'); $query = $AuditTrailsLog->find( 'all', [ 'contain' => [ 'MspPivotActivityLogRequest',
# Oct 18th 2019, 18:18 ron.rattie My Logs controller has this:
# Oct 18th 2019, 18:17 ron.rattie use Cake\Routing\RouteBuilder; use Cake\Routing\Router; use Cake\Routing\Route\DashedRoute; Router::plugin( 'AuditTrails', ['path' => '/audit-trails'], function ($routes) { $routes->get('/logs', ['controller' => 'Logs']); } );
# Oct 18th 2019, 18:16 ron.rattie This is the router for the plugin:
# Oct 18th 2019, 18:16 ron.rattie Hey, I have a routing question I think. I have a plugin "Audit Trails" with a controller "Logs" with an index function. When I go to /audit-trails/logs I see "Controller class AuditTrails could not be found".
# Oct 18th 2019, 16:48 daniel.upshaw I bet my routes issue is that this project uses `"cakephp/cakephp": "3.5.*"`
# Oct 18th 2019, 16:19 neothermic sweet, init was the key
# Oct 18th 2019, 16:18 daniel.upshaw You might have to `use` the trait in the `Table` class
# Oct 18th 2019, 16:17 noel I'm trying to get friendsofcake/Search and friendsofcake/crud-json-api to work together. What isn't clear is how to make a search request? Is this documented somewhere? I'm assuming it would be GET request using a query string but I'm getting an error `Missing Search.Search behavior on App\\Model\\Table\\CocktailsTable`
# Oct 18th 2019, 16:17 neothermic ```This branch is for CakePHP 3.4 and newer```
# Oct 18th 2019, 16:17 steinkel https://github.com/jippi/cakephp-newrelic/tree/cake3
# Oct 18th 2019, 16:16 neothermic (I'm aware that there's a middelware for this, but that one needs cake 3.6 and PHP 7.1+... and yeah.)
# Oct 18th 2019, 16:16 steinkel there's also a plugin for that I've used time ago...
# Oct 18th 2019, 16:16 steinkel middleware after routing middleware would work
# Oct 18th 2019, 16:16 steinkel because AppController happens now much deeper in the stack, Middleware sound like a good place for non cake stuff happening in the request
# Oct 18th 2019, 16:16 neothermic I need to construct enough of a path to be able to name the transaction for newrelic
# Oct 18th 2019, 16:15 noel Hi all
# Oct 18th 2019, 16:14 steinkel what do you need to inject?
# Oct 18th 2019, 16:14 daniel.upshaw Niiiice
# Oct 18th 2019, 16:14 neothermic been using cake since 1.3 :)
# Oct 18th 2019, 16:14 daniel.upshaw Lol I wish I could say that I've been a Cake dev that long.. PHP since v4, but I've only discovered the magic of Cake within the past year or so
# Oct 18th 2019, 16:13 neothermic very dirty
# Oct 18th 2019, 16:13 neothermic in 2.x I went into invokeAction() in Controller.php :)
# Oct 18th 2019, 16:13 daniel.upshaw If you need the request object, seems like you found a good way to do it
# Oct 18th 2019, 16:12 neothermic in cake2, I hijacked core code
# Oct 18th 2019, 16:12 daniel.upshaw Ah
# Oct 18th 2019, 16:12 neothermic so it can't be too high up
# Oct 18th 2019, 16:12 neothermic I need the request object to be a thing :slightly_smiling_face:
# Oct 18th 2019, 16:12 daniel.upshaw Oh, and `bootstrap()` in `Application.php`
# Oct 18th 2019, 16:12 daniel.upshaw `initialize()` seems a pretty clean way
# Oct 18th 2019, 16:12 daniel.upshaw Ah there's also `bootstrap.php`
# Oct 18th 2019, 16:12 neothermic if I find edge cases I'll look into a middleware
# Oct 18th 2019, 16:11 neothermic I'm hoping that init is high enough for what I'm doing