2017 © Pedro Peláez
 

library Pupcake

A PHP Microframework for PHP 5.4+ that can be run on top of a web server or as a standalone web server

image

Pupcake/Pupcake

A PHP Microframework for PHP 5.4+ that can be run on top of a web server or as a standalone web server

  • Tuesday, November 25, 2014
  • by jimthunderbird
  • Repository
  • 7 Watchers
  • 23 Stars
  • 147 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Pupcake --- a micro framework for PHP 5.3+

About Pupcake Framework

  • Pupcake is a minimal but extensible microframework for PHP 5.3+
  • Pupcake can be run in traditional web server such as Apache.
  • For more detail usages on using pupcake in general and on traditional web servers, please see https://github.com/superjimpupcake/Pupcake/wiki/_pages

Installation:

If you plan to use it on Apache

install package "Pupcake/Pupcake" using composer (http://getcomposer.org/)

.htaccess File for Apache

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]

Simple requests when running on Apache

For more details on running Pupcake in general and in traditional web server, please see https://github.com/superjimpupcake/Pupcake/wiki/_pages

<?php
//Assuming this is public/index.php and the composer vendor directory is ../vendor

require_once __DIR__.'/../vendor/autoload.php';

$app = new Pupcake\Pupcake();

$app->get("date/:year/:month/:day", function($req, $res){
    $output = $req->params('year').'-'.$req->params('month').'-'.$req->params('day');
    $res->send($output);
});

$app->get("/hello/:name", function($req, $res){
  $res->send("hello ".$req->params('name')." in get");
});

$app->post("/hello/:name", function($req, $res){
  $res->send("hello ".$req->params('name')." in post");
});

$app->put("/hello/:name", function($req, $res){
  $res->send("hello ".$req->params('name')." in put");
});

$app->delete("/hello/:name", function($req, $res){
  $res->send("hello ".$req->params('name')." in delete");
});

/**
 * Multiple request methods for one route
 */
$app->map("/api/hello/:action", function($req, $res){
  $res->send("hello ".$req->params('action')." in get and post");
})->via('GET','POST');


$app->run();

The Versions

25/11 2014

4.0.x-dev

4.0.9999999.9999999-dev https://github.com/superjimpupcake/Pupcake

A PHP Microframework for PHP 5.4+ that can be run on top of a web server or as a standalone web server

  Sources   Download

MIT

The Requires

  • php >=5.4.1

 

micro framework lightweight microframework nodejs extensible

22/11 2014

dev-master

9999999-dev https://github.com/superjimpupcake/Pupcake

A PHP Microframework for PHP 5.3+ that can be run on top of a web server or as a standalone web server

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

micro framework lightweight microframework nodejs extensible

28/01 2013

3.4.x-dev

3.4.9999999.9999999-dev https://github.com/superjimpupcake/Pupcake

A PHP Microframework for PHP 5.3+ that can be run on top of a web server or as a standalone web server

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

micro framework lightweight microframework nodejs extensible

14/08 2012

v3.2.18

3.2.18.0 https://github.com/superjimpupcake/Pupcake

A PHP Microframework for PHP 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

micro framework lightweight microframework extensible