Ejemplo n.º 1
0
/**
 * called for php errors
 *
 * @param int $errno
 * @param string $errstr
 * @param string $errfile
 * @param string $errline
 * @return null
 */
function ac_error_handler($errno, $errstr, $errfile, $errline)
{
    //skip notice
    if ($errno == E_NOTICE) {
        return null;
    }
    try {
        throw new AException($errno, $errstr, $errfile, $errline);
    } catch (AException $e) {
        ac_exception_handler($e);
    }
}
Ejemplo n.º 2
0
/**
 * called for php errors
 *
 * @param int $errno
 * @param string $errstr
 * @param string $errfile
 * @param string $errline
 * @return null
 */
function ac_error_handler($errno, $errstr, $errfile, $errline)
{
    if (class_exists('Registry')) {
        $registry = Registry::getInstance();
        if ($registry->get('force_skip_errors')) {
            return null;
        }
    }
    //skip notice
    if ($errno == E_NOTICE) {
        return null;
    }
    try {
        throw new AException($errno, $errstr, $errfile, $errline);
    } catch (AException $e) {
        ac_exception_handler($e);
    }
}
Ejemplo n.º 3
0
            $is_valid = true;
        }
    }
    if (!$is_valid) {
        $error = new AError('Template ' . $template . ' is not found - roll back to default');
        $error->toMessages()->toLog()->toDebug();
        $template = 'default';
    }
    if (IS_ADMIN) {
        $config->set('original_admin_template', $config->get('admin_template'));
        $config->set('admin_template', $template);
        // Load language
        $lang_obj = new ALanguageManager($registry);
    } else {
        $config->set('original_config_storefront_template', $config->get('config_storefront_template'));
        $config->set('config_storefront_template', $template);
        // Load language
        $lang_obj = new ALanguage($registry);
    }
    // Create Global Layout Instance
    $registry->set('layout', new ALayout($registry, $template));
    // load download class
    $registry->set('download', new ADownload());
    //load main language section
    $registry->set('language', $lang_obj);
    unset($lang_obj);
    $registry->get('language')->load();
    $hook->hk_InitEnd();
} catch (AException $e) {
    ac_exception_handler($e);
}
 public function createToken($cc, $customer_stripe_id)
 {
     if (!has_value($customer_stripe_id) || !has_value($cc)) {
         return null;
     }
     $card_data = array('number' => $cc['cc_number'], 'exp_month' => $cc['cc_expire_month'], 'exp_year' => $cc['cc_expire_year'], 'cvc' => $cc['cc_cvv2'], 'name' => $cc['cc_owner']);
     try {
         require_once DIR_EXT . 'default_stripe/core/stripe_modules.php';
         grantStripeAccess($this->config);
         $token = Stripe_Token::create(array("card" => $card_data));
         return $token['id'];
     } catch (Exception $e) {
         //log in AException
         $ae = new AException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
         ac_exception_handler($ae);
         return null;
     }
 }