RSS
 

Archive for the ‘PHP Framework’ Category

Reviving the ccPhp Framework

10 Nov

I had kinda given up on my PHP framework (as I’d mentioned in my “Simplicity via PHP Frameworks” article). But as I embarked on another little web project and realized that I might b … Reviving ccPhp. It took longer than I would have liked, to get up and running. … I noted that, at its core, it has a very programmatic approach to building a web page. That is, it assumes …

[This post was hacked, due to a WordPress bug, and I hadn’t backed it up. I tried to find it via some of the web caching/archival sites like achive.org, but, to no avail. The snippet above was a snippet from what the Facebook page preserved. A lot of thought went into the post, but once I spew my thoughts out onto the page, I wipe my brain of the details. If I find the rest, I’ll update this.]

 
 

Simplicity via PHP Frameworks

05 Apr

PHP language and web-technologyA long time ago, I’d endeavored to create my own lightweight PHP framework, ccPHP. It was a good exercise, but never reached prime time. Around that time I began to notice others endeavoring to do the same thing (i.e., create simpler, lighter weight PHP frameworks that didn’t take more time to learn than to implement the project). I’ve been away for a while and things have changed.

  1. The continued refinement and simplification of frameworks.
  2. The greater emphasis on frontend apps to do more of the work that used to be done in the middle tier.
  3. The ubiquity of RESTful interfaces, the dividing line between front-ends and servers.

Micro-PHP Frameworks

I doubt that I will ever finish my own framework, now that others are a lot closer to the goals that I was moving towards. And, right now, I simply want to find a lightweight modular frameworks that truly help me get my core work done. Dragan Gaic did a great survey of the PHP hot frameworks in Top 12 Best PHP RESTful Micro Frameworks (Pro/Con).

A key feature of such frameworks is for them to be modular to allow me to pick and choose only the components I need, rather than have to install, understand, and run a bunch of functionality that I do not need. It makes it harder for the developer and impacts performance of the results. Model-View-Controler (MVC) is a common software architecture pattern. With the client side being far more capable of managing the view part, on its own, the server side can be simpler. Instead of cluttering up the server-side app with trying to display information, it can simply focus on securing data and access and providing data services via RESTful interfaces.

So, what I am looking for are pieces to help me access persistent data and build RESTful interfaces. And something to help keep all the code flow organized. Based on the article, I can look at Silex, Slim, Lumen, or Phalcon for the latter. For database access, Ive worked with RedBeans before and liked it, so I will probably pick that up again. If one of the frameworks doesnt help implement and configure a RESTful interface simply, then I may get back into the framework building business again.

Model: RedBeans
View: Frontend client
Controler: one of Silex, Slim, Lumen, or Phalcon

A WordPress bug allowed my website to be hacked. I thought this was lost forever until I thought to reconstitute it from http://Archive.org!!

 

Server Handling of Accept HTTP Headers

31 Aug

When a browser (or any web client) requests content from a web server, it can tell the server what types of content type it can interpret (HTML, text, audio, etc.). The underlying HTTP protocol allows these to be specified via “header” settings—metadata that is sent before any actual content, describing characteristics about the content. The browser can send an “Accept” header—to describe what it accepts—and the server responds with a “Content-type” header. The Accept header can be quite elaborate, but what happens when what happens when these conflict? Read the rest of this entry »

 

The ccPhp Framework: Installation

24 May

I have a whole series of posts, waiting in draft, describing my evolving PHP framework, I call ccPhp. If you have nothing better to do than play with someone else’s dalliances, then here is a quick installation guide.  A little backwards, because I’ve yet to publish reasons why you’d want to. But, if, after my eventual publications describe this framework, you decide to install it, this is the quickest place to see how to do that.

The following describes only one way to arrange the setup.  I have designed the framework with few cross-dependencies.  After my “standard” setup description, I will describe the few file dependencies so that you easily define your own file organization. (If you are on Windows, you can extrapolate the appropriate things to do there). Read the rest of this entry »

 

Buried in PHP Frameworks

30 Sep

With thanks to “moomin lens” via Flickr http://www.flickr.com/photos/jumpn_around/185876077/

There are 100s of PHP frameworks out there, but I have been so frustrated with so many of them; they are either too complex, not well designed, not well documented, buggy, or all of the above. Also, there is a lot of great technology for PHP that are notfull frameworks. It’d be nice to have a framework that does not try to do everything but, instead, allow easy integration of “best of breed” technologies. And a much more subjectively, only a subset of frameworks out there (though growing) embrace object design as typical of traditional, non-web programming using C++, Java, C#, etc. PHP 5 allows that kind of programming, but not all framework developers have embraced that approached it yet. I’ve spend a non-trivial amount of time with the following (well, I haven’t spend enough time with Kohana, yet): Read the rest of this entry »

 

Frameworks: Beyond the Nuts and Bolts

06 May

Without frameworks our “big ideas” would still be stuck in the pre-industrial age. —Bill Lee, Berlin, 2008

I have been on a long hunt for a PHP framework so I was going to write up an article about PHP frameworks, but then I thought I should back up a bit and talk about what a framework is and why you should use one.

Software driven computing has existed for over 60 years. In the early days computer programming was performed using long series of numbers to represent the electronic switches tell a computer what to do—computers still work this way. Fortunately no one has to program computers by speaking computer-ese numbers anymore. With that kind of tedious programming, the most advanced programs would be tic-tac-toe games.

But numbers are the nuts-and-bolts of a computer’s operation. Designing a sky-scraper while having to dwell on every nut and bolt of its construction might limit us to working in ten story buildings. It is vitally important in designing complex systems to be able to think at more abstract, level. Programming using numbers quickly led to “assembly language” as mnemonic way of specifying those numbers, then to “third-generation” programming languages (such as C, C++, Pascal, Fortran) which allow programs to be written without regard to the numbers that the computers can actually interpret. This frees software designers to think about problem-solving without being encumbered by the tediousness of the numerical “nuts-and-bolts” needed by the computers that run the programs.

Constructing a building does not occur in isolation; its context involves the skills and machinery of those involved as well as governmental and environmental infrastructure. Over the past 30+ years, the complexity of computing has given rise to very advanced operating systems that define the context in which a program runs. Add to that, the interactions between a program and other programs or data that exist across a network or even the internet and the complexity of issues add to the tediousness of dealing with nuts and bolts. Again, if a software designer has to dwell on the minutia of all these elements, modern complex, powerful software would never be completed.

A framework attempts to encapsulate the complexities of designing and implementing software. A good framework allows software design to occur more abstractly, unencumbered by the tediousness of the contextual details of  the environment. Said a different way, a good framework allows the software designers to focus on the application’s purpose rather than the complexities of implementation.

Software is constructed in layers or components. Encapsulation is one of my favorite concepts in software design and implementation. It embodies the idea that there are specifics at every level or component within the software system that need not be exposed outside that implementation for that level. There are two key side-effects of this: (1) it prevents parts of the program outside the component from messing with or depending on implementation details which leads to (2) each component’s implementation can be changed or improved without fear of adversely affecting use of the component in unexpected ways. This leads to more stable, maintainable products.

Good programmers embed encapsulation within their design and implementation. Many object-oriented programming languages attempt to formalize this concept so that it is easy to do this. Well designed frameworks do the same, “protecting” some parts of the program from complex or variable implementation details.

There are good frameworks and there are bad ones. In a later article, I will discuss some of the issues to consider in picking a framework.

What have been your experiences in using programming frameworks?