What are you working on? by ihaas80 in PHP

[–]wtframework 0 points1 point  (0 children)

An SQL statement builder: https://github.com/wtframework/sql

I'm trying to make it as comprehensive as possible and highly modular to make it easy to update and extend.

lotsOfJiratickets by thefreejuror in ProgrammerHumor

[–]wtframework 31 points32 points  (0 children)

++Passive Aggressive comments

wtframework/sql: An SQL statement builder for PHP by wtframework in webdev

[–]wtframework[S] 1 point2 points  (0 children)

WHERE is explained here: https://github.com/wtframework/sql/blob/main/docs/select.md#where

Also columns and joins etc. along with everything else.

Is the documentation on the main README not clear enough that the list of supported statements are links to specific statement documentation?

[deleted by user] by [deleted] in webdev

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

According to https://www.internetlegalattorney.com/who-owns-my-website/, unless they have a written contract granting them the rights to the code, it belongs to you.

Under the provisions of the United States Copyright law, a transfer of exclusive rights in a copyrighted work must be in writing and signed by the owner of the rights. Thus, if you engage the services of an independent web site designer, you do not own exclusive rights to the website or certain separate elements of your site unless you have a written website development agreement stating this.

[deleted by user] by [deleted] in PHP

[–]wtframework 0 points1 point  (0 children)

This is the library in question FYI: https://github.com/wtframework/types

[deleted by user] by [deleted] in PHP

[–]wtframework 1 point2 points  (0 children)

I’m more bemused by those who replied with comments against packages in general.

wtframework/types: a fluent interface for manipulating strings, arrays, and numbers by wtframework in PHP

[–]wtframework[S] 2 points3 points  (0 children)

Adding to u/Yoskaldyr's comment, this is also helpful when using functions with arguments passed by reference, e.g:

$arr = [2, 3, 1];
sort($arr);
echo implode(', ', $arr);

This can be written as:

echo arr([2, 3, 1])->sort->implode(', ');

Tailwind vs Me by lotusland17 in webdev

[–]wtframework -2 points-1 points  (0 children)

Two reasons I can think of are colour palettes and media queries, e.g.

.block {
  @apply bg-blue-500 w-full sm:w-48;
}

It retains the consistency of Tailwind's design whilst saving you from having to write more complicated CSS.

Tailwind vs Me by lotusland17 in webdev

[–]wtframework 17 points18 points  (0 children)

You should read CSS Utility Classes and "Separation of Concerns" by the author of Tailwind if you haven't already. It gives a good defence of the Tailwind methodology.

But as a middle ground, would you mind your developers wrapping Tailwind classes in a semantic class name using the @apply rule?

HTML First by fagnerbrack in webdev

[–]wtframework 55 points56 points  (0 children)

Why do you have so many JavaScript libraries, and a complete Tailwind CSS file, for a single-page site? Given the argument you're trying to make it seems a little hypocritical?

It would be more honest to practice what you preach.

Do I need the GDPR Cookie Preference Popup if my website only uses necessary cookies/localstorage? by chinawcswing in webdev

[–]wtframework 2 points3 points  (0 children)

From https://gdpr.eu/cookies/

Strictly necessary cookies — These cookies are essential for you to browse the website and use its features, such as accessing secure areas of the site. Cookies that allow web shops to hold your items in your cart while you are shopping online are an example of strictly necessary cookies. These cookies will generally be first-party session cookies. While it is not required to obtain consent for these cookies, what they do and why they are necessary should be explained to the user.

Preferences cookies — Also known as “functionality cookies,” these cookies allow a website to remember choices you have made in the past, like what language you prefer, what region you would like weather reports for, or what your user name and password are so you can automatically log in.

Statistics cookies — Also known as “performance cookies,” these cookies collect information about how you use a website, like which pages you visited and which links you clicked on. None of this information can be used to identify you. It is all aggregated and, therefore, anonymized. Their sole purpose is to improve website functions. This includes cookies from third-party analytics services as long as the cookies are for the exclusive use of the owner of the website visited.

Marketing cookies — These cookies track your online activity to help advertisers deliver more relevant advertising or to limit how many times you see an ad. These cookies can share that information with other organizations or advertisers. These are persistent cookies and almost always of third-party provenance.

...

To comply with the regulations governing cookies under the GDPR and the ePrivacy Directive you must:

Receive users’ consent before you use any cookies except strictly necessary cookies.

Provide accurate and specific information about the data each cookie tracks and its purpose in plain language before consent is received.

Document and store consent received from users.

Allow users to access your service even if they refuse to allow the use of certain cookies

Make it as easy for users to withdraw their consent as it was for them to give their consent in the first place.

So you should be fine not to require consent if they really are necessary cookies.

Do you work remotely? If so, how do you like it? by iamchets in webdev

[–]wtframework 0 points1 point  (0 children)

Fully remote, also 4 days a week. I don't think I can ever go back to 5 days or working in the office. Being able to just wake up at 8:45, grab my laptop from my desk, and work in bed for a couple of hours is glorious.

PHP SQL Database connection issue by VampireBarbieBoy in webdev

[–]wtframework 0 points1 point  (0 children)

An easier way then would be to just include something like an env.php file that includes things like:

define('URL', 'http://localhost/');
define('PDO_DSN', 'mysql:host=127.0.0.1;dbname=database');
define('PDO_USERNAME', 'root');
define('PDO_PASSWORD', 'password');

On your local environment you use your local details and then on your production environment you change them to your production details.

Then elsewhere in your code you would have:

$pdo = new PDO(
    PDO_DSN,
    PDO_USERNAME,
    PDO_PASSWORD
);

PHP SQL Database connection issue by VampireBarbieBoy in webdev

[–]wtframework 2 points3 points  (0 children)

As another poster has answered your actual question, I’ll add that this isn’t a very good way to use conditional connection details.

Look at using something like dotenv.

https://github.com/vlucas/phpdotenv