PHP Classes

v3application: Creates an API for storing data using Slim

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 129 All time: 9,360 This week: 455Up
Version License PHP version Categories
v3application 1.0.1Custom (specified...5PHP 5, Databases, Web services
Description 

Author

This package creates an API for storing data using Slim framework.

It register all the end points for a API that can perform several types of operations for storing and retrieving data in either MySQL or MongoDB using the V3Warehouse package.

It can add custom routes to be implemented with given callback functions.

Picture of Yorch Ponce
Name: Yorch Ponce <contact>
Classes: 6 packages by
Country: Mexico Mexico
Age: 42
All time rank: 206022 in Mexico Mexico
Week rank: 278 Up4 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 1x

Documentation

V3ctor WareHouse Web Application

Description

V3ctorWH is a Web Application REST API for V3 WareHouse Core.

Requirements

Installation

Clone Repository Execute php composer.phar install

Create config.php


$hostname = 'DB_HOST';
$username = 'DB_USER';
$password = 'DB_PASSWORD';
$dbname   = 'DBNAME';
$port     = 27017;
$key      = "KEY";

Examples


<?php
require 'config.php';
require 'vendor/autoload.php';

// Init Database Connection
//V3WareHouse::getInstance("v3Mongo", $hostname, $username, $password, $dbname, $port);

// For PHP 7
V3WareHouse::getInstance("v3MongoDB", $hostname, $username, $password, $dbname, $port);

// Init Application
$app = new V3Application($dbname, $key);

// Add Custom Route
$app->addRoute('/openshift', function () {
		    	$app = \Slim\Slim::getInstance();

		        $app->response()->header('Content-Type', 'application/json');
		        $app->response()->status(200);

		        $msg = array("msg" => "Hello localhost !!!");

		        $envvar = getenv('OPENSHIFT_MONGODB_DB_HOST');

		        if (! empty($envvar))
		        	$msg = array("msg" => "Hello Openshift !!!");
		        
		        echo json_encode($msg);
		    });

// Start V3ctor Application
$app->start();

?>

References

https://en.wikipedia.org/wiki/Representational_state_transfer

P.D. Let's go play !!!


  Files folder image Files  
File Role Description
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file README.md Doc. Documentation
Plain text file V3Application.class.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:129
This week:0
All time:9,360
This week:455Up