當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kernel類代碼示例

本文整理匯總了PHP中Kernel的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel類的具體用法?PHP Kernel怎麽用?PHP Kernel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Kernel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(Kernel $kernel)
 {
     $this->kernel = $kernel;
     $this->db = $kernel->getClass('dbEngine');
     $this->user = $kernel->getClass('User');
     $this->_initEngine();
 }
開發者ID:ryanclark,項目名稱:kpanel,代碼行數:7,代碼來源:Template.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $this->kernel = new AppKernel('test', true);
     $this->kernel->boot();
     $this->container = $this->kernel->getContainer();
 }
開發者ID:mauriau,項目名稱:xi-bundle-breadcrumbs,代碼行數:7,代碼來源:ContainerTestCase.php

示例3: __construct

 /**
  * Initializes context.
  *
  * @param Kernel $kernel
  */
 public function __construct($kernel)
 {
     $this->kernel = $kernel;
     $this->container = $kernel->getContainer();
     $this->doctrine = $kernel->getContainer()->get('doctrine');
     $this->em = $this->doctrine->getManager();
 }
開發者ID:A5sys,項目名稱:MinkContext,代碼行數:12,代碼來源:SymfonyContext.php

示例4: fromString

 public function fromString()
 {
     $string = '[[-1.0, -1.0, -1.0], [-1.0, 16.0, -1.0], [-1.0, -1.0, -1.0]]';
     $matrix = array(array(-1.0, -1.0, -1.0), array(-1.0, 16.0, -1.0), array(-1.0, -1.0, -1.0));
     $k = new Kernel($string);
     $this->assertEquals($matrix, $k->getMatrix());
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:7,代碼來源:KernelTest.class.php

示例5: __construct

 public function __construct()
 {
     chdir(__DIR__);
     require __DIR__ . '/../vendor/autoload.php';
     $configPath = __DIR__ . '/../app/config/';
     $kernel = new Kernel($configPath);
     $kernel->loadContainer();
     $this->container = $kernel->getContainer();
 }
開發者ID:rocketgraph,項目名稱:sdk-php,代碼行數:9,代碼來源:ConsoleCommand.php

示例6: __construct

 public function __construct(Kernel $kernel)
 {
     $this->db = $kernel->getClass('dbEngine');
     if (isset($_POST['loginform']) === true) {
         $this->_checkAuth();
     }
     if ($this->_isGuest() === false) {
         $this->_buildUserInfo();
         //$this->forceGuestUser();
     }
     //print_r($this->userInfo);
 }
開發者ID:ryanclark,項目名稱:kpanel,代碼行數:12,代碼來源:User.php

示例7: _createContent

 public function _createContent(&$toReturn)
 {
     $ppo = new CopixPPO();
     // Récupération des paramètres
     $ppo->classeurId = $this->getParam('classeurId');
     $ppo->dossierId = $this->getParam('dossierId', null);
     $ppo->dossierCourant = $this->getParam('dossierCourant');
     // Paramètres pour la vue popup
     $ppo->field = $this->getParam('field');
     $ppo->format = $this->getParam('format');
     $ppo->withPersonal = $this->getParam('withPersonal', true);
     $ppo->moduleType = $this->getParam('moduleType', null);
     $ppo->moduleId = $this->getParam('moduleId', null);
     $ppo->estAdmin = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId) >= PROFILE_CCV_PUBLISH;
     $ppo->withLockers = $ppo->estAdmin || is_null($ppo->dossierId);
     // Récupération des dossiers
     $dossierDAO = _ioDAO('classeur|classeurdossier');
     $ppo->dossiers = $dossierDAO->getEnfantsDirects($ppo->classeurId, $ppo->dossierId, $ppo->withLockers);
     _classInclude('classeurservice');
     $ppo->dossiersOuverts = ClasseurService::getFoldersTreeState();
     if (!is_array($ppo->dossiersOuverts)) {
         $ppo->dossiersOuverts = array();
     }
     $toReturn = $this->_usePPO($ppo, '_arborescence_dossiers.tpl');
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:25,代碼來源:arborescencedossiers.zone.php

示例8: startExec

 public function startExec()
 {
     if (_currentUser()->isConnected()) {
         $userId = _currentUser()->getId();
         $userInfos = Kernel::getUserInfo('ID', $userId);
         $this->director = false;
         $this->animator = _currentUser()->hasAssistance();
         $this->idEn = isset($userInfos['id']) ? $userInfos['id'] : null;
         $this->id = $userId * 1;
         $this->type = isset($userInfos['type']) ? $userInfos['type'] : null;
         $this->root = false;
         $this->login = $userInfos['login'];
         $this->nom = $userInfos['nom'];
         $this->prenom = $userInfos['prenom'];
         $this->connected = true;
         $this->chartValid = isset($_SESSION['chartValid']) ? $_SESSION['chartValid'] : false;
     } else {
         $this->director = false;
         $this->animator = false;
         $this->id = 0;
         $this->type = 'USER_ANON';
         $this->root = false;
         $this->login = 'Anon';
         $this->nom = 'Anon';
         $this->prenom = 'Anon';
         $this->connected = false;
         $this->idEn = 0;
         $this->chartValid = true;
     }
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:30,代碼來源:enic.user.php

示例9: getInstance

 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new Kernel();
     }
     return self::$instance;
 }
