05 2019 档案

摘要:Service Container: https://laravel-china.org/articles/789/laravel-learning-notes-the-magic-of-the-service-container https://www.cnblogs.com/lyzg/p/618 阅读全文
posted @ 2019-05-13 10:44 Victor!!!! 阅读(73) 评论(0) 推荐(0)
摘要:<?php function getArrayValues ($data) { static $newArr = []; // New Array if (!is_array($data)) { $newArr[] = $data; } foreach($data as $value) { if(!is_array($... 阅读全文
posted @ 2019-05-13 10:43 Victor!!!! 阅读(175) 评论(0) 推荐(0)
摘要:Purpose: To dynamically add new functionality to class instance. Booking.php BookingDecorator.php DoubleRoomBooking.php ExtraBed.php WiFi.php Tests/De 阅读全文
posted @ 2019-05-10 18:00 Victor!!!! 阅读(168) 评论(0) 推荐(0)
摘要:Purpose: A Data Mapper, is a Data Access Layer that performs bidirectional transfer of data between a persistent data store (ofen a relational databas 阅读全文
posted @ 2019-05-09 17:37 Victor!!!! 阅读(232) 评论(0) 推荐(0)
摘要:Purpose: To treat a group of objects the same way as a single instance of the object. RenderableInterface.php Form.php InputElement.php TextElement.ph 阅读全文
posted @ 2019-05-09 14:47 Victor!!!! 阅读(260) 评论(0) 推荐(0)
摘要:Purpose: Decouple an abstraction from its implementation so that the two can vary independently FormatterInterface.php PlainTextFormatter.php HtmlForm 阅读全文
posted @ 2019-05-08 18:12 Victor!!!! 阅读(183) 评论(0) 推荐(0)
摘要:Purpose: To translate one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not becaus 阅读全文
posted @ 2019-05-08 17:25 Victor!!!! 阅读(125) 评论(0) 推荐(0)
摘要:Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities. 阅读全文
posted @ 2019-05-08 16:38 Victor!!!! 阅读(219) 评论(0) 推荐(0)
摘要:Creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situati 阅读全文
posted @ 2019-05-08 16:34 Victor!!!! 阅读(334) 评论(0) 推荐(0)
摘要:Purpose: Similiar to the AbstractFactory, this pattern is used to create series of related or dependent objects. The difference between this and abstr 阅读全文
posted @ 2019-05-08 15:51 Victor!!!! 阅读(176) 评论(0) 推荐(0)
摘要:Purpose: This is considered to be an ANTI-PATTERN! We could use dependency injection to replace this pattern. To have only one instance of object in t 阅读全文
posted @ 2019-05-08 15:34 Victor!!!! 阅读(154) 评论(0) 推荐(0)
摘要:Purpose: It differs from the static factory because it is not static. Therefore, you can have multiple factories, differently parameterized, you can s 阅读全文
posted @ 2019-05-08 14:50 Victor!!!! 阅读(132) 评论(0) 推荐(0)
摘要:Purpose: To avoid the cost of creating objects the standard way (new Foo()) and instead create a prototype and clone it. BookPrototype.php BarBookProt 阅读全文
posted @ 2019-05-08 10:25 Victor!!!! 阅读(217) 评论(0) 推荐(0)
摘要:Purpose: The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use - a "pool" rather th 阅读全文
posted @ 2019-05-07 17:49 Victor!!!! 阅读(248) 评论(0) 推荐(0)
摘要:Purpose To have only a list of named instances that are used, like a singleton but with n instances. Multiton.php 阅读全文
posted @ 2019-05-07 17:22 Victor!!!! 阅读(170) 评论(0) 推荐(0)
摘要:Purpose The good point over the SimpleFactory is you can subclass it to implement different ways to create objects. For simple cases, this abstract cl 阅读全文
posted @ 2019-05-07 16:09 Victor!!!! 阅读(169) 评论(0) 推荐(0)
摘要:Purpose: Builder is an interface that build parts of a complex object. Sometimes, if the builder has a better knowledge of what it builds, this interf 阅读全文
posted @ 2019-05-07 15:57 Victor!!!!
摘要:Creational Creational Design Patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to 阅读全文
posted @ 2019-05-07 15:05 Victor!!!! 阅读(141) 评论(0) 推荐(0)
摘要:To Start working with DateTime, convert raw date and time string to an object with createFromFormat() factory method or do new DateTime to get the cur 阅读全文
posted @ 2019-05-07 11:32 Victor!!!!
摘要:PHP supports first-class functions, meaning that a function can be assigned to a variable. Both user-defined and built-in functions can be referenced 阅读全文
posted @ 2019-05-05 16:20 Victor!!!! 阅读(118) 评论(0) 推荐(0)
摘要:金融的本质: 金融就是跨期价值交换,就是在双方之间进行的跨越时间的交易。所有的跨期价值交换都是金融,都是金融要解决的问题。借贷是交易两方的跨期价值互换,股票和保险等其他金融产品也是如此。 货币: 货币是人类最早,最基本,最普遍的金融品种,是跨越时间的价值载体,是货币使用人和发行方(一般为中央银行)之 阅读全文
posted @ 2019-05-05 14:48 Victor!!!! 阅读(567) 评论(0) 推荐(0)
摘要:首先,需要创建一个类来集成Facade类 <?php namespace App\Facades\GeoIP\Facade; use Illuminate\Support\Facades\Facade; class GeoIP extends Facade { protected static fu 阅读全文
posted @ 2019-05-05 14:47 Victor!!!! 阅读(218) 评论(0) 推荐(0)
摘要:Refer this article: https://aws.amazon.com/blogs/security/how-to-automatically-update-your-security-groups-for-amazon-cloudfront-and-aws-waf-by-using- 阅读全文
posted @ 2019-05-05 14:46 Victor!!!! 阅读(155) 评论(0) 推荐(0)
摘要:Facade是容器中的类的静态代理,可以调用容器中任何对象的任何方法。 Route::get(‘/cache’, function(){ return Cache::get(‘key’); }); 要使用Facade,首先需要继承‘Illuminate\Support\Facades\Facade’ 阅读全文
posted @ 2019-05-05 14:46 Victor!!!! 阅读(252) 评论(0) 推荐(0)
摘要:后台线程: InnoDB 存储引擎是多线程的模型,因此,其后台有多个不同的后台线程,负责处理不同的任务。 Master Thread: Master Thread 是一个非常核心的后台线程,主要负责将缓冲池中的数据异步刷新到磁盘,保证数据的一致性,包括脏页的刷新,合并插入缓存(Insert Buff 阅读全文
posted @ 2019-05-05 14:45 Victor!!!! 阅读(131) 评论(0) 推荐(0)
摘要:B+ 树索引并不能找到一个给定键值的具体行。B+ 树索引能找到的只是被查找数据行所在的页。然后将页读入内存,再在内存中进行查找,最后得到要查找的数据。 扇入性(fan in): 是指直接调用该模块的上级模块的个数,扇入大,代表模块的复用程度高。 扇出性(fan out): 扇出大一般是因为缺乏中间层 阅读全文
posted @ 2019-05-05 14:44 Victor!!!! 阅读(474) 评论(0) 推荐(0)
摘要:数据库: 物理操作系统文件或其他形式文件类型的集合。在MySQL数据库中,数据库文件可以是frm, MYD, MYI, ibd结尾的文件。当使用NDB引擎时,数据库的文件可能不是操作系统上的文件,而是存放于内存之中的文件,但是定义仍然不变。 实例: MySQL数据库由后台线程以及一个共享内存区组成。 阅读全文
posted @ 2019-05-05 14:44 Victor!!!! 阅读(171) 评论(0) 推荐(0)
摘要:数据库测试的四个阶段: 1. 建立基境(fixture) 2. 执行被测试系统 3. 验证结果 . 拆除基境(fixture) Fixture: 基境(fixture)是对开始执行某个测试时应用程序和数据库所处初始状态的描述 数据库测试处理建立与拆除的步骤: 1. 清理数据库: 由于总是会有某个测试 阅读全文
posted @ 2019-05-05 14:43 Victor!!!! 阅读(189) 评论(0) 推荐(0)
摘要:基境(fixture) 写测试时,编写代码来将整个场景设置成某个已知状态,并在测试完成后将其恢复到初始状态。这个已知状态称之为基境(fixture) <?php use PHPUnit\Framework\TestCase; class StackTest extends TestCase { pr 阅读全文
posted @ 2019-05-05 14:42 Victor!!!! 阅读(295) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-05-05 14:42 Victor!!!!
该文被密码保护。
posted @ 2019-05-05 14:41 Victor!!!!
摘要:POST HTTP.POST can be used when the client is sending data to the server and the server will decide the URI for the newly created resource. The POST m 阅读全文
posted @ 2019-05-05 14:40 Victor!!!! 阅读(133) 评论(0) 推荐(0)
摘要:标量类型声明: 增加了对返回类型声明的支持。 <?php function arraySum(array ...$arrays): array { return array_map(function(array $array): int { return array_sum($array); }, 阅读全文
posted @ 2019-05-05 14:39 Victor!!!!
摘要:定义超全局变量: <?php $room = 20; function show() : void { $room = $GLOBALS['room']; echo $room; } ?> 这里使用了$GLOBALS这个包含全局变量的数组 Final Key word: 如果父类中的方法被声明为 f 阅读全文
posted @ 2019-05-05 14:39 Victor!!!!
摘要:Zend OPcache: Nginx 把HTTP请求转发给PHP-FPM, PHP-FPM再把请求交给某个PHP子进程处理。PHP进程找到相应的PHP脚本后,读取脚本,把PHP脚本编译成操作码(或字节码)格式,然后执行编译得到的操作码,生成响应。最后把HTTP响应发送给nginx,nginx再把响 阅读全文
posted @ 2019-05-05 13:27 Victor!!!! 阅读(134) 评论(0) 推荐(0)
摘要:过滤输入: 是指转义或者删除不安全的字符。在数据到达应用的储存层(mysql or redis)之前,一定要过滤输入的数据。 过滤HTML数据: 使用htmlentities()函数。默认情况下,这个函数不会转义单引号。而且也检测不出输入字符串的字符集。htmlentities()函数的正确使用方式 阅读全文
posted @ 2019-05-05 13:26 Victor!!!!
摘要:Zend OPcache 字节码缓存:PHP是解释型语言,PHP解释器执行PHP脚本时会解析PHP脚本代码,把PHP代码编译成一系列Zend操作码,然后执行字节码。每次请求PHP文件都这样,会消耗很多资源,如果每次HTTP请求PHP都必须不断解析,编译和执行PHP脚本,消耗的资源更多。 字节码缓存能 阅读全文
posted @ 2019-05-05 13:06 Victor!!!!
摘要:安装: 1. 下载Composer安装脚本: curl -sS https://getcomposer.org/installer | php 2. 重命名以及移动到/usr/local/bin/composer: sudo mv composer.phar /usr/local/bin/compo 阅读全文
posted @ 2019-05-05 12:58 Victor!!!!
摘要:命名空间: 命名空间很重要,因为代码放在沙盒中,可以和其他开发者编写的代码一起使用。这是现代PHP组件生态系统的基础。组件和框架的作者编写了大量的代码,供众多PHP开发者使用,这些作者不可能知道或者控制别人在使用自己的代码时还能使用了什么其他类、接口、函数或者常量。在你自己的私人项目中也会遇到这种问 阅读全文
posted @ 2019-05-05 12:52 Victor!!!!