# |
Aug 21st 2019, 15:54 |
daniel.upshaw |
Still, it's an oddity to be on the lookout for |
# |
Aug 21st 2019, 15:53 |
daniel.upshaw |
Sorry about the PEBCAC issue @admad |
# |
Aug 21st 2019, 15:52 |
daniel.upshaw |
The custom route didn't seem to be the culprit, but it was and in an unexpected place -- there's presumably no caching taking place there |
# |
Aug 21st 2019, 15:52 |
daniel.upshaw |
I didn't notice it because disabling cache in the custom route didn't seem to have an effect |
# |
Aug 21st 2019, 15:52 |
daniel.upshaw |
``` public function __construct($template, $defaults = [], array $options = []) { parent::__construct($template, $defaults, $options); $this->redirectMapTable = TableRegistry::getTableLocator()->get('RedirectMap'); }``` |
# |
Aug 21st 2019, 15:51 |
daniel.upshaw |
It seems the problem was caused by this part of a custom route |
# |
Aug 21st 2019, 15:51 |
daniel.upshaw |
Thanks for your time @admad , let me know if there's anything I can do, e.g. have a 6 pack delivered to you or donate somewhere |
# |
Aug 21st 2019, 15:48 |
alexdd55976 |
nope, sorry |
# |
Aug 21st 2019, 15:39 |
mdotobie |
@admad @daniel.upshaw @alexdd55976 Just out of curiosity, does anyone know what the logic was behind making frontend libraries available through packagist.org? |
# |
Aug 21st 2019, 15:37 |
dereuromark |
xdebug would show you already basic path at least of input to output. and is free. |
# |
Aug 21st 2019, 15:36 |
np |
ok, thanks |
# |
Aug 21st 2019, 15:35 |
dereuromark |
no, but there is new relic and blackfire if you need professional tools. |
# |
Aug 21st 2019, 15:34 |
np |
hello, Is there any software / extension for vscode to visualize the flow of a cakephp / php application? I must understand what and who going in very large cakephp 3 app. |
# |
Aug 21st 2019, 15:31 |
daniel.upshaw |
So, just make a query at all is causing it |
# |
Aug 21st 2019, 15:30 |
daniel.upshaw |
Even overwriting the variable immediately: ```$tagRoutesPiped = (string)implode( '|', TableRegistry::getTableLocator() ->get('Tags') ->find('all') ->select(['alias']) ->where(['route' => 1]) ->all() ->extract('alias') ->toArray() ); $tagRoutesPiped = 'test';``` |
# |
Aug 21st 2019, 15:29 |
daniel.upshaw |
@admad When the cache is removed entirely, the error happens 100% of the time on every page load |
# |
Aug 21st 2019, 15:28 |
mdotobie |
Thanks for the tips @admad @daniel.upshaw @alexdd55976 |
# |
Aug 21st 2019, 15:26 |
daniel.upshaw |
So it's happening before it jumps inside the scope even |
# |
Aug 21st 2019, 15:26 |
daniel.upshaw |
This now comes before the `Router::scope('/', function (RouteBuilder $routes) use ($tagRoutesPiped) {` |
# |
Aug 21st 2019, 15:26 |
daniel.upshaw |
Here's an odd thing about the routing issue @admad ... If I use this, with no caching (presumably), it still throws the error: ```$tagRoutesPiped = (string)implode( '|', TableRegistry::getTableLocator() ->get('Tags') ->find('all') ->select(['alias']) ->where(['route' => 1]) ->all() ->extract('alias') ->toArray() );``` |
# |
Aug 21st 2019, 15:21 |
mdotobie |
Well not stick with, but start using rather. NPM is available now on our current VPS (even though we are planning to migrate to a DigitalOcean droplet where we have more control over the toolchain) |
# |
Aug 21st 2019, 15:20 |
mdotobie |
So it looks like I should stick with `npm` for the management of the frontend stuff. |
# |
Aug 21st 2019, 15:20 |
admad |
@btx there are tons of plugins out there will you can refer to for how to test standalone plugins :slightly_smiling_face: |
# |
Aug 21st 2019, 15:19 |
mdotobie |
No I definitely understand the distinctions @daniel.upshaw. It just seemed when I started seeing the frontend libraries I use on packagist.org that it was a move to a single manager. |
# |
Aug 21st 2019, 15:17 |
ricksaccous |
i dunno, i'm just guessing that's how it works actually i don't really do TDD at the moment but our organization is slowly gravitating towards it |
# |
Aug 21st 2019, 15:16 |
ricksaccous |
@btx you just have to make sure your composer autoload is updated and that phpunit.xml.dist is updated as well |
# |
Aug 21st 2019, 15:15 |
daniel.upshaw |
But I guess I might run into the same problem |
# |
Aug 21st 2019, 15:15 |
daniel.upshaw |
Okay, I may have to make a custom Route to do what I need in this case |
# |
Aug 21st 2019, 15:14 |
ricksaccous |
hmmmm |
# |
Aug 21st 2019, 15:14 |
ricksaccous |
@btx you can test plugins within the main app, if it's in your plugins folder, if it's in vendor then yeah you would do it separately |
# |
Aug 21st 2019, 15:14 |
daniel.upshaw |
Ahh |
# |
Aug 21st 2019, 15:12 |
admad |
@daniel.upshaw yeah that feature is a PITA |
# |
Aug 21st 2019, 15:11 |
btx |
the book just directs you to regular App tests which assume cake is already installed |
# |
Aug 21st 2019, 15:10 |
btx |
n00b question, but how should I be properly testing plugins? create a new Cake app, drop the plugin in, and then do the tests? |
# |
Aug 21st 2019, 15:09 |
daniel.upshaw |
By disabling the Routing cache |
# |
Aug 21st 2019, 15:09 |
daniel.upshaw |
Interestingly, if I change `->add(new RoutingMiddleware($this, '_cake_routes_'));` to `->add(new RoutingMiddleware($this, null));` it works |
# |
Aug 21st 2019, 15:08 |
alexdd55976 |
just put the files in the right folder. more packagemanager > chances to mess stuff up |
# |
Aug 21st 2019, 15:07 |
daniel.upshaw |
``` * Cache: Routes are cached to improve performance, check the RoutingMiddleware * constructor in your `src/Application.php` file to change this behavior.``` |
# |
Aug 21st 2019, 15:07 |
alexdd55976 |
you do not want to do that. |
# |
Aug 21st 2019, 15:05 |
daniel.upshaw |
And `bower` is a JS dependency |
# |
Aug 21st 2019, 15:05 |
admad |
Don't use composer for fronted libs |