PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2018-12-29 (4 hours ago) RSS 2.0 feedNot enough user ratingsTotal: 119 All time: 8,927 This week: 338Up
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.

Name: Yorch Ponce <contact>
Classes: 6 packages by
Country: Mexico Mexico
Innovation award
Innovation award
Nominee: 1x

Details

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:119
This week:0
All time:8,927
This week:338Up