天道酬勤,学无止境

ubersvn

SVN 发布/预提交钩子以检查 Windows 上的 php 语法(SVN post/pre commit hook to check php syntax on windows)

问题 我最近将我的 SVN 服务器迁移到了 Windows 服务器。 一切都进行得非常顺利——好得令人难以置信——所以结果出来了。 我有/有一个预提交钩子,它对提交的任何 PHP 文件运行语法检查,如果检查失败,则拒绝提交并显示合适的错误消息 - 我将在下面复制它。 显然这在 Windows 上不起作用,我也找不到替代方法。 外面有人有东西吗? 我真的不知道从哪里开始转换以下内容以在 Windows 系统上运行,特别是考虑到它依赖的 *nix 工具的数量:-S 我已经阅读了关于使用 Codesniffer 之类的东西进行 PHP 检查的预提交钩子 - 是我最好/最简单的路线吗? #!/bin/bash REPOS="$1" TXN="$2" PHP="/usr/bin/php" SVNLOOK=/var/www/UberSVN/ubersvn/bin/svnlook CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | awk '{print $2}'` ERRORSA=0 for LINE in $CHANGED do FILE=`echo $LINE | egrep \\.php$` if [ $? == 0 ] then MESSAGE=`$SVNLOOK cat -t "$TXN" "$REPOS" "${FILE}" | $PHP

2021-11-08 20:37:25    分类:技术分享    php   svn   ubersvn

SVN post/pre commit hook to check php syntax on windows

I have recently migrated my SVN server to a windows server. It all went very smoothly - it was too good to be true - so it turned out. I have/had a pre-commit hook which ran a syntax check on any PHP file committed and rejected the commit with a suitable error message if it failed the check - I will copy this below. Obviously this does not work on Windows, and I have not been able to find an alternative which does. Does anyone out there have anything? I wouldn't really know where to start converting the below to run on a Windows system, expecially given the number of *nix tools it is reliant

2021-11-07 18:33:20    分类:问答    php   svn   ubersvn