本文整理汇总了PHP中Load::charg_chain_dans_tab方法的典型用法代码示例。如果您正苦于以下问题:PHP Load::charg_chain_dans_tab方法的具体用法?PHP Load::charg_chain_dans_tab怎么用?PHP Load::charg_chain_dans_tab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::charg_chain_dans_tab方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initerConstruct
function initerConstruct($initercreated = array())
{
//simulation d'un initer avec les paramètres get
$initer = $initercreated;
//CREATE INITER
//get chain connector
$chainconnector = "none";
//load chain connector
if (file_exists("chain/connector.chain.default.php")) {
include "chain/connector.chain.default.php";
if (isset($firstchain) && file_exists("chain/connector.chain." . $firstchain . ".php")) {
include "chain/connector.chain." . $firstchain . ".php";
$chainconnector = $firstchain;
//echo $firstchain;
} else {
$chainconnector = "default";
}
}
//charge chains dans tab
$chemin_chain = "chain";
$loader = new Load();
$chaintab = $loader->charg_chain_dans_tab($chemin_chain);
//print_r($chaintab);
//init initer
$initer['chainconnector'] = $chainconnector;
$initer['loader'] = $loader;
$initer['chaintab'] = $chaintab;
//test chain ok
if ($chainconnector == "default" || $chainconnector == "none" || !isset($tabconnector)) {
return $initer;
}
//start connector
foreach ($tabconnector as $connectorcour) {
$connectorlowercase = strtolower($connectorcour['name']);
$connectorclass = ucfirst($connectorlowercase);
if (!file_exists("connector/connector." . $connectorlowercase . ".php")) {
continue;
}
include_once "connector/connector." . $connectorlowercase . ".php";
eval("\$instanceConnector=new Connector" . $connectorclass . "(\$initer);");
eval("\$instanceConnector" . $connectorclass . "=\$instanceConnector;");
eval("\$instance" . $connectorclass . "=\$instanceConnector->initInstance();");
${$connectorlowercase} = $instanceConnector->initVar();
//get modif du initer
$initer = $instanceConnector->initer;
//cas passage de class dans initer
if (isset($connectorcour['classtoiniter']) && $connectorcour['classtoiniter']) {
eval("\$initer['instance" . $connectorclass . "']=\$instance" . $connectorclass . ";");
}
//cas passage de var dans initer
if (isset($connectorcour['vartoiniter']) && $connectorcour['vartoiniter']) {
eval("\$initer['" . $connectorlowercase . "']=\$" . $connectorlowercase . ";");
}
//cas set variable ou classe spéciale (conf, db, tpl, ...)
if (isset($connectorcour['aliasiniter']) && $connectorcour['aliasiniter'] != "none") {
//class spéciale
if (isset($connectorcour['classtoiniter']) && $connectorcour['classtoiniter'] && (!isset($connectorcour['vartoiniter']) || !$connectorcour['vartoiniter'])) {
eval("\$" . $connectorcour['aliasiniter'] . "=\$instance" . $connectorclass . ";");
eval("\$initer['" . $connectorcour['aliasiniter'] . "']=\$instance" . $connectorclass . ";");
}
//variable spéciale (prioritaire pour variable, écrase la classe si var et class sont utilisés)
if (isset($connectorcour['vartoiniter']) && $connectorcour['vartoiniter']) {
eval("\$" . $connectorcour['aliasiniter'] . "=\$" . $connectorlowercase . ";");
eval("\$initer['" . $connectorcour['aliasiniter'] . "']=\$" . $connectorlowercase . ";");
}
}
//echo "</pre>";print_r($initer['instanceDroit']);echo "</pre>";
//pre exec
$instanceConnector->reloadIniter($initer);
$instanceConnector->preexec();
$initer = $instanceConnector->initer;
}
//post exec connector
/*
foreach($tabconnector as $connectorcour)
{
$connectorlowercase=strtolower($connectorcour['name']);
$connectorclass=ucfirst($connectorlowercase);
if(!file_exists("connector/connector.".$connectorlowercase.".php"))
continue;
eval("\$instanceConnector=\$instanceConnector".$connectorclass.";");
//$instanceConnector->initer=$initer;
$instanceConnector->reloadIniter($initer);
$instanceConnector->postexec();
$initer=$instanceConnector->initer;
}
*/
//...CREATE INITER
$initercreated = $initer;
return $initercreated;
}
示例2: Load
}
//include classes abstract
$chemin_classes = "abstract";
include $chemin_classes . "/class.load.php";
$loader = new Load();
$tab_class = $loader->charg_dossier_dans_tab($chemin_classes);
sort($tab_class);
//print_r($tab_class);
foreach ($tab_class as $class_to_load) {
if (!strstr($class_to_load, "class.load.php")) {
include $class_to_load;
}
}
//charge chains dans tab
$chemin_chain = "chain";
$chaintab = $loader->charg_chain_dans_tab($chemin_chain);
//print_r($chaintab);
//init initer
$initer = array();
$initer['chainconnector'] = $chainconnector;
$initer['loader'] = $loader;
$initer['chaintab'] = $chaintab;
//cas appel php from console
if (isset($argv)) {
$initer['argv'] = $argv;
}
//start connector
foreach ($tabconnector as $connectorcour) {
$connectorlowercase = strtolower($connectorcour['name']);
$connectorclass = ucfirst($connectorlowercase);
if (!file_exists("connector/connector." . $connectorlowercase . ".php")) {