最近我需要维护一个我不编程的代码,它的工作都很好,但它没有.htaccess但是我无法识别哪个框架是什么或我必须放在.htacess文件中。 我有这个文件夹: 模块与其他内部的每个内部的每个内部都有controller.php和一个model.php和一个模板文件夹 一个lib文件夹里面有一个boot.php,它有这个代码可能会有帮助
public function route($modulo, $accion)
{
$modulo = ucfirst($modulo);
$controller = ROOT_PATH . MODULES . DS . $modulo . DS . "controller.php";
$model = ROOT_PATH . MODULES . DS . $modulo . DS . "model.php";
if (!file_exists($controller) && !file_exists($model)) :
die("<b>Error 404</b> :: No se encontro la página");
return false;
endif;
require_once $controller;
require_once $model;
if (!is_callable(array($modulo . "_Controller", $accion))) :
die("<b>Error</b> :: No se puede llamar a la accion");
return false;
endif;
$control = $modulo . "_Controller";
$control = new $control;
$control->$accion();
}
在我的index.php中,我有这个
<?php
if (!eregi("www", $_SERVER['HTTP_HOST'])) :
if (!isset($_SERVER['argv'][1]) && !isset($_SERVER['argv'][1])) :
$redireccionar = "http://www.deconsultas.com" . $_SERVER['REQUEST_URI'];
header("Location: $redireccionar");
die();
endif;
endif;
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_PATH', dirname(__FILE__) . DS);
require_once ROOT_PATH . "constant.php";
require_once ROOT_PATH . LIB . DS . "boot.php";
BM::load();
// -----------------------------------
$conf = BM_Config::singleton();
// -----------------------------------
$modulo_default = (isset($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : $conf->read ( 'modulo' );
$accion_default = (isset($_SERVER['argv'][2])) ? $_SERVER['argv'][2] : $conf->read ( 'accion' );
//
$modulo = (isset($modulo)) ? $modulo : (isset ( $_GET ['controller'] )) ? $_GET ['controller'] : $modulo_default;
$action = (isset($action)) ? $action : (isset ( $_GET ['action'] )) ? $_GET ['action'] : $accion_default;
switch($modulo) :
case 'admin' :
$base = "admin.html";
$dc_route = true;
break;
case 'programa' :
$base = "programa.html";
$dc_route = true;
break;
case 'noticia' :
$base = "programa.html";
$dc_route = true;
break;
case 'mailings' :
$base = "mailing.html";
break;
case 'reporte' :
$base = "reporte.html";
$dc_route = false;
break;
default:
$base = "index2.html";
$dc_route = true;
break;
endswitch;
BM::init($base);
if ($dc_route)
BM::route("dc","__dc");
BM::route($modulo,$action);
BM::end();
?>
我绝望,我的文档很少,缺乏信息,希望你能帮助我,问我需要知道什么。