[Ivan Diaz] - Add server changes
This commit is contained in:
parent
504c4227b8
commit
36fd8a4585
|
@ -6,7 +6,6 @@ $app->group('/user', function () use ($app) {
|
|||
});
|
||||
|
||||
$app->get('/add/:user/:pass', function ($user, $pass) use ($app) {
|
||||
// $app->response()->setStatus(400);
|
||||
$userInstance = new User();
|
||||
$userInstance->setProperties(array(
|
||||
'user' => $user,
|
||||
|
|
|
@ -9,10 +9,6 @@ RedBean::setup('mysql:host='. $mysql_host .';dbname=' . $mysql_database, $mysql_
|
|||
// SLIM FRAMEWORK
|
||||
\Slim\Slim::registerAutoLoader();
|
||||
$app = new \Slim\Slim();
|
||||
$app->config('debug', true);
|
||||
$app->error(function (\Exception $e) use ($app) {
|
||||
echo "error";
|
||||
});
|
||||
|
||||
// LOAD MODELS
|
||||
spl_autoload_register(function ($class) {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
/*abstract class DataStore {
|
||||
protected $_id;
|
||||
protected $_bean;
|
||||
|
||||
protected function __construct($table) {
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
class Log {
|
||||
public static function getLog($id) {
|
||||
return RedBean::load('log', $id);
|
||||
}
|
||||
|
||||
public static function log($properties) {
|
||||
$this->log = RedBean::dispense('LOGS');
|
||||
$log->date = RedBean::isoDateTime();
|
||||
$log->type = $properties['type'];
|
||||
$log->content = $properties['content'];
|
||||
}
|
||||
|
||||
public function showUserDetails() {
|
||||
return $this->_user;
|
||||
}
|
||||
}
|
|
@ -44,7 +44,6 @@ class User {
|
|||
$this->_user = $user;
|
||||
}
|
||||
else {
|
||||
//echo RedBean;
|
||||
$this->_user = RedBean::dispense('users');
|
||||
$this->setDefaultProperties();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue