更新系统后, 一经调用PHP接口,PHPFPM一起来就疯狂占用内存. 经查是Monolog启用的info日志, info设置的日志如下: monolog: handlers: … … info: type: stream path: “%kernel.logs_dir%/%kernel.environment%-info.log” level: info channels: [‘!event’, ‘!doctrine’, ‘!console’ 删除该配置后系统恢复正常.
Category: Program
How to activation PHPStorm 2017 — 2018 License Server
http://nodde.ru:1027 https://roothat.ru/how-to-activation-phpstorm-2017-2018-license-server/
Angular 2.0
Angular2.0 http://angular.io https://angular.cn Installation npm install -g @angular/cli Create Project ng new my-app Start project cd my-app ng serve –open Open in browser open http://localhost:4200 Angular Cli WIKI https://github.com/angular/angular-cli/wiki Angular Cli ng new ng serve ng generate ng lint ng test ng e2e ng build ng get/ng set ng doc ng eject ng xi18n Angular…
phpstorm setup
Download https://www.jetbrains.com/phpstorm/ PhpStorm 2017.3.4 License Server http://license.topnguyen.net Install Symfony Plugin in PhpStorm Open PhpStorm Menu Perferences -> Plugins -> Browser Repositories Search “Symfony Plugin” Install -> OK Install phpunit6 & Setup wget -O phpunit https://phar.phpunit.de/phpunit-6.phar chmod +x phpunit ./phpunit –version Perferences -> Languages & Framworks -> PHP -> Test Frameworks Click “+” -> “PHPUnit Local”…
Homebrew install web development envirment
Nginx brew install nginx PHP brew install php71 brew install homebrew/php/php71-pcntl brew install homebrew/php/php71-xdebug MySQL brew install mysql
PHP Composer
https://getcomposer.org/ Installation curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer Use Chinese Packagist composer config -g repo.packagist composer https://packagist.phpcomposer.com
doctrine createQueryBuilder count and not exists
$qb = $this->o->createQueryBuilder(‘o’); $sub = $this->em->createQueryBuilder(); $sub->select(“o.id”); //notice this : cause e.offer is foreign key of o.id $sub->from(ExcludedByOffer::class, “e”); $sub->andWhere(‘e.offer = o.id’) ->andWhere(‘e.aff = :aff’); $qb->select(‘count(o.id)’) ->where(‘o.adv=:adv’) ->andWhere($qb->expr()->not($qb->expr()->exists($sub->getDQL()))) ->setParameters([‘adv’ => $adv, ‘aff’ => $aff ]); return $qb->getQuery()->getSingleScalarResult(); 参考 https://stackoverflow.com/questions/31536137/doctrine-not-exists-subquery/31536545 https://stackoverflow.com/questions/9214471/count-rows-in-doctrine-querybuilder
Mac os 上用C++进行MYSQL开发配置
下载boost: https://sourceforge.net/projects/boost/?source=typ_redirect 安装boost: 解压安装 ./bootstrap.sh ./b2 ./b2 install 在github下载安装mysql-connector-cpp: git clone https://github.com/mysql/mysql-connector-cpp cd mysql-connector-cpp/ cmake . make clean make make install 在xcode中进行项目配置 3.项目配置 3.1 Header Search Paths加 /usr/local/include /usr/local/mysql/include 3.2 Library Search Paths加 /usr/local/lib /usr/local/mysql/lib 3.1 Other Linker Flags加 -lmysqlcppconn -lm -lmysqlclient -lz 参考: http://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-distribution.html http://blog.csdn.net/abcjennifer/article/details/16983929 http://www.cnblogs.com/lchb/articles/3510082.html
Xcode + yaml-cpp 开发配置
下载安装: yams-cpp release 0.5.3, 支持 yaml 1.2标准, 比老版本语法更优雅 https://github.com/jbeder/yaml-cpp 解压至yaml-cpp-release-0.5.3 复制代码 cd yaml-cpp-release-0.5.3 mkdir build cd build cmake .. make make install 复制代码 确认include文件安装到/usr/local/include中,文件夹为 yaml-cpp 创建测试文件: main.cpp内容如下 复制代码 #include #include #include <yaml-cpp/yaml.h> #include int main(int argc, const char * argv[]) { // insert code here… YAML::Node config = YAML::LoadFile(“config.yaml”); const std::string username = config[“username”].as(); const…