使用https方式访问github时报错

Aura PHP项目托管在github上,前天在google groups上看到邮件,说auraphp的基本类库已经就绪,开始使用aura.system装备所有包了。于是按照教程使用git命令下载aura.system。

$ git clone https://github.com/auraphp/system
Cloning into system...
error: error setting certificate verify locations:
  CAfile: /bin/curl-ca-bundle.crt
  CApath: none
 while accessing https://github.com/auraphp/system/info/refs

fatal: HTTP request failed

提示错误,额。。。我的环境是Win 7+MSYS Git,但是可以使用git方式下载源码:

$ git clone git://github.com/auraphp/system.git

没办法,第一次用github,所以又回到groups中提问,得到@Lee 的回复:

Are you on windows?
If so try this (you may need to change the path to curl-ca-bundle.crt):
git config —system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"

事实证明,Ta是对的。。。

ROY@ROY-PC ~
$ git config --system http.sslcainfo "C:\MinGW\msys\1.0\bin\curl-ca-bundle.crt"

ROY@ROY-PC ~
$ git clone https://github.com/auraphp/system
Cloning into system...
remote: Counting objects: 577, done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 577 (delta 323), reused 498 (delta 293)
Receiving objects: 100% (577/577), 398.26 KiB | 4 KiB/s, done.
Resolving deltas: 100% (323/323), done.

Propel ORM Plus Phing On Windows

今天试用了传说中的Propel,感觉相当好,果然是个不错的ORM。不过它依赖于Phing,正好这两个项目都是BullSoft关注的项目。现在我就来讲下如何配置环境,两个项目都支持Pear安装,但是今天无论如何也装不上Phing,所以就讲讲单独安装的过程吧。

1. 下载两个包

项目官方站地址分别是http://www.propelorm.orghttp://www.phing.info/trac/。由于Propel由两部分组成,一部分用于生成Model,一部分用于使用Model,所以在此我们把生成Model的部分提取出来,也就是propel的generator文件夹,改名为propel和phing统一放在D:\phing目录下。

2. 添用户自定义环境变量,把=号后面的改成你实际的环境

#PHP执行文件目录
PHP_COMMAND=d:\php\php.exe

//phing根目录
PHING_HOME=d:\phing\phing
#propel根目录
PROPEL_HOME=d:\phing\propel
//phing的类目录
PHP_CLASSPATH=d:\phing\phing\classes

Continue reading

how to sync files and directories with batch?

今天终于找到了一款可以在windows平台同步目录和文件的工具 – Sync,可以在batch中调用,不过是用java编写的,所以需要jre环境,而且必须是jre 6。官方地址在这里:http://sync9.software.informer.com/

主要的处理过程都在一个jar文件中,作者提供了源码。那么要在batch文件中使用,只需要通过一个Bat文件调用它就行了,如(假设sync.jar和sync.bat在同一级目录):

@echo off
rem -------------------------------------------------------------
rem  sync.bat - Windows batch file for convenient execution of Sync
rem  use force default
rem  Author: roy - roy@solarphp.cn - http://roygu.com
rem  copyright (c) 2010 - http://solarphp.cn - http://solarphp.org.cn
rem -------------------------------------------------------------

@setlocal
rem --set bin path
set BIN_PATH=%~dp0

rem --run it
java -jar "%BIN_PATH%sync.jar"  --force %*
@endlocal

这样就可以了,也就是说,我们不久就可以在windows xp、2000、2003中自由地使用solar了。

xdebug的安装

一直以来觉得安装xdebug很简单,但是今天才发现安装xdebug还是花了很多时间,记录一下:
在windows.php.net上看到(事实上我前面有一篇文章引用过http://roygu.com/?p=584),windows下如果使用apache的话,PHP的版本是VC6,所以这里Xdebug都使用VC6。而PHP5.3与之前的挂载方式也有变化,在PHP5.3中,不管是NTS还是TS都使用zend_extension方式挂载,而PHP5.3以前,TS使用zend_extension_ts方式挂载,NTS使用zend_extension_nts挂载。下面是示例:
Continue reading