Giter Club home page Giter Club logo

garden-1's Introduction

Garden

Build Status Coverage

Garden is a mini framework for building pluggable web applications and apis. This framework is currently a work in progress and should be considered alpha quality code right now.

Howdy, Stranger!

The garden framwework was born out of our work on Vanilla Forums over the past four years. We've built a forum that started out simple, but has grown into a massively scalable, customizable solution with hundreds of plugins and themes. Over these years we've learned a lot about what we need and what we don't need in a framework, and garden is the result.

Garden is heavily inspired by the current work being done on micro frameworks around the web, most notably the Slim Framework. We're calling garden a mini framework because it has its roots in micro frameworks, but we're packing in enough functionality that it's too big to be considered micro.

Garden at a Glance

Restful Routing

You can make a simple api by easily routing to closures or route to controllers to make a more advanced applications.

Addons and Events

Make your application extendable with garden's addon and event framework. If you are familiar with Vanilla you can think of addons as the union of plugins and applications.

Garden's Event object allows you to bind to events and fire events of your own. Events allow for nearly limitless customization without having to about re-implementing huge swaths of code. You can bind to just the few events you need and snipe the functionality you need.

Object Oriented, but not too Much

We love objects and garden has a solid object oriented foundation. However, we believe that not everything has to be an object and that a class structure should really only go so deep. For us, developing with garden is an aesthetic experience and too much object configuration works against that goal.

Powered by Composer

Composer is the amazing package manager that has taken the PHP world by storm. Garden is implemented as a composer package making it easy to use and combine with the thousands of composer packages out there.

Unit Tested

Garden is tested with PHPUnit and Travis CI. We want to make sure that garden is high quality software that doesn't break as we add new features. Our goal is to implement all reported bugs as unit tests so that they can be fixed and never happen again.

Open Source

Garden is free, open source software distributed under the MIT license.

Installation

Garden requres PHP 5.4 or higher

Garden is PSR-4 compliant and can be installed using composer. Just add vanilla/garden to your composer.json.

"require": {
    "vanilla/garden": "*"
}

A Basic Garden Application

Most garden applications will make use of an .htaccess file for pretty urls and then have an index.php defined as follows:

// Put your index.php in the Garden namespace or import the various classes you need.
namespace Garden;

// Define the root path of the application.
define('PATH_ROOT', __DIR__);

// Require composer's autoloader.
require_once __DIR__.'/vendor/autoload.php';

// Instantiate the application.
$app = new Application();

// Load the default config from conf/config.json.php.
Config::load();

// Enable addon functionality.
Addons::bootstrap(); // enables config('addons')

// Fire the bootstrap event so that overridable function files can be included.
Event::fire('bootstrap');

// Register routes to functions.
$app->route('/hello', function () use ($app) {
    echo "Hello World!";
});

// Register a route to controllers.
$app->route('/api/', '%sApiController');

// Run the application.
$app->run();

More to Come

This read-me is a work in progress.

garden-1's People

Contributors

tburry avatar kasperisager avatar

Watchers

James Cloos avatar Robin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.