Log message #4054259

# At Username Text
# Jul 19th 2017, 17:44 inoas jeremyharris what would you think of splitting the core's getter/setter "metaphor" into two classes
# Jul 19th 2017, 17:44 styks1987 In a controller I instantiate a library. I want to mock this library. I want to create a private function for _getMyLibrary in the controller so I can override it in my test, but mocking private methods is messy… If I make it a public method then I have to deny access to it via a request… Any good ideas on how to call libraries in controllers while being able to mock them out? Are either of the methods mentioned above preferred?
# Jul 19th 2017, 17:31 genellern Don't remember
# Jul 19th 2017, 17:31 genellern Or was it cake1.3
# Jul 19th 2017, 17:31 genellern I don't remember pretty well, but I think you can change the driver to use Mysqli in 'datasource' => 'Database/Mysql',
# Jul 19th 2017, 17:21 jarard if anyone wants to earn some SO credit: https://stackoverflow.com/questions/45196560/cakephp-console-cron-database-connection-error
# Jul 19th 2017, 17:02 NickBusey deleted all that stuff from app.php, in bootstrap.php: Log::config('default', ['engine' => 'Console']);
# Jul 19th 2017, 17:01 NickBusey got it
# Jul 19th 2017, 16:58 NickBusey tried this: https://pastebin.com/raw/pgnDbvk7 no luck
# Jul 19th 2017, 16:55 NickBusey k thanks, I'll give it a shot
# Jul 19th 2017, 16:55 cleptric This works for me when using dokku which is based on docker
# Jul 19th 2017, 16:53 NickBusey hmm, console://logs, not php://stdout ?
# Jul 19th 2017, 16:52 cleptric error log url: console://logs?levels[]=warningandlevels[]=errorandlevels[]=criticalandlevels[]=alertandlevels[]=emergencyandfile=error
# Jul 19th 2017, 16:48 cleptric You have to set the log_url in your app.php
# Jul 19th 2017, 16:43 NickBusey Has anyone had any luck with getting cake3 log output through to the docker logs? Can't seem to get it piped out
# Jul 19th 2017, 16:24 admad Okay, sorry can't offer any help. Just that i too had got such random 403's a while back. But we already had a server switch planned so never got to the bottom of it
# Jul 19th 2017, 16:23 r3zam slackebot: nope ...
# Jul 19th 2017, 16:22 admad Was apache / its settings updated recently by any chance?
# Jul 19th 2017, 16:22 r3zam slackebot: yup
# Jul 19th 2017, 16:21 admad r3zam: using apache?
# Jul 19th 2017, 16:18 r3zam any idea what that might cause this problem ?
# Jul 19th 2017, 16:18 r3zam guys there is something else , i wrote a very simple app with cake 3.x but there is something wrong , every time i refresh page i got 403 error for one of the resources or after 5 times refresh i got forbidden error for whole page ,
# Jul 19th 2017, 16:05 inoas in php
# Jul 19th 2017, 16:05 inoas I wonder if there is a magic way to preprocess params when calling functions ;)
# Jul 19th 2017, 16:04 inoas not sure if my foo will be good enough, I will contact you if I start a PR
# Jul 19th 2017, 16:04 inoas like say this needs to be a legit ip-address
# Jul 19th 2017, 16:04 inoas ah you mean that you can use the validator... hum
# Jul 19th 2017, 16:04 jeremyharris if you want some help on it at any point, hit me up :slightly_smiling_face:
# Jul 19th 2017, 16:03 inoas it could in many occasions
# Jul 19th 2017, 16:02 jeremyharris would love to see it use the existing validation class if it can
# Jul 19th 2017, 16:02 inoas (or returns all fields invalid or true)
# Jul 19th 2017, 16:02 jeremyharris a PR might help others understand what you’re getting at :slightly_smiling_face: although, don’t get discouraged if it’s not accepted. It would be a PR a bit ahead of the finished discussion
# Jul 19th 2017, 16:02 inoas basically implement Options::validate() (returns true/false) and Options::validateOrFail()
# Jul 19th 2017, 16:01 inoas jeremyharris while my coding foo is mediocre if there is enough support in the core to consider this I would be willing to create a PR
# Jul 19th 2017, 16:00 inoas but rather real parameters
# Jul 19th 2017, 16:00 inoas but I think if you want that you should not use $options
# Jul 19th 2017, 16:00 inoas the only gripe is, it does not do IDE stuff very well
# Jul 19th 2017, 15:59 jeremyharris I think i’m on the same page now
# Jul 19th 2017, 15:59 inoas however you are then "on your own" (aka as $options are right now)
# Jul 19th 2017, 15:59 inoas that should be still possible through using type array and making it optional
# Jul 19th 2017, 15:58 jeremyharris I prefer that idea to the object one. I wonder if someone will come up with a use case where they want to provide an N amount of custom keys that aren’t defined in the schema, but still validate other options