PHPackages                             kevinkaske/pooch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kevinkaske/pooch

ActiveLibrary[Framework](/categories/framework)

kevinkaske/pooch
================

A simple lightweight MVC PHP framework

82713PHP

Since Aug 13Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/kevinkaske/pooch)[ Packagist](https://packagist.org/packages/kevinkaske/pooch)[ RSS](/packages/kevinkaske-pooch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Pooch Website: [PoochHQ.com](http://www.poochhq.com)

Pooch
=====

[](#pooch)

A simple lightweight PHP framework. I created Pooch while building [Where I Give](http://whereigiveapp.com/), an application to make it easy for none profit organizations to receive donations online.

About
-----

[](#about)

Pooch is a simple, small PHP framework. Pooch is able to stay tiny by being built to use the amazing [MysqliDb](https://github.com/joshcam/PHP-MySQLi-Database-Class) database class and built in PHP functionality (for templating). This framework focuses on convention over configuration. It abuses global variables as a necessary evil to keep code as light and simple as possible. It works great for prototyping small to medium sized web applications and getting your idea into a functioning product.

Who should use this framework? Anyone that wants to get an application up and running quickly and focus on their code and not the framework. If you want a small, light, quick framework and don't mind being tied to MySQL, this framework could be what you have been looking for.

Installation
------------

[](#installation)

### Installation Process (Detailed Overview)

[](#installation-process-detailed-overview)

Installation of pooch is through [composer](https://getcomposer.org). You simply need to create a directory and create a composer.json file with the following contents:

```
{
	"minimum-stability": "dev",
	"require": {
		"kevinkaske/pooch": "dev-master"
	}
}
```

Alternatively you can simply download the contents of [this file](https://raw.githubusercontent.com/kevinkaske/pooch/master/setup/base/composer.json)to your application dir.

Then run `composer install`. Composer will then install the dependent libraries.

Now we need to setup the project. Run the following command `php vendor/kevinkaske/pooch/setup/new_application.php`. Congratulations... Your project is now ready to go.

Welcome to pooch!

### Installation Example (OSX or Linux)

[](#installation-example-osx-or-linux)

The following commands will create a pooch application for an application named "pound"

```
mkdir pound
cd pound
curl -O https://raw.githubusercontent.com/kevinkaske/pooch/master/setup/base/composer.json
composer install
php vendor/kevinkaske/pooch/setup/new_application.php
```

Getting Started
---------------

[](#getting-started)

### Servers

[](#servers)

#### Built in PHP Server

[](#built-in-php-server)

A router.php file is included to let you serve your application from PHPs built in server. Simply run the following command from the application's root directory:

```
php -S localhost:8000 router.php
```

#### Apache

[](#apache)

A .htaccess file is included by default to route requests through index.php and remove index.php from the URL. If you are using a webserver besides Apache (Nginx for example) you will need to configure it to rewrite the URL and pass the request through index.php.

### Database Setup

[](#database-setup)

We are now ready to hook the database up. You can either use a GUI tool like MySQL Workbench or the MySQL CLI. To create a DB named "pound" using the CLI type the following:

```
mysql -u root -p
CREATE DATABASE pound;
```

You will then need to update the config files to point at this new database. Update the database connection details in both config/config.php and phinx.yml files.

### Database Migrations

[](#database-migrations)

Database migrations give you a way of keeping track of changes to your database schema in source control. This way you can keep your various database environment in sync.

Let's create a table for our new dog pound app called "dogs". We use the following command to create a migration:

```
php vendor/bin/phinx create CreateDogs
```

This will create a file in the migrations folder with a time stamp and the name CreateDogs. This will look something like 20151113201209\_create\_dogs.php. You will then need to edit the contents of the file. You can find more information on how the Phinx migration files work [here](http://docs.phinx.org/en/latest/). For now we will just edit the file to look like the following:

```
