# |
Jun 18th 2019, 13:47 |
jeremyharris |
I even worked on cake back in the svn days and even that history is preserved |
# |
Jun 18th 2019, 13:46 |
jeremyharris |
silly me for thinking that 2.x was a new repo |
# |
Jun 18th 2019, 13:45 |
jeremyharris |
oh nice |
# |
Jun 18th 2019, 13:45 |
ndm |
https://github.com/cakephp/cakephp/tree/1.2.12 ;) |
# |
Jun 18th 2019, 13:45 |
neothermic |
possibly? but the fact that the function they were doing these returns in was void too... I suspect caffeine induced awakeness |
# |
Jun 18th 2019, 13:44 |
jeremyharris |
I think some other framework might return view vars, so maybe they did it out of habit |
# |
Jun 18th 2019, 13:44 |
neothermic |
best part was, they were doing these `return $this-set()` inside of a function that was `@return void` too |
# |
Jun 18th 2019, 13:43 |
neothermic |
no idea what the dev was doing when they returned those |
# |
Jun 18th 2019, 13:43 |
neothermic |
it was void too |
# |
Jun 18th 2019, 13:43 |
neothermic |
sweet |
# |
Jun 18th 2019, 13:43 |
jeremyharris |
@neothermic I couldn’t find a repo, but you can look at the source via the api docs: https://api.cakephp.org/1.2/ |
# |
Jun 18th 2019, 13:34 |
neothermic |
hmm, odd question, but is there a repo copy of 1.x anywhere? I just want to check to see if the reason why this 2.x code tries to `return` on a `$this->set()` might've been because 1.x returned _something_... |
# |
Jun 18th 2019, 13:29 |
peppejaripappalardo |
thx... |
# |
Jun 18th 2019, 13:18 |
a.didier |
i need to make this plugins (https://github.com/loadsys/JSON-API) works with a 2.10.17... But the plugins seems to have been made for a custom version of cake or a very old one... |
# |
Jun 18th 2019, 13:16 |
admad |
there will most likely be people still using 2.x for a decade more |
# |
Jun 18th 2019, 13:15 |
a.didier |
not my personal choice tbh XD |
# |
Jun 18th 2019, 13:14 |
admad |
you are about half a century late upgrading a 2.3 app :P |
# |
Jun 18th 2019, 13:12 |
a.didier |
hmmm... Ok |
# |
Jun 18th 2019, 13:11 |
admad |
custom route param probably |
# |
Jun 18th 2019, 13:10 |
a.didier |
and in `$this->controller->request['url']['callback']` ? What was the callback ? |
# |
Jun 18th 2019, 13:09 |
admad |
try both and decide yourself whichever meets your requirement :slightly_smiling_face: |
# |
Jun 18th 2019, 13:06 |
peppejaripappalardo |
Hello everybody, someone can suggest to me, which one is the best way to implement the soft delete in CakePHP? I found 2 plugin, PGBI/cakephp3-soft-delete or UseMuffin/Trash. For my needs, is required that i can soft delete item, and hard delete if is required, and get back item soft deleted. Thanks for everyone who reply to my request |
# |
Jun 18th 2019, 12:51 |
a.didier |
Ho i see ^^ Thanks :) |
# |
Jun 18th 2019, 12:47 |
admad |
extension |
# |
Jun 18th 2019, 12:44 |
a.didier |
Hello, i working to migrate an application from cake 2.3 to 2.10 and this `$this->controller->params['url']['ext']` is broken. For `url` i can have it by using `$this->controller->request['url']`, but what is `['ext']` ? |
# |
Jun 18th 2019, 11:42 |
neothermic |
(if you're in a controller, you need to put a model name in the thing: $this->SomeModel->getDataSource... ) |
# |
Jun 18th 2019, 11:42 |
peppejaripappalardo |
Hi everyone, I'm new in this comunity, I write just to greet everyone :slightly_smiling_face: |
# |
Jun 18th 2019, 11:40 |
neothermic |
usually that's a sign of a N+1 query :P |
# |
Jun 18th 2019, 11:40 |
neothermic |
but be aware, if the ORM decides to break your SQL out into multiple queries, you'll get the last query the ORM ran, not the last query you think you ran :slightly_smiling_face: |
# |
Jun 18th 2019, 11:39 |
neothermic |
pidlo, if you're in a model, you can do $logs = $this->getDatasource()->getLog(false, false); and then $lastQuery = end($logs['log']); |
# |
Jun 18th 2019, 11:07 |
pidlo |
hello all i have one question in 2.10 version how can i get last sql in this version? |
# |
Jun 18th 2019, 10:56 |
conehead |
Is this useful for anyone? Should this be added to the docs? I personally find it really useful as you can skip other stuff like sending emails or licensing |
# |
Jun 18th 2019, 10:50 |
slackebot1 |
->setMethods(['check']) ->getMock(); $aclComponentMock ->expects($this->any()) ->method('check') ->willReturn(true); $this->_controller->Acl = $aclComponentMock; } ``` |
# |
Jun 18th 2019, 10:50 |
conehead |
``` use \Cake\TestSuite\IntegrationTestTrait { controllerSpy as traitControllerSpy; } /** * Inject Acl-Component to skip all authorization checks * * @param $event * @param null $controller */ public function controllerSpy($event, $controller = null) { $this->traitControllerSpy($event, $controller); $aclComponentMock = $this->getMockBuilder(AclComponent::class) ->disableOriginalConstructor() |
# |
Jun 18th 2019, 10:50 |
conehead |
If anyone else can use this: This works by injecting the component after controller has been generated |
# |
Jun 18th 2019, 10:01 |
conehead |
Well...I can add session data...which does not really help, because I am using ACL. Which would mean I would have to fill couple of hundred of entries in the database first. This would be a solution but a really bad solution imho |
# |
Jun 18th 2019, 10:00 |
challgren |
But you can pass authorization |
# |
Jun 18th 2019, 10:00 |
conehead |
Hm that would suck :P |
# |
Jun 18th 2019, 10:00 |
challgren |
From my understanding it isn’t possible when doing Integration testing |
# |
Jun 18th 2019, 09:59 |
conehead |
Wanna do an Integratration-Test ` use IntegrationTestTrait;` ``` public function testShowIndex() { $this->get('/documents'); $this->assertResponseOk(); } ``` |
# |
Jun 18th 2019, 09:54 |
challgren |
Depends how your testing |