開發者ID:alexandre-le-borgne,項目名稱:-PHP-DUT-S3-Projet,代碼行數:7,代碼來源:Kernel.php

示例10: processRequest

 public function processRequest(MMapRequest $request, MMapResponse $response)
 {
     ob_start('mb_output_handler');
     MMapManager::startSession();
     MMapManager::checkSessionExpiration();
     $username = $request->issetPOST('username') ? $request->getPOST('username') : '';
     $password = $request->issetPOST('password') ? $request->getPOST('password') : '';
     $loginPage = $request->issetPOST('loginPage') ? $request->getPOST('loginPage') : '';
     $subject = new Subject();
     $loginContext = new LoginContext('eyeos-login', $subject);
     $cred = new EyeosPasswordCredential();
     $cred->setUsername($username);
     $cred->setPassword($password, true);
     $subject->getPrivateCredentials()->append($cred);
     try {
         $loginContext->login();
         $memoryManager = MemoryManager::getInstance();
         Kernel::enterSystemMode();
         $memoryManager->set('isExternLogin', 1);
         $memoryManager->set('username', $username);
         $memoryManager->set('password', $password);
         $memoryManager->set('loginPage', $loginPage);
         Kernel::exitSystemMode();
         header("Location: index.php");
     } catch (Exception $e) {
         header("Location:" . $loginPage . "?errorLogin=1");
     }
 }
開發者ID:DavidGarciaCat,項目名稱:eyeos,代碼行數:28,代碼來源:MMapExternLogin.php

示例11: _createContent

 public function _createContent(&$toReturn)
 {
     $ppo = new CopixPPO();
     // Récupération des paramètres
     $ppo->classeurId = $this->getParam('classeurId');
     $ppo->dossierId = $this->getParam('dossierId');
     $ppo->current = $this->getParam('current');
     // Gestion des droits
     $ppo->niveauUtilisateur = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId);
     $ppo->typeUtilisateur = _currentUser()->getExtra('type');
     $ppo->vue = !is_null(_sessionGet('classeur|typeVue')) ? _sessionGet('classeur|typeVue') : 'liste';
     $ppo->conf_ModClasseur_options = CopixConfig::exists('default|conf_ModClasseur_options') ? CopixConfig::get('default|conf_ModClasseur_options') : 0;
     // L'album public est t-il publié ?
     $ppo->estPublic = false;
     if (!is_null($ppo->dossierId) && $ppo->dossierId != 0) {
         $dossierDAO = _ioDAO('classeur|classeurdossier');
         $ppo->dossier = $dossierDAO->get($ppo->dossierId);
         if ($ppo->dossier->public) {
             $ppo->estPublic = true;
         }
     } else {
         $classeurDAO = _ioDAO('classeur|classeur');
         $classeur = $classeurDAO->get($ppo->classeurId);
         if ($classeur->public) {
             $ppo->estPublic = true;
         }
     }
     $toReturn = $this->_usePPO($ppo, '_affichage_menu.tpl');
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:29,代碼來源:affichagemenu.zone.php

示例12: load

 /**
  * Loads a list of classes and caches them in one big file.
  *
  * @param array   $classes    An array of classes to load
  * @param string  $cacheDir   A cache directory
  * @param string  $name       The cache name prefix
  * @param Boolean $autoReload Whether to flush the cache when the cache is stale or not
  * @param Boolean $adaptive   Whether to remove already declared classes or not
  *
  * @throws \InvalidArgumentException When class can't be loaded
  */
 public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false)
 {
     // each $name can only be loaded once per PHP process
     if (isset(self::$loaded[$name])) {
         return;
     }
     self::$loaded[$name] = true;
     $classes = array_unique($classes);
     if ($adaptive) {
         // don't include already declared classes
         $classes = array_diff($classes, get_declared_classes(), get_declared_interfaces());
         // the cache is different depending on which classes are already declared
         $name = $name . '-' . substr(md5(implode('|', $classes)), 0, 5);
     }
     $cache = $cacheDir . '/' . $name . '.php';
     // auto-reload
     $reload = false;
     if ($autoReload) {
         $metadata = $cacheDir . '/' . $name . '.meta';
         if (!file_exists($metadata) || !file_exists($cache)) {
             $reload = true;
         } else {
             $time = filemtime($cache);
             $meta = unserialize(file_get_contents($metadata));
             if ($meta[1] != $classes) {
                 $reload = true;
             } else {
                 foreach ($meta[0] as $resource) {
                     if (!file_exists($resource) || filemtime($resource) > $time) {
                         $reload = true;
                         break;
                     }
                 }
             }
         }
     }
     if (!$reload && file_exists($cache)) {
         require_once $cache;
         return;
     }
     $files = array();
     $content = '';
     foreach ($classes as $class) {
         if (!class_exists($class) && !interface_exists($class)) {
             throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
         }
         $r = new \ReflectionClass($class);
         $files[] = $r->getFileName();
         $content .= preg_replace(array('/^\\s*<\\?php/', '/\\?>\\s*$/'), '', file_get_contents($r->getFileName()));
     }
     // cache the core classes
     if (!is_dir(dirname($cache))) {
         mkdir(dirname($cache), 0777, true);
     }
     self::writeCacheFile($cache, Kernel::stripComments('<?php ' . $content));
     if ($autoReload) {
         // save the resources
         self::writeCacheFile($metadata, serialize(array($files, $classes)));
     }
 }
