摘要: 程序 = 算法 + 数据结构 数据结构 制约了 算法的 >>>>依赖注入 依赖注入也就是解数据结构和算法耦合的思想 阅读全文
posted @ 2016-05-26 09:37 雨落知音 阅读(251) 评论(0) 推荐(0) 编辑
摘要: <?php /** * Created by PhpStorm. * Date: 2016/5/25 * Time: 19:09 * * YII的类的映射表 */ namespace frontend\controllers; use Yii; use yii\web\Controller; //use frontend\models\Post; //作用被下面的classMap... 阅读全文
posted @ 2016-05-26 09:31 雨落知音 阅读(352) 评论(0) 推荐(0) 编辑
摘要: http禁止缓存原理 HttpcacheController.php 首先判断的是客户端lastModified,如果最后更新时间没有变化,就不会更新缓存,然后再判断etagSeed httpcache/index.php 阅读全文
posted @ 2016-05-26 09:29 雨落知音 阅读(214) 评论(0) 推荐(0) 编辑
摘要: IndexController.php views/index/index.php 阅读全文
posted @ 2016-05-26 09:25 雨落知音 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 127.0.0.1 www.localhost.com 127.0.0.1 www.frontend.com 127.0.0.1 www.backend.com ServerAdmin frontend.com DocumentRoot "D:\wamp\www\advanced\frontend\web" ServerName www.fronte... 阅读全文
posted @ 2016-05-24 18:41 雨落知音 阅读(137) 评论(0) 推荐(0) 编辑
摘要: conn = mysql_connect('localhost','root',''); } //创建一个用来实例化对象的方法 public static function getInstance(){ if(!(self::$conn instanceof self)){ self::... 阅读全文
posted @ 2016-05-20 09:29 雨落知音 阅读(149) 评论(0) 推荐(0) 编辑
摘要: //文件依赖 $dependency = new \yii\caching\FileDependency(['filename'=>'hw.txt'])}; $cache->add("file_key",'hello world',3000,$dependency);//$dependency决定了当缓存文件发生修改时也会失效 //表达式的依赖 $dependency = new... 阅读全文
posted @ 2016-05-19 21:17 雨落知音 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 类的映射表 组件延迟加载 阅读全文
posted @ 2016-05-19 21:10 雨落知音 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 版本1 require('class\class1.php'); require('class\class1.php'); if($is_girl){ echo 'this is a girl'; $class1 = new Class1; }else{ echo "this is a boy"; $class2 = new Class2; } 版本2 if... 阅读全文
posted @ 2016-05-19 20:57 雨落知音 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 以customer order两个表为例 //关联查询控制器中 $customer = Customer::find()->where('name'=>'zhangsan')->one(); $orders = $customer->hasmany('orders',['customer_id']=>'id')->asArray()->all(); $orders = $customer->... 阅读全文
posted @ 2016-05-19 20:41 雨落知音 阅读(284) 评论(0) 推荐(0) 编辑