smalpierre
New member
I removed the Slim framework as a dependency for my apps. Slim is about 500k, so it's small, but it has disadvantages.
1. It's another bit of third party software, and removing dependencies is good!
2. You build routes in index.php by calling a function passing the route match, and an anonymous function to call the controller, and whatnot - so you have at least 5 lines of code added to index.php for every route.
3. It does a lot of things I don't need, and I had to modify it to make the newest version work .. so if I download a fresh copy of the dependency I've got to hack at it AGAIN. Why wrap my head around that much code just to fix their bug?
SO - I replaced it with about 100 lines of PHP and a database table with 3 fields - an id (which isn't REALLY necessary, but my standard is to have an autoincrement primary key) and 2 varchar(255) fields. They could be longer, but my charset is utf8 which is multiple bytes per character (count on 3, possibly 4), AND the fields are indexed, so that cuts them back to 767 - but I have to divide by 3 to get my total field length ..
Anyway - 100 lines of code, and 1 table with 3 small fields - not bad!.
Slim has get and post methods (also put and delete I think) defined in the routes, and I'm not sure if I have to do anything special to make that work, but the primary stage is done.
Tonight, I'm going to add in all my routes (no admin tools yet, I've got to add them via sql queries so far) and test them - including routes that post. If post doesn't work, I'll fix that, then I'll export a table create script for mysql, strip it down to a barebones site with no frills whatsoever.
Right now my basic test site has a responsive layout that uses jQuery for the menu (yech! it's got to go, but I hate front end coding so it's there for now haha!), a few images, home, contact, login form, it's got the beginnings of a blog system, and a user login/register system, and - and it's UNDER 2kb! Keep in mind, that's including the SASS, and the CSS it generates for my template ..
I suspect it'll be around 1k or less stripped down to it's most base form with a basic working no-frills example.
1. It's another bit of third party software, and removing dependencies is good!
2. You build routes in index.php by calling a function passing the route match, and an anonymous function to call the controller, and whatnot - so you have at least 5 lines of code added to index.php for every route.
3. It does a lot of things I don't need, and I had to modify it to make the newest version work .. so if I download a fresh copy of the dependency I've got to hack at it AGAIN. Why wrap my head around that much code just to fix their bug?
SO - I replaced it with about 100 lines of PHP and a database table with 3 fields - an id (which isn't REALLY necessary, but my standard is to have an autoincrement primary key) and 2 varchar(255) fields. They could be longer, but my charset is utf8 which is multiple bytes per character (count on 3, possibly 4), AND the fields are indexed, so that cuts them back to 767 - but I have to divide by 3 to get my total field length ..
Anyway - 100 lines of code, and 1 table with 3 small fields - not bad!.
Slim has get and post methods (also put and delete I think) defined in the routes, and I'm not sure if I have to do anything special to make that work, but the primary stage is done.
Tonight, I'm going to add in all my routes (no admin tools yet, I've got to add them via sql queries so far) and test them - including routes that post. If post doesn't work, I'll fix that, then I'll export a table create script for mysql, strip it down to a barebones site with no frills whatsoever.
Right now my basic test site has a responsive layout that uses jQuery for the menu (yech! it's got to go, but I hate front end coding so it's there for now haha!), a few images, home, contact, login form, it's got the beginnings of a blog system, and a user login/register system, and - and it's UNDER 2kb! Keep in mind, that's including the SASS, and the CSS it generates for my template ..
I suspect it'll be around 1k or less stripped down to it's most base form with a basic working no-frills example.