php 精简框架

这个是根据面试题做出来的,最精简的框架,用一下午时间做出来。

为了功能实现,任何防护和过滤都没有。

作者:风来了.呆狐狸

<?php
// 根目录
define('ROOT', __DIR__);
$c=trim($_REQUEST['c']);
$a=trim($_REQUEST['a']);
//配置加载
include ROOT.'/config/config.php';
header("Content-type:text/html;charset=".CHARSET);
//控制器加载
if (empty($c)) $c = 'index';
if (empty($a)) $a = 'init';
//是否已安装
if (!file_exists(ROOT.'/install.lock')) {
    $c = 'install';
    $a = 'init';
}
$file = ROOT.'/app/'.$c.'.php';
if (file_exists($file)) {
    include ROOT.'/class/DB.php';
    include ROOT.'/class/fun.php';
    include $file;
    if(class_exists($c)){
        $controller= new $c;
        if (method_exists($controller, $a)) {
            call_user_func([$controller, $a]);
        } else {
            exit('该动作不存在');
        }
    }else{
        exit('控制器不存在.');
    }
} else {
    exit('控制器不存在');
}
其他请看附件地址

http://download.csdn.net/detail/wljk506/8190339

面试题:

1. Introduction 
The following test-case1 is given to any future developer. The aim is to get to know you and the way you are working. We also want to test your basic PHP / MySQL skills. You have to use PHP / MySQL and you may use JavaScript. You should not use any predefined code downloaded from the internet. You are free on how you want to organize the files, database structure and code. You should try to develop in a way that allows for further increasing the functionality of the test-case 1 with little adjustments. 

2. Task 

A tiny version of an address-book should be developed. There should be some sort of list showing all the entries already made, a form to create new entries and edit existing ones and the possibility to export the list into a XML-file. Each entry should consist of the fields (name, first name, street, zip-code, and city) where the city should be a drop down, with cities defined in a table in the database. The design should be user-friendly but

 
3. Procedure 
You have to develop this little program on your own system, then send the code files, a file containing all the queries needed to create the database, a file with the queries to enter test-data, and a file containing the hours you have worked and on what you have been working, to us. 
4. Files to hand in 
a) Code files (may be several) 
b) File containing all the queries to setup the database 
c) File containing the queries to enter test-data 
d) The filled in journal (test-case_1.docx) 




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风.foxwho

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值