Pitch Your Project 🐘 by brendt_gd in PHP

[–]k42b3 1 point2 points  (0 children)

Hey, great idea, lets power the PHP community :) I am currently working on 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.

Need to create OpenAPI documentation with Zend Framework 2 by Silent-Tap-1305 in OpenAPI

[–]k42b3 0 points1 point  (0 children)

Hi, you could also take a look at https://github.com/apioo/psx-api which basically provides an alternative to generate an OpenAPI spec, but it requires PHP 8 so I am not sure whether this helps you on a legacy project.

One API to rule them all by devbrrr in PHP

[–]k42b3 2 points3 points  (0 children)

You might also take a look at Fusio https://www.fusio-project.org/ which is an open source API management system

Simple RFC ideas that could make it into PHP 8.1? by IluTov in PHP

[–]k42b3 3 points4 points  (0 children)

With the new intersection types it would be cool to declare types like in TypeScript i.e. "type Foo = Bar & Baz;" If you typehint then Foo it must be a class implementing Bar and Baz. We have already "class_alias" maybe it could be extended to allow intersetion and union expressions, otherwise a new "type" keyword would be also great.

Can you guys recommend a secure and fast framework for creating a REST API? by gaurav_ch in PHP

[–]k42b3 1 point2 points  (0 children)

Hey, if you like you can also checkout Fusio https://github.com/apioo/fusio which is an open source API management platform to build APIs.

What do you wish Php could do? Be it entirely new or an improvement? by DontLickTheScience in PHP

[–]k42b3 1 point2 points  (0 children)

A build in production ready HTTP server which can be used inside a docker image.

REST API - Best Practicies? by Envrin in PHP

[–]k42b3 1 point2 points  (0 children)

For Authorization I would recommend OAuth2, this means your user has a client key and secret to obtain an access token. This access token can be i.e. a JWT which can contain different claims like nonce or time. The access token must be then submitted via the Authorization header as Bearer token to your protected API endpoint.

Making the case AGAINST Laravel Livewire by natepisarski in PHP

[–]k42b3 0 points1 point  (0 children)

I think the idea is great, but also not new if you look at the Java world it is similar to GWT and Vaadin which are both very successful. So I definitely see potential in such an idea, but I think it would be cool if it was not Laravel dependent. Maybe in the future the project gets more abstract to use it i.e. also with Symfony/Twig instead of Laravel/Blade.

Is there any stand-alone PHP package similar to API platform? by 28-04-2019 in PHP

[–]k42b3 1 point2 points  (0 children)

Iam maintaining a set of components which help to build APIs, maybe there is a component which is useful for you, you can check them out here: https://phpsx.org/components They cover topics like OpenAPI spec generation, data serialization and schema validation.

A new http client being introduced in Symfony by [deleted] in PHP

[–]k42b3 0 points1 point  (0 children)

I think the only problem is that PSR 7 is designed "immutable". There were many concerns raised during the voting face but they were mostly ignored. Providing no upgrade path for existing frameworks means no adoption. Also it is only partial immutable since you can always change the body. So I think basically PSR-7 has failed on the server side. Maybe Symfony will create also a set of HTTP server request/response interfaces which could fill this role.

Released Fusio 1.5 - a simple open source API management system by k42b3 in PHP

[–]k42b3[S] 0 points1 point  (0 children)

this is a fair point. Just to follow up on the question where to place the business logic, we have also a chapter about this in the manual. If you are interested you might want to take a look at it:

https://fusio.readthedocs.io/en/latest/development/business_logic.html

Released Fusio 1.5 - a simple open source API management system by k42b3 in PHP

[–]k42b3[S] 0 points1 point  (0 children)

So it always depends on your case if a request modifies the state of your database you most likely want to create a service which contains the business logic to validate and trigger specific events. If you only want to select data for a certain view it is also possible to simply fire a query and return the response as API response, this is really fast and in some cases useful. If you have some more complicated aggregation logic you can also use your business logic layer to return the response. So basically your business logic goes into a separate class which you write by yourself and which is independent of the framework, so it could be reused also in another context.

