/**
 * Check if mod_rewrite is active and clean up templates cache
 */
function fn_settings_actions_addons_seo(&$new_value, $old_value)
{
    if ($new_value == 'A') {
        Http::get(Registry::get('config.http_location') . '/catalog.html?version');
        $headers = Http::getHeaders();
        if (strpos($headers, '200 OK') === false) {
            $new_value = 'D';
            fn_set_notification('W', __('warning'), __('warning_seo_urls_disabled'));
        }
    }
    fn_clear_cache();
    return true;
}
예제 #2
0
 /**
  * Check if mod_rewrite is available
  *
  * @return bool true if available
  */
 public function isModRewriteEnabled()
 {
     if (defined('PRODUCT_EDITION') && PRODUCT_EDITION == 'ULTIMATE') {
         // IIS Web-Servers fix
         if (!isset($_SERVER['REQUEST_URI'])) {
             $_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
             if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
                 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
             }
         }
         $url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace('index.php', '', $_SERVER['REQUEST_URI']);
         $url .= 'mod_rewrite';
         Http::get($url);
         $headers = Http::getHeaders();
         if (strpos($headers, '200 OK') === false) {
             return false;
         }
     }
     return true;
 }
예제 #3
0
function fn_eway_rapidapi_request($point, $request, $processor_data, &$response, $post = true)
{
    if ($processor_data['processor_params']['mode'] == 'test') {
        $request_url = 'https://api.sandbox.ewaypayments.com/';
    } else {
        $request_url = 'https://api.ewaypayments.com/';
    }
    if ($post) {
        $response = Http::post($request_url . $point, json_encode($request), array('basic_auth' => array($processor_data['processor_params']['username'], $processor_data['processor_params']['password']), 'headers' => array("Content-Type: application/json")));
    } else {
        $response = Http::get($request_url . $point, $request, array('basic_auth' => array($processor_data['processor_params']['username'], $processor_data['processor_params']['password'])));
    }
    $headers = preg_split("/[\\s]/", Http::getHeaders(), 4);
    if ($headers[1] == '200') {
        $response = json_decode($response);
        return true;
    } else {
        $response = $headers[1] . ' ' . $headers[2];
        return false;
    }
}