# |
Mar 8th 2019, 09:48 |
willem |
anynbody know a solution for this. I want to cache multiple queries per year, per user. so i can create cache keys containing a year and a slug for example. But now i need to invalidate all keys for a specific slug. is there a solution for this? ``` 'query:data:transactions:2018:slug' 'query:data:transactions:2019:slug' 'query:data:transactions:2018:slug2' ``` |
# |
Mar 8th 2019, 09:12 |
voycey |
Basically if we just wanted to cakeify some internal functions provided by mysql? |
# |
Mar 8th 2019, 09:11 |
voycey |
Question: Is there a shortcut for creating a cake adapter for internal mysql functions? |
# |
Mar 8th 2019, 09:11 |
voycey |
(evening for me!) |
# |
Mar 8th 2019, 09:11 |
voycey |
^morning! |
# |
Mar 8th 2019, 09:05 |
neon1024 |
Morning everyone |
# |
Mar 8th 2019, 05:18 |
mdotobie |
Thanks for having a look @admad. I have the trim methods because I didn’t want the format validations to run. But I completely forgot I could set the ‘last’ option |
# |
Mar 8th 2019, 04:10 |
admad |
@mdotobie what you have shown is fine. Just the trimming in methods which check format is redundant |
# |
Mar 8th 2019, 02:58 |
sdevore |
I use this https://gist.github.com/hmic/f38b409bb483de8d5b85bec1e0334abe trait on models and then just use $this->ModelIBatchedUp->updateCounterCache(); from the controller |
# |
Mar 8th 2019, 00:10 |
mdotobie |
Here’s my code for context |
# |
Mar 8th 2019, 00:09 |
slackebot1 |
the proper combination. Do I absolutely have to have both in this scenario. I don’t mind a future refactor but I just want to get my head around how it works. |
# |
Mar 8th 2019, 00:09 |
slackebot1 |
entries and trigger my customer message if it is. It triggers my custom message if the field has white space but no actual text, however, it shows the default `This field cannot be left empty` be empty if it has no value at all. This seemed to suggest I needed to also have the `allowEmpty()` validator rule as well (I’m using allowEmpty() with the `on` attribute set to `false` since the documentation states that the use of `notEmpty` is deprecated). |
# |
Mar 8th 2019, 00:09 |
mdotobie |
I’m trying to make sure I understand the use of `allowEmpty()` and and `notBlank()` when creating a validator. I have a postal code field that validates US or Canadian formatted zip codes. I have the `regex` rules working fine, but I can’t seem to make it work as expected with the `allowEmpty()` and `notBlank`, my thought process says that I should just be able to use `notBlank()` alone. This should guard against no input or all white s |
# |
Mar 7th 2019, 22:40 |
itmpls |
if not I figure it's easier writing a manual query script to do this |
# |
Mar 7th 2019, 22:39 |
itmpls |
I had to write some batch inserting for relationships and now the CounterCache columns are all 0. Is there a way to mimic running the countercache of all records of [x]? i dont' want to do 90 of them one by one |
# |
Mar 7th 2019, 18:25 |
NickBusey |
thanks |
# |
Mar 7th 2019, 18:21 |
dereuromark |
disable it |
# |
Mar 7th 2019, 18:21 |
dereuromark |
aggressive opcode cache |
# |
Mar 7th 2019, 18:16 |
NickBusey |
Hmm, cake seems to be caching the contents of my Shell/ files somehow. I can change files that are called by the Shell/ files, and those changes show up, but once I run a shell command once, changes to that Shell/ file don't seem to have any effect. So weird.. |
# |
Mar 7th 2019, 16:15 |
slackebot1 |
component or am i misusing the blackhole callback by trying to return redirects from it? |
# |
Mar 7th 2019, 16:15 |
nemmons |
I have noticed that if i modify the following lines in SecurityComponent::startup() ``` } catch (SecurityException $se) { $this->blackHole($controller, $se->getType(), $se); } ``` to ``` } catch (SecurityException $se) { return $this->blackHole($controller, $se->getType(), $se); } ``` this issue goes away. so i guess my question is, does this look like a minor bug in the security |
# |
Mar 7th 2019, 16:14 |
slackebot1 |
(e.g. if i was trying to post to /posts/add, i can see that even though the request was black-holed, the controller action was executed and a record was written to the database) |
# |
Mar 7th 2019, 16:14 |
nemmons |
Hey all, i'm noticing something odd in the behavior surrounding the Security Component and the blackhole callback. I'm currently on 3.5.4 and I have the following black hole callback setup in my controller: https://hastebin.com/kucamorovi.php and i have noticed that if my request gets black-holed due to form-tampering protection, it returns the redirect as expected _but it simultaneously executes the blackholed controller action anyway_ |
# |
Mar 7th 2019, 14:06 |
acosonic |
I've finally assembled (generated from cakphp's missing controllers, a comprehensive bad-bot fail2ban blocking filter...) It's as it is, only cleaned a littlebit to make it work... https://github.com/acosonic/fail2ban_custom_rules/blob/master/filter.d/apache-script-hackbots.conf |
# |
Mar 7th 2019, 14:05 |
acosonic |
@endersaka Me, why? |
# |
Mar 7th 2019, 13:41 |
endersaka |
anyone here uses Atom as his PHP editor? |
# |
Mar 7th 2019, 12:40 |
grossolive4 |
I did not find any delete event in behavior translate https://book.cakephp.org/3.0/en/orm/behaviors/translate.html |
# |
Mar 7th 2019, 12:38 |
grossolive4 |
hello everyone, I have a question how to delete i18n after model -> delete ? |
# |
Mar 7th 2019, 12:32 |
mrfeedback |
kan do you have an actual question? |
# |
Mar 7th 2019, 10:32 |
kan |
anyone has Done G suite API ? |
# |
Mar 7th 2019, 10:23 |
neon1024 |
:rubberduck: |
# |
Mar 7th 2019, 10:23 |
neon1024 |
Woo, so it’s `$View->getVars()`, to get the array keys, then `$View->get($viewVar)`, not quite sure how I missed that :face_palm: |
# |
Mar 7th 2019, 10:22 |
neon1024 |
..and the View uses the same Trait |
# |
Mar 7th 2019, 10:21 |
neon1024 |
Which it does! |
# |
Mar 7th 2019, 10:21 |
neon1024 |
Unless `set()` in a controller proxies the View |
# |
Mar 7th 2019, 10:21 |
neon1024 |
..and why would a controller do `$this->set('examples', $examples)` and then the View class `$this->set('examples', $undefinedVariable)` |
# |
Mar 7th 2019, 10:20 |
neon1024 |
The View class builds data and a template into a response right? So why would the View class not be able to access the data set to the view |
# |
Mar 7th 2019, 10:20 |
neon1024 |
I don’t understand that :thinking_face: |
# |
Mar 7th 2019, 10:18 |
neon1024 |
Kinda strange as the deprecation points to using `set()` and not `get()` |
# |
Mar 7th 2019, 10:18 |
neon1024 |
Ah, seems it’s `$View->viewVars` even though it’s been deprecated |
# |
Mar 7th 2019, 10:16 |
neon1024 |
Has anyone implemented the Fractal library? Is creating a custom View class the way to approach it? I can’t find anything in the View class which has the data set to the view. I thought it was `$View->getViewVars()` |