idno / known

A social publishing platform.
https://withknown.com/opensource
Other
1.06k stars 196 forks source link

Add Http Foundation to Known Core #3262

Open ipranjal opened 2 months ago

ipranjal commented 2 months ago

Here's what I fixed or added:

Here's why I did it:

So that non can be compatible with non apache environment like Swoole etc , and also integrate SymphonyResponse compatible package (like required for ActivityPub Integration)

Checklist: ([x] to check/tick the boxes)

ipranjal commented 2 months ago

WIP on #3029 cc : @mediaformat

ipranjal commented 2 months ago

This concludes minimum integration of httpFoundation , ill continue working on changing all our superglobals with ->request() All feedback and review are welcome @mediaformat @benwerd

lindner commented 1 month ago

What's holding this up?

My only comment is that we could go all-in on Symfony and just use that instead of wrapping Request/Response?

https://symfony.com/doc/current/setup.html

That could replace a lot of the CLI and dev server/testing infra that is currently unmaintained...

ipranjal commented 1 month ago

@lindner currently there needs to be little bit of work done on the current session class of know to replace $_SESSSION super globals that's the only thing that is holding back this pull request. Currently I have successfully

  1. Removed all $_SERVER and replaced it with request()->server
  2. Removed all $_REQUEST and replaced it with request()->request
  3. Removed all header() call and replaced it with request()->header / RedirectResponse()
  4. Removed all $_POST and replaced it with request()->request
  5. Removed all $_FILES and replaced it with request()->files
  6. Removed all echo call outside template and replaced it with response()->setContent()
  7. Removed Toro and made routing compatible with HttpFoundation
  8. Make onboarding compatible with HttpFoundation
  9. Modified Bonita core to use response()->setContent()
  10. Test everything on my local known instance

The last bit remaining is Removing all $_SESSION variables that needs a little bit of work as I need to integrate symfony session with current IDNO/Session .

Also while doing this I am finding few small bugs/improper way of handling things which I need to patch as part of this transition.

@lindner I agree ill remove the wrapper and directly use Symfony Request/Response , thanks for suggestion.

While I am finishing up Session integration, I would love to know thoughts of @benwerd on this PR

PS: I am a full time college student and work part time as freelance programmer , had a busy week did not get time to pach $_SESSSION yet, will finish this by tommrow most probably

ipranjal commented 1 month ago

@lindner @benwerd PR ready to be reviewed and merged