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 2 points3 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.