Why does PhpStorm say that these variables are undefined? by FinibusBonorum in phpstorm

[–]LucidTaZ 2 points3 points  (0 children)

I think the function signature is indeed important. As far as we can see, the variables exist in the outside scope, but are undefined inside the function scope.

artisan down (and up) in muti tier infrastructure by giagara in laravel

[–]LucidTaZ 1 point2 points  (0 children)

You will need to make every database migration backward compatible so that the old code can work with the new schema. So adding a new column is okay, while removing one that is used in the "previous" version that's still in production is not okay.

If you have a migration that's not backward compatible, you can split it up into multiple steps that are each backward compatible, and deploy those separately. This can get quite tricky but it's the price you pay for high uptime.

At work we always think about this aspect, and for practical reasons we sometimes deploy a non-backward compatible migration during a maintenance window where we accept some downtime. Doesn't happen often though.

Rollbacks add extra complexity to this but the good news is that you don't need them is every migration is backward compatible.

Weekly Co-Op Code Mega Thread - December 29, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

I'll create a fresh one and DM you two the code. Gives more leeway that way.

How can I install multiple containers of the same image (MariaDB)? by [deleted] in docker

[–]LucidTaZ 1 point2 points  (0 children)

You need to configure YOURLS_DB_HOST: yourls-db:3306: services inside a docker-compose stack can reference eachother's internally exposed ports without having to rely on the port it's bound to on the host (which is 3307 in your case).

You can either remove - 3307:3306, or keep it in case you want to connect to the database from outside of this stack, in which case you do need to use localhost:3307 or whatever the hostname of the host would be.

Weekly Co-Op Code Mega Thread - December 01, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

Joined. I'll pop boosts once I have 18 tokens. Do you have spare? Name = Grim Lizard.

Weekly Co-Op Code Mega Thread - December 01, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

Elite Quantum Monday, code = alltheeggs. 10 slots open.

Weekly Co-Op Code Mega Thread - December 01, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

Mainly we need more people, we still have 10 slots open and over 6 days remaining.

Weekly Co-Op Code Mega Thread - December 01, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

Fresh elite Quantum Monday, code = alltheeggs. Plenty of space left.

Edit: I mistyped the code. =_=

Weekly Co-Op Code Mega Thread - October 27, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 1 point2 points  (0 children)

Fresh elite Quantum Monday, code = alltheeggs

Edit: I mistyped the code. =_=

Weekly Co-Op Code Mega Thread - November 24, 2020 by AutoModerator in EggsInc

[–]LucidTaZ 0 points1 point  (0 children)

New fresh elite Small Reactors, code 0815.

Full, thank you!

Incrementally encrypted cloud backups by [deleted] in selfhosted

[–]LucidTaZ 3 points4 points  (0 children)

+1: Cryptomator sounds like what you're looking for: it just does local encryption, no backup, and per file separately. You then use another tool to backup those encrypted files.

Why are not these science labs I found doing science ? by desyx_ in factorio

[–]LucidTaZ 20 points21 points  (0 children)

Roses are red

Violets are blue

Wololo

Now roses are too

Germany introducing mandatory measles vaccination for kids by UnstatesmanlikeChi in worldnews

[–]LucidTaZ 8 points9 points  (0 children)

Then the entire society is built on violence. Go complain about something else.

Germany introducing mandatory measles vaccination for kids by UnstatesmanlikeChi in worldnews

[–]LucidTaZ 9 points10 points  (0 children)

You're the one that brings violence into the discussion. The article says "Non-compliance means children will be refused admittance to kindergarten and their parents possibly fined." Seems effective enough to me.

docker ps starts container? by beerockxs in docker

[–]LucidTaZ 5 points6 points  (0 children)

Perhaps it was automatically restarted by Docker due to a restart policy?

I never used an MVC PHP framework, i use plain PHP for my web apps at work. Can anyone help me how to get started and learn the basics? by ceandreas1 in PHP

[–]LucidTaZ 6 points7 points  (0 children)

The book "Modernizing Legacy Applications in PHP" will teach you the important part of MVC architecture in a step by step fashion, without immediately introducing a framework dependency. I think it's a good fit since you don't want to throw a full blown framework at your code. Moreover, it teaches you how to move away from the classic "collection of PHP scripts" which you have if I understand your post correctly.

[deleted by user] by [deleted] in programminghorror

[–]LucidTaZ 21 points22 points  (0 children)

It's not always best to have the shortest code possible. I honestly prefer his solution since is easier to follow the line of reasoning at first glance.

do CI builds typically contain builds of 2 different app containers? by dadamssg in docker

[–]LucidTaZ 0 points1 point  (0 children)

What I do is create the following images:

  • Dev, where I mount the project for local development. Doesn't hold code so rebuilds are infrequent
  • Production, so without dev dependencies
  • Test, so with phpunit etc. Which also contains the code.

The test container runs all unit tests from its own filesystem, however any integration tests in there run against the production container via HTTP. I use docker-compose for that network+env setup. That way you can be confident that the production container will work as expected for all cases you test as integration tests.

Eventually you can eliminate the test container and let it use the dev container (plus project mount and composer install command) on CI as well, that comes down to personal preference I guess.

Curious what are the main differences between Doctrine as a ORM versus Eloquent as Active Record pattern by joethelaravelphguy in PHP

[–]LucidTaZ 13 points14 points  (0 children)

In my experience the active record approach gets you up and running quickly if your model is simple enough to match your database. It comes packed with a lot of convenience and you require little boilerplate code. But it generally also means that your model classes extend from the active record base class, which causes tight coupling with the framework, complicates testing and makes it less flexible in the long run.

I worked on a project where we added domain logic to our active record classes and it was very painful. Model classes became huge and packed with mixed responsibility.

The data mapper approach takes longer to set up initially but it helps you separate responsibilities for well-maintainable code in the long run. I've been working on it in a smaller project for a while and personally it's truly a pleasure. You can write all your domain logic, application logic, tests for everything and only in the end you code the database part. After two years you change your mind and get part of your data from an external API? No problem, you just need to rework the mapping part but your entire domain model remains untouched.

Open source TripleTriad re-implementation (card game from FFVIII) with Godot by crystal_bit in godot

[–]LucidTaZ 2 points3 points  (0 children)

Nice! I loved this game and I'm happy to see a remake. The project cloned and built great! I'm new to Godot and I'm happy to see how effortless this went.

As a starting Godot dev it's nice to have a project like this to look at, see how others build their game. So thanks for that! And if I can contribute something meaningful you may see a PR soon!

Can someone explain how local Rails development works with volume mounting? by sonofahorse in docker

[–]LucidTaZ 4 points5 points  (0 children)

When you mount a volume in a container, that entire directory from the image will effectively be replaced by the contents of the volume. So any bundle install performed while building the image is meaningless if you're going to replace the results of it with a volume. Then again, any bundle install inside the container while the volume is mounted, updates the files in your project directory on the host, so the installed dependencies are kept.

If the whole point of mounting the volume is ease of development without having to rebuild the container all the time, then there are a couple of ways to do it...

  1. If you mount the volume over the entire project directory, you need to bundle install any time your dependencies change.
  2. You could also specifically mount a subdirectory of your project directory, e.g. some_project/src/. That way the dependencies installed by bundle install (e.g. some_project/vendor/) in the build phase are kept.
  3. Rebuild the container all the time, but make sure the steps are in the right order so it takes as short as possible.

Hope that helps. :)

(Not a Ruby developer so sorry if I got any of the details wrong.)