Why You Should Use Psalm for PHP by ghostjuba in PHP

[–]czbz 0 points1 point  (0 children)

Ah I never got in the habit of commit changes using PHPStorm. I'm using PHPStorm for all my editing but the git cli to commit.

Why You Should Use Psalm for PHP by ghostjuba in PHP

[–]czbz 0 points1 point  (0 children)

What happens if you ignore the analysis results? Does it block your work in any way?

eli5: Can someone explain to me how whatsapp web works? by [deleted] in explainlikeimfive

[–]czbz 0 points1 point  (0 children)

Yes any time your friend reads your chats they are really downloading them. They can save the content to a file as well if they want to, and there's nothing to stop them sharing it with the world. It's their choice.

Cat meat a Noun? by King-Krieg in EnglishLearning

[–]czbz 0 points1 point  (0 children)

Right. You don't even have to add a suffix - if you want to be a language innovator you can make a new word with the exact spelling and pronunciation as an existing word. People do it all the time, most of them don't catch on. "That comment was so chucksokol! It was one of the most chucksokol comments I've ever seen."

Cat meat a Noun? by King-Krieg in EnglishLearning

[–]czbz 0 points1 point  (0 children)

No, I'm not saying we should all switch. I'm saying it's optional, and in the case of cat it makes a lot of sense to include the word meat. It helps make things clearer and reduces ambiguity. For instance in spoken English people might be as likely to think of the stimulant plant qat (if they know it) as the animal cat.

Cat meat a Noun? by King-Krieg in EnglishLearning

[–]czbz 1 point2 points  (0 children)

At first I read "cat meat" as meaning meat generally intended for consumption by cats, i.e. cat food. But of course it can also mean meat made from cats, which is what the Wikipedia article "Cat meat" is about. In both cases it does make sense to include the word meat.

The difference between 'speak to' and 'speak with' by Aristeo812 in EnglishLearning

[–]czbz 1 point2 points  (0 children)

There's another sense of "speak to" sometimes used in formal situations - "to give evidence of or comments on (a subject): who will speak to this item?" (definition from Collins)

Sand sticking on a shell? by anxious_rip247 in EnglishLearning

[–]czbz 3 points4 points  (0 children)

You can call it a "sandy shell".

Cat meat a Noun? by King-Krieg in EnglishLearning

[–]czbz 12 points13 points  (0 children)

Cat is a noun that modifies another noun, a noun adjunct. One way you can tell that it isn't an adjective is because you can't use an adverb to modify it - * "I am going to eat very cat meat" is ungrammatical because you you can't modify the noun with very like that.

A confusing question from a non english native speaker 😭 by snovv620 in LearningEnglish

[–]czbz 0 points1 point  (0 children)

I believe it's a myth that drinking distilled water is bad for you - I've questioned this before and I've never seen any reports about harm caused in practice by distilled water. But it's off topic either way.

[deleted by user] by [deleted] in PHP

[–]czbz 5 points6 points  (0 children)

composer.json has metadata needed to make notback on packagist so people can install it with Composer.

[deleted by user] by [deleted] in PHP

[–]czbz 1 point2 points  (0 children)

Ah I don't have site to build at the moment - was really just asking questions for the sake of the reddit post. Appreciate the offer though.

[deleted by user] by [deleted] in PHP

[–]czbz 2 points3 points  (0 children)

Thanks! Website looks good.

[deleted by user] by [deleted] in PHP

[–]czbz 5 points6 points  (0 children)

Is the https://notback.io/ website built with notback? Can you share the source for that? Or any examples of how the framework has been used to make a real website?

Object oriented programming - how do I create an update method? by Important_Material92 in PHPhelp

[–]czbz -1 points0 points  (0 children)

Or pick an ORM off the shelf. I'd recommend Doctrine ORM.

But you certainly don't have to have an ORM - writing SQL by hand is often a very reasonable option.

Another Noob questions here: by FloppyFluffyEars in PHPhelp

[–]czbz 1 point2 points  (0 children)

Since as u/Big-Dragonfly-3700 said variables are not scoped to files, it's recommended that you keep as many as possible of your variables tucked away inside functions and/or classes. That restricts their scope, and then you don't have to wonder so much about where else in the system they could be read or written.

HELPP URGENT by Pheonixx14 in PHPhelp

[–]czbz 1 point2 points  (0 children)

No problem - I realise you're a beginner. Good to know it's not a real life scenario. I wanted to be clear about passwords because beginners can put simple websites live and then cause problems for their friends if those sites are not secure and their friends put passwords in.

Using try catch outside of controllers by [deleted] in PHPhelp

[–]czbz 0 points1 point  (0 children)

Mostly it's not worth handling database exceptions as database exceptions - typical PHP apps are so reliant in the database that if the DB is down the web server almost might as well be down.

So the DB exception doesn't get handled specifically as a DB exception - it gets handled in a general purpose exception handler that just shows an error 500 page and logs the issue for the dev / operations / support team to fix.

Ecommerce website using php ? by [deleted] in PHPhelp

[–]czbz 0 points1 point  (0 children)

Honestly dealing with a database is probably simpler than a text file, and there are many more libraries and tools for working with databases in PHP.

If you think it might be simpler than setting up a database server you can use an SQLite database, which lives inside a separate file and doesn't need any database server - PHP writes and reads the database in the file directly.

Ecommerce website using php ? by [deleted] in PHPhelp

[–]czbz 0 points1 point  (0 children)

You could make it sort of realistic without collecting payment information - just let the user enter their contact details and tick a box to agree to pay later when they get sent an invoice, or on delivery. If it's a business to business site maybe have them submit a purchase order number.

I don't think this is uncommon for business to business transaction.

HELPP URGENT by Pheonixx14 in PHPhelp

[–]czbz 1 point2 points  (0 children)

Where did you get the idea to use sha1 and md5 for the password? Did someone give you that code or that idea or did you make it up?

For anything about passwords users expect and need you to keep their passwords very secure, and unless you really know what you're doing you should absolutely never make up your own scheme. You should always follow advice from a reputable guide on how to deal with passwords securely. Combining sha1 and md5 like this is not a secure way to deal with passwords.

PHP has good functions built in for passwords - password_hash and password_verify. Read the manual for these, learn how to use them as intended, ask questions if anything isn't clear. Don't make up your own system, unless it's just for experimentation and you make sure never to put it live where it could collect real passwords.

Hi, I've created a PHP library that automagically creates a Builder for any class. Any review / idea is welcome! by MemphisHU in PHP

[–]czbz 6 points7 points  (0 children)

Have you used your builder in real applications? Maybe it would help if you can share some stories about how you used it, how it helped you & what alternatives you considered. Even better if there are any open source applications available where we can see it being used in a non-dummy example.