• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP _root类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中_root的典型用法代码示例。如果您正苦于以下问题:PHP _root类的具体用法?PHP _root怎么用?PHP _root使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了_root类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: generate

 private function generate($sTable, $tField)
 {
     $ret = "\n";
     $sXmlStructure = '<?xml version="1.0" encoding="UTF-8"?>' . $ret;
     $sXmlStructure .= '<structure>' . $ret;
     $sXmlStructure .= '<colonne primaire="true">id</colonne>' . $ret;
     foreach ($tField as $sField) {
         if (trim($sField) == '') {
             continue;
         }
         $sXmlStructure .= '<colonne>' . trim($sField) . '</colonne>' . $ret;
     }
     $sXmlStructure .= '</structure>' . $ret;
     $sXmlMax = '<?xml version="1.0" encoding="ISO-8859-1"?>' . $ret;
     $sXmlMax .= '<main>' . $ret;
     $sXmlMax .= '<max><![CDATA[1]]></max>' . $ret;
     $sXmlMax .= '</main>' . $ret;
     $sPath = _root::getConfigVar('path.generation') . _root::getParam('id') . '/data/xml/base/' . $sTable . '/';
     $oFile = new _file($sPath . 'structure.xml');
     $oFile->setContent($sXmlStructure);
     $oFile->save();
     $sPath = _root::getConfigVar('path.generation') . _root::getParam('id') . '/data/xml/base/' . $sTable . '/';
     $oFile = new _file($sPath . 'max.xml');
     $oFile->setContent($sXmlMax);
     $oFile->save();
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:26,代码来源:main.php


示例2: __construct

 /**
  * constructeur
  * @access public
  * @param array tableau a verifier ($_POST,tableau de la row...)
  */
 public function __construct($tPost)
 {
     $this->tPost = $tPost;
     $sClass = _root::getConfigVar('check.class', 'plugin_check');
     $this->oCheck = new $sClass();
     $this->bCheck = true;
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:12,代码来源:plugin_valid.php


示例3: _showXml

 public function _showXml()
 {
     $oAuteur = model_auteur::getInstance()->findById(_root::getParam('id'));
     $oXml = new plugin_xmlObject($oAuteur);
     $oXml->setListColumn(array('id', 'nom', 'prenom'));
     $oXml->show();
 }
开发者ID:clavat,项目名称:mkframework,代码行数:7,代码来源:main.php


示例4: regenerateIndexXml

 public function regenerateIndexXml($sConfig, $sTable, $sIndex)
 {
     //$sConfig='xml';
     if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'xml') {
         if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
             $sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
             if (file_exists($sBuilderDbPath)) {
                 _root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
             } else {
                 throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
             }
         }
     } else {
         if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'csv') {
             if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
                 $sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
                 if (file_exists($sBuilderDbPath)) {
                     _root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
                 } else {
                     throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
                 }
             }
         }
     }
     $oModelFactory = new model_mkfbuilderfactory();
     $oModelFactory->setConfig($sConfig);
     return $oModelFactory->getSgbd()->generateIndexForTable($sTable, $sIndex);
 }
开发者ID:clavat,项目名称:mkMarket,代码行数:28,代码来源:main.php


