private function autoPopulateSuperGlobals()
 {
     if (is_null($this->brServerGlobals)) {
         $rqst = new \Symfony\Component\HttpFoundation\Request();
         $this->brServerGlobals = $rqst->createFromGlobals();
     }
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->informatorInternalArray['composerLockFile'] = 'composer.lock';
     $this->informatorInternalArray['knownLabels'] = $this->knownLabelsGlobal(['composerLockFile' => $this->informatorInternalArray['composerLockFile'], 'informatorFile' => __FILE__]);
     ksort($this->informatorInternalArray['knownLabels']);
     $rqst = new \Symfony\Component\HttpFoundation\Request();
     $this->informatorInternalArray['superGlobals'] = $rqst->createFromGlobals();
     echo $this->setInterface();
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->getConfiguration();
     echo $this->setHeaderHtml();
     $rqst = new \Symfony\Component\HttpFoundation\Request();
     $superGlobals = $rqst->createFromGlobals();
     $this->prepareForOutputForm(['SuperGlobals' => $superGlobals]);
     if (!is_null($superGlobals->get('Label'))) {
         $this->processInfos(['sGlobals' => $superGlobals]);
         echo $this->setFormCurlInfos(['SuperGlobals' => $superGlobals]);
         echo $this->setFormInfos(['SuperGlobals' => $superGlobals]);
     }
     echo $this->setFooterHtml();
 }
Ejemplo n.º 4
0
 protected static function _invoke($args)
 {
     if ($args[0] !== 'civicrm') {
         return;
     }
     // CRM-15901: Turn off PHP errors display for all ajax calls
     if (CRM_Utils_Array::value(1, $args) == 'ajax' || CRM_Utils_Array::value('snippet', $_REQUEST)) {
         ini_set('display_errors', 0);
     }
     if (!defined('CIVICRM_SYMFONY_PATH')) {
         try {
             // Traditional Civi invocation path
             self::hackMenuRebuild($args);
             // may exit
             self::init($args);
             self::hackStandalone($args);
             $item = self::getItem($args);
             return self::runItem($item);
         } catch (CRM_Core_EXCEPTION $e) {
             $params = $e->getErrorData();
             $message = $e->getMessage();
             if (isset($params['legacy_status_bounce'])) {
                 //@todo remove this- see comments on
                 //https://github.com/eileenmcnaughton/civicrm-core/commit/ae686b09e2c987091612bb25ba0a58e520a203e7
                 CRM_Core_Error::statusBounce($params['message']);
             } else {
                 $session = CRM_Core_Session::singleton();
                 $session->setStatus($message, CRM_Utils_Array::value('message_title', $params), CRM_Utils_Array::value('message_type', $params, 'error'));
                 // @todo remove this code - legacy redirect path is an interim measure for moving redirects out of BAO
                 // to somewhere slightly more acceptable. they should not be part of the exception class & should
                 // be managed @ the form level - if you find a form that is triggering this piece of code
                 // you should log a ticket for it to be removed with details about the form you were on.
                 if (!empty($params['legacy_redirect_path'])) {
                     if (CRM_Utils_System::isDevelopment()) {
                         // here we could set a message telling devs to log it per above
                     }
                     CRM_Utils_System::redirect($params['legacy_redirect_path'], $params['legacy_redirect_query']);
                 }
             }
         } catch (Exception $e) {
             // Recall: CRM_Core_Config is initialized before calling CRM_Core_Invoke
             $config = CRM_Core_Config::singleton();
             return CRM_Core_Error::handleUnhandledException($e);
             /*
                     if ($config->backtrace) {
                       return CRM_Core_Error::formatHtmlException($e);
                     } else {
                      // TODO
                     }*/
         }
     } else {
         // Symfony-based invocation path
         require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache';
         require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php';
         $kernel = new AppKernel('dev', true);
         $kernel->loadClassCache();
         $response = $kernel->handle(Symfony\Component\HttpFoundation\Request::createFromGlobals());
         // $response->send();
         return $response->getContent();
     }
 }
Ejemplo n.º 5
0
 /**
  * This is the same as invoke(), but it does *not* include exception
  * handling.
  *
  * @param array $args
  *   The parts of the URL which identify the intended CiviCRM page
  *   (e.g. array('civicrm', 'event', 'register')).
  * @return string
  *   HTML. For non-HTML content, invoke() may call print() and exit().
  */
 public static function _invoke($args)
 {
     if ($args[0] !== 'civicrm') {
         return NULL;
     }
     // CRM-15901: Turn off PHP errors display for all ajax calls
     if (CRM_Utils_Array::value(1, $args) == 'ajax' || CRM_Utils_Array::value('snippet', $_REQUEST)) {
         ini_set('display_errors', 0);
     }
     if (!defined('CIVICRM_SYMFONY_PATH')) {
         // Traditional Civi invocation path
         self::hackMenuRebuild($args);
         // may exit
         self::init($args);
         self::hackStandalone($args);
         $item = self::getItem($args);
         return self::runItem($item);
     } else {
         // Symfony-based invocation path
         require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache';
         require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php';
         $kernel = new AppKernel('dev', TRUE);
         $kernel->loadClassCache();
         $response = $kernel->handle(Symfony\Component\HttpFoundation\Request::createFromGlobals());
         if (preg_match(':^text/html:', $response->headers->get('Content-Type'))) {
             // let the CMS handle the trappings
             return $response->getContent();
         } else {
             $response->send();
             exit;
         }
     }
 }
