Logs for #cakephp

Page 1 of 36,247, showing 100 records out of 3,624,625 total, starting on record 1, ending on 100

# At Username Text
# Yesterday, 20:16 maymeow cool let me try "::)
# Yesterday, 20:16 maymeow i need create default user menu and this is tree
# Yesterday, 20:15 ricksaccous and use the data already in the table
# Yesterday, 20:15 ricksaccous you can bake a seed
# Yesterday, 20:15 ricksaccous but i don' tknow if seeds work across db structures, i'm guessing they do
# Yesterday, 20:14 ricksaccous you can seed anything
# Yesterday, 20:14 maymeow and one more thing.. is there any way how to seed tree structure?
# Yesterday, 20:12 maymeow for mysql doesnt matter ...
# Yesterday, 20:11 slackebot $query->distinct(['Posts.created', 'Posts.sender_name'])->combine('sender_name', 'sender_name'); } ```
# Yesterday, 20:11 maymeow @ricksaccous what i found for example if you ordering something by created field postgres will return error if you selecting distinct on another field so you have to select on both and mssql will return error when you selecting distinct on both :) ``` if ($conn['driver'] == Sqlserver::class) { $senders = $query->distinct(['Posts.sender_name'])->combine('sender_name', 'sender_name'); } else { $senders =
# Yesterday, 20:06 daniel.upshaw Thanks for the info @admad :slightly_smiling_face:
# Yesterday, 20:06 ricksaccous weird
# Yesterday, 20:06 maymeow @ricksaccous it dont have problem when i use postgres or MSSQL
# Yesterday, 20:05 ricksaccous yeah that makes more sense @maymeow i don't see how inserting a class makes sense from a migrations standpoint so i don't know how it was working before but glad it's working now
# Yesterday, 20:04 admad so basically anything you can do with chronos instance you can with frozentime
# Yesterday, 20:04 maymeow dont know if its good idea but forkink for me :)
# Yesterday, 20:04 admad @daniel.upshaw frozentime wraps chronos and all some i18n formatting features
# Yesterday, 20:03 maymeow refresh ... updated
# Yesterday, 20:03 ricksaccous heh intersting
# Yesterday, 20:03 daniel.upshaw Now I'm curious about that lol
# Yesterday, 20:03 daniel.upshaw But seems the docs always mention `FrozenTime`
# Yesterday, 20:03 daniel.upshaw And active too: https://github.com/cakephp/chronos
# Yesterday, 20:02 daniel.upshaw This is the first I'd seen Chronos actually... looks interesting
# Yesterday, 20:02 maymeow old file in git... just changed it in notebook
# Yesterday, 20:02 maymeow sorry
# Yesterday, 20:01 daniel.upshaw Not using `FrozenTime`?
# Yesterday, 20:00 maymeow changed `'created' => \Cake\Chronos\Date::now(),` to `'created' => \Cake\Chronos\Date::now()->toDateTimeString(),` and its now working
# Yesterday, 19:59 maymeow @ricksaccous https://gist.github.com/MayMeow/c03b0cda19e0703bede81190fa13c56e
# Yesterday, 19:56 ricksaccous whatever
# Yesterday, 19:56 ricksaccous or i mean obfuscate them
# Yesterday, 19:56 ricksaccous feel free to comment out stuff/etc
# Yesterday, 19:56 ricksaccous can you gist the migration? I'm curious now
# Yesterday, 19:55 maymeow i think its same CEST... when i change app config to CEST or europe/something even on datasource config still not working
# Yesterday, 19:54 maymeow my notebook has CEST timezone and mysql has SYSTEM
# Yesterday, 19:54 ricksaccous so you have the default admin on those?
# Yesterday, 19:54 ricksaccous weird...
# Yesterday, 19:54 maymeow i didnt have this problem on dokce or on review server on digital ocean but on my notebook yes
# Yesterday, 19:54 ricksaccous hehe
# Yesterday, 19:53 ricksaccous also I still use seeds I just make sure they only run once ;) I do that by doing a find() and if there are results I just skip the seed
# Yesterday, 19:53 ricksaccous okay well it depends how you are doing the migration
# Yesterday, 19:53 maymeow migrations can run only once thats why
# Yesterday, 19:52 maymeow @ricksaccous no migration. I wanted to create admin on install application so i created new migration where i insert new user..
# Yesterday, 19:52 ricksaccous you're literally just saving a string to db
# Yesterday, 19:52 ricksaccous in migrations you don't have cake magic doing the saving
# Yesterday, 19:52 ricksaccous also you don't want a datetime object, what you want is a string that the database expects
# Yesterday, 19:51 ricksaccous @maymeow do you mean seed rather than migration?
# Yesterday, 19:45 pedrorocha Thank you guys!
# Yesterday, 19:35 maymeow @Dan yes its returning UTC date time i think... i have set app.ini to europe/bratislava and datasource timezone is same
# Yesterday, 19:34 admad If you find the need to use them in a custom event listener the it should probably be just a service class instead
# Yesterday, 19:34 daniel.upshaw @maymeow Did you try debugging your variables?
# Yesterday, 19:33 admad @pedrorocha components themselves are event listeners
# Yesterday, 19:33 maymeow System timezone is `CEST` database s mysql and timezone is set to `SYSTEM`. In php ini i have `Europe/Bratislava` but it didnt work with UTC or CEST either
# Yesterday, 19:32 maymeow i have problem with configuration... i creating default admin user in migration.. and creating date with `'created' => FrozenTime::now()` but getting `wrong date format` on migration.. where is problem? Other thing s on app works good
# Yesterday, 19:31 daniel.upshaw Maybe would probably say that's a bad idea
# Yesterday, 19:31 daniel.upshaw @pedrorocha, my understanding is that Components are for Controllers... but can you make a `use App\Controller\Component\YourComponent` to hack it in there?
# Yesterday, 19:30 maymeow Thank you
# Yesterday, 19:30 daniel.upshaw Using the routes like `/messages/inbox`, `/messages/sent`, `/messages/deleted` makes the most sense to me
# Yesterday, 19:29 daniel.upshaw But technically you can do it either way
# Yesterday, 19:28 daniel.upshaw For a search filter you might use the query strings like `?s=keywords`
# Yesterday, 19:28 daniel.upshaw @maymeow For that case it might make sense to do different routes
# Yesterday, 18:44 pedrorocha Hello guys, how do I load a component inside a Listener? I'm implementing an EventListenerInterface and would like to use a custom components I built inside that..
# Yesterday, 18:28 maymeow When you need filter list of items do you use `/controller/index` /controller/another-view` or `/controller/index`, `/controller/index?filter=another-view` For example i need to create page for send / recieved messages
# Yesterday, 17:36 daniel.upshaw It should have the same action if it's within the same Controller class
# Yesterday, 17:35 daniel.upshaw It refers to ``` private function doThatAction() { }```
# Yesterday, 17:35 ckjksl awesome, i'll give that a shot then. Thanks!
# Yesterday, 17:35 daniel.upshaw Yep it does @ckjksl
# Yesterday, 17:23 ckjksl that would work out, but would it have access to all the same `$this` as my other functions? like `$this->autoRender = false;`
# Yesterday, 17:22 ckjksl does ` $this->doThatAction();` refer to another function inside my controller?
# Yesterday, 17:19 ckjksl one of them has almost two hundred lines of code, so it's a bit hard to manage
# Yesterday, 17:18 ckjksl The switch statement is what's working right now, but it's getting close to having more than eight `$action`s.
# Yesterday, 17:13 daniel.upshaw Rather than connecting a route for each tag and trying to pass the tag in the route URL
# Yesterday, 17:13 daniel.upshaw `$routes->connect('/:tag')->setPatterns([':tag' => 'piped|list|of|valid|tags'])`
# Yesterday, 17:12 daniel.upshaw The only way I could find to reliably pass both indexed and associative to a controller method is to not use index
# Yesterday, 17:07 daniel.upshaw ```switch ($action) { case 'thisaction' : $this->doThisAction(); break; case 'thataction' : $this->doThatAction(); break; }```
# Yesterday, 17:06 daniel.upshaw You could have a `switch` statement and call different private methods?
# Yesterday, 17:05 daniel.upshaw Oooh the `action` arguments performs different things in the method depending on what is passed to that one
# Yesterday, 17:05 daniel.upshaw How are you routing to it?
# Yesterday, 17:05 daniel.upshaw @ckjksl You're saying that the `manageProject` action has an increasing number of arguments?
# Yesterday, 16:58 ckjksl I have a controller that takes a couple arguments: `public function manageProject ($pcode = null, $action = null, $arg = null)` It used to be only two actions, but now it's getting out of control. Is there a way to separate it into different controller functions so that they're easier to manage?
# Yesterday, 16:48 daniel.upshaw Arg but it still passes them in indexed... so the action can't use an indexed passed parameter mixed with named ones
# Yesterday, 16:42 daniel.upshaw I found that by guessing... the docs mention `$this->request->getParam('pass')` which returns indexed
# Yesterday, 16:41 daniel.upshaw Oh! Seems to be possible with `->getParam($passedName)`
# Yesterday, 16:38 daniel.upshaw Trying to find a way to use "named pass," associative
# Yesterday, 16:38 daniel.upshaw Both using `->setPass()` and adding to the URL array
# Yesterday, 16:38 daniel.upshaw They seem to come in indexed, so it's hard to predict what the variables will be
# Yesterday, 16:37 daniel.upshaw If the same Controller action has some optional arguments
# Yesterday, 16:37 daniel.upshaw Passing parameters in routes seems to be a bit confusing
# Yesterday, 16:33 graziel you can check whats possible with `bin/cake bake migration --help`
# Yesterday, 16:29 lpj145 not can be create with bake command ?
# Yesterday, 16:28 ricksaccous @lpj145 you can easily create migrations in a plugin path but apart from that you can just create them and move them wherever you want
# Yesterday, 16:13 lpj145 @deal have a release time to 4x ?
# Yesterday, 16:13 lpj145 with "cake bake migration MigrationName "
# Yesterday, 16:13 lpj145 hi guy's.... someone know how i can create migration in another path ?
# Yesterday, 15:30 ricksaccous lol
# Yesterday, 15:30 ricksaccous i'm thinking if he doesn't budge at first i'll offer to pay for the plane ride myself/etc until he's like OKAY FINE GO
# Yesterday, 15:29 alexdd55976 i tried that too... received a good laugh
# Yesterday, 14:22 ricksaccous i need to convince my manager/boss it sounds like a fun trip
# Yesterday, 14:21 dereuromark not sure yet
# Yesterday, 14:19 ricksaccous @dereuromark are you going to Japan?
# Yesterday, 14:19 dereuromark huhu, cake4 project (app) is now level 7 in phpstan :slightly_smiling_face: https://github.com/cakephp/app/blob/4.x/phpstan.neon