開發者ID:spf13,項目名稱:symfony,代碼行數:71,代碼來源:ClassCollectionLoader.php

示例13: _createContent

 public function _createContent(&$toReturn)
 {
     $ppo = new CopixPPO();
     // Récupération des paramètres
     $ppo->cahierId = $this->getParam('cahierId');
     $ppo->jour = $this->getParam('date_jour');
     $ppo->mois = $this->getParam('date_mois');
     $ppo->annee = $this->getParam('date_annee');
     $ppo->vue = $this->getParam('vue');
     $ppo->eleve = $this->getParam('eleve');
     $time = mktime(0, 0, 0, $ppo->mois, $ppo->jour, $ppo->annee);
     $cahierInfos = Kernel::getModParent('MOD_CAHIERDETEXTES', $ppo->cahierId);
     $nodeId = isset($cahierInfos[0]) ? $cahierInfos[0]->node_id : null;
     $ppo->estAdmin = Kernel::getLevel('MOD_CAHIERDETEXTES', $ppo->cahierId) >= PROFILE_CCV_PUBLISH ? true : false;
     // Récupération des travaux suivant les accès de l'utilisateur courant (élève / responsable / enseignant)
     $travailDAO = _ioDAO('cahierdetextes|cahierdetextestravail');
     if ($ppo->estAdmin) {
         $ppo->travaux = $travailDAO->findByClasseEtTypeDeTravail($nodeId, DAOCahierDeTextesTravail::TYPE_EN_CLASSE, $time);
     } elseif (Kernel::getLevel('MOD_CAHIERDETEXTES', $ppo->cahierId) == PROFILE_CCV_READ) {
         $ppo->travaux = $travailDAO->findByEleveEtTypeDeTravail($ppo->eleve, DAOCahierDeTextesTravail::TYPE_EN_CLASSE, $time);
     } else {
         $ppo->travaux = $travailDAO->findByEleveEtTypeDeTravail(_currentUser()->getExtra('id'), DAOCahierDeTextesTravail::TYPE_EN_CLASSE, $time);
     }
     $toReturn = $this->_usePPO($ppo, '_travaux_en_classe.tpl');
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:25,代碼來源:travauxenclasse.zone.php

示例14: checkRight

 public function checkRight($type, $id, $mini)
 {
     switch ($type) {
         case 'ANNU':
             $annuaire_dao = CopixDAOFactory::create("ressource_annuaires");
             $annuaire = $annuaire_dao->get($id);
             if (!$annuaire) {
                 return false;
             }
             $id_annu = $id;
             break;
         case 'RES':
             $ressource_dao = CopixDAOFactory::create("ressource_ressources");
             $ressource = $ressource_dao->get($id);
             if (!$ressource) {
                 return false;
             }
             $id_annu = $ressource->ressources_id_annu;
             break;
         default:
             return false;
     }
     // Test : if( ! Ressource::checkRight( "RES", $id, PROFILE_CCV_SHOW ) )
     if (Kernel::getLevel("MOD_RESSOURCE", $id_annu) >= $mini) {
         return true;
     }
     return false;
 }
開發者ID:JVS-IS,項目名稱:ICONITO-EcoleNumerique,代碼行數:28,代碼來源:ressource.class.php

示例15: setTimelimit

 public static function setTimelimit($timelimit)
 {
     self::$torrentTimelimit = $timelimit;
     $id = Sessionmanager::getUserId();
     $unixTime = strtotime($timelimit);
     Kernel::mysqli()->query("UPDATE usersetting SET timelimit=FROM_UNIXTIME({$unixTime}) WHERE id={$id}");
 }
開發者ID:jramstedt,項目名稱:AVM,代碼行數:7,代碼來源:AVM.class.php


注:本文中的Kernel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。