TRUE si aucune erreur, sinon FALSE * */ function insertUsersFromJSON(){ $json = manager\ResourcesDispatcher::getRessource('/f/json/generated_users/conf'); $json = json_decode( $json, true ); // Pour chaque entree foreach( $json as $user ){ $insertRequest = manager\Database::getPDO()->prepare("INSERT INTO user(id_user, code, username, firstname, lastname, mail, password, status) VALUES( DEFAULT, :code, :username, :firstname, :lastname, :mail, :password, :status )"); $status = $insertRequest->execute(array( ':code' => $user['code'], ':username' => $user['username'], ':firstname' => $user['firstname'], ':lastname' => $user['lastname'], ':mail' => $user['email'], ':password' => $user['password'], ':status' => $user['status'] )); var_dump( $status ); } return true; }// insertUsersFromJSON(); /* TEST DU DISPATCHER DES MANAGERS * * @return nomRetour Description du retour */ function testModuleDispatcher(){ $req1 = new manager\ModuleRequest('firstModule/a', array('id_user' => 10) ); $req2 = manager\ModuleRequest::fromString('{"path": "firstModule/a", "data": [{"id_user":10}]}'); $instance = new manager\ModuleDispatcher($req1); var_dump( $instance ); return true; }testModuleDispatcher(); ?>