因为项目中使用swoole开发,一直使用win10 ubuntu子系统开发,随着代码量的增加,每次启动越来越慢。swoole官方提供了一个windows版swoole,启动速度特别快。但是由于其使用cgwin编译,所以无法正常使用composer,每次都需要切换php的环境变量。于是就想能不能让composer 识别我原来的php版本。打开composer的根文件试试真的可以。
composer文件: D:\Program Files\composer\composer
(1).原代码:
#!/bin/sh
dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)
if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
# We are in Cgywin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
fi
php "${dir}/composer.phar" "$@"(2).修改后代码
#!/bin/sh
dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)
if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
# We are in Cgywin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
fi
D:/phpStudy/PHPTutorial/php/php-7.0.12-nts/php "${dir}/composer.phar" "$@"只是将php的地址修改下即可,让composer每次加载我的phpstudy的php版本
1.全局用户信息设置 git config --global user.name gaojiufeng git config --global user.email 392223903...
1.远程仓库的协作模式开发者把自己最新的版本推到线上仓库,同时把线上仓库的最新代码,拉到自己本地即可2.注册git帐号国外: http://www.github.com国内: http://git.oschina.net2.在码云创建项目,不要初始化readmegit push https://gi...
日志查看:git log版本切换:方式1:git reset --hard HEAD^ 倒退一个版本git reset --hard HEAD^^ 倒退两个版本方式2:(版本号的形式,建议版本号码补充完...
1.关机Process.Start("shutdown", "-s -t 0"); 2. 注销 Proc...
public static string GetMD5(string str) { //创建MD5对象 MD5 md5 = MD5.C...
private const string fantizi = "高久峰是個程序員"; private const string jiantizi = "高久峰是个程序员...