Beispiel #1
0
 /**
  * Create the ExtDirect API based on controllers files.
  *
  * @return string JSON description of Direct API
  */
 protected function createApi()
 {
     $bundles = $this->getControllers();
     $actions = array();
     foreach ($bundles as $bundle => $controllers) {
         $bundleShortName = str_replace('Bundle', '', $bundle);
         foreach ($controllers as $controller) {
             $api = new ControllerApi($this->container, $controller);
             if ($api->isExposed()) {
                 $actions[$bundleShortName . '_' . $api->getActionName()] = $api->getApi();
             }
         }
     }
     return array('url' => $this->container->get('request')->getBaseUrl() . $this->container->getParameter('direct.api.route_pattern'), 'type' => $this->container->getParameter('direct.api.type'), 'namespace' => $this->container->getParameter('direct.api.namespace'), 'id' => $this->container->getParameter('direct.api.id'), 'actions' => $actions);
 }
Beispiel #2
0
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     if (empty(self::$instance)) {
         throw new \Exception('Main Controller was unable to initiate');
     }
     return self::$instance;
 }
 public static function decoratePrecos($precos)
 {
     if ($precos && count($precos) > 0) {
         foreach ($precos as $k => $preco) {
             $precos[$k] = ControllerApi::decoratePreco($preco);
         }
     }
     return $precos;
 }
    require_once 'admin/PagSeguro-consulta.php';
}
add_filter('query_vars', 'query_vars_evento');
function query_vars_evento($vars)
{
    return array('certificado', 'area_restrita', 'inscricao', 'avaliacao', 'servico', 'ticket', 'pre', 'aplicarDesconto', 'transaction_id', 'set_meio_pagamento') + $vars;
}
// Operações por url
// URL chamada
$request = $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//var_dump($request);
//die();
// Carregar API?
$api = site_url() . '/api/';
if (stripos($request, $api) !== false) {
    ControllerApi::dispatcher();
    die;
}
// Executar o CRON?
if (strpos($request, site_url() . '/crontab/') !== false) {
    if (strpos($request, site_url() . '/crontab/dia/') !== false) {
        ControllerCrontab::dia();
    }
    if (strpos($request, site_url() . '/crontab/hora/') !== false) {
        ControllerCrontab::hora();
    }
    die;
}
// Aunteticar?
if ($_POST && $_POST['controller'] == 'pessoa') {
    //    var_dump($_POST);