/[openfoncier]/trunk/services/REST/maintenance.php
ViewVC logotype

Diff of /trunk/services/REST/maintenance.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 523 by mlimic, Fri Oct 19 11:59:44 2012 UTC revision 541 by mlimic, Mon Oct 29 15:44:03 2012 UTC
# Line 29  class maintenance extends Services { Line 29  class maintenance extends Services {
29       * Calls its parent's constructor and fills the contents array with the       * Calls its parent's constructor and fills the contents array with the
30       * keys that are to be searched for in the incoming JSON data.       * keys that are to be searched for in the incoming JSON data.
31       */       */
32      function __construct() {      public function __construct() {
33          parent::__construct();          parent::__construct();
34          $this->contents['module'] = '';          $this->contents['module'] = '';
35          $this->contents['data'] = '';          $this->contents['data'] = '';
# Line 41  class maintenance extends Services { Line 41  class maintenance extends Services {
41       *       *
42       * Call's its parent's destructor.       * Call's its parent's destructor.
43       */       */
44      function __destruct() {      public function __destruct() {
45          parent::__destruct();          parent::__destruct();
46      }      }
47            
# Line 61  class maintenance extends Services { Line 61  class maintenance extends Services {
61       * 400 is sent on error.       * 400 is sent on error.
62       * 200 is sent on success.       * 200 is sent on success.
63       */       */
64      function post($request_data) {      public function post($request_data) {
           
65          if (!$this->requestValid($request_data)) {          if (!$this->requestValid($request_data)) {
66                print '   request_data:';
67                print_r($request_data);
68              return $this->sendHttpCode(400, 'Missing mandatory data.');              return $this->sendHttpCode(400, 'Missing mandatory data.');
69          }          }
70                    
71          $this->metier_manager = new MaintenanceManager();          $this->metier_manager = new MaintenanceManager();
72          $ret = $this->metier_manager->performMaintenance(          $ret = $this->metier_manager->performMaintenance(
73                          $request_data['module'], $request_data['data']);                          $request_data['module'], $request_data['data']);
   
74          // send the reply          // send the reply
75          return $this->sendReply($ret, 'Error when synchronizing.');          $msg = $this->metier_manager->getMessage();
76            if ($ret != 'KO') {
77                return $this->sendHttpCode(200, $msg);
78            }
79            return $this->sendHttpCode(500, $msg);
80      }      }
81            
82            

Legend:
Removed from v.523  
changed lines
  Added in v.541

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26