本文整理汇总了PHP中Kernel类的典型用法代码示例。如果您正苦于以下问题:PHP Kernel类的具体用法?PHP Kernel怎么用?PHP Kernel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Kernel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: _createContent
/**
* Commentaires d'une procedure
*
* @author Christophe Beyer <[email protected]>
* @since 2008/01/30
* @param object $rFiche Recordset de la procedure
*/
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$rFiche = $this->getParam('rFiche');
$mondroit = $this->getParam('mondroit');
$daoinfo =& _dao('infosupp');
$sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . '';
$canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit);
$canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit);
if (!$canCheckVisible) {
$sql .= " AND info_message!='' AND info_message IS NOT NULL";
}
$sql .= " ORDER BY dateinfo ASC, idinfo ASC";
$results = _doQuery($sql);
// Pour chaque message on cherche les infos de son auteur
$list = array();
foreach ($results as $r) {
$userInfo = Kernel::getUserInfo("ID", $r->iduser);
//var_dump($userInfo);
$avatar = Prefs::get('prefs', 'avatar', $r->iduser);
$userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : '';
$r->user = $userInfo;
$list[] = $r;
}
//print_r($rFiche);
$tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false'))));
$tpl->assign('canCheckVisible', $canCheckVisible);
$tpl->assign('canAddComment', $canAddComment);
$tpl->assign('list', $list);
$tpl->assign('rFiche', $rFiche);
$toReturn = $tpl->fetch('fiche-comms-zone.tpl');
return true;
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:41,代码来源:fichecomms.zone.php
示例17: _createContent
public function _createContent(&$toReturn)
{
//Getting the user.
//Create Services, and DAO
$tpl = new CopixTpl();
$id_blog = $this->getParam('id_blog', '');
$tpl->assign('blog', $this->getParam('blog', null));
$tpl->assign('id_blog', $id_blog);
$tpl->assign('kind', $this->getParam('kind', ''));
$tpl->assign('tabBlogFunctions', $this->getParam('tabBlogFunctions', null));
$tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles'));
$tpl->assign('RESULT', $this->getParam('RESULT', ''));
$parent = Kernel::getModParentInfo("MOD_BLOG", $id_blog);
if ($parent) {
$mods = Kernel::getModEnabled($parent['type'], $parent['id'], '', 0, 1);
// _dump($mods);
$mods = Kernel::filterModuleList($mods, 'MOD_MAGICMAIL');
if (count($mods)) {
$magicmail_infos = _dao('module_magicmail')->get($mods[0]->module_id);
$tpl->assign('magicmail_infos', $magicmail_infos);
// _dump($magicmail_infos);
/*
'id' => '32',
'login' => 'cepapeti',
'domain' => 'magicmail.iconito.fr',
*/
}
}
// retour de la fonction :
$toReturn = $tpl->fetch('blog.show.tpl');
return true;
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:32,代码来源:showblog.zone.php
示例18: __construct
/**
*
*/
public function __construct()
{
self::$s_obj = $this;
spl_autoload_register(function ($i_name) {
list($ns, $name) = explode('\\', $i_name, 2);
if ($ns != __NAMESPACE__) {
return;
}
$name = strtolower($name);
if (substr($name, -5) == 'trait') {
if (Kernel::load('trait/' . substr($name, 0, -5) . '.php')) {
return;
}
} else {
if (substr($name, -4) == 'view') {
if (Kernel::load('view/' . substr($name, 0, -4) . '.php')) {
return;
}
}
}
Kernel::load('model/' . $name . '.php');
});
self::load('inc/global.php');
self::load('inc/db.php');
if (PHP_SAPI == 'cli' && @$_SERVER['argv'][1] == 'install') {
self::install_application();
die("done.\n");
}
self::initialize();
self::enqueue_std_styles();
self::enqueue_std_scripts();
$this->bootstrap();
}
开发者ID:rommelsantor,项目名称:RawMVC,代码行数:36,代码来源:kernel.php
示例19: home
/**
* Accueil des stats
*
* @author Christophe Beyer <[email protected]>
* @since 2007/03/19
*/
public function home()
{
if (!Admin::canAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.stats'));
$tpl->assign('MENU', Admin::getMenu('stats'));
$tplStats = new CopixTpl();
$modules = Kernel::getAllModules();
$tab = array();
foreach ($modules as $mod_val) {
$arModulesPath = CopixConfig::instance()->arModulesPath;
foreach ($arModulesPath as $modulePath) {
$class_file = $modulePath . $mod_val . '/' . COPIX_CLASSES_DIR . 'kernel' . $mod_val . '.class.php';
if (!file_exists($class_file)) {
continue;
}
$module_class =& CopixClassesFactory::Create($mod_val . '|Kernel' . $mod_val);
//print_r($module_class);
if (!is_callable(array($module_class, 'getStatsRoot'))) {
continue;
}
//$classeModule = CopixClassesFactory::create("$label|Kernel$label");
$tab[$mod_val]['module_nom'] = Kernel::Code2Name('mod_' . $mod_val);
$tab[$mod_val]['stats'] = $module_class->getStatsRoot();
}
}
//print_r($tab);
$tplStats->assign('tab', $tab);
$tpl->assign('MAIN', $tplStats->fetch('sysutils|stats.modules.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:39,代码来源:stats.actiongroup.php
示例20: _createContent
public function _createContent(&$toReturn)
{
$ppo = new CopixPPO();
_classInclude('classeur|ClasseurService');
// Récupération des paramètres
$ppo->classeurId = $this->getParam('classeurId');
$ppo->dossierId = $this->getParam('dossierId');
// Gestion des droits
$ppo->niveauUtilisateur = Kernel::getLevel('MOD_CLASSEUR', $ppo->classeurId);
$ppo->typeUtilisateur = _currentUser()->getExtra('type');
$ppo->idUtilisateur = _currentUser()->getExtra('id');
// Récupération des paramètres d'affichages
$ppo->tri = ClasseurService::getContentSort();
// Récupération des dossiers & des fichiers / favoris
$dossierDAO = _ioDAO('classeur|classeurdossier');
if ($ppo->dossier = $dossierDAO->get($ppo->dossierId)) {
if ($ppo->dossier->parent_id != 0) {
$ppo->dossierParent = $dossierDAO->get($ppo->dossier->parent_id);
} else {
$classeurDAO = _ioDAO('classeur|classeur');
$ppo->classeurParent = $classeurDAO->get($ppo->classeurId);
$ppo->classeurParent->isPersonnel = ClasseurService::getClasseurPersonnelId() == $ppo->classeurParent->id;
}
}
if (!$ppo->dossier->casier || $ppo->niveauUtilisateur >= PROFILE_CCV_MODERATE) {
$ppo->contenus = $dossierDAO->getContenus($ppo->classeurId, $ppo->dossierId, $ppo->tri);
foreach ($ppo->contenus as $contenu) {
if ($ppo->dossier->casier) {
$user = Kernel::getUserInfo($contenu->user_type, $contenu->user_id);
$contenu->user = $user['prenom'] . ' ' . $user['nom'];
}
}
}
$toReturn = $this->_usePPO($ppo, '_vue_liste.tpl');
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:35,代码来源:vueliste.zone.php
注:本文中的Kernel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论