[Ivan Diaz] - Add server changes

This commit is contained in:
Ivan Diaz 2015-11-01 18:46:13 -03:00
parent 504c4227b8
commit 36fd8a4585
5 changed files with 27 additions and 6 deletions

View File

@ -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,

View File

@ -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) {

View File

@ -0,0 +1,10 @@
<?php
/*abstract class DataStore {
protected $_id;
protected $_bean;
protected function __construct($table) {
}
}
*/

17
server/models/Log.php Normal file
View File

@ -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;
}
}

View File

@ -44,7 +44,6 @@ class User {
$this->_user = $user;
}
else {
//echo RedBean;
$this->_user = RedBean::dispense('users');
$this->setDefaultProperties();
}