IRC logs for #farmOS, 2022-02-22 (GMT)

2022-02-21
2022-02-23
TimeNickMessage
[04:00:18]* kunigunde[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* farmtech[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* postmanpat[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* IyarkaiTechLab[m has quit (Quit: You have been kicked for being idle)
[04:00:18]* SpencerOnazi[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* OmkarEkbote[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* Anonymous[m]1234 has quit (Quit: You have been kicked for being idle)
[04:00:18]* davd[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* and712[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* frederike[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* gretel[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* goldi[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* gunter[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* hra38192639[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* mindcls[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* iuresearcherpw[m has quit (Quit: You have been kicked for being idle)
[04:00:18]* harry[m]12 has quit (Quit: You have been kicked for being idle)
[04:00:18]* olaf[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* phantomse[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* steinfarm[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* JanSonntag[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* ChristophWolfes[ has quit (Quit: You have been kicked for being idle)
[04:00:18]* AllanMacGregor[m has quit (Quit: You have been kicked for being idle)
[04:00:18]* lordeddi[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* Noaht[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* aislinnpearson[m has quit (Quit: You have been kicked for being idle)
[04:00:18]* oliverp44[m] has quit (Quit: You have been kicked for being idle)
[04:00:18]* matrixtrix[m] has quit (Quit: You have been kicked for being idle)
[05:12:48]<skipper_is[m]>I've got a few days of being stuck in side doing admin, so I'm going to try again to migrate across to FarmOS2. I've got it working on my server (just running Apache2, php, MySQL etc nativly). But, I'm wondering is it better to use docker? Keep it all containerised? Can docker run alongside Apache2 without fighting too much?
[05:30:21]<skipper_is[m]>:Edit: Oh wow, no they do not place nice together.
[05:46:08]<mstenta[m]>skipper_is: i think port 80 conflict would be the only consideration
[05:47:08]<mstenta[m]>But there are ways around that... You can run the docker container on a different port... Or, you could put both behind an Nginx reverse proxy perhaps
[16:39:38]<skipper_is[m]>Spent the day trying to get Apache reverse proxy to work... Finally succeeded...
[16:43:33]<skipper_is[m]>Now I've just got to create the custom land types, and the migration form....
[16:44:05]<skipper_is[m]>How stable is it now? Do you recommend going for the main site on FarmOS2?
[16:44:21]<skipper_is[m]>Or keep it on FarmOS1.x for now?
[16:44:24]<mstenta[m]>Definitely! Good to go!
[16:45:48]<skipper_is[m]>Nice, I'll try and port some modules then!
[16:46:09]<skipper_is[m]>For updates, is it easy enough to update the docker instance?
[16:49:59]<mstenta[m]>https://farmos.org/hosting/update/
[16:50:18]<mstenta[m]>Tl;dr: yes - if you only bind-mount the `sites` directory as a volume
[16:50:55]<mstenta[m]>Also be sure to use a specific version for the docker image (eg: `farmos/farmos:2.0.0-beta2` - NOT `farmos/farmos:latest`) to ensure your updates are intentional
[16:51:46]<mstenta[m]>And of course, be sure to backup your db first! ;-)
[16:51:59]<mstenta[m]>And run `update.php` afterwards... and clear cache for good measure
[16:52:03]<mstenta[m]>(all in that doc link)
[16:52:19]<skipper_is[m]>Always CC, fixes everything
[16:52:56]<skipper_is[m]>What will "docker pull farmos/farmos" pull down?
[16:53:05]<skipper_is[m]>Latest latest, or latest release?
[16:53:34]<mstenta[m]>`farmos/farmos` will be automatically interpretted (by Docker) as `farmos/farmos:latest`
[16:53:44]<mstenta[m]>i don't recommend that, just because you may end up updating accidentally
[16:53:56]<skipper_is[m]>and :latest will be the most recent commit?
[16:53:59]<mstenta[m]>better to declare the specific version so it's intentional
[16:54:10]<mstenta[m]>ah good question... no... `latest` will be the latest tagged release
[16:54:18]<skipper_is[m]>ah ok
[16:54:24]<mstenta[m]>(that's how we do it anyway... not necessarily how other docker images work fyi)
[16:54:34]<skipper_is[m]>But it'll only update when you re-do pull? I've not used docker before..
[16:54:39]<mstenta[m]>yes
[16:54:45]<skipper_is[m]>Oki
[16:55:09]<mstenta[m]>so its *pretty* safe... but there are cases where it can "getcha"
[16:56:02]<mstenta[m]>eg: say you realized your server disk was full of old docker images, so you shut down your containers and run `docker system prune -a` - this deletes all unused images. if you then bring your farmOS container back up, it will pull a fresh `latest` automatically
[16:56:23]<mstenta[m]>GOTCHA
[16:56:26]<skipper_is[m]>Ah
[16:56:26]<mstenta[m]>:-P
[16:56:43]<skipper_is[m]>....And the quick forms format looks really different...
[16:56:46]<mstenta[m]>i speak from experience - i was gotten
[16:57:15]<mstenta[m]>there are some differences with quick forms... but in general the Drupal Form API hasn't changed too much
[16:57:26]<mstenta[m]>they are in classes now - that's the biggest thing
[16:57:34]<mstenta[m]>and `$form_state` is an object, not an array
[16:57:42]<skipper_is[m]>ACTION sent a code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/b27aebee57...
[16:57:44]<skipper_is[m]>What's all that stuff?
[16:58:30]<mstenta[m]>Drupal 8+ uses PSR-4 namespaces, which is a newer PHP standard... it allows you to have classes with the same name without conflicts basically
[16:58:47]<mstenta[m]>`namespace` at the top of the file declares the namespace for that class (one class per file)
[16:59:01]<mstenta[m]>all the `use` lines declare classes that are used by code in that file
[16:59:30]<skipper_is[m]>like import in Python?
[16:59:40]<mstenta[m]>PHPStorm makes this stuff WAAAAY easy... it will automatically fill a lot of that stuff in for you as you're coding
[16:59:45]<mstenta[m]>yes pretty much!
[16:59:54]<skipper_is[m]>Yea, but PHPStorm is expensive...
[17:00:06]<mstenta[m]>Drupal uses Symfony which "autoloads" classes as you use them
[17:01:05]<mstenta[m]>yea... I think symbioquine uses Eclipse (?) but I can't speak to that...
[17:01:20]<mstenta[m]>i do enough Drupal/PHP dev that it's worth it :-)
[17:01:38]<mstenta[m]>(definitely curious about Eclipse tho! just never made the jump)
[17:01:48]<skipper_is[m]>I'll stick with Atom
[17:01:50]<mstenta[m]>anywho- you can get away without that stuff too...
[17:02:00]<mstenta[m]>oh yea I bet Atom has some good PHP plugins
[17:02:31]<mstenta[m]>one other thing to notice... in the planting quick form there are a few `use` statements IN the class itself (at the top)
[17:02:32]<skipper_is[m]>I've no idea to be honest.... I just use it as notepad with a file explorer on the side...
[17:02:49]<mstenta[m]>those are traits... which are a new PHP feature that essentially let's you "mixin" additional methods into your class
[17:03:17]<mstenta[m]>so farmOS core provides a few `Quick*Trait` traits, that have some helper methods for doing common things
[17:03:25]<skipper_is[m]>So `use Drupal\Component\Datetime\TimeInterface;` for a date/time box?
[17:03:56]<mstenta[m]>search for `TimeInterface` and you'll see where that gets referenced
[17:05:23]<mstenta[m]>this is a somewhat complex quickform (the planting one) so it has a lot of stuff you may not need
[17:06:05]<mstenta[m]>here's a simpler one: https://github.com/mstenta/farmOS/blob/2.x-quick-wip/modules/quick/egg/s...
[17:06:26]<mstenta[m]>(work in progress - but maybe helpful for comparison)
[17:06:51]<mstenta[m]>(also hasn't been tested in a while - hopefully still works 😬)
[17:09:57]<mstenta[m]>the planting quick form makes use of another new(er) PHP concept you might need to learn: dependency injection (that's what the `__construct()` and `create()` methods are responsible for)
[17:10:31]<mstenta[m]>basically: allows you to declare the "services" you need, and Drupal will automagically pass them into the class for you to use
[17:10:44]<skipper_is[m]>Ah yes, the egg forms looks a bit simpler!
[17:11:13]<skipper_is[m]>Right, I'd better go shut some chickens in for the night. I'll have a play tomorrow and see what happens!
[17:11:16]<mstenta[m]>for example, the planting form makes use of the Drupal time service - that's where `TimeInterface` is used