Esempio n. 1
0
 /**
  * This function increments the global $sql_queries variable
  */
 public function countQuery()
 {
     if (self::$queryLimit != 0 && ++self::$queryCount > self::$queryLimit && (empty($GLOBALS['current_user']) || !is_admin($GLOBALS['current_user']))) {
         require_once 'include/resource/ResourceManager.php';
         $resourceManager = ResourceManager::getInstance();
         $resourceManager->notifyObservers('ERR_QUERY_LIMIT');
     }
 }
Esempio n. 2
0
$server->configureWSDL('sugarsoap', $NAMESPACE, $sugar_config['site_url'] . '/soap.php');
//New API is in these files
if (!empty($administrator->settings['portal_on'])) {
    require_once 'soap/SoapPortalUsers.php';
}
require_once 'soap/SoapSugarUsers.php';
//require_once('soap/SoapSugarUsers_version2.php');
require_once 'soap/SoapData.php';
require_once 'soap/SoapDeprecated.php';
/* Begin the HTTP listener service and exit. */
ob_clean();
if (!isset($HTTP_RAW_POST_DATA)) {
    $HTTP_RAW_POST_DATA = file_get_contents('php://input');
}
require_once 'include/resource/ResourceManager.php';
$resourceManager = ResourceManager::getInstance();
$resourceManager->setup('Soap');
$observers = $resourceManager->getObservers();
//Call set_soap_server for SoapResourceObserver instance(s)
foreach ($observers as $observer) {
    if (method_exists($observer, 'set_soap_server')) {
        $observer->set_soap_server($server);
    }
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
global $soap_server_object;
$soap_server_object = $server;
$server->service($HTTP_RAW_POST_DATA);
ob_end_flush();
flush();
sugar_cleanup();
Esempio n. 3
0
 /**
  * setupResourceManagement
  * This function initialize the ResourceManager and calls the setup method
  * on the ResourceManager instance.
  *
  */
 function setupResourceManagement($module)
 {
     require_once 'include/resource/ResourceManager.php';
     $resourceManager = ResourceManager::getInstance();
     $resourceManager->setup($module);
 }
Esempio n. 4
0
 /**
  * This function increments the global $sql_queries variable
  *
  * @param string $sql The query that was just run
  */
 public function countQuery($sql = '')
 {
     if (self::$queryLimit != 0 && ++self::$queryCount > self::$queryLimit && (empty($GLOBALS['current_user']) || !is_admin($GLOBALS['current_user']))) {
         require_once 'include/resource/ResourceManager.php';
         if ($sql) {
             $GLOBALS['log']->fatal("Last query before failure:\n" . $sql);
         }
         $resourceManager = ResourceManager::getInstance();
         $resourceManager->notifyObservers('ERR_QUERY_LIMIT');
     }
 }