Changeset 7577 for sandbox


Ignore:
Timestamp:
11/29/12 13:44:33 (9 years ago)
Author:
pereira.jair
Message:

Ticket #2507 - Correção da varíavel global DIR que estava incorreta.

Location:
sandbox/webservice/api
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/adapters/ExpressoAdapter.php

    r6601 r7577  
    1919                ); 
    2020                 
    21                 include_once(__DIR__.'/../../header.inc.php'); 
     21                include_once(apiDirectory.'/../../header.inc.php'); 
    2222                $this->expressoVersion = substr($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],0,3); 
    2323                $this->setCannotModifyHeader(false); 
  • sandbox/webservice/api/rest/core/ExpressoVersionResource.php

    r6554 r7577  
    11<?php 
    22 
    3 class ExpressoVersionResource extends ExpressoAdapter {          
     3class ExpressoVersionResource extends ExpressoAdapter { 
     4 
     5 
     6        public function get($request) { 
     7                return $this->post($request); 
     8        } 
     9 
    410        public function post($request){ 
    511                // to Receive POST Params (use $this->params) 
  • sandbox/webservice/api/rest/dispatch.php

    r7463 r7577  
    11<?php 
    22 
     3$dir = $_SERVER['DOCUMENT_ROOT']; 
     4 
     5if (substr($dir,strlen($dir)-1,strlen($dir)) != "/") { 
     6        $dir = $dir . "/"; 
     7} 
     8 
     9define(apiDirectory,$dir . "api/rest");  
     10 
    311// load libraries 
    4 require_once(__DIR__.'/../library/tonic/lib/tonic.php');  
    5 require_once(__DIR__.'/../library/utils/Errors.php'); 
     12require_once(apiDirectory.'/../library/tonic/lib/tonic.php');  
     13require_once(apiDirectory.'/../library/utils/Errors.php'); 
    614 
    715// load adapters 
    8 require_once(__DIR__."/../adapters/ExpressoAdapter.php"); 
    9 require_once(__DIR__."/../adapters/MailAdapter.php"); 
    10 require_once(__DIR__."/../adapters/CatalogAdapter.php"); 
    11 require_once(__DIR__."/../adapters/CalendarAdapter.php"); 
     16require_once(apiDirectory."/../adapters/ExpressoAdapter.php"); 
     17require_once(apiDirectory."/../adapters/MailAdapter.php"); 
     18require_once(apiDirectory."/../adapters/CatalogAdapter.php"); 
     19require_once(apiDirectory."/../adapters/CalendarAdapter.php"); 
    1220 
    1321// Load all resources 
    14 require_once(__DIR__."/availableServers/AvailableServersResource.php"); 
    15 require_once(__DIR__."/core/ExpressoVersionResource.php"); 
    16 require_once(__DIR__."/core/LoginResource.php"); 
    17 require_once(__DIR__."/core/LogoutResource.php"); 
    18 require_once(__DIR__."/mail/FoldersResource.php"); 
    19 require_once(__DIR__."/mail/MessagesResource.php"); 
    20 require_once(__DIR__."/mail/AddFolderResource.php"); 
    21 require_once(__DIR__."/mail/DelFolderResource.php"); 
    22 require_once(__DIR__."/mail/DelMessageResource.php"); 
    23 require_once(__DIR__."/mail/RenameFolderResource.php"); 
    24 require_once(__DIR__."/mail/CleanTrashResource.php"); 
    25 require_once(__DIR__."/mail/AttachmentResource.php"); 
    26 require_once(__DIR__."/mail/SendResource.php"); 
    27 require_once(__DIR__."/mail/SendSupportFeedbackResource.php"); 
    28 require_once(__DIR__."/catalog/ContactsResource.php"); 
    29 require_once(__DIR__."/catalog/ContactPictureResource.php"); 
    30 require_once(__DIR__."/calendar/EventsResource.php"); 
     22require_once(apiDirectory."/availableServers/AvailableServersResource.php"); 
     23require_once(apiDirectory."/core/ExpressoVersionResource.php"); 
     24require_once(apiDirectory."/core/LoginResource.php"); 
     25require_once(apiDirectory."/core/LogoutResource.php"); 
     26require_once(apiDirectory."/mail/FoldersResource.php"); 
     27require_once(apiDirectory."/mail/MessagesResource.php"); 
     28require_once(apiDirectory."/mail/AddFolderResource.php"); 
     29require_once(apiDirectory."/mail/DelFolderResource.php"); 
     30require_once(apiDirectory."/mail/DelMessageResource.php"); 
     31require_once(apiDirectory."/mail/RenameFolderResource.php"); 
     32require_once(apiDirectory."/mail/CleanTrashResource.php"); 
     33require_once(apiDirectory."/mail/AttachmentResource.php"); 
     34require_once(apiDirectory."/mail/SendResource.php"); 
     35require_once(apiDirectory."/mail/SendSupportFeedbackResource.php"); 
     36require_once(apiDirectory."/catalog/ContactsResource.php"); 
     37require_once(apiDirectory."/catalog/ContactPictureResource.php"); 
     38require_once(apiDirectory."/calendar/EventsResource.php"); 
    3139 
    3240//Retrieveing the mapping of the URIs and his respectives classNames and classPath 
    33 $config = parse_ini_file( __DIR__ . '/../config/Tonic.srv', true ); 
     41$config = parse_ini_file( apiDirectory . '/../config/Tonic.srv', true ); 
    3442$autoload = array(); 
    3543$classpath = array(); 
  • sandbox/webservice/api/rest/mail/SendResource.php

    r6666 r7577  
    4646                                if($this->getExpressoVersion() != "2.2") 
    4747                                { 
    48                                         require_once (__DIR__.'/../../../prototype/api/controller.php'); 
    49                                         Controller::addFallbackHandler( 0, function($e){ 
    50                                                 throw $e; 
    51                                         } ); 
    52                                  
     48 
     49                                        $fileInclude = apiDirectory.'/../../../prototype/api/controller.php'; 
     50                                        try { 
     51                                                require_once ($fileInclude); 
     52 
     53                                                Controller::addFallbackHandler(0,$this->fallBackHandler($e)); 
     54                                        } catch (Exception $e) { 
     55                                                Errors::runException($e->getMessage()); 
     56                                        } 
     57 
    5358                                        $result = array(); 
    5459                                        $attachments_ids = array(); 
     
    7984        } 
    8085 
     86        function fallBackHandler($e) { 
     87                throw $e; 
     88    } 
     89 
    8190} 
Note: See TracChangeset for help on using the changeset viewer.