Logs for #cakephp

Page 5 of 36,430, showing 100 records out of 3,642,926 total, starting on record 401, ending on 500

# At Username Text
# Dec 12th, 12:51 jotpe Maybe you need the field to be accessible?
# Dec 12th, 12:50 jotpe :thinking_face:
# Dec 12th, 12:49 neon1024 Yes, it seems to be fine in the entity, but when it hits Twig is vanishes
# Dec 12th, 12:48 jotpe ?
# Dec 12th, 12:48 jotpe And in your Controller its working @neon1024
# Dec 12th, 12:47 neon1024 https://book.cakephp.org/3/en/orm/entities.html#accessors-mutators
# Dec 12th, 12:47 kevin.pfeifer i dont know what you mean with ``Entity accessor methods``
# Dec 12th, 12:47 neon1024 Of what? An example of `null`?
# Dec 12th, 12:46 kevin.pfeifer example?
# Dec 12th, 12:45 neon1024 Anyone using Twig for templating having any issues with Entity accessor methods being NULL in the template
# Dec 12th, 12:45 neon1024 @jotpe Heading out in the rain at lunchtime to vote
# Dec 12th, 12:43 jotpe _how do i fix long running tasks? ->_ Call out general elections :troll: Hope you UK guys are decide wisely :uk: :flag-eu:
# Dec 12th, 12:42 neon1024 Or use a message queue
# Dec 12th, 12:42 kevin.pfeifer split your tasks for your background daemon into several smaller tasks so the database can respond for each small task?
# Dec 12th, 12:41 info315 I have a background daemon and it needs an method to reconnect to the DB... There is no other fix for this i guess
# Dec 12th, 12:40 neon1024 That’s the “How long is a piece of string?” question
# Dec 12th, 12:40 neon1024 Lots of ways, benchmark it, streamline it, chunk it, depends what it is, what it’s doing, where it’s running, and about 3.14m other variables
# Dec 12th, 12:39 info315 @neon1024 how do i fix long running tasks?
# Dec 12th, 12:38 ndm Doesn't 1 reconnect attempt happen automatically now?
# Dec 12th, 12:38 neon1024 Fix the script?
# Dec 12th, 12:35 info315 Is there a CakePHP 4 way to reconnect to the database to avoid mysql has von away issues for long running console scripts like i did in cake2? ``` // Avoid "MySQL server has gone away" $this->Cake->Systemsetting->getDatasource()->reconnect();```
# Dec 12th, 10:47 boydbuenodemesquita I'm running in situations sometimes where my migrations fail halfway through. Stranding the database in a situation where migrate and rollback are both error. So I was checking for ways to reduce the change of that happening, so checking the queries after the migration will not solve that. Although I'm not sure if seeing the queries will actually help with anything. :P
# Dec 12th, 10:44 steinkel @boydbuenodemesquita poor man's dry-run would be: take a db-dump, enable query debug, run migrations, restore dump :slightly_smiling_face:
# Dec 12th, 10:35 boydbuenodemesquita Thanks for the help!
# Dec 12th, 10:33 boydbuenodemesquita Ah, might be that the current version doesn't support it. :(
# Dec 12th, 10:33 neon1024 Use `-h` to see options for any shell command 8)
# Dec 12th, 10:33 neon1024 Paydirt!
# Dec 12th, 10:33 neon1024 `-x, --dry-run Dump queries to standard output instead of executing it`
# Dec 12th, 10:33 neon1024 `$ bin/cake migrations migrate -h`
# Dec 12th, 10:33 neon1024 Teach a man to fish
# Dec 12th, 10:32 neon1024 Isn’t there a `--dryrun` option?
# Dec 12th, 10:30 boydbuenodemesquita Can anyone tell me if there is a way to dry-run migrations using the CakePHP CLI, instead of Phinx?
# Dec 12th, 09:29 javier.villanueva hi all
# Dec 12th, 09:04 neon1024 Morning everyone
# Dec 12th, 08:02 jotpe Morning!
# Dec 12th, 05:40 jpramirez And got my first review: https://github.com/FriendsOfCake/awesome-cakephp/pull/333
# Dec 12th, 00:42 jpramirez Pull requested
# Dec 12th, 00:33 dev.cyrusjayson good morning
# Dec 12th, 00:33 dev.cyrusjayson thanks marco
# Dec 11th, 22:20 jpramirez Thanks, I will!
# Dec 11th, 22:15 voycey Submit this to awesome-cakephp :ok_hand:
# Dec 11th, 22:12 storkovo @jpramirez nicely done!
# Dec 11th, 21:49 jpramirez Hi channel, here is a little announcement, a kind of support hint for monster apps. Cake makes you build fast and grow solid. But over the years, my company's app has become too big and too rigid. The problem would have occurred with any framework. We postponed again and again, but at some point it had become impossible, we had to rethink our architecture. I searched for domain driven design approaches for CakePHP, or any other
# Dec 11th, 21:49 slackebot2 framework. But I could not find anything really convincing. So I started implementing something for our CakePHP app. And it turned out that the way Cake is built, we could pretty easily split the MVC structure into mini MVC structures. At once, we started understanding our code again. I wanted to share my experience on that in a package. If you have or expect having an ever growing app, this could be of interest to you:
# Dec 11th, 21:49 slackebot2 https://github.com/pabloelcolombiano/cake-dm Fell free to try it and to contribute! Happy baking, Juan-Pablo
# Dec 11th, 20:24 japerlman Thank you!
# Dec 11th, 20:24 japerlman Ok, thanks. That makes sense, it still isn't 100% clear but I'm sure I can figure it out from that page you linked.
# Dec 11th, 20:20 ndm To the memory, it's non-persistent runtime configuration. It can be persisted by using `Configure::store()` https://book.cakephp.org/3/en/development/configuration.html#storing-runtime-configuration
# Dec 11th, 20:18 japerlman so not sure where it's writing it to
# Dec 11th, 20:17 japerlman I just need it to persist, I restarted sql and it still has the value
# Dec 11th, 20:16 ricksaccous basically if you write it in a certain controller/certain controller action, anything outside of that, the configs won't apply
# Dec 11th, 20:16 ricksaccous i think not anywhere, that's why you can over-ride config values
# Dec 11th, 20:15 japerlman I don't see any files in /config/ being modified
# Dec 11th, 20:15 japerlman Where are things being written if I define 'use Cake\Core\Configure;' in my controller then use 'Configure::write('KEY','VALUE')
# Dec 11th, 20:15 ricksaccous there that's better
# Dec 11th, 20:15 ricksaccous you can do this via adding validation to field b and writing a custom rule where you check the context and actually just validate field a
# Dec 11th, 20:14 ricksaccous that was confusing
# Dec 11th, 20:14 ricksaccous you can do this via adding validation to the other field and writing a custom rule where you check the context and actually just validate the other field
# Dec 11th, 20:14 ricksaccous yeah
# Dec 11th, 19:15 jotpe Is it possible to add a validation message to another field than the validation is run on? E.g. I have a file upload and validate if the file is already uploaded (via sha1 hash of the file = storage_filename). If the storage_filename exists, validation fails, but the validation message is not applied to the form field.
# Dec 11th, 16:17 ricksaccous so wasn't getting the set values
# Dec 11th, 16:17 ricksaccous i wasn't using default
# Dec 11th, 16:17 ricksaccous nevermind i figured it out
# Dec 11th, 16:09 ricksaccous this is what i tried
# Dec 11th, 16:09 slackebot2 <ricksaccous>
# Dec 11th, 16:08 ricksaccous this party mainly, because all this is deprecated and the code i am attempting isn't working
# Dec 11th, 16:08 slackebot2 <ricksaccous>
# Dec 11th, 16:07 ricksaccous I'm having trouble with https://book.cakephp.org/3/en/core-libraries/validation.html#using-custom-validation-rules
# Dec 11th, 16:07 noel ok nvm I see it
# Dec 11th, 16:04 noel I am a bit confused by it though because it seems to be including just a file name, not a full path. How does it know the path?
# Dec 11th, 15:58 storkovo flashback to php4
# Dec 11th, 15:53 noel wow.. I didn't know one could use PHP like that. I mean I've used include before but I didn't realise that you could use it within a class and it would pick up context from the class. And the buffering picks up the output neatly too.
# Dec 11th, 15:47 dereuromark see View class and how it gets rendered there
# Dec 11th, 15:46 noel How is it that Templates have a `$this` context when they are not classes?
# Dec 11th, 15:22 ricksaccous @scuadra https://www.php.net/manual/en/datetime.diff.php
# Dec 11th, 15:20 scuadra @jotpe thank you, it's perfect. But I couldn't find a way to calculate the difference between the dates. For example today is 2019-12-11 and my `expire_date` is 2019-12-15. So this is 4 days but how to get it?
# Dec 11th, 14:15 info315 @challgren thanks
# Dec 11th, 14:13 challgren Command
# Dec 11th, 14:12 info315 Hi, quick question, what is the new `Shell` if `@deprecated 3.6.0 ShellDispatcher and Shell will be removed in 5.0` with CakePHP 4?
# Dec 11th, 13:47 challgren Yeah it was back in the 2.x to 3.x days. But I was able to fix it by making my own repos. Probably not everything needs forked but its always good to have a copy
# Dec 11th, 13:35 boydbuenodemesquita Ah, that does sound like headache material. I never though about forking everything, I'll certainly keep it in mind.
# Dec 11th, 13:30 jotpe @scuadra What about this? https://book.cakephp.org/3/en/core-libraries/time.html#comparing-with-the-present
# Dec 11th, 13:23 challgren I had a horrible issue where our cluster was spinning up new VMs and a package was deleted and the clusters were failing because they couldnt spin up. Major headache.
# Dec 11th, 13:23 challgren Ahh no worries glad we could help you. Also if your in production and dont plan on doing much dev I would recommend forking all the packages you use and use your repos that way in the future you wont run into the issue.
# Dec 11th, 13:19 boydbuenodemesquita It took me way longer than I had hoped. After adding the files to a remote repo, I also had to push a tag with version number. Otherwise composer didn't understand that the repo actually had versions (defining a version inside the composer.json would've probably also worked) Thanks again for the help.
# Dec 11th, 13:13 scuadra Hello. I have a field `expire_date` of type `DATE` in a table. I want to select the `DATEDIFF` between this field and today. How can I do this in Cake 3.x? In Cake 2.x I used the following: 'DATEDIFF(Event.expire_date, CURDATE()) as days_remaining'
# Dec 11th, 13:02 jh as for logging, did you configure to auto expire
# Dec 11th, 13:02 jh Is anyone of you using redis with https://github.com/lorenzo/cakephp-redis to filter/search/index/display redis data?
# Dec 11th, 13:01 jh Is anyone of you using redis for logging?
# Dec 11th, 12:12 challgren https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository
# Dec 11th, 12:12 boydbuenodemesquita Yeah, we're planning to go live next week, so I was setting up production right now. Talking about bad timing.
# Dec 11th, 12:12 narendravaghela or you can move to your app's plugin directoruy
# Dec 11th, 12:11 challgren Yep
# Dec 11th, 12:11 boydbuenodemesquita I'll take that route. I can just require packagest directly from git right? I don't need to publish them somewhere?
# Dec 11th, 12:11 narendravaghela :)
# Dec 11th, 12:10 challgren Thats the one thing I dont like about composer is the package can go missing and totally wreck your world
# Dec 11th, 12:10 challgren Thats what I would do take the files in vendor and make my own repo.
# Dec 11th, 12:09 narendravaghela both packages are different
# Dec 11th, 12:08 narendravaghela @boydbuenodemesquita That package does not exists in their github account. So, you have to update the vendor files itself or as @challgren suggested create one from the files.
# Dec 11th, 12:08 boydbuenodemesquita This one doesn't seem to use the same method of setting the response though. So it doesn't seem like it's just a drop in replacement. But I'll definitely try one of the other ones.