# |
Sep 19th 2019, 19:58 |
daniel.upshaw |
Ah okay, yes, check out that thread of replies.. I think the best bet is to make it in something like `./src/functions.php`, then require it in `bootstrap.php` |
# |
Sep 19th 2019, 19:57 |
luizcmarin |
Dan: are just generic functions, example: functionDateLong (), April 23, 2019 (example), functionMoney () return '23 mil and 23 cents', .... |
# |
Sep 19th 2019, 19:53 |
daniel.upshaw |
Probably the best bet is to require it in your `bootstrap.php` like Cake core does with its `src/basics.php` |
# |
Sep 19th 2019, 19:52 |
daniel.upshaw |
See also `vendor/cakephp/cakephp/src/Core/functions.php` Which is loaded via `/vendor/cakephp/cakephp/composer.json` ``` "files": [ "src/Core/functions.php", "src/Collection/functions.php", "src/I18n/functions.php", "src/Utility/bootstrap.php" ]``` |
# |
Sep 19th 2019, 19:50 |
daniel.upshaw |
Which is located in `vendor/cakephp/cakephp/src/basics.php` |
# |
Sep 19th 2019, 19:49 |
daniel.upshaw |
Check out `vendor/cakephp/config/bootstrap.php` line 19: ```require CAKE . 'basics.php';``` |
# |
Sep 19th 2019, 19:46 |
luizcmarin |
good afternoon, after about 10 hours searching google ... :( ... I want to create a file with general functions for my application. How can I do this? I think it's simple, but I'm not used to cakephp's naming. Could you give some tips? I appreciate help. |
# |
Sep 19th 2019, 19:44 |
daniel.upshaw |
Maybe the "Remember Me" cookie field is not unlocked by default |
# |
Sep 19th 2019, 19:43 |
slackebot |
if (Configure::read('debug')) { $msg = $this->_debugPostTokenNotMatching($controller, $hashParts); } throw new AuthSecurityException($msg); }``` |
# |
Sep 19th 2019, 19:43 |
daniel.upshaw |
The `hash_equals` function keeps returning `false`:``` protected function _validatePost(Controller $controller) { $token = $this->_validToken($controller); $hashParts = $this->_hashParts($controller); $check = hash_hmac('sha1', implode('', $hashParts), Security::getSalt()); if (hash_equals($check, $token)) { return true; } $msg = self::DEFAULT_EXCEPTION_MESSAGE; |
# |
Sep 19th 2019, 19:42 |
daniel.upshaw |
I'm surprised more people aren't seeing it |
# |
Sep 19th 2019, 19:42 |
daniel.upshaw |
Bad Request on form submit (login form) |
# |
Sep 19th 2019, 19:41 |
daniel.upshaw |
While following the documentation on Authentication, currently while trying the latest CakeDC/Users |
# |
Sep 19th 2019, 19:41 |
daniel.upshaw |
Mannn, I am running into this all the time recently: https://github.com/cakephp/cakephp/issues/12086 |
# |
Sep 19th 2019, 19:23 |
jotpe |
Cu guys |
# |
Sep 19th 2019, 18:58 |
jotpe |
I also don't use the decorator, my User implements the AuthInterface |
# |
Sep 19th 2019, 18:58 |
ron.rattie |
definitely |
# |
Sep 19th 2019, 18:58 |
ricksaccous |
@ron.rattie are you missing that? lolll |
# |
Sep 19th 2019, 18:58 |
jotpe |
Cheers ;) |
# |
Sep 19th 2019, 18:58 |
jotpe |
:coffee: |
# |
Sep 19th 2019, 18:58 |
ricksaccous |
@jotpe good luck |
# |
Sep 19th 2019, 18:58 |
ricksaccous |
so i don't know why you wouldn't be |
# |
Sep 19th 2019, 18:57 |
ron.rattie |
@ricksaccous |
# |
Sep 19th 2019, 18:57 |
ricksaccous |
yeah, i actually do obtain the entity properties i set |
# |
Sep 19th 2019, 18:57 |
jotpe |
Anyways; I'll just do another query then ;) |
# |
Sep 19th 2019, 18:56 |
jotpe |
It's maybe because I have a custom Resolver |
# |
Sep 19th 2019, 18:56 |
ricksaccous |
nevermind |
# |
Sep 19th 2019, 18:56 |
ricksaccous |
lol |
# |
Sep 19th 2019, 18:56 |
ricksaccous |
but it's working for me |
# |
Sep 19th 2019, 18:56 |
ricksaccous |
actually i think I do something similar |
# |
Sep 19th 2019, 18:55 |
ricksaccous |
i think that's why you don't see those changes anyway |
# |
Sep 19th 2019, 18:55 |
ricksaccous |
the auth identity is not being constantly being queried and operated on, whatever is initially set is is set |
# |
Sep 19th 2019, 18:55 |
jotpe |
But it returns null |
# |
Sep 19th 2019, 18:55 |
jotpe |
I'm getting the user by `$user = $this->Authentication->getIdentity();` and did `protected function _getTitle(){return 'test';}` in the entity |
# |
Sep 19th 2019, 18:53 |
jotpe |
I'm using the Authentication Plugin and wonder why it's not possible to add a getter on the user entity?! |
# |
Sep 19th 2019, 18:39 |
henri.mjr |
tks |
# |
Sep 19th 2019, 18:33 |
ricksaccous |
@henri.mjr https://book.cakephp.org/3.0/en/intro/conventions.html |
# |
Sep 19th 2019, 18:31 |
henri.mjr |
What is the convetion for table/controller/models names with two words? Like "Hair Types" |
# |
Sep 19th 2019, 18:05 |
this.impetus |
@ricksaccous No, services doesn't contains Cvsubsections; you were right, that is the only line where in a child-container asks for the parent, and I only included it as a convenience so removing it and fetching the missing field from earlier up the chain is perfectly doable, I just avoid logic in my view templates to an unreasonable degree |
# |
Sep 19th 2019, 17:48 |
ricksaccous |
and not getting the error there |
# |
Sep 19th 2019, 17:47 |
ricksaccous |
and it's contained associations |