需要像解决方案单一的入口点 [英] Need single entry point like solution

查看:164
本文介绍了需要像解决方案单一的入口点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作现成的框架(传统架构)。其几乎像任何其他的MVC framwork你在市场上得到的,不同之处在于它没有单一的入口点。
因此,在每一个控制器文件我必须包括的configs和放大器;模型类。
目前,我管理与__autoload(),但仍然之一,包括留在每一页上。
如果我添加的.htaccess单一入口点,则我必须做很多的变化在我的code.Because每个控制器的文件是不同的物理file.Its甚至没有接近面向对象的结构和看法Smarty的使用。
是替代php.ini有包括的.htaccess规则的任何解决方案,?这将是更容易维护。 请建议最好的解决方案我dificulty。

I work on ready made framework (legacy framework).Its almost like any other MVC framwork you get in market, except that its not having single entry point.
So in every Controller file I have to include configs & Model classes.
Currently I manage with __autoload() , but still one include is left on every page.
If I add .htaccess for single entry point then I have to do lots of changes in my code.Because every controller file is different physical file.Its not even near to object oriented structure and for views smarty is used.
Is there any solution including .htaccess rules , instead of php.ini? It will be easier to maintain. Please suggest best solutions for my dificulty.

推荐答案

我可以给你最好的建议是使用的汽车prePEND文件。在任何脚本运行,一块code是ppended它$ P $。

The best suggestion I could give you is by using auto prepend files. Before any script runs, a piece of code is prepended to it.

在Apache的,你可以使用 php_value AUTO_ prepend_file xxx.php 指令设置此每个目录。

In Apache you can set this per directory using the php_value auto_prepend_file xxx.php directive.

这篇关于需要像解决方案单一的入口点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