# |
Aug 15th 2019, 12:23 |
slackebot |
__construct(ComponentCollection $collection, $settings = array()) { parent::__construct($collection, $settings); CakeEventManager::instance()->attach($this); } public function shutdown(Controller $controller) { // This prevents the memory leak. //CakeEventManager::instance()->detach($this); } /** * {@inheritDoc} * @see Component::initialize() */ public function initialize(Controller $controller) { Configure::write('GlobalAuth', |
# |
Aug 15th 2019, 12:23 |
val |
<?php App::uses('Component', 'Controller'); /** * GlobalAuth component * * @property AuthComponent $Auth */ class GlobalAuthComponent extends Component implements CakeEventListener { public $components = ['Auth']; /** * Constructor. * * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components. * @param array $settings Array of configuration settings. */ public function |
# |
Aug 15th 2019, 12:22 |
val |
``` |
# |
Aug 15th 2019, 11:31 |
val |
@neothermic probably |
# |
Aug 15th 2019, 11:23 |
neothermic |
@val in an ironic question, can you make a testcase that shows the leak? |
# |
Aug 15th 2019, 11:21 |
val |
Hi, it looks like `CakeEventManager::instance()->attach($this);` in 2.x leads to the memory leak in unit tests. Is it a known problem? |
# |
Aug 15th 2019, 11:21 |
alexdd55976 |
my old company was sold...so i switched jobs ... other way i had 250 loc to maintain |
# |
Aug 15th 2019, 11:21 |
neothermic |
I somewhat wish when we did our big 1.3 -> 2.x migration, we'd just bitten the bullet and gone to 3.x as well |
# |
Aug 15th 2019, 11:20 |
spriz |
We're a simple SaaS with 330k LOC - looking forward to that 4.x migration already :) |
# |
Aug 15th 2019, 11:20 |
spriz |
Oh yikes! :) |
# |
Aug 15th 2019, 11:18 |
neothermic |
so we have a percentage of that on our platform right now |
# |
Aug 15th 2019, 11:18 |
neothermic |
```the number of applicants looking for a place through clearing on Thursday morning rose slightly to 126,170.``` |
# |
Aug 15th 2019, 11:16 |
neothermic |
it's the big results day today, so our platform is under moderate load :) |
# |
Aug 15th 2019, 11:16 |
alexdd55976 |
now software engineer again.. hoping to establish cake as the new framework for next-gen internal dev |
# |
Aug 15th 2019, 11:16 |
spriz |
Ah I see |
# |
Aug 15th 2019, 11:16 |
alexdd55976 |
was in advertise (shop system with cake then), then software (js only), then on software with cakephp |
# |
Aug 15th 2019, 11:16 |
neothermic |
@spriz we run a SaaS platform that unis in the UK use for all things between first contact up until their first day at uni. After that we don't deal with them until they rock back up as alumni :P |
# |
Aug 15th 2019, 11:15 |
neothermic |
@spriz my idea is to roughly get enough tests going, then do the upgrade shell, use the 2.x shim and see if I can get 3.x running in that bastard config |
# |
Aug 15th 2019, 11:15 |
spriz |
like what kind of business if you can't tell exactly which? :) |
# |
Aug 15th 2019, 11:15 |
alexdd55976 |
hey.. just saw the shop is still running |
# |
Aug 15th 2019, 11:15 |
spriz |
what you guys doing? :) |
# |
Aug 15th 2019, 11:14 |
neothermic |
parts of the code are from 2010 :) |
# |
Aug 15th 2019, 11:14 |
neothermic |
@alexdd55976 it was originally a 1.2 codebase ;) |
# |
Aug 15th 2019, 11:14 |
alexdd55976 |
i built a shop system on it... |
# |
Aug 15th 2019, 11:13 |
spriz |
I've seen people proxy requests with the web server to 3.x slowly for URLs |
# |
Aug 15th 2019, 11:13 |
neothermic |
only if they're 100% new properties. The platform is stuck on 2.x for now |
# |
Aug 15th 2019, 11:13 |
alexdd55976 |
you should have tried 1.x :) |
# |
Aug 15th 2019, 11:13 |
spriz |
I guess you already write all new things in 3.x no? |
# |
Aug 15th 2019, 11:13 |
challgren |
Yep, 2.x though allowed you to do some stupid things at times |
# |
Aug 15th 2019, 11:13 |
neothermic |
so when you've got ~500k SLoC... that's not upgrading quickly :) |
# |
Aug 15th 2019, 11:13 |
spriz |
Ah, I'd believe so. Never used 2.x though |
# |
Aug 15th 2019, 11:12 |
neothermic |
no, 3.x is far more complex than 2.x |
# |
Aug 15th 2019, 11:12 |
spriz |
length of the book? :O |
# |
Aug 15th 2019, 11:12 |
neothermic |
this is part of why we're not yet on 3.x :) |
# |
Aug 15th 2019, 11:11 |
challgren |
Yeah not too much to it |
# |
Aug 15th 2019, 11:11 |
neothermic |
:) |
# |
Aug 15th 2019, 11:11 |
spriz |
Wow the 2.x book is short! :) |
# |
Aug 15th 2019, 11:11 |
spriz |
suggests to put it at `app/Lib/AppError.php` |
# |
Aug 15th 2019, 11:10 |
spriz |
that looks like it: https://book.cakephp.org/2.0/en/development/errors.html#creating-your-own-error-handler |
# |
Aug 15th 2019, 11:10 |
neothermic |
setErrorHandlers seems that it might do the trick |
# |
Aug 15th 2019, 11:10 |
neothermic |
mm, I'd also need to work out how to force cake to use them |