Ejemplo n.º 6
0
<?php

require_once __DIR__ . '/../auth.php';
$request = Symfony\Component\HttpFoundation\Request::createFromGlobals();
if ($request->isXmlHttpRequest() === false) {
    redirige("../accueil.php");
}
if (!est_autorise("acces_contenu")) {
    exit;
}
switch ($request->query->get('action')) {
    case 'changeDisplay':
        FolderAdmin::getInstance($request->query->get('folder_id'))->display($request->query->get('display'));
        break;
}
Ejemplo n.º 7
0
 /**
  * Controller action which is used to upload a theme zip file
  * and extract it into the engine\Shopware\Themes folder.
  *
  * @throws Exception
  */
 public function uploadAction()
 {
     /**@var $file UploadedFile */
     $file = Symfony\Component\HttpFoundation\Request::createFromGlobals()->files->get('fileId');
     $system = new Filesystem();
     if (strtolower($file->getClientOriginalExtension()) !== 'zip') {
         $name = $file->getClientOriginalName();
         $system->remove($file->getPathname());
         throw new Exception(sprintf('Uploaded file %s is no zip file', $name));
     }
     $targetDirectory = $this->container->get('theme_path_resolver')->getFrontendThemeDirectory();
     if (!is_writable($targetDirectory)) {
         return $this->View()->assign(array('success' => false, 'error' => sprintf("Target Directory %s isn't writable", $targetDirectory)));
     }
     $this->unzip($file, $targetDirectory);
     $system->remove($file->getPathname());
     $this->View()->assign('success', true);
 }
Ejemplo n.º 8
0
 function request()
 {
     return Symfony\Component\HttpFoundation\Request::createFromGlobals();
 }
 /**
  * @return Enlight_View|Enlight_View_Default
  */
 public function importProfileAction()
 {
     /**@var $file UploadedFile */
     $file = Symfony\Component\HttpFoundation\Request::createFromGlobals()->files->get('profilefile');
     /** @var ProfileService $service */
     $service = $this->get('swag_import_export.profile_service');
     try {
         $service->importProfile($file);
     } catch (\Exception $e) {
         return $this->View()->assign(['success' => false, 'message' => $e->getMessage()]);
     }
     return $this->View()->assign(['success' => true]);
 }
Ejemplo n.º 10
0
    return new Kodazzi\Console\Commands\ModelCommand();
});
Service::factory('command.form', function () {
    return new Kodazzi\Console\Commands\FormsCommand();
});
Service::factory('command.bundle', function () {
    return new Kodazzi\Console\Commands\BundleCommand();
});
Service::factory('command.routes', function () {
    return new Kodazzi\Console\Commands\RoutesCommand();
});
Service::set('shell', function () {
    return new Kodazzi\Console\Shell();
});
Service::factory('new.request', function () {
    return new Symfony\Component\HttpFoundation\Request();
});
// Captura la peticion
Service::instance('kernel.request', Symfony\Component\HttpFoundation\Request::createFromGlobals());
// Agrega al contenedor la instancia de Request y loader.
Service::instance('kernel.loader', $loader);
// Suscribe los escuchas
$dispatcher = Service::get('event');
$dispatcher->addSubscriber(Service::get('listener.router'));
$dispatcher->addSubscriber(Service::get('listener.firewall'));
$dispatcher->addSubscriber(Service::get('listener.controller'));
$dispatcher->addSubscriber(Service::get('listener.locale'));
$dispatcher->addSubscriber(Service::get('listener.response'));
$dispatcher->addSubscriber(Service::get('listener.subrequest'));
$dispatcher->addSubscriber(Service::get('listener.postaction'));
$dispatcher->addSubscriber(Service::get('listener.exception'));
Ejemplo n.º 11
0
 public function __construct()
 {
     $rqst = new \Symfony\Component\HttpFoundation\Request();
     echo $this->setApplicationHeader() . $this->buildApplicationInterface($rqst->createFromGlobals()) . $this->setApplicationFooter();
 }
 /**
  * Returns the IP of the client
  *
  * @return string
  */
 protected function getClientRealIpAddress()
 {
     $rqst = new \Symfony\Component\HttpFoundation\Request();
     return $rqst->createFromGlobals()->getClientIp();
 }