示例5: _index

 public function _index()
 {
     $msg = '';
     $detail = '';
     if ($this->isPost()) {
         $sModule = _root::getParam('module');
         $sActions = _root::getParam('actions');
         $tAction = explode("\n", $sActions);
         if ($this->projectMkdir('module/' . $sModule) == true) {
             $detail = trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule));
         } else {
             $detail = trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule));
         }
         if ($this->projectMkdir('module/' . $sModule . '/view') == true) {
             $detail .= '<br />' . trR('creationRepertoire', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
         } else {
             $detail .= '<br />' . trR('repertoireDejaExistant', array('#REPERTOIRE#' => 'module/' . $sModule . '/view'));
         }
         $this->genModuleMain($sModule, $tAction);
         $msg = trR('moduleGenereAvecSucces', array('#MODULE#' => $sModule, '#listACTION#' => implode(',', $tAction)));
         $detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/main.php'));
         foreach ($tAction as $sAction) {
             $detail .= '<br />' . trR('CreationDuFichierVAR', array('#FICHIER#' => 'module/' . $sModule . '/view/' . $sAction . '.php'));
         }
         $detail .= '<br />' . tr('accessibleVia');
         foreach ($tAction as $sAction) {
             $detail .= '<br />- <a href="data/genere/' . _root::getParam('id') . '/public/index.php?:nav=' . $sModule . '::' . $sAction . '">index.php?:nav=' . $sModule . '::' . $sAction . '</a>';
         }
     }
     $oTpl = $this->getView('index');
     $oTpl->msg = $msg;
     $oTpl->detail = $detail;
     return $oTpl;
 }
开发者ID:clavat,项目名称:mkMarket,代码行数:34,代码来源:main.php


