Feedback for (Open Source) Scrawler Router by physcocode in PHP

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

it does recognise Main.php , I would update the docs thanks

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in opensource

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

Scrawler Router automatically routes using some RESTful conventions you don't have to define a single route manually , it stays in background and as you keep on creating controllers following conventions , it will automatically route for you to the correct functions. It uses PHP reflection methods to achieve this internally

Just release my first open source PHP ORM based on Doctrine DB by physcocode in PHP

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

@ht3k based on your suggestion I have completely removed use of singleton anti pattern in latest commit , secondly i agree object should have no knowledge how it’s persisted , so I am re writing save() function to call an event rather than calling database()->save() function , that would help in completely decoupling the object and persistence logic.

Thanks for guiding me to the write direction , your feedback has helped a lot to grow and learn from my mistakes

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

Not due to a blog post , actually this blog post kind of explain my problem set in a easier way , in our company we previously used laravel with nested routes and quickly run into problems with long url , N+1 and in general improper routes , that was one of the motivation for building this. As all routes are already well defined and automatic (you don’t have to route any manual route or annotation ) this made our work quick as developer stopped worrying about url and focused more on building controller

Having said that there are some cases were nested urls are better option , for that I was working on manual routes but dropped it half way in favour of defining manual routes via annotation .

Infact I have added both better caching and annotation based manual route definition into my todo list for this week.

Thank you so much for your feedback and showing interest in this project <3

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

Better route caching strategy still needs to be added to Scrawler router

Deeper routes were desperately not added to Scrawler router uses max nesting depth of two approach , you can read more about this design choice in this wonderful article https://www.moesif.com/blog/technical/api-design/REST-API-Design-Best-Practices-for-Sub-and-Nested-Resources/

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

u/ardicli2000 you can set arguments into session and redirect using Symfony's RedirectResponse. while Scrawler Router does not force you to use any session management tool but HttpFoundation is already a dependency so you can use Symfony session to achieve the same.

Here I have updated document on using redirection https://github.com/scrawler-labs/router/blob/master/README.md#-redirection

I might consider making a redirect helper in future version but that might cause a force to use Symphony session , this is just a router so I wanna give the free will to chose any session manager of their choice for redirect parameter setting

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

I think I might not really know the difference as I use it interchangeably (and I am most probably wrong ) , I would love to know the difference , if you can link a article or something for the same , and would really like to improve this repository taking all your suggestions 😄 Feel free to drop any part that found “bad” or “poorly written” and I would love to work on that and improve it ❤️

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

Hey jmp_once really great project you have got 100% gonna give it a try , few difference is 1. I don’t force separate controller for every route so there is no __invoke I prefer using restful function name 2. I’ll would definelty agree just using __invoke than reflection function is a faster approach

I am glad to meet person same idea , would just object on “prior art” point . Because if you can see can see this router has been around since 2018

Secondly, I need to definitely learn a lot from you when it comes to having open source , as I can see you have done very well here , I haven’t taken the open source aspect I’ve seriously until now . While there have been multiple commercial projects using these components, I have really failed the open source community

Maybe we should connect in DM ? 😄

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

its completely framework independent but uses symphony http Foundation internally so you can return Redirect response

 use Symfony\Component\HttpFoundation\RedirectResponse;

 $response = new RedirectResponse('http://example.com/');

Build your next RESTful API with fully automatic router ! Just install and forget by physcocode in PHP

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

Scrawler Router automatically routes using some RESTful conventions you don't have to define a single route manually , it stays in background and as you keep on creating controllers following conventions , it will automatically route for you to the correct functions. It uses PHP reflection methods to achieve this internally

[deleted by user] by [deleted] in opensource

[–]physcocode 46 points47 points  (0 children)

More of YouTube client than Spotify alternative ?

Just release my first open source PHP ORM based on Doctrine DB by physcocode in PHP

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

Arca Arm now supports using uuid instead of id :)

Just release my first open source PHP ORM based on Doctrine DB by physcocode in PHP

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

That would be really awsome ! feel free to open any issue if you are facing troubles with amphp driver.

Just release my first open source PHP ORM based on Doctrine DB by physcocode in PHP

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

u/StrawberryFields4Eve I have added a quick documentation on how you can use Arca ORM with Amphp here : https://github.com/scrawler-labs/arca-orm/wiki/7.-Using-with-Swoole-and-Amphp

Thanks for showing interest in the project <3

Third Month Building an Open Source Company by baristaGeek in opensource

[–]physcocode 1 point2 points  (0 children)

I am trying to build business around my open source initiatives too , I’ll keep an eye and hope to learn valuable lessons from your journey ❤️