Skip to content

Instantly share code, notes, and snippets.

@arcanisgk
Last active September 24, 2022 02:47
Show Gist options
  • Save arcanisgk/0c261db6041e36dbd7e722c27af8c73c to your computer and use it in GitHub Desktop.
Save arcanisgk/0c261db6041e36dbd7e722c27af8c73c to your computer and use it in GitHub Desktop.
What to know and do, before and during the development of a php framework?
Hello friends; if you got here you already know a little about what this is about, I am trying to create a roadmap to develop my own framework with your ideas and opinions, since I believe that there is no absolute truth.
Objective: create a framework from scratch; with a graphical environment for its setup/configuration; with CMS capabilities to establish the different areas of development: Maintenance, Processes, Reports.
What I want to avoid: dependencies on external libraries.
What I need from you: your opinions, to know what you consider to be good and bad in the other frameworks, what things would change, but first I need to know in what order it should be developed.
What to know and do, before and during the development of a php framework (The Roadmap)?
Before development:
1. Select the platform (OS, Stack) and the minimum requirements for your framework to work correctly, establish the stack dependencies and the methods to carry out the development and deployment without major problems. create the minimum documentation required on the platform (SO, Stack) to make your framework work.
During the development:
1. The use of interfaces, traits will be avoided.
Roadmap:
1. Generic Libraries.
1.1 classLoader.
2. installer/environment configuration from form.
Note:
OS: Operating System
Stack: Server application or that provides the web service for the execution of php or other languages
@mleczakm
Copy link

Why are you doing this?
What problem do you want to target?
How was it resolved in different frameworks/languages before and why can't you use?

@arcanisgk
Copy link
Author

arcanisgk commented Aug 26, 2022

Why are you doing this? What problem do you want to target? How was it resolved in different frameworks/languages before and why can't you use?

thanks for write; Can you indicate if you are addressing these questions to me as the creator of the gist or as a point that should be touched on in the process of creating a new framework? Whichever the case, indicate where you should place your contribution.

i have add 2 first point.

@mleczakm
Copy link

As a point that should be touched on in the process of creating a new framework :) I've seen too much of them where properly answered question would fix months of coding :)

@arcanisgk
Copy link
Author

@m

As a point that should be touched on in the process of creating a new framework :) I've seen too much of them where properly answered question would fix months of coding :)

I do not understand any particular question or something else to add in particular to the process??? at what point of those that already exist in the gist?

@jmar1998
Copy link

My answers are very general, im trying just to complement the information about what I think a good framrwork should have.

Actually for me, the whole point depends from the target, because for example for me a good framework should

  1. Average high speed, avoid of doing redundant processes, every module that your framwork has, should be independent (Laravel and Symfony are goods on this BUT i consider laravel better optimized)
  2. Have an impeccable route system (events, ways to customize and create several configurations for enviroment)
  3. A BIG "VERY" good query system, you need to simplify the way how the queries are done, i honestly feel like YII2 and Laravel are the bests on this point
  4. Cache system, without doudbt yii2 has unique cache systems but in average all frameworks implement this
    This are the criteria that i follow before choosing any framework.

Now about your points,
Before

  1. About OS and system requirements, you dont need to worry about this, PHP will run everywhere, you only need to provide a good "Quick Start" or a docker image with a bundle and thats it
  2. Now the second point is really simple to do, cuz PHP is very simple to configure, obviously you need to provide documentation
    For me honestly is more important the Framework methods documentation and examples (ALSO interactive examples)

@arcanisgk
Copy link
Author

@jmar1998 Thank you very much. what you have told me is very important; At least I know where to look for routes and cache issues/examples.

@givihuda
Copy link

givihuda commented Sep 23, 2022

avoid: dependencies on external libraries

I think it's going to be very hard to avoid external libraries, as you will be rewriting a lot of already-written functionality, much of it essentially perfected.

Also, they provide much modularity, and modularity will be a key factor to enjoyable usage of your framework.

  1. Select the platform (OS, Stack)

I think Linux, particularly Ubuntu should be targeted, as I've found in my PHP development that Linux has been the easiest/most-powerful to work PHP with over time, and Ubuntu most recently.

However, you should keep in mind targeting all popular OS stacks, such as Ubuntu, Windows, and Mac. Other people however, if they like your framework and want to run it on their OS, could make contributions for compatibility.

Docker is good for cross-compatibility, but I've run into a lot of trouble with it on Mac and Windows, so I would consult with other PHP Docker users about this.

  1. The use of interfaces, traits will be avoided.

I think you'll find this very hard to do as well... interfaces are one of the most powerful capabilities in PHP frameworks, and you may just not have enough understanding of or experience with them to know why. I would highly recommend reconsidering this requirement.

[EDIT: If you prefer simplicity, then users preferring simplicity will also use or continue with your framework; however, simplicity only lasts so long as an app evolves, though not all apps will evolve much. I think there is room for simple frameworks.]

Also, traits are very useful.

Both are best for modularity and will reduce duplicate code functionality, and give users more choice and flexibility for their own apps using your framework.

@arcanisgk
Copy link
Author

@givihuda thank you, i will take your experience and work in account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment