-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure PHP code #161
Comments
That's a result from the history of this project. A couple of weeks ago I tried to enhance and simplify the structure while still maintaining the old style, so that everyone with no major experience in PHP can contribute to this project. If I have started the project, I would use a framework like neos or something similar, but I think that would be to complicated. Of course this is something which can be discussed.
Code is documentation, if done right 😉. If you feel that you don't know what a function is doing it's probably to large or the name was not chosen wisely. But that's only my philosophy.
I'm fine with another restructuring. Don't know what @andi34 is thinking. |
I am fine with it, we might want to ask @andreknieriem too. |
You can adjust the code like you want. The complete Code is grown from test to working solution with no rewrite by me. In the past my first version was a website with just one button and a script tag with an ajax call, which calls a php file and makes a shell exec. When this was working, I added the layout and other functions. For me a framework was way to overhead. Nowadays I would build this with some more JS. Maybe vue.js or angular and node with a gphoto library. And I only had some weeks to finish it for my wedding ;) So conclusion. If a framework with routing and classes is not worsen the performance, I think it is a good idea to do this. Maybe use https://lumen.laravel.com/ oder symfony in a small version. |
I think a framework with a big model, routing und template engine is way to big for this small project. There are only some small PHP functions in this project. A big part is als JS. My suggestion for restructuring the PHP code is simply create some classes with static and non-static functions. For example: A class called |
Sounds great. If you have time a pr would be appreciated. If you do it, please open it as soon as possible with an estimated completion time, so that we can postbone other changes. |
Looking forward to this restructuring as this will also allow to introduce a proper config class/object with getters/and setters for retrieving the properties properly, also allowing to fall back to default where possible and stuff... ultimately getting rid of these 'undefined index...' :) |
We just have to keep in mind, that the config is also used in the js code. |
I just want to let you know that I am currently working on the restructure thing in my fork of this repo (https://github.com/mhellmeier/photobooth/tree/restructurePHP) I will create a first PR as soon as a meaningful step has reached. |
@mhellmeier Nice! |
Is your feature request related to a problem? Please describe.
The structure of the PHP code is really confusing and different from many other project. The main problem is IMHO that this tool uses a one-function-per-file approach with a lot of includes. Furthermore there are a lot of uncommented functions. This isn't very comfortable and makes it very sluggish for new contributors.
Describe the solution you'd like
A better approach would be a class oriented approach with well commented functions and a clear structure.
If you want, I can restructre the PHP part (
api
andlib
folder) for you in a PR.The text was updated successfully, but these errors were encountered: