phingofficial / phing Goto Github PK
View Code? Open in Web Editor NEWPHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.
Home Page: https://www.phing.info
License: GNU Lesser General Public License v3.0
PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.
Home Page: https://www.phing.info
License: GNU Lesser General Public License v3.0
Reproducable example:
Should do the same as:
mkdir empty
cd empty
mkdir empty
tar czvf empty.tar.gz empty
I like to have a task like the concat task in ANT, so you can merge to or more files into a single new file.
Maybe it is a good idea to describe how to integrate phing into CruiseControl.
phing.util.regexp.PregEngine->replace() tries to replace \1 with $1 but uses an incorrect match-string for it. Fix appended
Using mappers is currently broken and gives an error message:
''Fatal error: Argument 1 must be an object of class Project in /path/to/phing/2.2.0RC1/classes/phing/types/Mapper.php on line 52''
Mapper seems to be instantiated in {{{Project::createDataType()}}} with {{{$type = new $cls();}}} on line 650. However {{{Mapper::__construct()}}} requires an argument of type Project which is missing here and leads to the error message named above.
Changing the instantiation to {{{$type = new $cls($this);}}} doesn't help as other classes inherited from {{{DataType}}} expect other arguments on their constructor method.
Hi folks,
when I put the following lines in my build.xml file
{{{
I would expect that two files "OpenDocumentPHP-dev.zip" and "OpenDocumentPHP-dev.tar.gz" will be generated. So far so good. But when I look into these files I found some very nasty things:
This happend in a unix and in a windows enviroment.
Thanks,
Norman
If I enter title="DOC-TITLE" in the build file, the generated doc will have 'DOC-TITLE' as the title (with the quotes).
It looks like this is due to the function PHPDocumentorTask::constructArguments(), this line:
$arguments.= "-ti '" . $this->title . "' ";
I'm on a windows machine so the single-quotes can't be used to put a string for an argument. This error also prevents me from putting a space in the title. This seems to fix the problem:
$arguments.= '-ti "' . $this->title . '" ';
I reviewed the code with a colleague today and we're pretty sure that
the second solution I came up with is viable.
Normally, the rule is that !TaskHandler will only be used at the top
level of the buildfile (that is, in !ProjectHandler) or in targets
(!TargetHandler).
As soon as a Task has been set up in the target, everything below it is
handled by !NestedElementHandler (see !TaskHandler, about line 221). That
also applies to tags like : Property is a Task on its own, but
when used like
{{{
<phing phingfile="..." ...>
}}}
it is set up as a nested element (in the Phing task).
In order to execute "real" tasks -- that is those directly below
that really "do some work" --, all the Tasks they contain need
to be executed (and especially runtime-configured) before. From what
we've seen, these nested Tasks always seem to be "declarative" in nature
(like fileset, property etc). Additionally, the set of !NestedElements
allowed depends on the Task and is limited.
Now comes the exception from the rule: The handler used for setting up
the Tasks can switch back to a !TaskHandler only when the element at
hand is an instanceof !TaskContainer (see startElement() in
!NestedElementHandler and !TaskHandler). In this case, the tasks contained
are again treated like "main" tasks (directly below target).
Only Target and !SequentialTaskContainer implement !TaskContainer. Target
is obvious; !SequentialTaskContainer is only used by the if/then/else
construct. In other words, currently only if/then/else should allow for
an arbitrary set of elements below it, like does.
This makes us pretty sure that !TaskHandler is the only place where
unrelated "main" tasks start (and it only starts this kind of tasks).
Thus, we suggest removing lines 167-170 from !TaskHandler.php, which is
where these unrelated and new tasks hook up with their parent's runtime
configurable wrapper. The tasks will still call maybeConfigure
themselves when they start. That will defer the configuration until the
task really needs it.
Best regards,
Matthias
In the file: trunk/classes/phing/Project.php, there is a method _makeCircularException defined at line 840.
This method mentions a local variable $c, which is uninitialized and referenced only in the while of a do/while loop.
It seems that $c will never = $end and therefore the loop is infinite.
If I am correct, then I think it probably should be coded as:
{{{
function _makeCircularException($end, $stk) {
$sb = "Circular dependency: $end";
do {
$c = (string) array_pop($stk);
$sb .= " <- ".$c;
} while($c != $end);
return new BuildException($sb);
}
}}}
Thanks, Scott Pascoe
There are a number of E_STRICT errors which can be seen when running in -verbose mode. (w/ PHP 5.1.x)
Hi folks,
i saw that in the generated code coverage reports all & will be converted to "& amp ;". That is a good idea, but not if you want an ">" => "&g t ;" => "& amp ;gt;" ...
Thanks in advance
Norman
Document the If task and conditions
In classes/phing/types/FileList.php, the method getListFile has no parameters and yet references $p
without defining it.
Unfortunately, I'm not sure how to fix it, but it probably needs to be corrected.
The user guide is not up-to-date: the whole includepath task and the classpath attribute of the nested phpunit2/batchtest tag are missing.
Setting includeEmptyDirs="true" in the task doesn't seem to make any difference.
The built-in property list has several mistakes.
http://phing.info/docs/guide/current/chapters/appendixes/AppendixA-FactSheet.html#BuiltInProperties
These supposedly properties aren't set:
phing.buildfile (phing.file is set instead), phing.id, project.name (phing.project.name is set instead), project.description
These properties aren't mentioned in the list:
env.???, host.os, os.name (seems to be the same as host.os), phing.home (although it has no value on a PEAR install)
These properties have wrong descriptions:
host.arch, host.machine, host.name
And while we're at it, for a good alphabetical listing, the php properties should be after the phing properties and "project.name" should be the last project property of the list. :P
Hi folks,
i saw this on some of my code reports this morning. Look at the folling if statment:
if (x > 0) {
//foo
} else {
// bar
}
The code coverage report tells me that it handled the foo-part and the bar-part and also the if-part but tells me, it doesn't cover the else-part. This will lead to wrong coverage outputs even when it is summed up.
Thanks in advance
Norman
Hi, I've notice a really strange behavior in the task PhingTask with the ''dir'' property.
I've a build.properties with only one property inside :
{{{
propel.generator.home = Libraries\propel-1.2.0RC1\generator
}}}
And in my build file I try to call an other build like this :
{{{
}}}
When I run my build I get this error statment :
{{{
[phing] Error reading project file [wrapped: Cannot fopen C:\MyProject\Libraries\propel-1.2.0RC1\generator\Libraries\prope
l-1.2.0RC1\generator\build.xml. failed to open stream: No such file or directory]
}}}
As you can see the ''propel.generator.home'' property have been duplicated twice in the final search path.
I've browse the source and found that the mistake is located in the ''PhingTask.php'' file, line 218. Here is the code :
{{{
if ($this->dir !== null) {
$this->newProject->setBasedir($this->dir);
if ($savedDir !== null) { // has been set explicitly
$this->newProject->setInheritedProperty("project.basedir", $this->dir->getAbsolutePath());
}
} else {
$this->dir = $this->getProject()->getBaseDir();
}
}}}
After some tests I've seen that the $this->dir value is correct before the ''$this->newProject->setBaseDir'' call but wrong right after. I've checked the setBasedir of the project class, but I don't understand the side effect that cause this problem.
Temporary I've solved this by changing the code in the like this :
{{{
if ($this->dir !== null) {
$this->newProject->setBasedir($this->dir);
// [DK] Correction of a strange bug. I don't understand what's going on, but the dir is changed by the setBasedir call.
$this->dir = $this->newProject->getBasedir();
if ($savedDir !== null) { // has been set explicitly
$this->newProject->setInheritedProperty("project.basedir", $this->dir->getAbsolutePath());
}
} else {
$this->dir = $this->getProject()->getBaseDir();
}
}}}
Hope this will help you guys and thanks again for this great product that is phing !
http://www.phing.info/ shows the default Apache website. Made me very nervous for a little while this morning ...
Is there a way to get this working?
In classes/phing/parser/TaskHanlder.php,
Line 152:
{{{
$configurator->configureId($task, $attrs);
}}}
Should be
{{{
$configurator->configureId($this->task, $attrs);
}}}
Thanks, Scott
The phing CLI script uses bash syntax, but its shebang line points to sh. This works on Linux, where sh is usually just a variant of bash. However it will '''not run at all''' on more traditional UNIXes like Solaris.
this:
{{{
export PHP_COMMAND="/usr/local/bin/php"
}}}
should be:
{{{
PHP_COMMAND=/usr/local/bin/php
export PHP_COMMAND
}}}
This is a tiny mistake; but it has a big impact!
PHPUnit2Util::getDefinedClasses issues a notice:
[PHP Error] Undefined index: ... [line 111 of /usr/share/pear/phing/tasks/ext/phpunit2/PHPUnit2Util.php]
Line 111 should be replaced with:
$declaredClasses = array_merge(get_declared_interfaces(), get_declared_classes());
I use the current svn version 1.3.0 on a local windows machine.
Both, the and tasks seems to doesn't work.
The throws an exception with the message, that it failed to parse the output of 'svn info'.
The tasks do nothing. I get the message that it exports the repository to my directory, but this is always empty.
In Path::listPaths
when looking at a DirSet
object, Line 264, has a couple of problems.
addUnlessPresent
defined anywhere.I think that Line 264 should probably be removed, but don't know that for certain.
{{{
$this->addUnlessPresent($result, $dir, $s);
}}}
Thanks, Scott
Using mappers is currently broken and gives an error message:
''Fatal error: Argument 1 must be an object of class Project in /path/to/phing/2.2.0RC1/classes/phing/types/Mapper.php on line 52''
Mapper seems to be instantiated in {{{Project::createDataType()}}} with {{{$type = new $cls();}}} on line 650. However {{{Mapper::__construct()}}} requires an argument of type Project which is missing here and leads to the error message named above.
Changing the instantiation to {{{$type = new $cls($this);}}} doesn't help as other classes inherited from {{{DataType}}} expect other arguments on their constructor method.
C:\vx\tests\unit>phing
Buildfile: C:\vx\tests\unit\build.xml
Fatal error: Class XMLPHPUnit2ResultFormatter contains 1 abstract method and mus
t therefore be declared abstract or implement the remaining methods (PHPUnit2_Fr
amework_TestListener::addSkippedTest) in c:\php\PEAR\phing\tasks\ext\phpunit2\XM
LPHPUnit2ResultFormatter.php on line 37
... SNIP ...
Fatal error: Class PlainPHPUnit2ResultFormatter contains 1 abstract method and m
ust therefore be declared abstract or implement the remaining methods (PHPUnit2_
Framework_TestListener::addSkippedTest) in c:\php\PEAR\phing\tasks\ext\phpunit2
PlainPHPUnit2ResultFormatter.php on line 116
C:\vx\tests\unit>pear list
PACKAGE VERSION STATE
Archive_Tar 1.3.1 stable
Archive_Zip 0.1.1 beta
Auth_SASL 1.0.1 stable
Benchmark 1.2.6 stable
Cache 1.5.4 stable
Cache_Lite 1.7.0 stable
Config 1.10.6 stable
Console_Getopt 1.2 stable
Console_Table 1.0.4 stable
DB 1.7.6 stable
DB_DataObject 1.8.4 stable
DB_NestedSet 1.2.4 stable
Date 1.4.6 stable
File 1.2.2 stable
HTML_Common 1.2.2 stable
HTML_Javascript 1.1.1 stable
HTML_QuickForm 3.2.5 stable
HTML_Template_Flexy 1.2.4 stable
HTML_Template_Sigma 1.1.4 stable
HTML_TreeMenu 1.2.0 stable
HTTP 1.4.0 stable
HTTP_Download 1.1.1 stable
HTTP_Header 1.2.0 stable
HTTP_Request 1.3.0 stable
HTTP_Session2 0.2.0 alpha
HTTP_SessionServer 0.5.0 alpha
HTTP_Upload 0.9.1 stable
Image_Canvas 0.2.4 alpha
Image_Color 1.0.2 stable
Image_Graph 0.7.1 alpha
Image_GraphViz 1.1.0 stable
Image_Transform 0.9.0 alpha
Log 1.9.5 stable
MDB2 2.0.1 stable
MDB2_Driver_mysql 1.0.1 stable
MIME_Type 1.0.0 stable
Mail 1.1.10 stable
Mail_Mime 1.3.1 stable
Net_DIME 0.3 beta
Net_SMS 0.0.2 beta
Net_SMTP 1.2.8 stable
Net_Server 0.12.0 alpha
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
Net_UserAgent_Detect 2.2.0 stable
Numbers_Roman 0.2.0 stable
Numbers_Words 0.14.0 beta
PEAR 1.4.6 stable
PEAR_Frontend_Web 0.4 beta
PEAR_PackageFileManager 1.5.2 stable
PHPUnit 1.3.2 stable
PHPUnit2 3.0.0alpha2 alpha
PHP_Beautifier 0.1.7 beta
PHP_Compat 1.5.0 stable
PHP_CompatInfo 1.0.0 stable
Pager 2.4.0 stable
PhpDocumentor 1.3.0RC6 beta
SOAP 0.9.1 beta
Services_ABR 0.1.0 beta
Services_OpenSearch 0.0.2 alpha
System_Command 1.0.5 stable
Text_Diff 0.2.1 beta
Text_Highlighter 0.6.5 beta
Text_Password 1.1.0 stable
Text_Statistics 1.0 stable
Text_TeXHyphen 0.1.0 alpha
Validate 0.6.1 beta
Validate_AT 0.5.0 alpha
Validate_AU 0.1.2 alpha
XML_Beautifier 1.1 stable
XML_DTD 0.4.2 alpha
XML_FastCreate 1.0.3 stable
XML_Feed_Parser 0.2.5alpha alpha
XML_Feed_Writer 0.0.7 alpha
XML_HTMLSax 2.1.2 stable
XML_Parser 1.2.7 stable
XML_RPC 1.4.8 stable
XML_RSS 0.9.2 stable
XML_Serializer 0.16.0 beta
XML_Tree 2.0.0RC2 beta
XML_Util 1.1.1 stable
seagull 0.4.6 beta
Would be very nice for Continous Integration
The Lint task fails for me because the files to syntax check are not found, at least when I use a fileset with a directory different from ".". Seems that when the Lint task creates the file list, the fileset base path is ommitted.
Changing line 46 of tasks/ext/PhpLintTask.php to
$this->lint($fs->getDir($this->project)->getPath() . '/' . $file);
fixes this problem, though I am not sure if this will work all the time. For me, it does, however.
Cannot import class file located in a directory named that includes dot(such as "Foo-x.y.z\FooTask.php").
I propose a solution to fix it.
{{{
Phing::import() {
:
$path = strtr($dotPath, '.', DIRECTORY_SEPARATOR) . ".php";
:
}
}}}
to
{{{
Phing::import() {
:
$dotClassname = basename($dotPath);
$dotClassnamePos = strlen($dotPath) - strlen($dotClassname);
$classFile = strtr($dotClassname, '.', DIRECTORY_SEPARATOR) . ".php";
$path = substr_replace($dotPath, $classFile, $dotClassnamePos);
:
}
}}}
If I have zend.ze1_compatibility_mode = On in my php.ini phing gives me such error:
Fatal error: Call to a member function startElement() on a non-object in c:\usr\php5\PEAR\phing\parser\AbstractSAXParser.php on line 77
This happes in 2.2RC1 and RC2, PHP 5.0.2, 5.1.2 and 5.1.4.
If I turn this option off and run phing with -debug parameter I get many errors about static call of non-static methods:
[PHP Error] Non-static method ProjectConfigurator::configure() should not be called statically, assuming $this from incompatible context [line 92 of c:\usr\php5
\PEAR\phing\RuntimeConfigurable.php]
My system:
Windows XPSP2, PHP 5.1.4, phing 2.2RC2, pear 1.4.9
Hi folks,
after upgrading from phpDocumentor 1.3.0RC5 to RC6 the following line:
doesn't work any more. After a downgrade, everything works again. Maybe something in RC6 has changed? I couldn't investigate any further right now.
Thanks,
Norman
The IfTask is prematurely configured when it is not contained within a target.
Simple reproduction:
{{{
The above will always echo "Yeah, the property was set!" regardless of whether the property was actually set.
Currently if the ''basedir'' attribute is set, then a include-all fileset is created at that directory. Arguably, this is "supposed" to happen, but it creates some bugs that are hard to track down, in the event that you do something like this for your !TarTask:
{{{
In that case the {{{app/cache}}} directory '''will''' be included, because a fileset that includes it has been created automatically.
The appropriate fix - to bring this inline with documentation - for this is probably to only create this other fileset if there is none specified in the tar task.
both API docs (current and 2.2.0) down :&
The PEAR package Phing build script is using the phing.home reserved property, which points to the currently used Phing -- and not the new Phing package.
The install process via pear on the current home page results in an installation that's missing the phing.php and/or Phing.php in the php include path. Upgrading to pear 1.4.7 seems to fix the problem.
Also, your version dropdown is lacking 2.2.0RC1, which is the version I saw this bug on.
Stop watching the Steve-note and upgrade! :)
The Lint task does not seem to be defined in tasks/default.properties yet.
Adding
to build.xml is a workaround for the moment.
In the user guide PropertyTask example, the properties are inserted into the attributes with the dollar sign after the opening curly bracket, instead of before like it should be:
http://phing.info/docs/guide/current/chapters/appendixes/AppendixB-CoreTasks.html#PropertyTask
I'm new to Phing and this simple mistake made me lose lots of time.
I want to execute SQL code on a Oracle 10gR2 base but the Oracle driver throws an exception:
{{{
ORA-00911: invalid character
}}}
So I looked to the code and found that the trailing delimiter is not removed. Mysql doesn't care about it but Oracle does.
This is the patch I use to fix it:
{{{
--- classes/phing/tasks/ext/CreoleSQLExecTask.php (revision 31)
+++ classes/phing/tasks/ext/CreoleSQLExecTask.php (copie de travail)
@@ -390,7 +390,7 @@
|| $this->delimiterType == self::DELIM_ROW
&& $line == $this->delimiter) {
$this->log("SQL: " . $sql, PROJECT_MSG_VERBOSE);
$this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter)), $out);
$this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter)) - 1, $out);
$sql = "";
}
}
I don't think many of you use this task but it would be cool to fix that for us in the next release.
Thanks
In the phing/pear/build.xml file, the property phing.home is set with the override attribute set to false. The property is never set because phing.home is set at startup. Because of this, you can't use this build file to create a pear package from source files other than the phing sources you're currently using.
To fix this, the build file can be modified so that it uses a property with a different name or the override attribute can be set to true. This can have side-effects however if the phing.home property is ever used by some other tasks.
'''[2.2.0RC1]'''
Hi folks!
Got always a
{{{
PHP Error Phing::inlcude_once(\myLogger.php):
failed to open stream:
Invalid argument [line 860 of D:\PHP\phing-2.2.0RC1\classes\phing\Phing.php]
}}}
Two thinks might be helpful:
First, the path of the file is ''myLogger.php'' is ''D:\PHP\OpenDocumentPHP\poc\src\myLogger.php5''.
Secound, the error occurs when phing executes this part of the build.xml:
{{{
}}}
Thanks in advance,
Norman.
(This ticket is being create after after the patch has already been applied so that we can track this in the changelog.)
Original work committed by mrook in changeset:107
In the main headline: "Welcome to the Phing Poject Website"
The word "Poject" should be "Project"
with -debug flag the phing emits tons of warnings. most regarding the wrong use of static/instance access calls. this errors makes it impossible to debug phing. please remove them before 2.2.0 release.
The IntrospectionHelper is checking return values in phpdoc comments for possible class names and does a check with class_exists(). This will cause {{{__autoload()}}} to be called if defined. Since this code has no reason to call {{{__autoload()}}} it shouldn't since it would most likely break. Typically {{{@return void}}} etc.
The fix is to set the second parameter to {{{class_exists}}} to false to ensure that {{{__autoload()}}} is never called.
This issue was discovered running code coverage of PRADO trunk.
Hello,
Currently the PHPUnit2Task and the CoverageReportTask tasks do not support PUnit2_Framework_TestSuite and PHPUnit2_Extensions_TestSetup sub-classes. We should enhance the tasks to allow such constructs.
Optional we can wait for phpunit 3.0 which has โ as far as I know - an advanced build-in code coverage mechanism.
Cheers,
Bernd
From Sebastian Bergmann:
For PHPUnit 3.0 I changed the result format of the
PHPUnit2_Framework_TestResult::getCodeCoverageInformation() method from
array(
"testCase" => array(
"/tested/code.php" => array(
linenumber => flag
)
)
)
to
array(
array(
'test' => PHPUnit2_Framework_Test
'files' => array(
"/tested/code.php" => array(
linenumber => flag
)
)
)
)
The user guide's resolvepath example uses the element 'resolve' instead of 'resolvepath':
http://phing.info/docs/guide/current/chapters/appendixes/AppendixB-CoreTasks.html#ResolvePathTask
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.