loading...
Cover image for Building a PHP Framework: Part 1 - Why? Seriously, Why?

Building a PHP Framework: Part 1 - Why? Seriously, Why?

mattsparks profile image Matt Sparks Updated on ・2 min read

There are a tremendous amount of great PHP frameworks. Off the top of my head I can think of several: Laravel, Symfony, Yii, Slim, Cake, etc. Yet, for every Laravel there are probably five lesser-known, high quality frameworks. Go ahead and search Github for “PHP Framework.” As of this writing it lists 20,000 results. Sure, most aren’t fully fledged PHP frameworks, but that’s still a lot of code.

So with all of that being said, it begs the question: why on Earth would you want to do this?

The extremely short answer: I want to.

The less short answer: A PHP framework encompasses many of the areas I want to learn more about.

Why I’m Building a PHP Framework

Look, I’m very aware that there is no need for a new framework. I agree with that. For whatever problem you’re trying to solve you’ll no doubt be able to find a solid solution.

I’m not trying to reinvent the wheel or make a “better” code-base. I’m under no delusions of grandeur – this framework will never see a production environment. If it does, may God have mercy on your soul.

I’m building this to learn. That’s really the long and short of it.

What I Want to Learn

There are a number of areas that I would like to have more knowledge of. Chief among them are:

  • Application Architecture
  • Design Patterns

Other areas include (but aren’t limited to):

  • Routing
  • Cache
  • Database Abstraction
  • IoC
  • Code Organization
  • Testing

All of those topics fall into the “yeah, I ‘get’ it but do I really understand it” category. That’s what I hope this little experiment solves.

What This Won’t be

It is not my intent to make a production-ready framework. I have no plans of making a robust code-base. This project is a tool to help me (and hopefully others) learn. Anything after that is just gravy.

What’s Next

Before I build a framework, I should probably figure out what exactly a framework constitutes. That doesn’t sound intimidating at all.

Wait! We Need a Name

I can’t keep referring to “the framework” or “code-base.” I’m one post in and it’s already getting old. Let’s call it the Analyze PHP Framework. Seems appropriate to me.

Originally posted on DevelopmentMatt.com

Posted on Aug 10 '18 by:

mattsparks profile

Matt Sparks

@mattsparks

I've been a web developer for a bit. I enjoy donuts and horror movies.

Discussion

markdown guide
 

Haha! I can't tell you how many PHP Frameworks I've built over the years. It all started with Zoose, z20, Zoose2.0, ulfberht-application...and so on. Now I'm building my final framework. FireStudio! Over the years I've built frameworks as a way to understand design patterns. Thanks for sharing your thoughts! I can appreciate the task you are trying to pull off!

 

Thank you so much for writing this series. Today I'm going to start to read and code all these tutorials in order and will share my experiences on each of these. I'm really looking forward to understanding framework internals, and hopefully create my own cookie-cutter of sorts (maybe based on the Slim Framework).

 

[...] for every Laravel there are probably five lesser-known, high quality frameworks.

Laravel, in my opinion, isn't that high quality. It's just very convenient. So, other than Symfony (and maybe Slim) I don't know of any other high-quality frameworks that really justify picking them up. Could you provide some examples?

 

You've got an excellent reason to build a framework.

Have you made any architecture/design decisions yet? Any decisions you care to share?

 

Thanks, Blaine!

I've yet to fully decide. I have a general idea of how I want to try and structure things, but I need to get more of a concrete implementation in mind. I'm hoping to make that apart of my next post (which should be later this week).

 

Cool. I'm looking forward to reading it!

 

"Analyze" PHP Framework . . . 😂 😂 😂 Very nice!