示例6: __construct

 /** 
  * constructeur
  * @access public
  * @param string $sToken
  */
 public function __construct()
 {
     $this->sSalt = 'fdsfA34T679hjfdsAfef';
     $this->iLifetime = _root::getConfigVar('security.xsrf.timeout.lifetime');
     $this->bUseSession = _root::getConfigVar('security.xsrf.session.enabled', 0);
     $this->sSessionVar = 'xsrfTokenArray';
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:12,代码来源:plugin_xsrf.php


示例7: getImg

 /** 
  * retourne le code html d'une image
  * @access public
  * @param string $sSrc path de l'image, par defaut utilisera le path.img configure dans conf/site.php
  * @param string $sAlt texte alternatif
  * @param array $tOption tableau contenant autant d'options a ajouter 
  * 						array('style'=>'border:1px')  >> <img style="border:1px"...
  * @return string retourne le code html de l'image
  */
 public function getImg($sSrc, $sAlt = null, $tOption = null)
 {
     if ($sAlt == null) {
         $sAlt = $sSrc;
     }
     $sOptions = $this->getOptionFromTab($tOption);
     return '<img src="' . _root::getConfigVar('path.img') . $sSrc . '" title="' . $sAlt . '" ' . $sOptions . '/>';
 }
开发者ID:clavat,项目名称:mkMarket,代码行数:17,代码来源:plugin_html.php


示例8: load

 private function load($sId)
 {
     if ($this->_toFile and isset($this->_toFile[$sId])) {
         return;
     }
     $oFile = new _file(_root::getConfigVar('path.cache') . $sId . '.cachevar');
     $this->_toFile[$sId] = $oFile;
 }
开发者ID:clavat,项目名称:mkframework,代码行数:8,代码来源:class_cacheVar.php


示例9: _show

 public function _show()
 {
     $oExamplemodel = model_examplemodel::getInstance()->findById(_root::getParam('id'));
     $oView = new _view('examplemodule::show');
     $oView->oExamplemodel = $oExamplemodel;
     //icishow
     $this->oLayout->add('main', $oView);
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:8,代码来源:main.php


示例10: load

 /** 
  * charge le fichier de langue situe dans la section [path], valeur de i18n
  * @access public static
  * @param string $sLang (doit etre present dans le fichier de config [language] allow separer par des virgules
  */
 public static function load($sLang)
 {
     $tAllowed = preg_split('/,/', _root::getConfigVar('language.allow'));
     if (!in_array($sLang, $tAllowed) and $sLang != _root::getConfigVar('language.default')) {
         throw new Exception('Lang not allowed, list allow:' . _root::getConfigVar('language.allow'));
     }
     include_once _root::getConfigVar('path.i18n') . $sLang . '.php';
     self::$tLangue = _root::getConfigVar('tLangue');
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:14,代码来源:plugin_i18n.php


示例11: _projetEmbedded

 public function _projetEmbedded()
 {
     if (_root::getParam('action') == 'model') {
         $tLink = array();
     } else {
         //if(_root::getParam('action')=='module'){
         $tLink = array('Modules' => 'title', 'Cr&eacute;er un module' => 'module', 'Cr&eacute;er un module CRUD' => 'crud', 'Cr&eacute;er un module Lecture seule' => 'crudreadonly', 'Cr&eacute;er un module d\'authentification' => 'authmodule', 'Cr&eacute;er un module d\'authentification avec inscription' => 'authwithinscriptionmodule', 'Modules int&eacute;grable' => 'title', 'Cr&eacute;er un module menu ' => 'addmodulemenu', 'Cr&eacute;er un module int&eacute;grable' => 'moduleembedded', 'Cr&eacute;er un module CRUD int&eacute;grable' => 'crudembedded', 'Cr&eacute;er un module Lecture seule int&eacute;grable' => 'crudembeddedreadonly');
     }
     $oTpl = new _tpl('menu::projetEmbedded');
     $oTpl->tLink = $tLink;
     return $oTpl;
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:12,代码来源:main.php


示例12: _index

 public function _index()
 {
     $tLink = array('Articles' => 'article::list', 'Articles pagine' => 'article::listPagination', 'Articles via module table' => 'article::listModuleTable', 'Utiliser des classes metiers' => 'article::myclass', 'Appeler des sous module' => 'private_article::list', 'Graphiques' => 'chart::examples', 'Graphiques SVG' => 'chart::examplesSVG', 'Google Map' => 'default::googleMap', 'Auteurs xml' => 'auteurxml::list', 'Products "virtuel"' => 'virtualProducts::list', 'Prive' => 'prive::list');
     if (_root::getACL()->can('edit', 'acl')) {
         $tLink['Manage accounts'] = 'account::list';
         $tLink['Manage groups'] = 'group::list';
         $tLink['Manage permission'] = 'permission::list';
     }
     $oView = new _view('menu::index');
     $oView->tLink = $tLink;
     return $oView;
 }
开发者ID:clavat,项目名称:mkframework,代码行数:12,代码来源:main.php


示例13: _list

 public function _list()
 {
     //cache
     if (_root::getCache()->isCached('sidebar_categories')) {
         $oView = _root::getCache()->getCached('sidebar_categories');
         return $oView;
     }
     $tCategories = model_categories::getInstance()->findAll();
     $oView = new _view('categories::list');
     $oView->tCategories = $tCategories;
     _root::getCache()->setCache('sidebar_categories', $oView);
     return $oView;
 }
开发者ID:EhteshamMehmood,项目名称:BlogMVC,代码行数:13,代码来源:main.php


示例14: _category

 public function _category()
 {
     $oView = new _view('default::index');
     $this->oLayout->add('main', $oView);
     //posts (main)
     $oModuleExamplemodule = new module_posts();
     $oModuleExamplemodule->setCategory(_root::getParam('id'));
     //si vous souhaitez indiquer au module integrable des informations sur le module parent
     $oModuleExamplemodule->setRootLink('default::categoryDetail', array('id' => _root::getParam('id')));
     //recupere la vue du module
     $oViewModule = $oModuleExamplemodule->_index();
     //assigner la vue retournee a votre layout
     $this->oLayout->add('main', $oViewModule);
 }
开发者ID:EhteshamMehmood,项目名称:BlogMVC,代码行数:14,代码来源:main.php


示例15: _connect

 /**
  * @access public
  */
 public function _connect()
 {
     //on regenere un nouvel id de session
     session_regenerate_id(true);
     $this->_bConnected = true;
     $_SESSION['ip'] = sha1($_SERVER['REMOTE_ADDR']);
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $_SESSION['userAgent'] = sha1($_SERVER['HTTP_USER_AGENT']);
     } else {
         $_SESSION['userAgent'] = sha1('noUserAgent');
     }
     if ((int) _root::getConfigVar('auth.session.timeout.enabled') == 1) {
         $_SESSION['timeout'] = time() + (int) _root::getConfigVar('auth.session.timeout.lifetime');
     }
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:18,代码来源:abstract_auth.php


示例16: _redirect

 public static function _redirect($sRootModule, $tRootParams, $sModuleName, $sModuleAction, $tModuleParam = null)
 {
     $sPrefix = $sModuleName;
     $tParam = array();
     if ($tRootParams) {
         $tParam = $tRootParams;
     }
     $tParam[$sPrefix . 'Action'] = $sModuleAction;
     if ($tModuleParam) {
         foreach ($tModuleParam as $sKey => $sVal) {
             $tParam[$sPrefix . $sKey] = $sVal;
         }
     }
     return _root::redirect($sRootModule, $tParam);
 }
开发者ID:clavat,项目名称:mkframework,代码行数:15,代码来源:abstract_moduleembedded.php


示例17: _index

 public function _index()
 {
     module_builder::getTools()->rootAddConf('conf/connexion.ini.php');
     $tConnexion = _root::getConfigVar('db');
     $tSqlite = array();
     foreach ($tConnexion as $sConfig => $val) {
         if (substr($val, 0, 6) == 'sqlite') {
             $tSqlite[substr($sConfig, 0, -4)] = $val;
         }
     }
     $msg = '';
     $detail = '';
     if ($this->isPost()) {
         $sDbFilename = _root::getParam('sDbFilename');
         $sTable = _root::getParam('sTable');
         $tField = _root::getParam('tField');
         $tType = _root::getParam('tType');
         $tSize = _root::getParam('tSize');
         try {
             $oDb = new PDO($sDbFilename);
         } catch (PDOException $exception) {
             die($exception->getMessage());
         }
         $oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $sSql = 'CREATE TABLE IF NOT EXISTS ' . $sTable . '(';
         $sSql .= 'id  INTEGER PRIMARY KEY AUTOINCREMENT';
         foreach ($tField as $i => $sField) {
             $sSql .= ',';
             $sSql .= $sField . ' ' . $tType[$i];
             if ($tType[$i] == 'VARCHAR') {
                 $sSql .= '(' . $tSize[$i] . ')';
             }
         }
         $sSql .= ')';
         try {
             $oDb->exec($sSql);
         } catch (PDOException $exception) {
             die($exception->getMessage());
         }
         $msg = trR('baseTableGenereAvecSucces', array('#maTable#' => $sTable, '#listField#' => implode(',', $tField)));
         $detail = trR('creationFichier', array('#FICHIER#' => ' sqlite ' . $sDbFilename));
     }
     $oTpl = $this->getView('index');
     $oTpl->msg = $msg;
     $oTpl->detail = $detail;
     $oTpl->tSqlite = $tSqlite;
     return $oTpl;
 }
开发者ID:clavat,项目名称:mkMarket,代码行数:48,代码来源:main.php


示例18: _index

 public function _index()
 {
     module_builder::getTools()->rootAddConf('conf/connexion.ini.php');
     $tConnexion = _root::getConfigVar('db');
     $tSqlite = array();
     foreach ($tConnexion as $sConfig => $val) {
         if (substr($val, 0, 6) == 'sqlite') {
             $tSqlite[substr($sConfig, 0, -4)] = $val;
         }
     }
     $msg = '';
     $detail = '';
     if (_root::getRequest()->isPost()) {
         $sDbFilename = _root::getParam('sDbFilename');
         $sTable = _root::getParam('sTable');
         $tField = _root::getParam('tField');
         $tType = _root::getParam('tType');
         $tSize = _root::getParam('tSize');
         try {
             $oDb = new PDO($sDbFilename);
         } catch (PDOException $exception) {
             die($exception->getMessage());
         }
         $oDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $sSql = 'CREATE TABLE IF NOT EXISTS ' . $sTable . '(';
         $sSql .= 'id  INTEGER PRIMARY KEY AUTOINCREMENT';
         foreach ($tField as $i => $sField) {
             $sSql .= ',';
             $sSql .= $sField . ' ' . $tType[$i];
             if ($tType[$i] == 'VARCHAR') {
                 $sSql .= '(' . $tSize[$i] . ')';
             }
         }
         $sSql .= ')';
         try {
             $oDb->exec($sSql);
         } catch (PDOException $exception) {
             die($exception->getMessage());
         }
         $msg = 'Table ' . $sTable . ' (champs: ' . implode(',', $tField) . ') g&eacute;n&eacute;r&eacute; avec succ&egrave;s';
         $detail = 'Cr&eacute;ation du fichier sqlite ' . $sDbFilename;
     }
     $oTpl = new _Tpl('moduleSqlite::index');
     $oTpl->msg = $msg;
     $oTpl->detail = $detail;
     $oTpl->tSqlite = $tSqlite;
     return $oTpl;
 }
开发者ID:CariteColas,项目名称:projetTKB,代码行数:48,代码来源:main.php


示例19: _project

 public function _project()
 {
     $bBootstrap = 0;
     if (file_exists('data/genere/' . _root::getParam('id') . '/layout/bootstrap.php')) {
         $bBootstrap = 1;
     }
     if ($bBootstrap) {
         $tType = array('all', 'bootstrap');
     } else {
         $tType = array('all', 'normal');
     }
     $sLang = _root::getConfigVar('language.default');
     $tLinkModule = array();
     foreach ($tType as $sType) {
         $sPathModule = _root::getConfigVar('path.module') . '/mods/' . $sType;
         $tModulesAll = scandir($sPathModule);
         foreach ($tModulesAll as $sModule) {
             if (file_exists($sPathModule . '/' . $sModule . '/info.ini')) {
                 $tIni = parse_ini_file($sPathModule . '/' . $sModule . '/info.ini');
                 $priority = 999;
                 if (isset($tIni['priority'])) {
                     $priority = $tIni['priority'];
                 }
                 $sPriority = sprintf('%03d', $priority);
                 $tLinkModule[$tIni['category']][$tIni['title.' . $sLang] . ' <sup>version ' . $tIni['version'] . '</sup>'] = $sPriority . 'mods_' . $sType . '_' . $sModule . '::index';
             }
         }
     }
     //$tModules=scandir(_root::getConfigVar('path.module')).'/mods/normal';
     $tTitle = array('market', 'coucheModel', 'modules', 'modulesEmbedded', 'views', 'databasesEmbedded', 'unitTest');
     $tLink = array();
     foreach ($tTitle as $sTitle) {
         if (isset($tLinkModule[$sTitle])) {
             $tLinkModuleCat = $tLinkModule[$sTitle];
             asort($tLinkModuleCat);
             $tLink[tr('menu_' . $sTitle)] = 'title';
             foreach ($tLinkModuleCat as $sLabel => $sLink) {
                 $tLink[$sLabel] = substr($sLink, 3);
             }
         }
     }
     $oTpl = $this->getView('project');
     $oTpl->tLink = $tLink;
     return $oTpl;
 }
开发者ID:clavat,项目名称:mkframework,代码行数:45,代码来源:main.php


示例20: process

 private function process()
 {
     if (_root::getRequest()->isPost() == false) {
         return null;
     }
     $this->msg = tr('coucheModeleGenereAvecSucces');
     $this->detail = trR('CreationDuFichierVAR', array('#FICHIER#' => 'model/model_' . $sTable));
     $this->projectMkdir('module/' . $sModuleMenuName);
     /*SOURCE*/
     $oSourceModel = $this->getObjectSource('example.php');
     /*SOURCE*/
     $oSourceModel->setPattern('#maTable#', $maTable);
     $sSnippet = $oSourceModel->getSnippet('monSnippet', array('#maVar#' => $maValeur));
     /*SOURCE*/
     $oSourceModel->setPattern('#sSnippet#', $sSnippet);
     /*SOURCE*/
     $oSourceModel->save();
 }
开发者ID:clavat,项目名称:mkMarket,代码行数:18,代码来源:main.php



注:本文中的_root类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP a类代码示例发布时间:2022-05-23
下一篇:
PHP __Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap