Home Β» Php Β» Byte PHP framework – PHP

Byte PHP framework – PHP

Posted by: admin February 22, 2020 Leave a comment

Q(Question):

I’d like to create a PHP framework based on the latest and newest PHP (5.3RC or 6.0 ) that is upcoming soon.

I mentioned this months ago, but now I have the time to persue it, Instead of making it "Dan’s Framework", I’d like to make it ‘Bytes PHP Framework’ with the suggestions of you fine PHP experts.

My high-level goals are:

1. Under 10 Files and needs only PHP and MySQL
2. Targeted to those who want to get the basics out of the way and start coding the application logic from day one.
3. User manual will be under 10 pages (Including Examples), no special insight needed to learn to use it, or understand the code.
4. Any new person can learn it AND implement it within half an hour.
5. Completely whitebox (User can change the code without breaking anything)
6. Limited rules. Unlike CakePHP, ZendF, and others that outline pages upon pages of what methods are accessible, this framework will be so sleek, the entire API can be defined in one page.
7. MVC (of course) with Smarty templates
8. portable, fast, little overhead.
9. Not crowded with extra functionality (e.g. PDF converter, Multiple DB support MySQL only (but can be ported by user to other easily)).
10. Reliable, Secure, and Robust. …and extremely LIGHT!!

Who’s with me?

Tasks:

1. I need to get permission from bytes to use Bytes, otherwise find another name and open a sourceforge.net account for it.

2. Upload what I have so far for your review and feedback (it’s 60% complete)

3. Have Fun!

Dan

A(Answer):

I’m down. Sounds interesting. 10 files or less? That does sound interesting, if a little optimistic?

Are we talking a full framework such as CodeIgniter, or a compilation of libraries?

Go sourceforge πŸ˜€

I’m on with a couple of projects at the moment, but I would love to help out.

A(Answer):

you can count on me, but I insist on not limiting the manual (unless you have huuuge pages) Β– the more you document, the easier is troubleshooting.

A(Answer):

Stuck.

To get it some more attention πŸ™‚

A(Answer):

Sorry guys didn’t have a chance to upload what I have so far. Not doing it now because the question of "where" popped in my head. Just attach it here? no.

Few things:

1. Do we have the OK to use bytes (identity) and hand over the source code to its community and the rest of the world?

2. First time launching an online group project, what tools do we need to keep track of a) code, b) Milestones/tasks and assignments, c) discussions/documents and other assets…. sourceforge.net provides all we need?

I’ve already submitted the project idea to sourceforge and is awaiting approval at the moment.

If sourceforge offers no code-versioning/management, I have a new-to-me HP server in my basement (HP 1U, P4 2.4Ghz 2G 40GB) that will be hosting my project sites. I can easily load SVN and use this to check the manual and codes in.

how does this sound?

A(Answer):

By the way, sourceforge.net project name is bytesphpfw

I’m going to work on explaining what I have so far to get you guys up to speed, and hopefully a start at some documentation but I have a confession to make: Writing technical documents is the least favorite thing for me to do and thus — to be blunt — suck at it. I would infinitely appreciate (and maybe compensate with online gift card) to anyone who loves writing and is good at it to take this challenge with help from rest of us of course.

PM me or reply here please

Thanks,

Dan

A(Answer):

you should use SVN to keep track of changes.

A(Answer):

I prefer GIT, but I don’t mind which we use.

Sourceforge, if you go to the ‘project features’ area, has everything you need: bug tracker, forums, task assignments, etc. You may have to look under the second tab (I forget the name of the tab) to see the features that aren’t already enabled.

If some of the things you don’t understand, SVN, Git, etc., there are lots of good resources on sourceforge.

Also, we should probably all have gmail accounts for real-time group discussions.

I wouldn’t mind documentating it (gift card not required, of course :).

Be in touch,
Mark.

PS. Thank god we’re not supporting PHP4 πŸ˜€

A(Answer):

Regarding the use of Bytes in the name: I’ll ask on of the admins about it. I don’t see it being a problem, though. After all, we had the Bytes Desktop thing.

Also, the source code will be freely available anyway, if we’re using SVN (or something like) on SF.net

A(Answer):

@Markus

if there are participating more Mac users than me, we can consider using SubEthaEdit‘s Collaboration functions, too.

@Markus

yes, indeed

A(Answer):

@Dormilich

NetBeans has a cool collab feature, too. I’ve not used it yet, but the manual says it *works*.

And no mac for me πŸ™

A(Answer):

no mac either.

Markus, I’m confused at the sf.net interface, but I’ll get use to it. I already use SVN at work and home so I’ll no problem checking the code in as soon with that URL.

Dormilich, Thanks for taking on the docs. One of the goals is to have a short manual readers can go through in one sitting.

Do you guys have accounts on SF to add you to the project?

Also, I requested Mantis Bug Tracker, phpBB Forum and DotProject management "hosted apps".

Catch ya later,

Dan

A(Answer):

@dlite922

so, one extensive for debugging and insight reading and one to get startedΒ…

@dlite922

the only thing close to that is my beanstalk account

do you have anything planned for mail sending?

A(Answer):

My SF username: mahcuz

Yeah, the interface is pretty confusing at first, but you get used to it after a while.

A(Answer):

Thanks to markus for making this thread as a sticky. if not for sure I’ll never find it. I’m really less active these days on Bytes. But hopefully I can find more time withing next couple of months. It’s a pleasure to here about the framework and I’d like to put some inputs from my end too.

SF is great system to host the projects but I do recommend Google project hosting for this.
http://code.google.com/hosting/ its not because of SF is bad, but its only because may be I’m a google lover.

Anyway have a look on this comparison chart
http://en.wikipedia.org/wiki/Compari…ing_facilities

Also I’d like join with you guys with the development if there is a space for me, but never ask me to write those documentations.

Good Luck with your project !!

EDIT!!
Also there is no other IDE like Netbeans

A(Answer):

@ak1dnar

I think google code is good, but compared to the possible features you can have on sourceforge, it’s nothing. You have CVS, SVN, Git, phpBB, TaskFreak, Project website (<projname>.sourceforge.net), FTP access to that site, MySQL databases for that site, Shell access, WordPress, Tracker, and loads more. πŸ˜€

It’d be awesome if you could be a part of the project, ak1dnar. πŸ™‚

NetBeans is pretty awesome, it just takes forever to load. Whereas Eclipse loaded almost instantaneously, but then Eclipse was pretty crappy feature-wise (lots of plugins available, just not so easy to install and configure them.)

I love the UML plugin for NetBeans. Truly awesome.

A(Answer):

That’s true Markus. SF provides a great system for project tracking. But most of those features may not require for small projects.

With my understanding we need (for now);Source Control system Issue/Bug Tracking system System for setting up Milestones Documentation System And a web Site to spread the word about the framework.
Point number 3 and 5 is not available on Google project hosting as I know. correct me if I’m wrong here. so SF is good because may be we have everything we need.

I just recovered my SF account password (Didn’t use it after creating the account πŸ˜€ )
username: randika

Hope to see you guys there.

A(Answer):

Guys,

I added Mahcuz and randika as users and both of you should have SVN access.

I checked in (most of the) code from the last project I used my framework for: zankobooks.com to show you the code from a working site.

The code as it sits is, of course, very dirty compared to our final goal but it’s definitely a start.

My plan was to "sit down" with you all weekend long and get the project underway, but unfortunately (?) I’ll be with family on a little get-away in Colorado.

So I know tomorrow night I’ll leave and won’t have time to write this so I’ll give you guys a brief description in the developer forum of what you’re looking at so far but I know all of you can figure my simple code out easily, there’s nothing special about it….yet.

