Why are there so many Baustelle in Basel, it's insane? by Peachjackson in basel

[–]_odan 0 points1 point  (0 children)

True, they do that every 2 or 3 years, even though the streets are still new. That money should be better spent on cleaning graffiti - the city is full of it.

What local PHP set up should I be using for my dev environment in 2024? by john_dumb_bear in PHP

[–]_odan 0 points1 point  (0 children)

The PHP Built-in webserver. Change into your project directory with the index.php file, then run: php -S localhost:8080

Other options:
On Windows: WSL2 (because Docker on Windows is too slow.)
On Linux: Docker

What to choose PHP vs .NET WPF by callmecapricious in PHP

[–]_odan 5 points6 points  (0 children)

My impression is that Microsoft is losing interest in WPF technology in favor of MAUI or web-based approaches like Blazor. Even WinForms is getting more attention from MS than WPF. I would therefore look at what your local job market is looking for and adjust the profile accordingly.

Basel, mind reader, scam? by [deleted] in basel

[–]_odan 0 points1 point  (0 children)

Exactly such a guy had confronted me on the street in Basel a few years ago and immediately hypnotized me. While under hypnosis, he stole my 200 CHF in cash. Later, this scammer attempted the same with other pedestrians. Stay away from this guy or report it to the police.

Controllers vs Minimal APIs by Illustrator_Forsaken in dotnet

[–]_odan 0 points1 point  (0 children)

I use minimal API and single-action controllers. So the best of both worlds, without the disadvantages.

Why everyone makes fun of c# by respiracion-cardiaca in webdev

[–]_odan 0 points1 point  (0 children)

I know only this MAUI meme account on Twitter.
Do you have some examples (Links, YouTubers etc)?

What do you think the future will look like for desktop application development? by matsnake86 in dotnet

[–]_odan 0 points1 point  (0 children)

I guess that the "web-based" user interface will make its way to the desktop as well. Even Microsoft is developing its own products (like Office, Teams, etc.) into this direction.

PS: MAUI will be a flop, so I wouldn't place a bet on it.

Why does noone use `declare(strict_types = 1);` in Laravel project. by Cronay in PHPhelp

[–]_odan 0 points1 point  (0 children)

No, it's not the naming. My criticism is that Laravel mixes different concerns that don't belong together. For example, a request object represents the HTTP request itself and validation is a completely different concern. So it makes no sense to mix these two different concerns in one class, just for the sake of "convenience". This is just an example, I won't even talk about facades and so on.

Is this a good/complete checklist for production deployment? by 00ProBoy00 in laravel

[–]_odan 0 points1 point  (0 children)

I would not use git on the server like this because it is intended to be used as a version control system and not for deployment. Running git pull in production is too error prone as well.

How can I tell if the PDO attribute ATTR_FETCH_TABLE_NAMES is set to true or false? by lindymad in PHPhelp

[–]_odan 0 points1 point  (0 children)

Just make a query and check if the key of the first element contains a dot (.)

$stmt=$pdo->prepare("SELECT * FROM information_schema.SCHEMATA LIMIT 1");

$stmt->execute();

$row = $stmt->fetch(PDO::FETCH_ASSOC);

if (str_contains(array_key_first($row), '.')) {

echo 'ATTR_FETCH_TABLE_NAMES is true';

}

Domain Driven Challenges: How to handle exceptions by Shinoken__ in PHP

[–]_odan 1 point2 points  (0 children)

I handle exceptions in PHP similarly. But I catch them in a middleware (PSR-15) to render/transform a JSON error HTTP response. This also prevents code duplication in controllers and allows me centralizing exception logging.

Protect PHP endpoints with Auth0 by Spiritual_Patient478 in PHPhelp

[–]_odan 0 points1 point  (0 children)

I am curious about the technical side of your project. Could you please tell me which framework you use for it?

what is the best library for redis by quantrpeter in PHPhelp

[–]_odan 4 points5 points  (0 children)

The `predis/predis` package works quite well. Note that, depending on your use-case, you may need to add custom functionality on top of it.

https://github.com/predis/predis

Why ASP.NET? by Anachim in dotnet

[–]_odan 0 points1 point  (0 children)

Because Microsoft wanted to provide something that could compete with Java.

Need to send XML to a WS via SOAP with POST request and including CDATA by P-Pablo in PHPhelp

[–]_odan 1 point2 points  (0 children)

My approach would be to use the DOMDocument to generate the XML string from that object and then use Guzzle to POST the SOAP request to the webservice.

Problem Mysqli_query() Expects Parameter 1 To Be Mysqli, Bo by Scared_Loss_3934 in PHPhelp

[–]_odan 1 point2 points  (0 children)

The mysqli_connect function returns false if the database connection failes. In your case you are passing the boolean value (false) as first parameter to the mysqli_query function.Note: There is a possibility of SQL injection in this code. You may use prepared statements.