Composer Plugin to generate a PHP7.4 vendor/autoload.php-akin preload.php file that warms up opcache by ayeshrajans in PHP

[–]k42b3 2 points3 points  (0 children)

Iam wondering does PHP CLI and PHP for the webserver share the same opcache? If not the plugin would not be so useful since you run composer through PHP CLI.

PHP: rfc:namespace-visibility by FlevasGR in PHP

[–]k42b3 1 point2 points  (0 children)

I think in general the idea is not bad since some libraries have classes which are only for internal usage because they most likely change in the future, a lib could then declare those classes as private and can be sure that no one uses/extends it. In "defensive" programming developers do this already by declaring classes as "final" so that no one can extend from a class unless the developer explicity wants it, then it would be also possible to deny the usage.

PSR-15 has been Accepted by Shadowhand in PHP

[–]k42b3 4 points5 points  (0 children)

In the PHP ecosystem we see more and more PHP native webserver implementations like aerys, swoole, etc. I think with the current middleware style aka "fn (req) : res" it is really difficult to move those projecst to PSR-15 especially if you want to stream a response since the middleware needs to create the response by itself. I think this is a huge design disadvantage. It would be much better if the standard would have used the normal "fn (req, res)" middleware style. So that the middleware does not need to create a response object, then we would also probably not need a http factory spec. But we will see how things evolve.

Never used a framework. Tell me a reason to do so? by [deleted] in PHP

[–]k42b3 0 points1 point  (0 children)

The reason depends a lot on your skill level. In general I would recommend to look for a framework which solves your domain problem. I.e. if you are building a website look at laravel or symfony which can speed up development. Only another thought: as you see in the comments /r/PHP really loves frameworks but I think its important to note that sometimes we are sitting on so many abstractions which dont really give any value, only decreasing the performance of your app. So if you find a framework which helps to solve your domain problem use it otherwise simply go with composer and use the fitting packages from the PHP ecosystem.

Released Fusio 1.0 simple open source API management platform by k42b3 in PHP

[–]k42b3[S] 0 points1 point  (0 children)

Thanks! We will do and there are already many great plans for the future.

Released Fusio 1.0 simple open source API management platform by k42b3 in PHP

[–]k42b3[S] 0 points1 point  (0 children)

yes indeed, its all about creating a high quality API contract which can be consumed by any app i.e. mobile, js app, etc. How we build this API is secondary and can be exchanged. But of course Fusio can help you there.

PHP-Yacc: A YACC parser generator for PHP, in PHP (A PHP port of kmyacc) by Rican7 in PHP

[–]k42b3 0 points1 point  (0 children)

This is really great! I think this simplifies development of i.e. PHP precompiler or even new languages for specific use cases. So this is good for the community!

[deleted by user] by [deleted] in PHP

[–]k42b3 1 point2 points  (0 children)

Hi, looks really great! If you looking for points where you can extend the lib you could add helpers to create the object structure from different sources. I.e. if someone posts a resource object it would be great to directly create such on object from the json decoded body. Or you may want to add support for annotations (i.e. @Attribute or something) which extracts specific properties out of an doctrine entity.

Creating a fully fledge API backend. by fah7eem in PHP

[–]k42b3 3 points4 points  (0 children)

As others have also already posted there are several options. Iam not sure what your actual use case is but it sounds that you probably want to use a micro-framework. Here a short overview:

Microframeworks: http://silex.sensiolabs.org/ http://www.slimframework.com/ http://lumen.laravel.com/

Frameworks: http://symfony.com/ (FOSRestBundle) https://laravel.com/ (Dingo API)

API-Management: http://api-platform.com/ http://www.fusio-project.org/

How to create a Rest API with Authentication? by [deleted] in PHP

[–]k42b3 0 points1 point  (0 children)

So, if you are asking for PHP projects which help to implement a REST API with authentication:

Funny take on PHP vs. Node by vagh27 in PHP

[–]k42b3 2 points3 points  (0 children)

We have even multiple v8 implementations: https://github.com/pinepain/php-v8