Looking forward to a swarm of replies and ideas when I get back next week. Let’s discuss everything so we can plan it out and avoid conflicts.

Thanks!

PS: Mahcuz (Markus), I’ve given you as much access as I could fine because…well frankly you’ve got a lot more time on your hands…and I trust you πŸ™‚

May the Forge be with you!

(too corny?)

Dan

A(Answer):

…a little more about my feelings on this…(sorry)

I could see this as a gateway framework. One that is inspirational and makes every PHP lover take it and run with it to create they’re own "unique" code they feel confident and secure with to do their applications with. What I have today was inspired by someone else that I improved upon and I want every soul that has fallen in love with PHP like me to take it and spread their wings with.

/okay, that’s enough vodka for me

Good Night!

Dan

A(Answer):

πŸ˜€

Right, a couple of things:
Inline documentation should be done with either /* .. */, //, or #, not /** **/ PHPDoc should be:


/**
* title,
*
* description,
*
* @access, etc..
*/

notice the spacing before and after the asterisks.
That is all for now πŸ™‚

PS. Thanks for the trust πŸ˜‰

Also, I will return that passing insult you made, however true it may be. πŸ˜‰

A(Answer):

Hi,

Would I be able to get involved in this in some capacity? Not so much on the development side as you seem to have enough people on that front but perhaps on the end user side?

I have always stayed away from frameworks in the past due to them appearing very bloated, instead writing my own libraries so if you are creating a very lightweight framework I would like to help test it.

Cheers.

A(Answer):

@hoopy

Of course you can help out, but you do not have to just stick to testing.

Do you have a SourceForge.net account? If not, go make one, and I will add you to the member list of the project (PM me with your account name).

You should then go and check out (using an SVN tool, or by downloading a tarball). Give the code a look-see, run it and report any errors using the mantis bug-tracking tool.

πŸ™‚

A(Answer):

@Markus

You ARE our target audience. A perfect tester indeed, but like Markus said you can give us your input since over the years of PHP development we may skip steps here and there.

The code is no shape to be downloaded and used (although it’s copied from one of my working projects), but you’ll know when the first version comes out if you participate with us.

Thanks!

(My last minute post before total silence of the weekends)

Dan

A(Answer):

Have a good weekend, Dan.

Mark.

A(Answer):

I’ve been following this thread for a while.
I might give this one a go too once you manage to get something like a pre-release together (i.e. when it starts looking like what you want to achieve) – 60% complete might still be a bit too early.

There are a few things that seem to be too optimistic about this one, but I presume only time will show whether I was right thinking what I was thinking πŸ˜‰

What size of projects do you reckon this framework will be usable for?

Lots of people only want to use a framework if they want to avoid writing more or less the same code, such as displaying tabular data, manage caching, users (logins and general security), forms, image manipulation, web services and so on.
Almost any decent framework allows you to strip it of classes you won’t need for that particular project, making it rather lean.

By the way, I think you’ll want to have something like ActiveRecord or ORM implemented eventually. Not because you’d be bored of writing the same SQL again, but because it might be faster to write, you won’t have to bother with string escaping and, last but not least, if you’d have to migrate a project to a different database, you’d be thanking yourself.

I’m currently working on an e-shop, using CodeIgniter and so far the experience with it was very pleasant. Documentation is crucial – the one CodeIgniter has is excellent.
There are a few other frameworks that are appealing to me, but I haven’t got to trying them out myself. They’d be Yii, Jelix and Seagull. I’m giving Yii a go today (or maybe tomorrow – I’ll have to shut down the computer until my room gets painted).

I’m not sure I’ve actually written anything helpful, but I hope to stir a discussion with that.

A(Answer):

Slap,

You have great suggestions, but it’s plugins like that, that scare many beginners away. To me it’s easier to code than learn how to use — or worse trouble shoot — the framework code I’m using. I found myself doing this with the two most popular frameworks praised a year ago.

