github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

maintainable / framework

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 53
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • 0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

MVC framework for PHP 5.1.4 and later. — Read more

  cancel

http://framework.maintainable.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix creation of main application directory when using createapp 
Philipp Gildein (author)
Fri Jan 15 07:11:12 -0800 2010
mnaberez (committer)
Tue Jan 19 13:31:59 -0800 2010
commit  eefadf96b6924e281da16b0f0573d19d274424ed
tree    4eaa6beed5c3603f72175d7a34b49e1809844983
parent  221523a57b20a5ab210e6c2032d287c62f9bf07f
framework /
name age
history
message
file .gitignore Sat Mar 28 23:39:26 -0700 2009 Added tmp directory used by FileUtils test. [mnaberez]
file CHANGES.txt Sat Mar 28 23:16:03 -0700 2009 Replaced Mad_Support_Timer with Horde_Support_T... [mnaberez]
file README.markdown Loading commit data...
file Rakefile Thu Jul 03 10:04:58 -0700 2008 Added sanity check. [mnaberez]
file TODO.txt
directory app/ Mon Jul 13 12:17:08 -0700 2009 mixedCase database columns are now accessible i... [windock]
directory config/
directory db/
directory log/ Sat Mar 28 23:33:40 -0700 2009 Added .gitignore with log/ and tmp/ directories. [mnaberez]
directory public/ Mon Nov 03 08:34:11 -0800 2008 Added sample public/ folder. [mnaberez]
directory script/ Thu Jan 14 10:29:39 -0800 2010 Add createapp script to create an application d... [Philipp Gildein]
directory test/ Tue Jan 19 13:31:16 -0800 2010 validation declaration validatesUniquenessOf no... [DKarp]
directory tmp/ Sat Mar 28 23:33:40 -0700 2009 Added .gitignore with log/ and tmp/ directories. [mnaberez]
directory vendor/
README.markdown

Maintainable PHP Framework

This is a framework that is based around the Model-View-Controller pattern and is modeled after Ruby on Rails. It aims for compatibility with PHP version 5.1.4 and later. More information can be found at: http://framework.maintainable.com.

The framework was developed at Maintainable Software, a software development company in the San Francisco Bay Area.

Repository Layout

The repository shares the same layout as an application built with the framework. This is mostly because of historical reasons. In the future, we'd like to remove some of the coupling between components and lay out the repository as separate PEAR packages.

Starting a New Application

You can use ./script/createapp appname to generate an application directory in the current directory. Adjust the path to the createapp script to create the application in a different place.

If you are familiar with Rails, using the framework should be rather straightfoward at this point. If not, our book Rails for PHP Developers provides an introduction to Rails.

The framework expects its index.php file is located in the DocumentRoot of an Apache VirtualHost and that mod_rewrite is enabled. If you aren't familiar with how to set this up, the framework is probably not for you. We haven't made any attempt to support running it out of a subdirectory or on shared hosting.

One noticeable difference from Rails is that files are named with uppercase as in PostsController.php rather than posts_controller.php. This is largely because our libraries use PEAR-like conventions, where the uppercase naming style is used. Browse the repository directories under app/ to see the naming of controllers, models, and views. Similarly, we use camelCase names for methods (e.g. respondTo rather than respond_to).

You can generate stubs with ./script/generate. You'll probably want to start with ./script/generate model post, which will create a Post model file with associated migration and test files. Use ./script/generate with no arguments for help.

Tasks such as db:migrate are run as ./script/task db:migrate. For a list of tasks, use ./script/task -T. If you copied the Rakefile and have Rake installed, you can call the tasks using the rake command.

Packages and Dependencies

Applications built with the framework use class naming conventions similar to Rails, e.g. classes named Post and PostsController. However, the framework itself is built entirely with PEAR-style naming conventions and does not pollute the global space.

Classes required by the framework are placed in the vendor/ directory, which is a simple PEAR-style directory. Any framework classes are prefixed with Mad_ (Mike and Derek) and placed under vendor/Mad/.

There are some libraries from other projects included in the vendor/ directory as well that are dependencies. We have no interest in building a monolith and try to share our code with other projects as we can. Most of the dependencies in vendor/ started out as Mad_ classes that found homes elsewhere. We hope in the future that the framework will continue to shrink in this way.

Running Tests

The repository has the same layout as an application. The framework tests are run the same way as an application's tests would be. Change to the test/ directory and run phpunit AllTests.

Before you can run the tests, you need to create a database and configure the connection in database.yml. You also need to build the tests database using the file db/tests/madmodel_test.sql.

State of Development

Most of the development was done around the time Rails 1.2. As such, Rails developers will notice many of the important additions since Rails 2.0 are not implemented.

The Maintainable Framework was built almost entirely by two people (Mike and Derek) who work on it only on a part-time basis. It has been an interesting experiment and a useful project for us.

However, we mostly work on the framework only when we need it for a customer or our own applications. We have a lot of other work to do and competing in the PHP framework world isn't on our agenda.

Contributing Patches

The best way to contribute patches is to fork the repository on GitHub and then send us a pull request with your changes.

It's unlikely that we'll accept patches that deviate from the "Rails way". For example, a patch that implements support for Smarty templates will not be accepted. It's best to make your own fork for those kinds of changes.

If you implement a useful Rails feature that we have not yet implemented, it's more likely your patch will be accepted. We will also accept patches that improve the implementation of existing features.

We will not accept patches unless they use the same coding standards and include reasonable test coverage. Please refrain from sending us huge patches. Incremental improvements are best.

Developers

  • Mike Naberezny
  • Derek DeVries

Acknowledgements

We would like to thank Chuck Hagenbuch of the Horde Project and Sebastian Bergmann of PHPUnit for helping us with maintenance by integrating some of our code into their projects.

We would also like to thank all the folks who have provided patches or support in other ways.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server