├── .gitignore
├── .htaccess
├── app
├── models
│ └── Users.php
├── resources
│ ├── config
│ │ ├── config.autoload.php
│ │ └── config.env.php
│ ├── routes
│ │ ├── users.php
│ │ └── example.php
│ ├── security
│ │ └── SecurityApp.php
│ ├── errors
│ │ └── HTTPException.php
│ ├── response
│ │ └── JsonResponse.php
│ └── micro
│ │ └── micro.php
└── controllers
│ ├── BaseController.php
│ ├── UsersController.php
│ └── ExampleController.php
├── public
├── .htaccess
└── index.php
├── composer.json
├── composer.lock
├── README.md
└── schema
└── rainrest.sql
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/*
2 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | RewriteEngine on
3 | RewriteRule ^$ public/ [L]
4 | RewriteRule (.*) public/$1 [L]
5 |
--------------------------------------------------------------------------------
/app/models/Users.php:
--------------------------------------------------------------------------------
1 |
4 | RewriteEngine On
5 | RewriteCond %{REQUEST_FILENAME} !-d
6 | RewriteCond %{REQUEST_FILENAME} !-f
7 | RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
8 |
--------------------------------------------------------------------------------
/app/resources/config/config.autoload.php:
--------------------------------------------------------------------------------
1 | $appDir .'/controllers/',
14 | 'Models' => $appDir .'/models/'
15 | ];
16 |
17 | return $autoload;
18 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "darkerthanblack/rain-rest",
3 | "description": "Phalcon Micro Restapi",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "Jan Rainier Llarenas",
8 | "email": "llarenasjanrainier@gmail.com"
9 | }
10 | ],
11 | "require": {
12 | "firebase/php-jwt": "^4.0",
13 | "paypal/rest-api-sdk-php": "*"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/resources/config/config.env.php:
--------------------------------------------------------------------------------
1 | array(
13 | 'adapter' => 'Mysql',
14 | 'host' => 'localhost',
15 | 'username' => 'root',
16 | 'password' => 'krab',
17 | 'name' => 'rainrest',
18 | 'port' => 3306
19 | ),
20 | );
21 |
22 | return $settings;
--------------------------------------------------------------------------------
/app/resources/routes/users.php:
--------------------------------------------------------------------------------
1 | '/users/',
14 | 'handler' => 'Controllers\UsersController',
15 | 'lazy' => TRUE,
16 | 'collection' => [
17 |
18 | [
19 | 'method' => 'get',
20 | 'route' => 'getuser',
21 | 'function' => 'getUser',
22 | 'authentication' => FALSE
23 | ],
24 |
25 | [
26 | 'method' => 'post',
27 | 'route' => 'saveuser',
28 | 'function' => 'saveUser',
29 | 'authentication' => FALSE
30 | ]
31 |
32 | ]
33 | ];
34 |
35 | return $collection;
--------------------------------------------------------------------------------
/app/controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | db;
14 | $stmt = $dbconnection->prepare($sqlquery);
15 | $stmt->execute();
16 | $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
17 | return $result;
18 | }
19 |
20 | /**
21 | * customQueryFirst return only one result
22 | */
23 | public function customQueryFirst($sqlquery)
24 | {
25 | $dbconnection = $this->db;
26 | $stmt = $dbconnection->prepare($sqlquery);
27 | $stmt->execute();
28 | $result = $stmt->fetch(\PDO::FETCH_ASSOC);
29 | return $result;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/resources/routes/example.php:
--------------------------------------------------------------------------------
1 | '/example/',
14 | 'handler' => 'Controllers\ExampleController',
15 | 'lazy' => TRUE,
16 | 'collection' => [
17 |
18 | [
19 | 'method' => 'post',
20 | 'route' => 'post/ping',
21 | 'function' => 'postPing',
22 | 'authentication' => FALSE
23 | ],
24 |
25 | [
26 | 'method' => 'get',
27 | 'route' => 'get/ping/{id}',
28 | 'function' => 'getPing',
29 | 'authentication' => FALSE
30 | ],
31 |
32 | [
33 | 'method' => 'put',
34 | 'route' => 'put/ping',
35 | 'function' => 'putPing',
36 | 'authentication' => FALSE
37 | ],
38 |
39 | [
40 | 'method' => 'delete',
41 | 'route' => 'delete/ping',
42 | 'function' => 'deletePing',
43 | 'authentication' => FALSE
44 | ]
45 |
46 | ]
47 | ];
48 |
49 | return $collection;
--------------------------------------------------------------------------------
/app/resources/security/SecurityApp.php:
--------------------------------------------------------------------------------
1 | router->getMatchedRoute()->getHttpMethods());
20 | $unAuthenticated = $app->routeAllowed();
21 |
22 | if(isset($unAuthenticated[$method])) {
23 | $unAuthenticated = array_flip($unAuthenticated[$method]);
24 |
25 | if (isset($unAuthenticated[$app->router->getMatchedRoute()->getPattern()])) {
26 | return true;
27 | }
28 | }
29 |
30 | //user authentication logic here
31 |
32 | throw new HTTPException(
33 | 'Your not allowed!.',
34 | 401,
35 | array(
36 | 'dev' => 'Your not allowed!',
37 | 'internalCode' => 'AT401',
38 | 'more' => 'Your not allowed!'
39 | )
40 | );
41 |
42 | }
43 |
44 |
45 |
46 | }
--------------------------------------------------------------------------------
/app/controllers/UsersController.php:
--------------------------------------------------------------------------------
1 | toArray();
20 |
21 | //find limit 4
22 |
23 | // $users = Users::find(
24 | // array(
25 | // "limit" => 4
26 | // )
27 | // )->toArray();
28 |
29 | /**
30 | * faster than phalcon find method
31 | */
32 | $users = $this->customQuery("SELECT * FROM users LIMIT 4");
33 |
34 | /**
35 | * all return must be an array
36 | */
37 | return array(
38 | 'userlist' => $users
39 | );
40 |
41 | }
42 |
43 | public function saveUser()
44 | {
45 |
46 | /**
47 | * all return must be an array
48 | */
49 | return array(
50 | 'Save' => 'Save Use'
51 | );
52 | }
53 |
54 | }
55 | // end of UserController Class
56 |
--------------------------------------------------------------------------------
/app/controllers/ExampleController.php:
--------------------------------------------------------------------------------
1 | 'pong - post method'
17 | );
18 |
19 | }
20 |
21 | public function getPing($id)
22 | {
23 |
24 | /**
25 | * all return must be an array
26 | */
27 | return array(
28 | 'getpong'=>'pong - get method',
29 | 'id'=> $id
30 | );
31 |
32 | }
33 |
34 | public function putPing()
35 | {
36 |
37 | /**
38 | * all return must be an array
39 | */
40 | return array(
41 | 'putpong'=>'pong - put method'
42 | );
43 | }
44 |
45 |
46 | public function deletePing()
47 | {
48 |
49 | /**
50 | * all return must be an array
51 | */
52 | return array(
53 | 'deletepong'=>'pong - delete method'
54 | );
55 |
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/app/resources/errors/HTTPException.php:
--------------------------------------------------------------------------------
1 | message = $message;
15 | $this->devMessage = @$errorArray['dev'];
16 | $this->errorCode = @$errorArray['internalCode'];
17 | $this->code = $code;
18 | $this->additionalInfo = @$errorArray['more'];
19 | $this->response = $this->getResponseDescription($code);
20 | }
21 |
22 | protected function getResponseDescription($code)
23 | {
24 | $codes = array(
25 |
26 | // Informational 1xx
27 | 100 => 'Continue',
28 | 101 => 'Switching Protocols',
29 |
30 | // Success 2xx
31 | 200 => 'OK',
32 | 201 => 'Created',
33 | 202 => 'Accepted',
34 | 203 => 'Non-Authoritative Information',
35 | 204 => 'No Content',
36 | 205 => 'Reset Content',
37 | 206 => 'Partial Content',
38 |
39 | // Redirection 3xx
40 | 300 => 'Multiple Choices',
41 | 301 => 'Moved Permanently',
42 | 302 => 'Found', // 1.1
43 | 303 => 'See Other',
44 | 304 => 'Not Modified',
45 | 305 => 'Use Proxy',
46 | // 306 is deprecated but reserved
47 | 307 => 'Temporary Redirect',
48 |
49 | // Client Error 4xx
50 | 400 => 'Bad Request',
51 | 401 => 'Unauthorized',
52 | 402 => 'Payment Required',
53 | 403 => 'Forbidden',
54 | 404 => 'Not Found',
55 | 405 => 'Method Not Allowed',
56 | 406 => 'Not Acceptable',
57 | 407 => 'Proxy Authentication Required',
58 | 408 => 'Request Timeout',
59 | 409 => 'Conflict',
60 | 410 => 'Gone',
61 | 411 => 'Length Required',
62 | 412 => 'Precondition Failed',
63 | 413 => 'Request Entity Too Large',
64 | 414 => 'Request-URI Too Long',
65 | 415 => 'Unsupported Media Type',
66 | 416 => 'Requested Range Not Satisfiable',
67 | 417 => 'Expectation Failed',
68 |
69 | // Server Error 5xx
70 | 500 => 'Internal Server Error',
71 | 501 => 'Not Implemented',
72 | 502 => 'Bad Gateway',
73 | 503 => 'Service Unavailable',
74 | 504 => 'Gateway Timeout',
75 | 505 => 'HTTP Version Not Supported',
76 | 509 => 'Bandwidth Limit Exceeded'
77 | );
78 |
79 | $result = (isset($codes[$code])) ?
80 | $codes[$code] :
81 | 'Unknown Status Code';
82 |
83 | return $result;
84 | }
85 |
86 | public static function returnParseError($e){
87 | JsonResponse::errorParse($e, 500)->send();
88 | }
89 |
90 | }
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | appDir = $appDir;
51 |
52 | // Define Autoloads here
53 | $app->setAutoload($autoLoad, $appDir);
54 |
55 | // Define Env and Database connections
56 | $app->setConfig($env);
57 |
58 | // Define the routes here
59 | $app->setRoutes($app->request->getURI());
60 |
61 | $app->options('/([a-z0-9/]+)', function()
62 | {
63 | $response = new Response();
64 | $response->setHeader('Access-Control-Allow-Origin', '*');
65 | $response->setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
66 | $response->setHeader('Access-Control-Allow-Headers', 'X-Requested-With, content-type, Authorization');
67 | return $response;
68 | });
69 |
70 | /**
71 | * Before Execute Routes
72 | */
73 | $app->before(function () use ($app)
74 | {
75 | // authentication logic here
76 | return SecurityApp::jwtAuthentication($app);
77 | });
78 |
79 | /**
80 | * After Execute Routes
81 | */
82 | $app->after(function () use ($app)
83 | {
84 |
85 | $results = $app->getReturnedValue();
86 |
87 | if(empty($results)){
88 | throw new HTTPException(
89 | 'No available response to your request.',
90 | 412,
91 | array(
92 | 'dev' => 'Returned empty set',
93 | 'internalCode' => 'ER412',
94 | 'more' => 'No Return value'
95 | )
96 | );
97 | }
98 |
99 | if(is_array($results)){
100 | JsonResponse::make(array($results), 200)->send();
101 | return;
102 | }
103 |
104 | throw new HTTPException(
105 | 'Could not return results in specified format',
106 | 403,
107 | array(
108 | 'dev' => 'Return value must be an array.',
109 | 'internalCode' => 'AR403',
110 | 'more' => 'your return value must be an array'
111 | )
112 | );
113 |
114 | });
115 |
116 | /**
117 | * Route NotFound
118 | */
119 | $app->notFound(function () use ($app)
120 | {
121 |
122 | throw new HTTPException(
123 | 'There was a problem understanding the data sent to the server by the application.',
124 | 404,
125 | array(
126 | 'dev' => 'Api url not found '. $app->request->getURI().'',
127 | 'internalCode' => 'R404',
128 | 'more' => 'Please Check your request Url'
129 | )
130 | );
131 |
132 | });
133 |
134 | $app->handle();
135 |
136 | }
137 | catch(Exception $e)
138 | {
139 |
140 | JsonResponse::error($e, $e->getCode())->send();
141 | return;
142 |
143 | }
144 |
--------------------------------------------------------------------------------
/app/resources/response/JsonResponse.php:
--------------------------------------------------------------------------------
1 | $code,
20 | 'status_message' => self::getResponseDescription($code),
21 | 'result' => $result
22 | ];
23 |
24 | if (is_array($result)) {
25 | $responseArray['count'] = count($result);
26 | } else if (is_object($result)) {
27 | $responseArray['count'] = 1;
28 | }
29 |
30 | $response = new Response();
31 | $response->setJsonContent($responseArray);
32 | $response->setStatusCode($code);
33 |
34 | //Starting from now, cache the response page for one day.. comment it to disable
35 | $response->setHeader('Cache-Control', 'max-age=86400');
36 |
37 | $response->setHeader('Access-Control-Allow-Origin', '*');
38 | $response->setHeader('Access-Control-Allow-Headers', 'X-Requested-With');
39 | $response->setContentType('application/json');
40 |
41 | return $response;
42 | }
43 |
44 | public static function error($result, $code = 200){
45 | $responseArray = [
46 | 'status' => $code,
47 | 'status_message' => self::getResponseDescription($code),
48 | 'Error_message' => $result->getMessage(),
49 | 'dev' => $result->devMessage,
50 | 'Internal_code' => $result->errorCode,
51 | 'more' => $result->additionalInfo,
52 | ];
53 |
54 | $response = new Response();
55 | $response->setJsonContent($responseArray);
56 | $response->setStatusCode($code);
57 | $response->setHeader('Access-Control-Allow-Origin', '*');
58 | $response->setHeader('Access-Control-Allow-Headers', 'X-Requested-With');
59 | $response->setContentType('application/json');
60 |
61 | return $response;
62 | }
63 |
64 | public static function errorParse($result, $code = 200){
65 | $responseArray = [
66 | 'status' => $code,
67 | 'status_message' => self::getResponseDescription($code),
68 | 'Error_message' => $result['message'],
69 | 'File' => $result['file'],
70 | 'Error_line' => $result['line'],
71 | ];
72 |
73 | $response = new Response();
74 | $response->setJsonContent($responseArray);
75 | $response->setStatusCode($code);
76 | $response->setHeader('Access-Control-Allow-Origin', '*');
77 | $response->setHeader('Access-Control-Allow-Headers', 'X-Requested-With');
78 | $response->setContentType('application/json');
79 |
80 | return $response;
81 | }
82 |
83 | public static function getResponseDescription($code){
84 | $codes = array(
85 |
86 | // Informational 1xx
87 | 100 => 'Continue',
88 | 101 => 'Switching Protocols',
89 |
90 | // Success 2xx
91 | 200 => 'OK',
92 | 201 => 'Created',
93 | 202 => 'Accepted',
94 | 203 => 'Non-Authoritative Information',
95 | 204 => 'No Content',
96 | 205 => 'Reset Content',
97 | 206 => 'Partial Content',
98 |
99 | // Redirection 3xx
100 | 300 => 'Multiple Choices',
101 | 301 => 'Moved Permanently',
102 | 302 => 'Found', // 1.1
103 | 303 => 'See Other',
104 | 304 => 'Not Modified',
105 | 305 => 'Use Proxy',
106 | // 306 is deprecated but reserved
107 | 307 => 'Temporary Redirect',
108 |
109 | // Client Error 4xx
110 | 400 => 'Bad Request',
111 | 401 => 'Unauthorized',
112 | 402 => 'Payment Required',
113 | 403 => 'Forbidden',
114 | 404 => 'Not Found',
115 | 405 => 'Method Not Allowed',
116 | 406 => 'Not Acceptable',
117 | 407 => 'Proxy Authentication Required',
118 | 408 => 'Request Timeout',
119 | 409 => 'Conflict',
120 | 410 => 'Gone',
121 | 411 => 'Length Required',
122 | 412 => 'Precondition Failed',
123 | 413 => 'Request Entity Too Large',
124 | 414 => 'Request-URI Too Long',
125 | 415 => 'Unsupported Media Type',
126 | 416 => 'Requested Range Not Satisfiable',
127 | 417 => 'Expectation Failed',
128 |
129 | // Server Error 5xx
130 | 500 => 'Internal Server Error',
131 | 501 => 'Not Implemented',
132 | 502 => 'Bad Gateway',
133 | 503 => 'Service Unavailable',
134 | 504 => 'Gateway Timeout',
135 | 505 => 'HTTP Version Not Supported',
136 | 509 => 'Bandwidth Limit Exceeded'
137 | );
138 |
139 | $result = (isset($codes[$code])) ?
140 | $codes[$code] :
141 | 'Unknown Status Code';
142 |
143 | return $result;
144 | }
145 | }
--------------------------------------------------------------------------------
/app/resources/micro/micro.php:
--------------------------------------------------------------------------------
1 | _routeAllowed = array();
30 | }
31 |
32 | public function routeAllowed()
33 | {
34 | return $this->_routeAllowed;
35 | }
36 |
37 | // set autoload components
38 | public function setAutoload($file, $appDir)
39 | {
40 |
41 | if (!file_exists($file))
42 | {
43 |
44 | throw new HTTPException(
45 | 'Unable to load autoloader file',
46 | 500,
47 | array(
48 | 'dev' => 'Could not found autoload.php .',
49 | 'internalCode' => 'AU500',
50 | 'more' => 'Please Check your autoload path'
51 | )
52 | );
53 |
54 | }
55 |
56 | $namespaces = include $file;
57 | $loader = new Loader();
58 | $loader->registerNamespaces($namespaces)->register();
59 |
60 | }
61 |
62 | // set Configs
63 | public function setConfig($env)
64 | {
65 |
66 | // define Dependency Injector
67 | $di = new FactoryDefault();
68 |
69 | // Set request di
70 | $di->set("request", new Request());
71 |
72 | // Set Envenronmental Variables
73 | $di->set('env', new \Phalcon\Config(require $env));
74 |
75 | // Set database for custom PDO
76 | $di->set('db', function() use ($di)
77 | {
78 |
79 | $type = strtolower($di->get('env')->database->adapter);
80 | $creds = array(
81 | 'host' => $di->get('env')->database->host,
82 | 'username' => $di->get('env')->database->username,
83 | 'password' => $di->get('env')->database->password,
84 | 'dbname' => $di->get('env')->database->name
85 | );
86 |
87 | if ($type == 'mysql')
88 | {
89 | $connection = new \Phalcon\Db\Adapter\Pdo\Mysql($creds);
90 | }
91 | else if ($type == 'postgres')
92 | {
93 | $connection = new \Phalcon\Db\Adapter\Pdo\Postgresql($creds);
94 | }
95 | else if ($type == 'sqlite')
96 | {
97 | $connection = new \Phalcon\Db\Adapter\Pdo\Sqlite($creds);
98 | }
99 | else
100 | {
101 |
102 | throw new HTTPException(
103 | 'Bad Database Adapter',
104 | 405,
105 | array(
106 | 'dev' => 'Please Check your database adapter .',
107 | 'internalCode' => 'AD405',
108 | 'more' => 'use (mysql ,postgres, sqlite)'
109 | )
110 | );
111 | }
112 |
113 | return $connection;
114 | });
115 |
116 | }
117 |
118 | //set routes collection
119 | public function setRoutes($req)
120 | {
121 |
122 | $reqUri = $req;
123 |
124 | $getreqPrefix = explode('/', $reqUri);
125 |
126 | $collections = array();
127 |
128 | $collectionFiles = scandir($this->appDir . '/resources/routes');
129 |
130 | foreach($collectionFiles as $collectionFile)
131 | {
132 | $pathinfo = pathinfo($collectionFile);
133 |
134 | if($pathinfo['extension'] === 'php')
135 | {
136 |
137 | $getcollection = include($this->appDir.'/resources/routes/'.$collectionFile);
138 | $prefixrplc = str_replace('/', '',$getcollection['prefix']);
139 |
140 | if($prefixrplc == $getreqPrefix[1])
141 | {
142 | $collections[] = $this->buildcollection($getcollection);
143 | }
144 |
145 | }
146 | }
147 |
148 | foreach($collections as $collection){
149 | $this->mount($collection);
150 | }
151 |
152 | }
153 | //end of setRoutes
154 |
155 | //build route collection
156 | private function buildcollection($route)
157 | {
158 |
159 | $cltn = new Collection();
160 |
161 | $cltn->setPrefix($route['prefix'])
162 | ->setHandler($route['handler'])
163 | ->setLazy($route['lazy']);
164 |
165 | foreach($route['collection'] as $obj){
166 |
167 | if($obj['authentication']===false)
168 | {
169 |
170 | $method = strtolower($obj['method']);
171 |
172 | if (!isset($this->_routeAllowed[$method]))
173 | {
174 | $this->_routeAllowed[$method] = array();
175 | }
176 | $this->_routeAllowed[$method][] = $route['prefix'].$obj['route'];
177 |
178 | }
179 |
180 | $cltn->{$obj['method']}($obj['route'], $obj['function']);
181 |
182 | }
183 |
184 | return $cltn;
185 |
186 | }
187 | //end of buildcollection
188 |
189 |
190 | }
191 | // end of class
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "hash": "1690aff98c6526260e575696338a22f8",
8 | "content-hash": "20c7f29fbf6c75a4725cca20a1956437",
9 | "packages": [
10 | {
11 | "name": "firebase/php-jwt",
12 | "version": "v4.0.0",
13 | "source": {
14 | "type": "git",
15 | "url": "https://github.com/firebase/php-jwt.git",
16 | "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35"
17 | },
18 | "dist": {
19 | "type": "zip",
20 | "url": "https://api.github.com/repos/firebase/php-jwt/zipball/dccf163dc8ed7ed6a00afc06c51ee5186a428d35",
21 | "reference": "dccf163dc8ed7ed6a00afc06c51ee5186a428d35",
22 | "shasum": ""
23 | },
24 | "require": {
25 | "php": ">=5.3.0"
26 | },
27 | "type": "library",
28 | "autoload": {
29 | "psr-4": {
30 | "Firebase\\JWT\\": "src"
31 | }
32 | },
33 | "notification-url": "https://packagist.org/downloads/",
34 | "license": [
35 | "BSD-3-Clause"
36 | ],
37 | "authors": [
38 | {
39 | "name": "Neuman Vong",
40 | "email": "neuman+pear@twilio.com",
41 | "role": "Developer"
42 | },
43 | {
44 | "name": "Anant Narayanan",
45 | "email": "anant@php.net",
46 | "role": "Developer"
47 | }
48 | ],
49 | "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
50 | "homepage": "https://github.com/firebase/php-jwt",
51 | "time": "2016-07-18 04:51:16"
52 | },
53 | {
54 | "name": "paypal/rest-api-sdk-php",
55 | "version": "1.7.4",
56 | "source": {
57 | "type": "git",
58 | "url": "https://github.com/paypal/PayPal-PHP-SDK.git",
59 | "reference": "d62e8db407827229c6c7aabfa54792d0113b99e4"
60 | },
61 | "dist": {
62 | "type": "zip",
63 | "url": "https://api.github.com/repos/paypal/PayPal-PHP-SDK/zipball/d62e8db407827229c6c7aabfa54792d0113b99e4",
64 | "reference": "d62e8db407827229c6c7aabfa54792d0113b99e4",
65 | "shasum": ""
66 | },
67 | "require": {
68 | "ext-curl": "*",
69 | "ext-json": "*",
70 | "php": ">=5.3.0",
71 | "psr/log": "1.0.0"
72 | },
73 | "require-dev": {
74 | "phpunit/phpunit": "3.7.*"
75 | },
76 | "type": "library",
77 | "autoload": {
78 | "psr-0": {
79 | "PayPal": "lib/"
80 | }
81 | },
82 | "notification-url": "https://packagist.org/downloads/",
83 | "license": [
84 | "Apache2"
85 | ],
86 | "authors": [
87 | {
88 | "name": "PayPal",
89 | "homepage": "https://github.com/paypal/rest-api-sdk-php/contributors"
90 | }
91 | ],
92 | "description": "PayPal's PHP SDK for REST APIs",
93 | "homepage": "http://paypal.github.io/PayPal-PHP-SDK/",
94 | "keywords": [
95 | "payments",
96 | "paypal",
97 | "rest",
98 | "sdk"
99 | ],
100 | "time": "2016-07-15 20:42:18"
101 | },
102 | {
103 | "name": "psr/log",
104 | "version": "1.0.0",
105 | "source": {
106 | "type": "git",
107 | "url": "https://github.com/php-fig/log.git",
108 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
109 | },
110 | "dist": {
111 | "type": "zip",
112 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
113 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
114 | "shasum": ""
115 | },
116 | "type": "library",
117 | "autoload": {
118 | "psr-0": {
119 | "Psr\\Log\\": ""
120 | }
121 | },
122 | "notification-url": "https://packagist.org/downloads/",
123 | "license": [
124 | "MIT"
125 | ],
126 | "authors": [
127 | {
128 | "name": "PHP-FIG",
129 | "homepage": "http://www.php-fig.org/"
130 | }
131 | ],
132 | "description": "Common interface for logging libraries",
133 | "keywords": [
134 | "log",
135 | "psr",
136 | "psr-3"
137 | ],
138 | "time": "2012-12-21 11:40:51"
139 | }
140 | ],
141 | "packages-dev": [],
142 | "aliases": [],
143 | "minimum-stability": "stable",
144 | "stability-flags": [],
145 | "prefer-stable": false,
146 | "prefer-lowest": false,
147 | "platform": [],
148 | "platform-dev": []
149 | }
150 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Phalcon Micro Rest Api #
2 |
3 | Phalcon Restful API that uses Phalcon Micro framework (works with Phalcon 2.0+ and 3.0)
4 |
5 | The framework requires PHP 5.4, 5.5, 5.6 or PHP7
6 |
7 | ### What is this repository for? ###
8 |
9 | * Phalcon Micro Rest Application
10 | * Version 1.0
11 | * [Learn Markdown](https://docs.phalconphp.com/en/latest/reference/tutorial-rest.html)
12 |
13 | ### How do I get set up? ###
14 |
15 | * Clone repo
16 | * change to root directory "cd phalcon-restapi-rain"
17 | * run "composer install" without qoute to install php classes
18 |
19 | ### Requirements ###
20 | ---------
21 | PHP 5.4 or greater
22 |
23 | Required PHP Modules
24 | - Phalcon (http://phalconphp.com/en/download)
25 | - PDO-MySQL
26 |
27 | Database Configuration
28 | --------------
29 | Open `phalcon-restapi-rain/config/config.env.php` and setup your database connection credentials
30 |
31 | ```php
32 | $settings = array(
33 | 'database' => array(
34 | 'adapter' => 'Mysql', /* Possible Values: Mysql, Postgres, Sqlite */
35 | 'host' => 'your_ip_or_hostname',
36 | 'username' => 'your_username',
37 | 'password' => 'your_password',
38 | 'name' => 'your_database_schema',
39 | 'port' => 3306
40 | ),
41 | );
42 | ```
43 |
44 | you can use my sample schema in `phalcon-restapi-rain/schema/rainrest.sql`
45 |
46 |
47 | Routes
48 | -------------
49 | Routes are stored in `phalcon-restapi-rain/app/resources/routes` as an array. A route has a method (HEAD, GET, POST, PATCH, DELETE, OPTIONS), uri (which can contain regular expressions) and handler/controller to point to.
50 |
51 | `phalcon-restapi-rain/app/resources/routes/exaple.php`
52 |
53 | ```php
54 | $collection = [
55 | 'prefix' => '/example/',
56 | 'handler' => 'Controllers\ExampleController',
57 | 'lazy' => TRUE,
58 | 'collection' => [
59 |
60 | [
61 | 'method' => 'post',
62 | 'route' => 'post/ping',
63 | 'function' => 'postPing',
64 | 'authentication' => FALSE
65 | ],
66 |
67 | [
68 | 'method' => 'get',
69 | 'route' => 'get/ping/{id}',
70 | 'function' => 'getPing',
71 | 'authentication' => FALSE
72 | ],
73 |
74 | [
75 | 'method' => 'put',
76 | 'route' => 'put/ping',
77 | 'function' => 'putPing',
78 | 'authentication' => TRUE
79 | ],
80 |
81 | [
82 | 'method' => 'delete',
83 | 'route' => 'delete/ping',
84 | 'function' => 'deletePing',
85 | 'authentication' => FALSE
86 | ]
87 |
88 | ]
89 | ];
90 |
91 | return $collection;
92 | ```
93 |
94 | `phalcon-restapi-rain/app/resources/routes/users.php`
95 |
96 | ```php
97 | $collection = [
98 | 'prefix' => '/users/',
99 | 'handler' => 'Controllers\UsersController',
100 | 'lazy' => TRUE,
101 | 'collection' => [
102 |
103 | [
104 | 'method' => 'get',
105 | 'route' => 'getuser',
106 | 'function' => 'getUser',
107 | 'authentication' => FALSE
108 | ],
109 |
110 | [
111 | 'method' => 'post',
112 | 'route' => 'saveuser',
113 | 'function' => 'saveUser',
114 | 'authentication' => FALSE
115 | ]
116 |
117 | ]
118 | ];
119 |
120 | return $collection;
121 | ```
122 |
123 |
124 | Test Routes
125 | -------------
126 | to test route either use Postman plugin of google chrome or any other api testing application
127 |
128 | Note! change http://rainrestv1.dev use your own hostname
129 |
130 | POST Method
131 | url: http://rainrestv1.dev/example/post/ping
132 |
133 | Response :
134 | ```json
135 | {
136 | "status": 200,
137 | "status_message": "OK",
138 | "result": [
139 | {
140 | "postpong": "pong - post method"
141 | }
142 | ],
143 | "count": 1
144 | }
145 | ```
146 |
147 | GET Method
148 | url: http://rainrestv1.dev/example/get/ping/12345
149 |
150 | Response :
151 | ```json
152 | {
153 | "status": 200,
154 | "status_message": "OK",
155 | "result": [
156 | {
157 | "getpong": "pong - get method",
158 | "id": "12345"
159 | }
160 | ],
161 | "count": 1
162 | }
163 | ```
164 |
165 | PUT Method
166 | url: http://rainrestv1.dev/example/put/ping
167 |
168 | Response :
169 | ```json
170 | {
171 | "status": 200,
172 | "status_message": "OK",
173 | "result": [
174 | {
175 | "putpong": "pong - put method"
176 | }
177 | ],
178 | "count": 1
179 | }
180 | ```
181 |
182 | DELETE Method
183 | url: http://rainrestv1.dev/example/delete/ping
184 |
185 | Response :
186 | ```json
187 | {
188 | "status": 200,
189 | "status_message": "OK",
190 | "result": [
191 | {
192 | "deletepong": "pong - delete method"
193 | }
194 | ],
195 | "count": 1
196 | }
197 | ```
198 |
199 |
200 | GET Method
201 | url: http://rainrestv1.dev/users/getuser
202 |
203 | Response :
204 | ```json
205 | {
206 | "status": 200,
207 | "status_message": "OK",
208 | "result": [
209 | {
210 | "userlist": [
211 | {
212 | "id": "1",
213 | "name": "Jan Rainier Llarenas",
214 | "username": "superagent",
215 | "password": "1234568"
216 | },
217 | {
218 | "id": "2",
219 | "name": "Janine Hazel Labadia",
220 | "username": "superlady",
221 | "password": "1234568"
222 | },
223 | {
224 | "id": "3",
225 | "name": "Heaven Leih Mojica",
226 | "username": "superbabs",
227 | "password": "12345678"
228 | },
229 | {
230 | "id": "4",
231 | "name": "Jonalyn Hazel Cajalne",
232 | "username": "superslim",
233 | "password": "1234568"
234 | }
235 | ]
236 | }
237 | ],
238 | "count": 1
239 | }
240 | ```
241 |
242 |
243 | ### Who do I talk to? ###
244 |
245 | * Owner Jan Rainier Llarenas
246 | * Contributor Neil Male
247 | * Contributor Hazel Cajalne
248 |
--------------------------------------------------------------------------------
/schema/rainrest.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 4.6.2
3 | -- https://www.phpmyadmin.net/
4 | --
5 | -- Host: localhost
6 | -- Generation Time: Aug 03, 2016 at 10:21 PM
7 | -- Server version: 5.7.13
8 | -- PHP Version: 7.0.9
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | SET time_zone = "+00:00";
12 |
13 |
14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
17 | /*!40101 SET NAMES utf8mb4 */;
18 |
19 | --
20 | -- Database: `rainrest`
21 | --
22 |
23 | -- --------------------------------------------------------
24 |
25 | --
26 | -- Table structure for table `users`
27 | --
28 |
29 | CREATE TABLE `users` (
30 | `id` int(11) NOT NULL,
31 | `name` varchar(250) NOT NULL,
32 | `username` varchar(250) NOT NULL,
33 | `password` varchar(250) NOT NULL
34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
35 |
36 | --
37 | -- Dumping data for table `users`
38 | --
39 |
40 | INSERT INTO `users` (`id`, `name`, `username`, `password`) VALUES
41 | (1, 'Jan Rainier Llarenas', 'superagent', '1234568'),
42 | (2, 'Janine Hazel Labadia', 'superlady', '1234568'),
43 | (3, 'Heaven Leih Mojica', 'superbabs', '12345678'),
44 | (4, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
45 | (5, 'Jan Rainier Llarenas', 'superagent', '1234568'),
46 | (6, 'Janine Hazel Labadia', 'superlady', '1234568'),
47 | (7, 'Heaven Leih Mojica', 'superbabs', '12345678'),
48 | (8, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
49 | (9, 'Jan Rainier Llarenas', 'superagent', '1234568'),
50 | (10, 'Janine Hazel Labadia', 'superlady', '1234568'),
51 | (11, 'Heaven Leih Mojica', 'superbabs', '12345678'),
52 | (12, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
53 | (13, 'Jan Rainier Llarenas', 'superagent', '1234568'),
54 | (14, 'Janine Hazel Labadia', 'superlady', '1234568'),
55 | (15, 'Heaven Leih Mojica', 'superbabs', '12345678'),
56 | (16, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
57 | (17, 'Jan Rainier Llarenas', 'superagent', '1234568'),
58 | (18, 'Janine Hazel Labadia', 'superlady', '1234568'),
59 | (19, 'Heaven Leih Mojica', 'superbabs', '12345678'),
60 | (20, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
61 | (21, 'Jan Rainier Llarenas', 'superagent', '1234568'),
62 | (22, 'Janine Hazel Labadia', 'superlady', '1234568'),
63 | (23, 'Heaven Leih Mojica', 'superbabs', '12345678'),
64 | (24, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
65 | (25, 'Jan Rainier Llarenas', 'superagent', '1234568'),
66 | (26, 'Janine Hazel Labadia', 'superlady', '1234568'),
67 | (27, 'Heaven Leih Mojica', 'superbabs', '12345678'),
68 | (28, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
69 | (29, 'Jan Rainier Llarenas', 'superagent', '1234568'),
70 | (30, 'Janine Hazel Labadia', 'superlady', '1234568'),
71 | (31, 'Heaven Leih Mojica', 'superbabs', '12345678'),
72 | (32, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
73 | (33, 'Jan Rainier Llarenas', 'superagent', '1234568'),
74 | (34, 'Janine Hazel Labadia', 'superlady', '1234568'),
75 | (35, 'Heaven Leih Mojica', 'superbabs', '12345678'),
76 | (36, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
77 | (37, 'Jan Rainier Llarenas', 'superagent', '1234568'),
78 | (38, 'Janine Hazel Labadia', 'superlady', '1234568'),
79 | (39, 'Heaven Leih Mojica', 'superbabs', '12345678'),
80 | (40, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
81 | (41, 'Jan Rainier Llarenas', 'superagent', '1234568'),
82 | (42, 'Janine Hazel Labadia', 'superlady', '1234568'),
83 | (43, 'Heaven Leih Mojica', 'superbabs', '12345678'),
84 | (44, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
85 | (45, 'Jan Rainier Llarenas', 'superagent', '1234568'),
86 | (46, 'Janine Hazel Labadia', 'superlady', '1234568'),
87 | (47, 'Heaven Leih Mojica', 'superbabs', '12345678'),
88 | (48, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
89 | (49, 'Jan Rainier Llarenas', 'superagent', '1234568'),
90 | (50, 'Janine Hazel Labadia', 'superlady', '1234568'),
91 | (51, 'Heaven Leih Mojica', 'superbabs', '12345678'),
92 | (52, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
93 | (53, 'Jan Rainier Llarenas', 'superagent', '1234568'),
94 | (54, 'Janine Hazel Labadia', 'superlady', '1234568'),
95 | (55, 'Heaven Leih Mojica', 'superbabs', '12345678'),
96 | (56, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
97 | (57, 'Jan Rainier Llarenas', 'superagent', '1234568'),
98 | (58, 'Janine Hazel Labadia', 'superlady', '1234568'),
99 | (59, 'Heaven Leih Mojica', 'superbabs', '12345678'),
100 | (60, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
101 | (61, 'Jan Rainier Llarenas', 'superagent', '1234568'),
102 | (62, 'Janine Hazel Labadia', 'superlady', '1234568'),
103 | (63, 'Heaven Leih Mojica', 'superbabs', '12345678'),
104 | (64, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
105 | (65, 'Jan Rainier Llarenas', 'superagent', '1234568'),
106 | (66, 'Janine Hazel Labadia', 'superlady', '1234568'),
107 | (67, 'Heaven Leih Mojica', 'superbabs', '12345678'),
108 | (68, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
109 | (69, 'Jan Rainier Llarenas', 'superagent', '1234568'),
110 | (70, 'Janine Hazel Labadia', 'superlady', '1234568'),
111 | (71, 'Heaven Leih Mojica', 'superbabs', '12345678'),
112 | (72, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
113 | (73, 'Jan Rainier Llarenas', 'superagent', '1234568'),
114 | (74, 'Janine Hazel Labadia', 'superlady', '1234568'),
115 | (75, 'Heaven Leih Mojica', 'superbabs', '12345678'),
116 | (76, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
117 | (77, 'Jan Rainier Llarenas', 'superagent', '1234568'),
118 | (78, 'Janine Hazel Labadia', 'superlady', '1234568'),
119 | (79, 'Heaven Leih Mojica', 'superbabs', '12345678'),
120 | (80, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
121 | (81, 'Jan Rainier Llarenas', 'superagent', '1234568'),
122 | (82, 'Janine Hazel Labadia', 'superlady', '1234568'),
123 | (83, 'Heaven Leih Mojica', 'superbabs', '12345678'),
124 | (84, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
125 | (85, 'Jan Rainier Llarenas', 'superagent', '1234568'),
126 | (86, 'Janine Hazel Labadia', 'superlady', '1234568'),
127 | (87, 'Heaven Leih Mojica', 'superbabs', '12345678'),
128 | (88, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
129 | (89, 'Jan Rainier Llarenas', 'superagent', '1234568'),
130 | (90, 'Janine Hazel Labadia', 'superlady', '1234568'),
131 | (91, 'Heaven Leih Mojica', 'superbabs', '12345678'),
132 | (92, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
133 | (93, 'Jan Rainier Llarenas', 'superagent', '1234568'),
134 | (94, 'Janine Hazel Labadia', 'superlady', '1234568'),
135 | (95, 'Heaven Leih Mojica', 'superbabs', '12345678'),
136 | (96, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
137 | (97, 'Jan Rainier Llarenas', 'superagent', '1234568'),
138 | (98, 'Janine Hazel Labadia', 'superlady', '1234568'),
139 | (99, 'Heaven Leih Mojica', 'superbabs', '12345678'),
140 | (100, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
141 | (101, 'Jan Rainier Llarenas', 'superagent', '1234568'),
142 | (102, 'Janine Hazel Labadia', 'superlady', '1234568'),
143 | (103, 'Heaven Leih Mojica', 'superbabs', '12345678'),
144 | (104, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
145 | (105, 'Jan Rainier Llarenas', 'superagent', '1234568'),
146 | (106, 'Janine Hazel Labadia', 'superlady', '1234568'),
147 | (107, 'Heaven Leih Mojica', 'superbabs', '12345678'),
148 | (108, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
149 | (109, 'Jan Rainier Llarenas', 'superagent', '1234568'),
150 | (110, 'Janine Hazel Labadia', 'superlady', '1234568'),
151 | (111, 'Heaven Leih Mojica', 'superbabs', '12345678'),
152 | (112, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
153 | (113, 'Jan Rainier Llarenas', 'superagent', '1234568'),
154 | (114, 'Janine Hazel Labadia', 'superlady', '1234568'),
155 | (115, 'Heaven Leih Mojica', 'superbabs', '12345678'),
156 | (116, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
157 | (117, 'Jan Rainier Llarenas', 'superagent', '1234568'),
158 | (118, 'Janine Hazel Labadia', 'superlady', '1234568'),
159 | (119, 'Heaven Leih Mojica', 'superbabs', '12345678'),
160 | (120, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
161 | (121, 'Jan Rainier Llarenas', 'superagent', '1234568'),
162 | (122, 'Janine Hazel Labadia', 'superlady', '1234568'),
163 | (123, 'Heaven Leih Mojica', 'superbabs', '12345678'),
164 | (124, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
165 | (125, 'Jan Rainier Llarenas', 'superagent', '1234568'),
166 | (126, 'Janine Hazel Labadia', 'superlady', '1234568'),
167 | (127, 'Heaven Leih Mojica', 'superbabs', '12345678'),
168 | (128, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
169 | (129, 'Jan Rainier Llarenas', 'superagent', '1234568'),
170 | (130, 'Janine Hazel Labadia', 'superlady', '1234568'),
171 | (131, 'Heaven Leih Mojica', 'superbabs', '12345678'),
172 | (132, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
173 | (133, 'Jan Rainier Llarenas', 'superagent', '1234568'),
174 | (134, 'Janine Hazel Labadia', 'superlady', '1234568'),
175 | (135, 'Heaven Leih Mojica', 'superbabs', '12345678'),
176 | (136, 'Jan Rainier Llarenas', 'superagent', '1234568'),
177 | (137, 'Janine Hazel Labadia', 'superlady', '1234568'),
178 | (138, 'Heaven Leih Mojica', 'superbabs', '12345678'),
179 | (139, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
180 | (140, 'Jan Rainier Llarenas', 'superagent', '1234568'),
181 | (141, 'Janine Hazel Labadia', 'superlady', '1234568'),
182 | (142, 'Heaven Leih Mojica', 'superbabs', '12345678'),
183 | (143, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
184 | (144, 'Jan Rainier Llarenas', 'superagent', '1234568'),
185 | (145, 'Janine Hazel Labadia', 'superlady', '1234568'),
186 | (146, 'Heaven Leih Mojica', 'superbabs', '12345678'),
187 | (147, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
188 | (148, 'Jan Rainier Llarenas', 'superagent', '1234568'),
189 | (149, 'Janine Hazel Labadia', 'superlady', '1234568'),
190 | (150, 'Heaven Leih Mojica', 'superbabs', '12345678'),
191 | (151, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
192 | (152, 'Jan Rainier Llarenas', 'superagent', '1234568'),
193 | (153, 'Janine Hazel Labadia', 'superlady', '1234568'),
194 | (154, 'Heaven Leih Mojica', 'superbabs', '12345678'),
195 | (155, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
196 | (156, 'Jan Rainier Llarenas', 'superagent', '1234568'),
197 | (157, 'Janine Hazel Labadia', 'superlady', '1234568'),
198 | (158, 'Heaven Leih Mojica', 'superbabs', '12345678'),
199 | (159, 'Jan Rainier Llarenas', 'superagent', '1234568'),
200 | (160, 'Janine Hazel Labadia', 'superlady', '1234568'),
201 | (161, 'Heaven Leih Mojica', 'superbabs', '12345678'),
202 | (162, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
203 | (163, 'Jan Rainier Llarenas', 'superagent', '1234568'),
204 | (164, 'Janine Hazel Labadia', 'superlady', '1234568'),
205 | (165, 'Heaven Leih Mojica', 'superbabs', '12345678'),
206 | (166, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
207 | (167, 'Jan Rainier Llarenas', 'superagent', '1234568'),
208 | (168, 'Janine Hazel Labadia', 'superlady', '1234568'),
209 | (169, 'Heaven Leih Mojica', 'superbabs', '12345678'),
210 | (170, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
211 | (171, 'Jan Rainier Llarenas', 'superagent', '1234568'),
212 | (172, 'Janine Hazel Labadia', 'superlady', '1234568'),
213 | (173, 'Heaven Leih Mojica', 'superbabs', '12345678'),
214 | (174, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
215 | (175, 'Jan Rainier Llarenas', 'superagent', '1234568'),
216 | (176, 'Janine Hazel Labadia', 'superlady', '1234568'),
217 | (177, 'Heaven Leih Mojica', 'superbabs', '12345678'),
218 | (178, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
219 | (179, 'Jan Rainier Llarenas', 'superagent', '1234568'),
220 | (180, 'Janine Hazel Labadia', 'superlady', '1234568'),
221 | (181, 'Heaven Leih Mojica', 'superbabs', '12345678'),
222 | (182, 'Jan Rainier Llarenas', 'superagent', '1234568'),
223 | (183, 'Janine Hazel Labadia', 'superlady', '1234568'),
224 | (184, 'Heaven Leih Mojica', 'superbabs', '12345678'),
225 | (185, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
226 | (186, 'Jan Rainier Llarenas', 'superagent', '1234568'),
227 | (187, 'Janine Hazel Labadia', 'superlady', '1234568'),
228 | (188, 'Heaven Leih Mojica', 'superbabs', '12345678'),
229 | (189, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
230 | (190, 'Jan Rainier Llarenas', 'superagent', '1234568'),
231 | (191, 'Janine Hazel Labadia', 'superlady', '1234568'),
232 | (192, 'Heaven Leih Mojica', 'superbabs', '12345678'),
233 | (193, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
234 | (194, 'Jan Rainier Llarenas', 'superagent', '1234568'),
235 | (195, 'Janine Hazel Labadia', 'superlady', '1234568'),
236 | (196, 'Heaven Leih Mojica', 'superbabs', '12345678'),
237 | (197, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
238 | (198, 'Jan Rainier Llarenas', 'superagent', '1234568'),
239 | (199, 'Janine Hazel Labadia', 'superlady', '1234568'),
240 | (200, 'Heaven Leih Mojica', 'superbabs', '12345678'),
241 | (201, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
242 | (202, 'Jan Rainier Llarenas', 'superagent', '1234568'),
243 | (203, 'Janine Hazel Labadia', 'superlady', '1234568'),
244 | (204, 'Heaven Leih Mojica', 'superbabs', '12345678'),
245 | (205, 'Jan Rainier Llarenas', 'superagent', '1234568'),
246 | (206, 'Janine Hazel Labadia', 'superlady', '1234568'),
247 | (207, 'Heaven Leih Mojica', 'superbabs', '12345678'),
248 | (208, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
249 | (209, 'Jan Rainier Llarenas', 'superagent', '1234568'),
250 | (210, 'Janine Hazel Labadia', 'superlady', '1234568'),
251 | (211, 'Heaven Leih Mojica', 'superbabs', '12345678'),
252 | (212, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
253 | (213, 'Jan Rainier Llarenas', 'superagent', '1234568'),
254 | (214, 'Janine Hazel Labadia', 'superlady', '1234568'),
255 | (215, 'Heaven Leih Mojica', 'superbabs', '12345678'),
256 | (216, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
257 | (217, 'Jan Rainier Llarenas', 'superagent', '1234568'),
258 | (218, 'Janine Hazel Labadia', 'superlady', '1234568'),
259 | (219, 'Heaven Leih Mojica', 'superbabs', '12345678'),
260 | (220, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
261 | (221, 'Jan Rainier Llarenas', 'superagent', '1234568'),
262 | (222, 'Janine Hazel Labadia', 'superlady', '1234568'),
263 | (223, 'Heaven Leih Mojica', 'superbabs', '12345678'),
264 | (224, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
265 | (225, 'Jan Rainier Llarenas', 'superagent', '1234568'),
266 | (226, 'Janine Hazel Labadia', 'superlady', '1234568'),
267 | (227, 'Heaven Leih Mojica', 'superbabs', '12345678'),
268 | (228, 'Jan Rainier Llarenas', 'superagent', '1234568'),
269 | (229, 'Janine Hazel Labadia', 'superlady', '1234568'),
270 | (230, 'Heaven Leih Mojica', 'superbabs', '12345678'),
271 | (231, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
272 | (232, 'Jan Rainier Llarenas', 'superagent', '1234568'),
273 | (233, 'Janine Hazel Labadia', 'superlady', '1234568'),
274 | (234, 'Heaven Leih Mojica', 'superbabs', '12345678'),
275 | (235, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
276 | (236, 'Jan Rainier Llarenas', 'superagent', '1234568'),
277 | (237, 'Janine Hazel Labadia', 'superlady', '1234568'),
278 | (238, 'Heaven Leih Mojica', 'superbabs', '12345678'),
279 | (239, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
280 | (240, 'Jan Rainier Llarenas', 'superagent', '1234568'),
281 | (241, 'Janine Hazel Labadia', 'superlady', '1234568'),
282 | (242, 'Heaven Leih Mojica', 'superbabs', '12345678'),
283 | (243, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
284 | (244, 'Jan Rainier Llarenas', 'superagent', '1234568'),
285 | (245, 'Janine Hazel Labadia', 'superlady', '1234568'),
286 | (246, 'Heaven Leih Mojica', 'superbabs', '12345678'),
287 | (247, 'Jonalyn Hazel Cajalne', 'superslim', '1234568'),
288 | (248, 'Jan Rainier Llarenas', 'superagent', '1234568'),
289 | (249, 'Janine Hazel Labadia', 'superlady', '1234568'),
290 | (250, 'Heaven Leih Mojica', 'superbabs', '12345678');
291 |
292 | --
293 | -- Indexes for dumped tables
294 | --
295 |
296 | --
297 | -- Indexes for table `users`
298 | --
299 | ALTER TABLE `users`
300 | ADD PRIMARY KEY (`id`);
301 |
302 | --
303 | -- AUTO_INCREMENT for dumped tables
304 | --
305 |
306 | --
307 | -- AUTO_INCREMENT for table `users`
308 | --
309 | ALTER TABLE `users`
310 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=251;
311 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
312 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
313 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
314 |
--------------------------------------------------------------------------------