Gestion de la création de sujet via API

This commit is contained in:
xdrm-brackets 2016-11-24 16:15:00 +01:00
parent 41a9480e49
commit 361858e604
7 changed files with 32 additions and 24 deletions

View File

@ -4,6 +4,7 @@
use \database\core\DatabaseDriver;
use \manager\ManagerError;
use \api\core\Checker;
use \database\core\Repo;
class ModuleRequest{

View File

@ -140,7 +140,7 @@
/* [1] On récupère l'id unique actuel
=========================================================*/
$funiq = fopen( __BUILD__.'/src/dynamic/uniqid', 'r+' );
$funiq = fopen( __BUILD__.'/lightdb/storage/uniqid', 'r+' );
flock($funiq, LOCK_EX); // On verrouille le fichier
$uniqid = trim( fgets( $funiq ) );

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"1":{"line":0}}
{"1":{"line":0},"52":{"line":1},"53":{"line":2},"54":{"line":3}}

View File

@ -1 +1 @@
51
54

View File

@ -88,33 +88,33 @@
*/
public static function explicit($error){
switch($error){
case self::Success: return "Tout s'est bien deroulé."; break;
case self::Success: return "All right."; break;
case self::ParsingFailed: return "La lecture du fichier JSON ou XML a echouée."; break;
case self::ParsingFailed: return "JSON/XML file format error."; break;
case self::InvalidFlags: return "Les spécifications (drapeaux) sont incorrects."; break;
case self::UnreachableResource: return "La ressource n'existe pas (404)."; break;
case self::MissingPath: return "Le chemin de délégation n'a pas été renseigné."; break;
case self::WrongPathModule: return "Le chemin de délégation est incorrect ('nomModule/nomMethode')."; break;
case self::WrongPathRepo: return "Le chemin de délégation est incorrect ('nomRepo/nomMethode')."; break;
case self::UnknownModule: return "Le module n'existe pas."; break;
case self::UnknownRepo: return "Le repo n'existe pas."; break;
case self::UnknownMethod: return "Le methode n'existe pas."; break;
case self::UncallableMethod: return "Le methode n'est pas amorçable."; break;
case self::InvalidFlags: return "Flags are incorrect."; break;
case self::UnreachableResource: return "Resource unreachable (404)."; break;
case self::MissingPath: return "Path missing."; break;
case self::WrongPathModule: return "Module path incorrect 'module/method'."; break;
case self::WrongPathRepo: return "Repository path incorrect 'repo/method'."; break;
case self::UnknownModule: return "Requested module not found."; break;
case self::UnknownRepo: return "Requested repository not found."; break;
case self::UnknownMethod: return "Requested method not found."; break;
case self::UncallableMethod: return "Cannot call requested method."; break;
case self::ParamError: return "Un ou plusieurs paramètres sont manquants ou incorrects."; break;
case self::ModuleError: return "Erreur lors du traitement du module."; break;
case self::RepoError: return "Erreur lors du traitement du repo."; break;
case self::ParamError: return "Wrong or missing parameter(s)."; break;
case self::ModuleError: return "Module error."; break;
case self::RepoError: return "Repository error."; break;
case self::PDOConnection: return "La connexion avec la base de données a echouée."; break;
case self::PDOConnection: return "Database connection failed."; break;
case self::TokenError: return "Le token de connection est absent, érroné ou expiré."; break;
case self::PermissionError: return "Vous n'avez pas la permission d'effectuer cette action."; break;
case self::UploadError: return "Une erreur d'upload est survenue."; break;
case self::FormatError: return "Le fichier n'est pas au bon format."; break;
case self::Already: return "Action déja effectuée."; break;
case self::TokenError: return "Access token wrong, missing or expired."; break;
case self::PermissionError: return "Not granted to do so."; break;
case self::UploadError: return "Upload error."; break;
case self::FormatError: return "Format error."; break;
case self::Already: return "Already done."; break;
default: return "Description d'erreur inconnue..."; break;
default: return "Unknown debug error"; break;
}
// Erreur inconnue

View File

@ -13,6 +13,10 @@
if( $LOG ){
var_dump('subjects');
foreach($sl->index() as $index=>$null)
var_dump( $index.' # '.$sl->fetch($index)['subject']['name'] );
$sub = $sl->fetch(1);
var_dump( count($sub['relations']) );