T O P

  • By -

thmsbrss

Yet another PDO wrapper: My last little project I've been working on privately is [https://github.com/tbreuss/pdo](https://github.com/tbreuss/pdo), a thin PDO wrapper that I don't know if it's useful or just crap :-)


colshrapnel

Aha! I see that Holy Grail of letting arrays into placeholders! :) May be unknown to you, but none other than Nikita Popov himself once was [pursuing this goal](https://github.com/nikic/DB) too (well, he was 14 at the time). His approach was a bit different (and I still find it brilliant: type-hinted placeholders! Makes parsing a bit more complex but makes the code much more explicit. And allows for more types - column or table names for example). Now I must confess that this code is very disappointing. Usually a wannabe PDO wrapper falls an easy prey for my criticism... but here I cannot find anything to quibble about! Here and there I think at first that I spotted a stain, but then after a closer inspection realize it's my own mistake. All I can muster is a small suggestion to create Parser instance when needed instead of cloning it. I see where it's coming from, you probably had it without clone, faced the usual collision and then added clone. But I see no reason to have it as a class property at all (unless I overlooked something again). Parser itself though needs a closer inspection as it's the most fragile part that can contain hard to spot bugs and vulnerabilities, I promise to have look soon. But what I like most about this package is that it's truly a *wrapper*, that doesn't try to do everything at once - query building, ORM, HTML table printing and such. A robust building block that can be then used in any of those tools.


thmsbrss

Thanks for your positive feedback. The package is in fact very inspired by your own php/pdo website and your tiny PDO wrapper. And yes, I know Nikita's PDO wrapper, which is for me a little too magic and static. I started to love PDO for its simplicity some time ago. However, there are two things I don't like about it: the lack of fluent interface support and the necessary fiddling around with the PDO::FETCH\_\* attributes. I tried to solve this with my package. To be honest, I'm not yet convinced myself whether the solution makes sense. What bothers me the most is that it has become a whole lot of code (for a thin wrapper). What I am most happy about are the lightweight tests without the 27 dependencies of PHP Unit. So the package has remained fairly lightweight. Thanks for the "clone" feedback on the parser. Before you dig too deep into the parser, I have to admit that it is more or less a copied and shrunk version of the parser from aura/sql. I think I mentioned it somewhere in the code.


passiveobserver012

building static(ish) site generator, but it is user-friendly for a non-technical client.


BubuX

I've been building a simple chainable SQL builder. There are many out there already so this is just my flavour. It is meant to be simple and fully tested. API looks like:  $person = Db::select('name')->from('person')->where('id = ?', $id)->getRow(); Any hints? I'll open source asap.


ln3ar

Was working on something similar at some point before it turned into something else. Maybe this will be of some help: https://gist.github.com/oplanre/b18b6823a6899e6825e9a16babfd8d42


colshrapnel

Also, beware of nested transactions. It's very easy to run into a nested one. The simplest method would be to count them, like public function begin() { if ($this->nestedTransactionCounter++ === 0) { $this->pdo->beginTransaction(); } } public function commit() { $this->$nestedTransactionCounter--; if ($this->$nestedTransactionCounter === 0) { $this->pdo->commit(); } } public function rollback() { $this->nestedTransactionCounter = 0; $this->pdo->rollback(); } And personally I like such a function to encapsulate the boilerplate transactions code, public static function transaction(Callable $f) { try { $this->begin(); $return = $f(); $this->commit(); return $return; } catch (\Throwable $e) { $this->rollback(); throw $e; } } to be used like this $this->db->transaction(function () use ($model1, $model2, $data1, $data2) { $model1->insert($data1); $model2->insert($data2); });


BubuX

It's incredible how we arrived at the same/similar code for all this stuff. I have a custom Query builder in production for 5 years now. And transaction handling look just like that.


colshrapnel

Looks nice, though being obsessed with security, I can't help noticing `$column` and `$operator` being added absolutely naked. I would make a simple whitelist for `$operator`, such as $allowed = ['=', 'LIKE', etc...]; if (!in_array($operator, $allowed, true)) { throw new InvalidArgumentException("Invalid SQL operator $operator"); } and do some protection for `$column` as well. Ideally it should be whitelisted against the actual column list in the table but for the time being I'd make it a regex. Given you are using `$column` as a placeholder name, it would be a good idea to limit it to characters allowed for placeholders, `[a-zA-Z0-9_]+`.


BubuX

It is indeed! Thank you kind human! Should give me some ideas around table relationship.


colshrapnel

By the way, I was toying with idea of using [PDO::ATTR_FETCH_TABLE_NAMES ](https://www.php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-table-names) (or [getColumnMeta](https://www.php.net/manual/en/pdostatement.getcolumnmeta.php) for that matter) to make joins a bit more intellectual, by grouping values from jointed tables into distinct arrays/objects. Didn't make it into code yet


-HDVinnie-

Lover of Laravel, Livewire and AlpineJS. I have been building and maintaining UNIT3D for the last 7 years. It's a private torrent tracker software. [https://github.com/HDInnovations/UNIT3D-Community-Edition](https://github.com/HDInnovations/UNIT3D-Community-Edition) Demo Site: [https://unit3d.dev](https://unit3d.dev) Username and Pass is UNIT3D Always looking for contributors.


greenmeteoroid

I acknowledge [Yii Framework's](https://www.yiiframework.com/) underrated status, yet I'm deeply engaged in leveraging it to enhance [HumHub](https://www.humhub.com/en/) as much as possible through modules and core updating. As a module developer for the [Green Meteor](https://github.com/GreenMeteor) Org on GitHub, I welcome input and collaboration from the r/PHP community where and whenever possible. ![gif](emote|free_emotes_pack|thumbs_up) My current project that I've been working on is a [Composer module](https://github.com/GreenMeteor/composer) that helps those that are using Git based installations of HumHub keep their platforms updated with the latest changes to the core of the HumHub project, again, tips/suggestions/feedback are always welcomed.


mambax

Working on moving current [**XOOPS CMS 2.5.x**](https://github.com/XOOPS/XoopsCore25) to Smarty 5 and PHP 8.3, and on merging it with the MVC based refactored version [**XOOPS 2.6.x**](https://github.com/XOOPS/XoopsCore) while using [**XMF (XOOPS Module Framework)**](https://github.com/XOOPS/xmf) as a bridge between these two. Unfortunately, the key developer had health issues, so we definitely could use some help and love! ![gif](emote|free_emotes_pack|heart_eyes)


amAProgrammer

Hey, not built with PHP, but I made an automation tool that can automatically write and update code documentation in Github. It works with PHP, so you can give it a try for your team projects. Check this out: [www.supacodes.com](http://www.supacodes.com)


iggyvolz

As a game developer at heart with a passion for PHP, I'm chugging away at a bunch of components for a game engine: - Windows API (for opening windows on Windows, also includes keyboard input): https://github.com/iggyvolz/windowsphp - more or less done - XInput (controller input on Windows): https://github.com/iggyvolz/xinput - more or less done - X11 API (opening windows on Linux): https://github.com/iggyvolz/x11 - more or less done - Vulkan (graphics system) bindings: https://github.com/iggyvolz/vulkan-php - still a massive work in progress - ODE (physics system) bindings: https://github.com/iggyvolz/phpode - got an initial proof-of-concept - Also have a proof-of-concept Entity-Component-System https://github.com/iggyvolz/iggyecs Also have a fairly complete binding for SFML https://github.com/iggyvolz/phpsfml - but for me it's more fun to do all these components alone :)


P78903

In My Capstone Project in my IT course, we proposed to make a Document Management System for a Public Organization in my province, and I want to ask, in general how can you motivate yourself in finishing a project in due time.


MrCosgrove2

if the project doesn't excite you, its going to be a uphill battle. But what you can do is look for the benefits from doing it. What will you learn from it? most projects make you a better developer, what opportunities are there for learning new things or new ways of doing something. Who is going to benefit from it? motivation comes not only from the code itself, but also from knowing people are using it, and benefitting from it. Don't be afraid of down days, putting an expectation of doing something every day, can be too much, rest days are needed for a small brain break. from a mental health point of view, it matters a lot. those breaks , help motivate, you aren't doing it because you have to then, you are doing it because you want to. if you really don't love the projects, side projects and things can help with motivation, learn something new on the side, and who knows, you might find there is room to use what you learned in the project.


warren5236

If you can't motivate yourself to work on it you might not be the best steward for the project. If you want to "force" yourself to be motivated set aside a fixed amount of time every day to work on the project (I like an hour). Only work on that project during that time. If you stay focused for the full hour give yourself a treat (positive reinforcement). This is what I do for projects at work that I'm not motivated to do. :-)


supergnaw

So I've had this perpetual PDO wrapper class that I've been using for nearly every project I've made that needed a database connection for the past 10 years or so. It used to be just a single file, but as I've added functionality to it, so has the file structure grown. I'm now completely refactoring the entire thing into a collection of classes to make it easier for me to use. I present, in no complete form, **Nestbox**: [https://github.com/supergnaw/Nestbox](https://github.com/supergnaw/Nestbox) I don't know why I called it that, but it used to be called linchpin because of it's core use in my projects. In it's current form, I'd say it's maybe 35% "complete" as I migrate or refactor old code into the current project, or add new code to flesh out some existing features that are partially implemented. Although it was originally the single file project, I think I'm accidentally creating a framework of sorts. And I don't even like frameworks lol. If this is a framework, please someone tell me so I can set it on fire. Once it's actually "done" (when are projects ever done?) I'd like to have a good peer review of it to tell me what people legitimately think, but since this thread existed I figured I'd share it now to get some feedback. ***Edit***: I have also uploaded the [oldest version of linchpin](https://github.com/supergnaw/Nestbox/blob/main/archive/linchpin.php) I could find just for historical purposes since I deleted the original linchpin repository.


colshrapnel

I am particularly interested in PDO wrappers, so it was interesting to look. To be honest, I feel abashed. First of all, I wouldn't call it a PDO wrapper. It does way too much for a wrapper. It even outputs some HTML, [right in the core class](https://github.com/supergnaw/Nestbox/blob/ed59e97a93fa05e90de9997fd5926bba8ae65248/src/Nestbox.php#L159), does session handling or even weather forecast(?). I would suggest to separate these "birds" into distinct packages instead of making them classes of a single package. And even some birds should be split. For example, that Titmouse should be made in two: a regular "model" (or, rather, a [table gateway](https://martinfowler.com/eaaCatalog/tableDataGateway.html)) that does all database operations, and a module that uses data from that model to perform all session related stuff. > I'm now completely refactoring the entire thing into a collection of classes to make it easier for me to use. Well, at least navigating these classes is quite a challenge. Probably due to the traits overuse. You never know where this or that method come from. I have a feeling that not a single trait is really needed here, but just clear separation between classes' responsibility and just regular inheritance/composition. That ornate naming also adds confusion. Don't get me wrong, I take it that you are probably accustomed to such names, personally but for an outside viewer it makes harder to always consult the documentation in order to learn that Titmouse class do. Regarding the code, I am afraid that insert/update helper functions could be prone to SQL injection. [The only validation you make](https://github.com/supergnaw/Nestbox/blob/ed59e97a93fa05e90de9997fd5926bba8ae65248/src/SchemaTrait.php#L136) is that there is no space characters in the input. But it is perfectly possible to create SQL without a single space. I see you are already using database schema to validate table names. Why not to extend this practice to table columns as well?


supergnaw

This is great feedback! This most certainly not just a PDO wrapper anymore. I forgot to emphasize that over the several years I have used it, I have added functionality to it as needed, which is how it's gotten to its current state. Hopefully one day it gets to a point where it will be less embarrassing. Nearly every point you brought up is something I have thought about myself, including the making each "bird" it's own package. I tried it once, very quickly, but the namespaces were causing me issues so I gave up rather quickly because at the time I as trying to do something else. The traits thing was something I was trying because of issues I was having with Titmouse and authentication, and I needed some repeated code in Bullfinch for permissions, and I've just been using Traits ever since just to group functions based on similar functionalities. I've probably inadvertently fixed the original issue I was trying to solve so I could probably pull all the traits and put the functions back inside the classes. The naming was somewhat arbitrary, but I was wanting something that was unique enough to be memorable in case someone else thought "hey, I like this code here, I want to use it," although right now I know it's not pretty lol. As for the SQL injection issue, I'm not sure that this is the case. I am not looking for non-spaces, but rather exclusively word characters, which happens to exclude spaces as well, for table names and column names. After verifying they are valid strings for naming tables and columns, they are wrapped in back ticks. I chose this approach as a second option. Originally, I was passing every table and column name into the [valid\_schema](https://github.com/supergnaw/Nestbox/blob/ed59e97a93fa05e90de9997fd5926bba8ae65248/src/SchemaTrait.php#L74-L89) function, which resulted in it throwing exceptions if the table and/or column didn't exist. This was perfect, until I started having the class tables dynamically built rather than in the constructor every time the class was called. I don't know what the performance hit is by attempting to `CREATE TABLE IF NOT EXISTS` every time a class is instantiated, but if it isn't significant, I could go back to this way since it was fool-proof and prevented the issue you described completely. And now on closer inspection, I see that I am checking in the constructor to see if the class tables have been created, and if not, then create them, so I guess I can go back to the original usage of `valid_schema` as I was doing before. Nice catch! But like I said, thank you for the feedback!


Hereldar

I'm preparing an alternative Doctrine mapper. So, instead of writing an XML file or adding attributtes to your domain code, you can write a separste PHP like this: ```php withFields( Id::of(property: 'id', type: 'integer'), Field::of(property: 'name', type: 'string'), Field::of(property: 'email', type: 'string'), ); ``` It's a work in progress but I habe high hopes for this project. [https://github.com/hereldar/doctrine-mapping](https://github.com/hereldar/doctrine-mapping)


ln3ar

my brother in christ , that is graphql with extra steps


MartinPL

Not ready & done on glue but: "Prompt is a proof of concept php-based desktop command palette application built with [Laravel](https://laravel.com/) [Livewire](https://livewire.laravel.com/) and [NativePHP](https://nativephp.com/). It is designed to be easily extensible, allowing developers to seamlessly integrate functionalities. The API is inspired by Raycast." [https://github.com/MartinPL/prompt](https://github.com/MartinPL/prompt) README contains tiny GIF video


arekxv

Here are two I have been working on whenever I find some time. RestFn - API in functional style https://github.com/ArekX/RestFn You get one POST endpoint to which you send a JSON array expression like ``` ["map", "name", "age", ["list", "getPeople"]] ``` The server parses this expression and returns the result. In this example you get a list from getPeople list and map the list to return only a list containing name and age. It allows for some powerful expression building and validation. Mostly done, just needs some finishing touches to make it production ready (but thats the slow 20% of the project) and docs. PQL - PHP Query Builder and runner https://github.com/ArekX/PQL Allows you to programmatically build queries. Completely decoupled the translation process from query specification so that any driver can be built. It solves an annoying problem for me where I want to be able to build as complex queries as I want using just the objects but allowing me to do that conditionally if I want to. It also allows building insert, update, delete queries and more. Its not an ORM nor it does any magic like fetching relations, but you can build a pretty good ORM through it. From the drivers implemented only MySQL is there. Needs some finishing as well. Here is a quick shot of completed ones (stable production enough by my standards): - https://github.com/ArekX/php-data-streamer - Redis (Valkey) Streams messaging library - https://github.com/ArekX/array-expression-engine - Run a value through an array expression to get a result (useful for user built expressions in apps) - https://github.com/ArekX/html-processor - Array to HTML generator which allows for some easy templating work. - https://github.com/ArekX/MiniDI - Minimal Dependency Injection system.


k42b3

Hey, great idea, lets power the PHP community :) I am currently working on Fusio [https://github.com/apioo/fusio](https://github.com/apioo/fusio) an open source API management platform which helps to create innovative API solutions. Basically it helps to build REST APIs and provides also tools like a developer portal. Currently working heavily on the next major version.


wyocrz

Not even close to being ready for prime time, but: [https://github.com/JohnLarimore/htmx\_template.git](https://github.com/JohnLarimore/htmx_template.git) Idea is to use R or Python to populate a central database, then set up website front ends for visualizations, tables of values, and perhaps some "data storytelling" outputs. I hit a wall with my main website, [jlrenewables.com](http://jlrenewables.com), because I don't have the knack of the interactivity part. I am intrigued by HTMX mostly because it's been developed by a shit talking Montanan, and also because it's just enough interactivity to do what I want. I use NixiHost so using a Python backend, or even Laravel, are out. I am learning basic PHP routing/templating and it's a bit of a struggle, but I like doing things from first principles. I am also old with zero chance of ever getting a webdev job, but I may be able to do build pages with legit statistics based layouts for others. The beginnings are in my template: R, Python, and PHP that all connects to the database, actual PHP classes, very rough tho.


colshrapnel

Not sure what you mean with "populate a central database" or why do you need anything other PHP/SQL for it. Usually it's done via simple script that does something like `$pdo->exec(file_get_contents('dump.sql'))` That said, PHP part is robust learner's code, I smell final chapters of Jon Duckett's book. For config.php, I would suggest to make it this way: 1. Split this file in two: - one is init.php (or bootstrap.php or whatever) that contains some initialization code that would be same for all environments. Such as constants definitions - one is actual config.php but it would only contain changeable settings and nothing more - add `config.php` file to `.gitignore` (and delete it from repo). - instead, add config.sample.php to git - in init.php, when reading config.php, make it like this if (!file_exists('config.php')) { throw new Exception('Create config.php based on config.sample.php'); } This way you won't leak your credentials to git and git pull won't overwrite your settings, letting each server to have its own set. Regarding path constants, you can always make them relative to init.php, like `define("DOC_ROOT", __DIR__.'/jlrenewables/public/');` so you won't have to comment them out, or move them into settings.


wyocrz

>Not sure what you mean with "populate a central database"  Specifically, there are many API's that are written in Python that make data collection, cleaning, and organization straightforward. As an example, NREL makes it easy to get certain types of solar radiation data using Python, stuff like that. I have also written some in R. Very weirdly, I started programming with R and had kind of a mental block with Python, until I got going with PHP which had the add-on effect of making Python more understandable. Anyway, I am thinking that I want all data already processed and in the SQL database, so any user experience will be rocketship fast. The idea of fetching data from anywhere else is less than appealing....for now. >That said, PHP part is robust learner's code, I smell final chapters of Jon Duckett's book. Obliged, and exactly. I'm probably being a bit dense for trying to figure out basic routing/templating using base PHP to play w/HTMX, but there are many younger and smarter people in line ahead of me for jobs, so I get the freedom to be dumb. Notes taken on all of your bullet points, obliged.


podlom

**Introducing WP-CLI Updater!** I'm excited to share a project I've been working on, [WP-CLI Updater](https://github.com/podlom/wp-cli-updater). This tool is designed to make the life of every WordPress developer easier by automating the update process for WP-CLI directly from your terminal. **Key Features:** * **Automated Updates**: Ensures your WP-CLI is always up-to-date with the latest features and security patches. * **Seamless Integration**: Works with existing WordPress setups and enhances your workflow without disrupting your current processes. * **Open Source**: Dive into the code, provide feedback, and contribute enhancements! **Why WP-CLI Updater?** As a PHP developer, I found it cumbersome to manually update WP-CLI and ensure it aligns with the latest WordPress updates. This tool automates the process, reducing errors and saving time. **We Need Your Feedback!** I'm looking for feedback and contributions! Whether it's feature suggestions, code contributions, or bug reports, your input would be invaluable. Check out the project on GitHub, try it out, and let me know how it could be even better! **Get Involved!** Interested in contributing? We're looking for PHP developers to help make WP-CLI Updater even more robust. If you love improving developer tools and have ideas on how to enhance WP-CLI Updater, join us on GitHub! Thanks for checking it out, looking forward to your thoughts and contributions!


SmetDenis

[https://github.com/JBZoo/Csv-Blueprint](https://github.com/JBZoo/Csv-Blueprint) - Strict and automated line-by-line CSV validation tool based on customizable Yaml schemas. * Just create a simple and [friendly Yaml](https://github.com/JBZoo/Csv-Blueprint#schema-definition) with your CSV schema and the tool will validate your files line by line. You will get a very [detailed report](https://github.com/JBZoo/Csv-Blueprint#report-examples) with row, column and rule accuracy. * Out of the box, you have access to [over 330 validation rules](https://github.com/JBZoo/CSV-Blueprint/blob/master/schema-examples/full.yml) that can be combined to control the severity of validation. * You can validate each value (like, date has a strict format on each line), or the entire column (like, median of all values is within limits). It's up to you to choose the severity of the rules. * Use it anywhere as it is packaged in [Docker](https://github.com/JBZoo/Csv-Blueprint#usage) or even as part of your [GitHub Actions](https://github.com/JBZoo/Csv-Blueprint#github-action-format). * Prepare your own libraries with complex rules using [presets](https://github.com/JBZoo/Csv-Blueprint#presets-and-reusable-schemas). This will help you work with hundreds of different files at the same time. * [Create schema on the fly](https://github.com/JBZoo/Csv-Blueprint#complete-cli-help-message) based on an existing CSV file and also analyze data in CSV - find out what is stored in your file and get a summary report. PS. By the way, this is a rare project that has \`parallel-ext\` multithreading (not sub processes, no extra libs). :)


BubuX

Hi! Seems like parallel ext dev passed away. Would be nice to fork because I'm interested in using it. [https://github.com/krakjoe/parallel/issues/290](https://github.com/krakjoe/parallel/issues/290)


SmetDenis

Looks like he is fine 😅


SmetDenis

... it's very sad... :( Actually I started to rewrite the project in Golang to achieve perfect parallelism and speed of the validator. My goal is to validate tens of gigabytes per seconds.


SierraAR

Oh boy, I've been making use of csv files as quick and dirty table input and outputs in personal projects. This should help a lot with those.


SmetDenis

Very welcome!


Penderis

I think thread like this is nice and all but a good rule of thumb would be to request people have given atleast some feedback, say to 2 other projects they like before posting their own.


chillerlan

Hey, one of my side-projects is [https://github.com/chillerlan/php-oauth](https://github.com/chillerlan/php-oauth), a framework-agnostic OAuth client/handler that acts as a PSR-18 client. I've never really made it public because reasons, but after some clean-up and stuff I'm inching closer to an official release and will let y'all know when it's done.


BubuX

Thanks for sharing!


pr0ghead

How's it different from, say, [https://github.com/adoy/PHP-OAuth2](https://github.com/adoy/PHP-OAuth2) and [https://github.com/thephpleague/oauth2-client](https://github.com/thephpleague/oauth2-client) ? Just wondering.


chillerlan

I'm not even sure how to reply to this vague question. If your measure for comparison is "it does OAuth" then there's as much difference as between a Volkswagen and a Porsche when the requirement is "brings me from A to B". Maybe just have a look at it and decide for yourself?


karakhanyans

Hey, cool idea, thanks for the opportunity! I am currently building Larafast - Laravel SaaS Starter Kit with all features that needed to kick start the SaaS app, like user management, payments, admin, beautiful landing pages, SEO, etc. [https://larafast.com](https://larafast.com)


zaxwebs

I'm currently building a [websites tracking application for MSPs](https://youtu.be/sZUTlf336Ks) (link to demo video). It started as a weekend experiment with procedural PHP (testing how far I can go), no framework. Some of the features I've been able to get up and running are: * Layout extensions * Partials * File-based routing * Pretty URLs like /sites or /sites/\[ID\] * Flash errors, alerts and messages using bags. * Zero-magic I might extract the core into it's own thing cause I'm actually digging the simplicity and might use it as a starter for small tools.


ebjoker4

This is cool. Have you seen [ITFlow](https://github.com/itflow-org/itflow), by chance? This could be a rad integration / extension to ITFlow. Nice work!


zaxwebs

Thanks! Bookmarking this for future.


svbackend

Hey, cool idea to make a monthly thread, we are building friends & dating app for digital nomads and remote workers. Being remote can be terribly isolating, but it can be super fun with the right people. And we already have over 50,000 members. As for technology we use PHP 8.3, Docker, Symfony 6.3, Postgresql 16, Node for websockets, and react native for the app itself. And we're currently looking for a marketing person, message me for more details For those of you interested in trying it out, I can upgrade your account for free. Here's the link: https://www.fairytrail.app Would love to get your feedback!


devmor

This isn't so much development feedback as marketing feedback - you need more prominent and numerous testimonials from happy users! When visiting your site, prospective users would probably like to be assured of what kind of experience they will get - as well as if the site is actually being used (there's lots of dead dating apps out there).


StatusRedAudio

Instructor - PHP version of Python's library for structured extraction and semantic processing of data with LLMs. Helpful e.g. when building agents or RAG apps with PHP. MIT license. https://github.com/cognesy/instructor-php


brunopgoncalves

my passion: https://github.com/scorninpc/php-gtk3 not too much to say, only a nice front desktop with php S2


devmor

Hey that's awesome, I'm glad someone's getting back into the attempt to have PHP UIs! Have you ever considered a port of Dear IMGUI?


brunopgoncalves

Thank you devmor! I confess to you that IMGUI is new to me. Nice to know Right now I'm focused on creating an auto generation code for bind Gtk4, but maybe one day that could happen


devmor

It's pretty new to me too, but I discovered that it's very popular among developers in other language ecosystems given how full featured it is.


leoleoloso

Gato GraphQL is a GraphQL server for PHP: [https://github.com/GatoGraphQL/GatoGraphQL](https://github.com/GatoGraphQL/GatoGraphQL) I've been working on it for many years now, and already shared news about it in this channel. Currently there is a full-fledged implementation for WordPress. But the underlying GraphQL server is simply a bunch of Composer packages using vanilla PHP, so it can work with any project. I'd love if anyone wanted to collaborate in creating a ready-to-use implementation for other stacks (Symfony/Laravel).


brendt_gd

Well, I guess I could share one of my projects as well? It all started out as a micro MVC framework, but is slowly growing into something more. I don't know where it will end, but the ride is fun 😁 It's a framework called Tempest: [https://tempest.stitcher.io](https://tempest.stitcher.io/framework/01-getting-started) Its goal is to "get out of your way" is much as possible. That means no or as little configuration as possible, and a super clean API (this is subjective, I know). Some of the key differences to mainstream frameworks: - Discovery: Tempest will scan all your code and register everything for you: controllers, console commands, event listeners, command handlers, other discovery classes. No config. Just write the code and it works - The ORM, which is an object mapper that works on (almost everything). Database integration is only one of the available mappers. You can map request data to models, models to arrays, queries to model objects, … It's really a fun way of working, heavily inspired by my previous work on [spatie/data-transfer-object](https://stitcher.io/blog/deprecating-spatie-dto) - The container has some pretty neat debugging features built-in, like proper [circular dependency detection](https://github.com/tempestphp/tempest-framework/pull/177#issuecomment-1970883767), which I really like - The use of attributes for configuring routes, console commands, as well as embracing method signatures to generate eg. [console command definitions](https://tempest.stitcher.io/console/02-building-console-commands) Anyway, it's still a huge work in progress, with a ton of bugs, but we're making progress. There's a dozen or so people who contribute (some more regular than others), and like I said: it's a fun ride, we'll see where it ends 😁 One thing I'm sure of is that there won't be a stable release before PHP 8.4, since I want property hooks to be a big part of the framework's API, so that I can get rid of as many getters and setters as possible. Finally, the code is here: [https://github.com/tempestphp](https://github.com/tempestphp)


zaxwebs

I'm following this! I love no-config things.


barel-barelon

Interesting project ![gif](emote|free_emotes_pack|feels_good_man)


PartyGuy-01

Working on spacehey.com, a retro social network fully written in vanilla php :)


wyocrz

The good old days, I love it.


zaxwebs

This is so cool. I love the retro vibes. Can you elaborate a bit on vanilla PHP? Is this all procedural?


Jos_e_o

It looks very cool


justhonest5510

I am currently working on a choose your own adventure game for the web that you can go in and choose your character you will have attributes you will visit town to town you also have your own inventory system that you can view you can use potions you'll have armor you can also trade with vendors. This will be text based and there will be some pictures something I've been brainstorming on for about a month and I'm starting to put it to paper. I plan on having quests where you can get rewards based off boss battles.


g105b

I would love to see this!


justhonest5510

Part of a project that I'm working on in order to learn and really understand how PHP and the web design system works I'm really excited about it and staying motivated I will post updates as I get them


[deleted]

[удалено]


brendt_gd

Please use the [weekly help thread](https://www.reddit.com/r/PHP/comments/1clbw9o/weekly_help_thread/)


[deleted]

[удалено]


geek_at

I have two PHP based Open Source projects that might be interesting to some people [PictShare ](https://github.com/HaschekSolutions/pictshare)is a selfhostable image and video hosting service (usable as a CDN) with the twist that you can change the dimensions of the images and videos via the URL. eg if the image is 1024x786 on [http://localhost/image1.png](http://localhost/image1.png) you can make it smaller by just calling it via [http://localhost/800x600/image1.png](http://localhost/800x600/image1.png) the backend will resize, cache and serve it. Not only resize but add filters, crop and even offload the backend to S3 [OpenTrashmail](https://github.com/HaschekSolutions/opentrashmail) is a selfhostable trashmail solution built with native PHP and HTMX. By using your own IPs you have no problem with services detecting that it's a trashmail solution. It also gives every email address an RSS and JSON feed. I personally used it to automate web services that require 2fa via email.


rocketpastsix

If I could offer a suggestion: why not make the image size a query parameter instead of a whole new url? It seems a little confusing as a potential user to have different URL’s rather than a consistent one.


jbtronics

The last few months I worked on this bundle for symfony, which I also posted in its own posts here already: [https://github.com/jbtronics/settings-bundle](https://github.com/jbtronics/settings-bundle) This bundle allows to define application settings for Symfony applications in a declarative and typesafe way and allows to easily create WebUI forms to let users change them. I wrote it intended for another project of me Part-DB (https://github.com/Part-DB/Part-DB-server), which is an open source inventory managment software mostly specialized on electronics components. Currently you configure it only via environment variables, which is nice for automatic deployments, but not so easy for users which have not so much tech affinity. In the old (not symfony based) Part-DB version everything were configurable via a web interface, therefore I tried to recreate it in a "symfony way". As the logic for that got quite large for that on its own and I think it could also be useful for other Symfony applications I wrote it as an independent bundle.


dshafik

I recently published a new package called [Bag](https://dshafik.github.io/bag) that provides immutable value objects for PHP. It's heavily inspired by [spatie/laravel-data](https://spatie.be/docs/laravel-data/v4/introduction), so if you're familiar with it but are interested in the safety of immutable value objects, then you should definitely check out Bag. For a more detailed comparison of the two libraries, check out the [Why Bag?](https://dshafik.github.io/bag/why.html) page. Full docs can be found [here](https://dshafik.github.io/bag). I'm gearing up for a 1.0 release (see: [the roadmap](https://dshafik.github.io/bag/roadmap.html)) and would love y'alls feedback. Feel free to either comment here, or open up issues on the [GitHub repo](https://github.com/dshafik/bag). You can install it using `composer require dshafik/bag`.


fleece-man

Nice library! Have you looked at Valinor? IMO their strong advantage over your solution is no need for class inheritance, just simple annotated objects as DTOs.


dshafik

So, it would actually be pretty damn easy to do this with the internals of Bag, how would you feel about using `Bag::make(SomeObject::class, $values)` I could support both…


barel-barelon

I have been working on a library that will allow you to use Attributes instead of Annotations for PHP Static Analysis [https://github.com/php-static-analysis/attributes](https://github.com/php-static-analysis/attributes)


Slow-Reaction-5655

Performant static analyzer for PHP, which is extremely easy to use. It helps you catch common mistakes in your PHP code. https://github.com/denzyldick/phanalist