# |
May 24th 2021, 09:44 |
michal_kotus |
Thanks!! |
# |
May 24th 2021, 09:32 |
kevin.pfeifer |
```use Cake\Mailer\MailerAwareTrait;``` is just 1 part you need to add to your controller. You also need to add ```use MailerAwareTrait;``` bellow the class definition, so in total like ```use Cake\Mailer\MailerAwareTrait; class UsersController extends AppController { use MailerAwareTrait;``` |
# |
May 24th 2021, 09:25 |
michal_kotus |
Hello, I am learning https://book.cakephp.org/4/en/core-libraries/email.html#creating-reusable-emails. But in PHPStorm I get warning `Method 'getMailer' not found in UsersController` and in browser I get `Call to undefined method App\Controller\UsersController::getMailer()`. I put use `Cake\Mailer\MailerAwareTrait;` into UsersController, so why it do not want to find getMailer method? Thanks for an answer |
# |
May 24th 2021, 08:51 |
rudy1976s |
I would like to configure mailer using env file : what is the correct syntax to build the url ? is there somewhere an example ? thank you !!!! |
# |
May 24th 2021, 08:49 |
rudy1976s |
good morning !!!! |
# |
May 24th 2021, 08:04 |
khalil |
Thanks @dereuromark! |
# |
May 24th 2021, 07:44 |
dereuromark |
And yes, it might be stored as jaon, but that is not sth visible from normal usage |
# |
May 24th 2021, 07:44 |
dereuromark |
The core natively Supports array. Json is sth only Extertal api represenstation needs. Internally, using array suffices imo. |
# |
May 23rd 2021, 22:50 |
kevin.pfeifer |
https://github.com/liqueurdetoile/cakephp-orm-json But I would rather split that json appart and save the individual fields either in the given data structure (=seperate tables) or in a generic key- and value-columb table rather than saving the JSON directly |
# |
May 23rd 2021, 22:17 |
khalil |
is MySQL JSON column type supported in cakephp? I can't find anything about it in the docs, unless I'm missing something |
# |
May 23rd 2021, 22:16 |
khalil |
Another quick question |
# |
May 23rd 2021, 22:16 |
khalil |
Hey guys |
# |
May 22nd 2021, 20:00 |
Martin` |
hi |
# |
May 22nd 2021, 18:18 |
etibor |
Hello everyone |
# |
May 21st 2021, 15:49 |
ndm |
@neon1024 Identifiers are not tied to a specific "backend", the identity could stem from anywhere, not necessarily a row in a database. If you want something consistent, consider `AuthenticationComponent::getIdentity()`, which will always give you something that implements `\Authentication\IdentityInterface`. |
# |
May 21st 2021, 15:39 |
caseyw |
@ndm that's what I'm looking into right now. Thanks for that. |
# |
May 21st 2021, 15:38 |
ndm |
@caseyw Neither attributes nor parameters can be configured for a test request, so it wouldn't make a difference. If you're mocking the thing that sets the attribute, then it's maybe possible to set the attribute from your mock config. |
# |
May 21st 2021, 15:31 |
neon1024 |
PHP Stan gets angry if you try and `instanceof \ArrayObject` |
# |
May 21st 2021, 15:30 |
slackebot |
<neon1024> |
# |
May 21st 2021, 15:30 |
neon1024 |
I’ve had array, Entity and ArrayObject |
# |
May 21st 2021, 15:29 |
neon1024 |
> TypeError: Argument 1 passed to Cake\ORM\Table::save() must implement interface Cake\Datasource\EntityInterface, instance of ArrayObject given, called in /var/www/html/src/Model/Table/UsersTable.php on line 259 |
# |
May 21st 2021, 15:29 |
neon1024 |
Why does Identity return so many types? |
# |
May 21st 2021, 15:25 |
slackebot |
https://github.com/cakephp/cakephp/releases/tag/2.10.24 |
# |
May 21st 2021, 15:25 |
kevin.pfeifer |
I just checked the doc for CakePHP 2 https://book.cakephp.org/2/en/core-utility-libraries/security.html As stated there `cipher() uses a *weak* XOR cipher and should *not* be used. It is only included for backwards compatibility.` Dont know if you can/should get that working with newer versions. I would recommend you to start planning a cakephp upgrade in general since cakephp 2 has an EOL of 15th June 2021 |
# |
May 21st 2021, 14:54 |
rajesh |
do any one have suggestion? how swiftly we can migrate from 5.6 to 7.3 - without deleting old cookies - Thanks |
# |
May 21st 2021, 14:53 |
rajesh |
We are migrating Cakephp 2.10 from php 5.6 to 7.3 - we are generating cookies through default CakePHP method Security::cipher() And current active users having cookies generated from php 5.6 (we have approx 200K Active users) now issue is that we can't get cookies correct values those set in php 5.6 at new server 7.3 |
# |
May 21st 2021, 14:22 |
slackebot |
Maybe that's more difficult than I expected? That makes me wonder, does it make more sense for testability to change it from attributes to parameters? |
# |
May 21st 2021, 14:22 |
caseyw |
You're totally right. What was done is there is a service class that's fully tested. The middleware instantiates it, and runs a method passing Req/Resp. All that was mocked and tested and it's good to go. It essentially modifies the request to add the attribute and that's it. We have test around it as well. I don't want to mess with any internals, but thought there might be an easy way in the configRequest to pass attributes. |
# |
May 21st 2021, 14:16 |
ndm |
I wouldn't fiddle with internals in an integration, until there's a specific technical need for it. |
# |
May 21st 2021, 14:15 |
ndm |
Well, apparently it does need it, given that the attribute is missing ;) |
# |
May 21st 2021, 14:14 |
caseyw |
In this case it's being set in middleware, but the test doesn't need the middleware to run. I was hoping to be able to simply set the attribute when I construct the request in the test :) |
# |
May 21st 2021, 14:00 |
ndm |
If it's present in a regular web request, then I'd generally expect that it's present in a simulated test request too. |
# |
May 21st 2021, 13:59 |
ndm |
I'd say that depends on where that attribute is being set. |
# |
May 21st 2021, 13:56 |
caseyw |
Greetings, I have a question about a unit test in 3.9. In a controller we're making use of $this->getRequest()->getAttribute('example') - In an integration test we can't figure out how to populate the attribute field for the request. Any ideas on passing it in the test? |
# |
May 21st 2021, 11:49 |
paolo.bragagni |
ok thanks. lot of work to do |
# |
May 21st 2021, 11:47 |
ndm |
Build your own application template, that's not a workaround, but a perfectly acceptable solution. Check out other's app templates, like https://github.com/markstory/cakephp-typescript-react |
# |
May 21st 2021, 11:46 |
paolo.bragagni |
I know so I have to find a workaround |
# |
May 21st 2021, 11:45 |
ndm |
There is no application baking anymore, custom app skeletons look like `cakephp/app` now. |
# |
May 21st 2021, 11:44 |
paolo.bragagni |
go for easier :) |
# |
May 21st 2021, 11:44 |
paolo.bragagni |
and I had my new app with my settings/template/configuration |
# |
May 21st 2021, 11:43 |
paolo.bragagni |
in cake2 I didi cake bake project --skel Templates/myskel myapp |