随笔分类 -  php

摘要:PHP 开发起步示例 开发y一个demo 用 phpstorm 创建新项目 demo 构建开发编程环境 使用 psr-4 标准化加载机制 使用 composer 构建 初始化 项目 项目目录下打开命令行运行 composer require symfony/var-dumper 引入 compose 阅读全文
posted @ 2022-05-28 16:18 brookin 阅读(142) 评论(0) 推荐(0)
摘要:1. array_merge 字符索引:后面的覆盖前面的。 如果输入的数组中有相同的字符串键名,则该键名后面的值将覆盖前一个值。 混合索引:如果数组包含数字键名,后面的值将不会覆盖原来的值,而是附加到后面。从左到右,依次重新索引 如果只给了一个数组并且该数组是数字索引的,则键名会以连续方式重新索引。 阅读全文
posted @ 2017-11-23 20:22 brookin 阅读(187) 评论(0) 推荐(0)
摘要:Under Linux, sleeping time is ignored, but under Windows, it counts as execution time. Note The set_time_limit() function and the configuration direct 阅读全文
posted @ 2017-11-22 10:25 brookin 阅读(184) 评论(0) 推荐(0)
摘要:构建工程 composer create project test/name project_name help composer help create project 参数 prefer dist 强制使用压缩包,而不是克隆源代码 prefer source 优先使用源代码 阅读全文
posted @ 2017-11-21 20:51 brookin 阅读(160) 评论(0) 推荐(0)
摘要:PHPUnit 运行指定的 testCase phpunit tests/Screw/StrTest 运行指定的 testCase Method phpunit tests/Screw/StrTest filter Println 注意:Method 是大小写敏感的 阅读全文
posted @ 2017-11-21 20:48 brookin 阅读(144) 评论(0) 推荐(0)
摘要:1. func_get_args 示例 2. using ... operator Notice: PHP version 5.6 meanwhile you can set the type of parameters In php 7 3. use ReflectionClass 阅读全文
posted @ 2017-10-31 11:52 brookin 阅读(189) 评论(0) 推荐(0)
摘要:同时打开多个工程,多项目并存 快速模板 阅读全文
posted @ 2017-08-25 18:06 brookin 阅读(115) 评论(0) 推荐(0)
摘要:date: 2017 07 27 PHP的命名空间是否区分大小写? 结论:不区分大小写,与类名一样(不区分大小写)。 不区分大小写的包括 1. 函数名 2. 方法名 3. 类名 4. 控制语句(if, else, for, while, foreach) 5. null,true, false 6. 阅读全文
posted @ 2017-07-27 23:02 brookin 阅读(143) 评论(0) 推荐(0)
摘要:常量定义 PHP =5.3 支持在全局命名空间和类中使用 const 定义常量。 旧式风格: define("XOOO", "Value"); // 错误用法。等到PHP 7才支持。 define("XO", [1, 2, 3]); // 解决:define("XO", json_encode([1 阅读全文
posted @ 2017-05-22 23:59 brookin 阅读(207) 评论(0) 推荐(0)
摘要:javascript compress 阅读全文
posted @ 2017-04-13 14:23 brookin 阅读(295) 评论(0) 推荐(0)
摘要:PHP 的整数和字符串比较是 "松散比较" switch switch 在进行比较的时候,只是对值进行比较("松散比较") value 的取值为 'case 0' 阅读全文
posted @ 2017-01-17 20:34 brookin 阅读(289) 评论(0) 推荐(0)
摘要:inotify resources exhausted tail f /var/log/kubelet.log tail: inotify resources exhausted tail: inotify cannot be used, reverting to polling debug cat 阅读全文
posted @ 2016-12-06 20:50 brookin 阅读(2261) 评论(0) 推荐(0)
摘要:安装composer wget http://curl.haxx.se/ca/cacert.pem curl sS https://getcomposer.org/installer | php cafile=cacert.pem 安装protoc gen php composer r... 阅读全文
posted @ 2015-12-02 14:34 brookin 阅读(251) 评论(0) 推荐(0)
摘要:get_object_vars($var) vs array($var) test case class Test { public function actionGetObjectVarsVsArrayCast() { $obj = new TestA(); println... 阅读全文
posted @ 2015-09-07 20:46 brookin 阅读(276) 评论(0) 推荐(0)
摘要:zendstudio 行内注释, 显式声明变量类型,让变量自动方法提示 $out = []; /* @var $row \xxyy\SizeEntity */ foreach ($rows[ 'list'] as $row) { $out[ '... 阅读全文
posted @ 2015-07-27 10:30 brookin 阅读(355) 评论(0) 推荐(0)
摘要:gavin@webdev:~> curl -sS https://getcomposer.org/installer | phpDownloading...Download failed: file_get_contents(): SSL operation failed with code 1. ... 阅读全文
posted @ 2015-04-14 20:23 brookin 阅读(4012) 评论(0) 推荐(0)
摘要:背景业务需要用protobuffer 进行通讯。client: phpserver: c++在github 上找到Protobuf-PHP(https://github.com/drslump/Protobuf-PHP) 的评分不错,故采用它作为协议生成库来生成PHP侧的交互协议。问题生成php p... 阅读全文
posted @ 2015-04-13 23:54 brookin 阅读(5172) 评论(1) 推荐(0)
摘要:软件版本: pcre-8.36.tar.gzapr-1.5.1.tar.gzapr-util-1.5.4.tar.gzhttpd-2.4.12.tar.bz2 mysql-5.6.24.tar.gz libxml2-2.7.8.tar.gzlibpng-1.5.12.tar.gzfreetype-2 阅读全文
posted @ 2015-04-11 16:45 brookin 阅读(1226) 评论(0) 推荐(1)
摘要:背景get_cfg_var() 取的值是配置文件中的值ini_get() Gets the value of a configuration option, 则取的当前值(运行时,PHP系统定义)示例<?phpprintget_cfg_var('memory_limit');//返回1024Mpri... 阅读全文
posted @ 2014-10-31 19:52 brookin 阅读(453) 评论(0) 推荐(0)
摘要:背景CURL在 a.php 中以 POST方式向 b.php 提交数据,但b.php无法接收到数据,而 CURL 操作显示成功。原来,"传递一个数组到CURLOPT_POSTFIELDS,CURL会把数据编码成 multipart/form-data,而传递一个URL-encoded字符串时,数据会... 阅读全文
posted @ 2014-10-30 20:00 brookin 阅读(31051) 评论(0) 推荐(0)