This framework still expects you to write most of the logic, you may ask well what’s the point?

The point is to get people familiar with a "structured" PHP design to help them create secure, portable, and robust PHP apps and have PHP clear of some of the bad rep it’s been getting due to beginners not using it write.

This framework will be a gateway to show how you can "lightly" use classes, an object, controller and a data access model to your benefit when developing apps.

These apps, while they may not be enterprise, can be as large as your typical blog, forum, eCommerce web apps.

I believe most frameworks lose their head in trying to code as much possible for the programmer that the programmer ends up trying to figure out just how much, and how it is implemented. Agility, Flexibility, and Usability suffers greatly resulting in a very steep learning curve.

In conclusion, while an expert can easily sit down and learn codeIgniter in one day and start developing, a beginner will be overwhelmed and result to coding scripts and not implementing any form of OOP.

We welcome any feedback or criticism and would love for you to be part of it, this goes for all byte members at any expert or beginner level.

(Yes I’m back in town! :D)

Dan

A(Answer):

Thanks for the response, dlite πŸ™‚

How do you plan on routing URI parameters? I think that could influence a lot.
I see two sensible approaches at the moment:
1. use the usual form of parameters, e. g. index.php?c=main&amp;f=index
2. pseudo seo style, e. g. index.php/main/index or index/main/index (where there’s only index, .htaccess or something similar would have to be used to force the webserver to feed it to the PHP interpreter; a question mark after index.php would probably be needed on IIS)

Both of these enforce using classes, although not lightly, but rather heavily, as the first two parameters (or segments in the second case) would be mapped to a class (parameter c) and a function (parameter f), with the rest of the parameters available freely to the programmer.

It’s the way CodeIgniter does it (the second case) and it works very well in most cases. It’s light on resources, unlike e. g. mod_rewrite.

A(Answer):

I like the way codeigniter routes it’s URIs. index.php/controller/method/other/stuff.

However, I think we need to determine whether this will be a ‘glue’ framework, or a ‘full stack’ framework (definition).

I’m too tired to say anything constructive right now.

Where’s my coffee?

A(Answer):

@Markus

I’d suggest ‘glue’, as it gives flexibility both newbies and advanced users might like.
‘Full stack’ might feel more consistent, but if it would make integration of 3rd party classes difficult, it would become time consuming and there would be little point in using it further for many.

EDIT: ditch coffee, try mint tea πŸ˜‰

A(Answer):

I think the conversation is going to where I thought it would, which is:

Define what the capabilities, usage, target audience, etc. To start coding anything, we must have a base line goal of what we’re trying to achieve.

So maybe when I said 60% done, I got excited and way ahead of myself.

Which brings us to the next question: where are we going to have this "chat" since writing post replies could take forever on a conversation like this.

Google Chat? some other chat client and set up a time to discuss all of this.

Thanks,

Dan

A(Answer):

@dlite922

google chat or skype. though I won’t be available until sunday (not too late, please)

I recommend to subscribe to the "recent activity" feedΒ—makes for a faster notice if something changed or someone posted in the forum.

A(Answer):

Google chat, google chat!

In retrospect, I have been using the code hosting on google recently, and I prefer it to Sourceforge. Just sayin πŸ˜€

A(Answer):

don’t go switchin’ sides on me Markus πŸ™‚ , but Google chat it is. (send me link, my first time)

When?

We live in different parts of the world but i’m a night owl, I can stay up pretty late , no sweat.

Since weekends work better for most people, let’s have it this weekend, Saturday or Sunday.

Some possible (GMT UTC+0) times for me are:

1. 16:00 to 22:00 , 2009\05\09
2. 05:00 to 08:00 , 2009\05\10
3. 16:00 to 22:00 , 2009\05\10

what will it be, fellas?

A(Answer):

I opt for 2, (I’m not available for 1 and 3 is quite late when you have to get up at 4 GMT)

A(Answer):

Okay, maybe this wasn’t enough warning in advance.

Let’s brainstorm on SF forum then. Throw your ideas, suggestions, and thoughts of what this framework should be like. we’ll gather them all and put them in order later.

Because of the size of this framework, we won’t code much. We’ll program the core and offer "one" of the best ways to use it (by example). Users can take it from there.

I’d hate to plug it in with 50 billion functionality that won’t be used by beginners or for every project.

I’ll log on later tonight and post my thoughts and look for yours in the next few days. Dormilich or I can put it in a doc, check it in and make sure it looks good by everybody.

talk to you later guys,

Dan

A(Answer):

My apologies for not keeping up with this; I’ve been limited with the amount of time I have on a computer – mine has died, lost everything including my full seasons of scrubs, the crazy amount of books (on programming and other things) that I had aquired, all of my games and films. Gah!

If we can set up a time and date for a convo (preferably towards late GMT) I’d be available.

Mark.

A(Answer):

until then you can think about which DB system we want to use (or just check out the SF forum)

A(Answer):

@Dormilich

The Help, Open discussion forum or a different one?
I can’t see any other than welcome posts in the project forums on SF.

Can (and do) project developers have their own private forums or thread on SF?

A(Answer):

@Slapo

I meant the Developer Forum.

@Slapo

yup, for example the Developer Forum. If you want to ask something (meanwhile) use the Open Discussion Forum.

A(Answer):

if no-one objects, we proceed using PDO thenΒ…

any wishes how we implement it?

A(Answer):

Sorry for not replying to your PM, dorm. Been busy. I will reply later today (job interview to go to at the moment.)

Mark.

A(Answer):

@Markus

what a coincidence, I got one next week. anyway, good luck and may the force be with you.

A(Answer):

@Dormilich

I think it would make sense to make it optional and interchangeable with ordinary drivers, so that the one using it can simply choose changing a line in a configuration file (if you plan on using one, which is probably a good idea if you’d include a line in the code that would disable viewing it directly).

Why would one want to use something else than PDO drivers? For drivers that don’t have a PDO variant or that perform better than the PDO ones, for example.

A(Answer):

@Slapo

PDO is not a driver, it’s a database abstraction layer. the drivers (meaning PDO_MYSQL, PDO_ODBC, etc.) have to be present in the PHP installation (which is usually the case, since PDO is part of PHP 5).

making it optional would be a pain, because the only other supported DAL I know of is MySQLi, which is less comfortable in getting the data and uses a completely different interface.

@Slapo

just a matter of constructing the DSN.

@Slapo

this I don’t understand, btw how many people do you know, who haven’t a PDO compatible driver?

A(Answer):

I know that the pdo extension itself is just an abstraction layer, but some cheap hosts don’t have the pdo drivers, such as those you have mentioned, turned on. Then again, one could question whether it’s sensible to use such hosts πŸ˜›

Anyway, I was just thinking it would help making it more flexible.

That and I’ve found that my cheap (a. k. a.) free host has them turned on, so I guess I’m good to go now πŸ˜€

EDIT: might be worth investigating whether the MS SQL Server php pdo driver will last when there’s the sqlsrv driver. I’ll try to look into that later today… or this weekend πŸ˜›

A(Answer):

Then let’s go with PDO keeping in mind that we should make it easier to add support for other databases as well. It might be just including one class and not the other while the access functions remain the same. This is what MVC is all about after all: The application logic can stay exactly the same if you change databases.

ie my call to $dbAccess->add($userVO); would do the same exact thing no matter what the underlying methods/dbms $dbAccess uses.

I’ll try to code this week and test it with a PDO DAO (too many freakin’ acronyms).

~Hope you guys get the job you interviewed for.~

Dan

A(Answer):

have a look at /core/DB.php. that’s how I implemented PDO, maybe you can use it.