예제 #1
0
파일: scan_msg.php 프로젝트: rodbox/rodbox3
<?php

extract($_GET);
extract($_POST);
$routingList = getRouting($app);
$formLabelList = getForm($app);
$msgList = getMsg($app);
$new = 0;
$msgRoutingList = [];
function getRouting($app)
{
    $routingFile = DIR_APP . "/" . $app . "/config/routing.json";
    return $json = json_decode(file_get_contents($routingFile), true);
}
function getMsg($app)
{
    $msgFile = DIR_APP . "/" . $app . "/msg/" . LANG_PRINCIPAL . ".json";
    return $json = json_decode(file_get_contents($msgFile), true);
}
function setMsg($app, $msgList)
{
    $msgFile = DIR_APP . "/" . $app . "/msg/" . LANG_PRINCIPAL . ".json";
    $c = new controller();
    $c->saveMsg($app, LANG_PRINCIPAL);
    // setJson enregiste un array qui va etre convertie au format json dans le fichier pointer;
    $c->setJson($msgFile, $msgList);
}
/**
 * retourne un tableau de tout les itemLabel de toutes les form de $app
 * @param  [type] $app [description]
 * @return [type]      [description]
예제 #2
0
파일: index.php 프로젝트: nokatsur/blog
<?php

require '../config.php';
Config::read('admin.php');
// Admin用の環境設定読み込み
Debug::log('Controller Action', false, 'system', __FILE__, __LINE__);
list($classFile, $className, $methodName) = getRouting();
require $classFile;
$controller = new $className($methodName);
Debug::output($controller);
// Debug用の出力
예제 #3
0
파일: cron.php 프로젝트: nokatsur/blog
<?php

error_reporting(E_ALL);
require dirname(__FILE__) . '/../core/bootstrap.php';
Config::read('cron.php');
// cron用の環境設定読み込み
require_once Config::get('CORE_DIR') . 'Request.php';
Request::getInstance()->setCronParams($argv);
list($classFile, $className, $methodName) = getRouting(Config::get('DEFAULT_CLASS_NAME'), Config::get('DEFAULT_METHOD_NAME'), Config::get('APP_PREFIX'));
require $classFile;
$controller = new $className();
Debug::log('Controller Action', false, 'system', __FILE__, __LINE__);
$controller->process($methodName);
예제 #4
0
$error = array();
$appAutoload = new appAutoload();
/**** MON EXEC ****/
$appAutoload->mod("file");
$list = file::folder_list(DIR_APP);
/* Tableau a compiler*/
$compile = [];
$app = [];
/* Fichier route */
$routingInitFile = "routing.json";
/* Parcours de la liste d 'app installer */
foreach ($list as $key => $value) {
    $info = pathinfo($value);
    $app = $info["filename"];
    /* Routing */
    $compile = merge_unique($compile, getRouting($app));
}
$app = $compile;
$jsonConfigEncode = json_encode($compile, JSON_PRETTY_PRINT);
$c->saveRouting();
file_put_contents(DIR_ROUTING, $jsonConfigEncode);
function getRouting($app)
{
    $configDir = DIR_APP . "/" . $app . "/config";
    $routingFile = $configDir . "/routing.json";
    return $json = json_decode(file_get_contents($routingFile), true);
}
/**** END MON EXEC ****/
$valid = count($error) == 0 ? true : false;
//la condition
/* Return for json content */