phing

Preprocessing PHP to remove functionality from built files

六眼飞鱼酱① 提交于 2020-01-01 10:08:18
问题 I've been reading about Phing and Ant and I'm not sure which, if either, of these tools are most useful for this scenario. It could easily be debug statements etc, but I'll give you our literal scanario. We have a free and premium version of a downloadable PHP app, and rather than including just a variable hidden somewhere and then doing: if($premium == true) { echo 'some additional functionality'; } else { echo 'basic functionality'; } Obviously someone could then take the source and change

PHP build/integration tools: Do you use them? [closed]

淺唱寂寞╮ 提交于 2019-12-31 10:20:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . After reading the "Modern PHP workflow" article in the November 2008 edition of php|architect magazine which discussed unit testing

Unable to globally install older version of phpunit phar

喜欢而已 提交于 2019-12-31 03:43:11
问题 As given in https://phpunit.de/manual/current/en/installation.html#installation.phar.verification, the steps to globally install the PHAR are: $ wget https://phar.phpunit.de/phpunit.phar $ chmod +x phpunit.phar $ sudo mv phpunit.phar /usr/local/bin/phpunit $ phpunit --version PHPUnit x.y.z by Sebastian Bergmann and contributors. I followed the above, but with the URL for the older version, i.e. https://phar.phpunit.de/phpunit-old.phar (because our PHP version is older). I ran the following

Installing Phing & PHPUnit on MAMP

回眸只為那壹抹淺笑 提交于 2019-12-30 05:35:10
问题 I'm having problems running phpunit under MAMP on OS X 10.6. I've installed phpunit via PEAR and it is exists in the MAMP directory but when I run phpunit in terminal nothing happens. I'm guessing that this is a path problem but as a os x newbie, I don't know how to fix it. This is what happens when I try to run it from /Applications/MAMP/bin/php5.3/bin $ phpunit -bash: /usr/bin/phpunit: No such file or directory $ ./phpunit $ The problem looks very similar to this How to Install phpunit 3.5

Unable to use here-document delimited by EOF within phing XML

◇◆丶佛笑我妖孽 提交于 2019-12-25 09:15:27
问题 I have some commands to be run after switching to a different user. I need to do this in a build xml file. Following is what I have done - <exec command="sudo su auto_deploy << EOF echo 'Logged in user' whoami EOF" dir="${dir.scratchpad}" /> I have used XML escaping, i.e. < for < . However, I am getting the following error - sh: warning: here-document at line 0 delimited by end-of-file (wanted `EOF') Related question - here-document gives 'unexpected end of file' error Update Note - I have

Hudson keeps failing with Phing AND Ant. Any hints?

久未见 提交于 2019-12-24 07:39:33
问题 Let's just skip right to the good stuff... errors I'm getting from the console when running Ant: phpunit: [exec] PHPUnit 3.2.16 by Sebastian Bergmann. [exec] [exec] Class /var/lib/hudson/jobs/Goals/workspace/Goals/AllTests could not be found in /var/lib/hudson/jobs/Goals/workspace/Goals/AllTests.php. [exec] Result: 1 phpcpd: [exec] The referenced parameter '--log-pmd=/var/lib/hudson/jobs/Goals/workspace/Goals/build/logs/pmd.xml' is not registered. [exec] Result: 1 pdepend: [exec] ALERT -

Phing String Manipulation

风格不统一 提交于 2019-12-23 12:42:36
问题 I have a Phing project that you pass in a parameter. I want to perform simple string manipulation on this parameter such a strtolower() or ucwords() etc. Any ideas how I can go about this? 回答1: How about using the PhpEvaLTask: <project name="StringTest" default="all" basedir="."> <target name="stringtest" description="test"> <php expression="strtolower(${param})" returnProperty="paramToLower"/> <php expression="ucwords(${param})" returnProperty="paramUcwords"/> <echo>To lower ${paramToLower}<

Phing, call a command get its output into a property

大兔子大兔子 提交于 2019-12-23 09:17:48
问题 I have a script that can lookup and output or write my current release # to a text file. Now the only problem is how do I get this version number into a PHING property. Right now my PHING target builds build.zip and built.tar, I would like it to build build-1.0.0.zip or whatever the version script decides the current version is. How can I do this? Will I have to create my own "task"? 回答1: You might need to create your own task for this. The task may look something like... <?php require_once

How to return a value from a phing target?

走远了吗. 提交于 2019-12-23 07:30:11
问题 I would like to have a foreach task like this, which iterates over all the files/directories in a directory "A" - <foreach param="dirname" absparam="absname" target="subtask"> <fileset dir="${dir.destination}/${dir.subdir}/"> <type type="file" /> </fileset> </foreach> The target "subtask" should check if the counterpart of the file/folder exists in another directory "B" (I am comparing directory A and B basically), and return either of the following if it does not - a flag. name of the file.

How to beautify the output of phing?

旧城冷巷雨未停 提交于 2019-12-23 02:36:33
问题 Phing, by default, or even with any of built-in loggers (phing.listener.NoBannerLogger, phing.listener.AnsiColorLogger, phing.listener.XmlLogger and phing.listener.HtmlColorLogger) has quite verbose output. My use-case is to use Phing for running tests as a pre-commit hook. Therefore I don't care about all that information in log phing may provide me. I just use it as a multiplatform tool for running tests. Example: Buildfile: /private/var/workspace/www/me_com/build.xml SBKSWWW > main: