<?php

#include APPLICATION_PATH . '/DAO/FicheSmsDAO.php';
include APPLICATION_PATH . '/api/UtilisateurApi.php';

abstract class REST_Controller extends Zend_Rest_Controller
{
 public function headAction()
  {
    // you should add your own logic here to check for cache headers from the request
    $this->getResponse()->setBody(null);
  }

  public function optionsAction()
  {
    $this->getResponse()->setBody(null);
    $this->getResponse()->setHeader('Allow', 'OPTIONS, HEAD, INDEX, GET, POST, PUT, DELETE');
  }
}

class RestController extends  REST_Controller

{

  
 

    public function init(){
    $bootstrap = $this->getInvokeArg('bootstrap');
    //$options = $bootstrap->getOption('resources');

    $contextSwitch = $this->_helper->getHelper('contextSwitch');
    $contextSwitch  ->addActionContext('index', array('json'))
                    ->addActionContext('get', array("json"))
                    ->addActionContext('post', array("json"))
                    ->addActionContext('put', array("json"))
                    ->addActionContext('delete', array("json"))
                    ->initContext('json');
}
   
    public function apiAction()
        {
          $server = new Zend_Rest_Server();
          $server->setClass('ModuleUser');
          $server->setClass('ModuleRole');
          $server->setClass('ModuleSite');
          $server->handle();

          exit;
        }

public function deleteAction() {
        $this->view->retour = "deleteAction";
    }

    public function getAction() {
        $this->view->retour = "getAction";
    }

    public function indexAction() {
        
        
    }

    public function postAction() {
        $this->view->retour = "postAction";
    }

    public function putAction() {
        $this->view->retour = "putAction";
    }


  

}



