Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foreach with filelist causes fatal error #1103

Closed
AKhrulev opened this issue Aug 1, 2019 · 2 comments
Closed

foreach with filelist causes fatal error #1103

AKhrulev opened this issue Aug 1, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@AKhrulev
Copy link

AKhrulev commented Aug 1, 2019

Versions: both 2.16.1 and phing-3.0.0-alpha2
PHP versions: tested on 7.2, 5.6 (on 5.6 error does not interrupt execution)
Steps:

  1. create two files in same folder

build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="TestBug" default="build" >
	<target name="build" depends="" >
		<foreach param="build.type" target="T1">
			<filelist listfile="list.txt"/>
		</foreach>
	</target>
	<target name = "T1" depends="" >
		<echo message = "In target T1" />
	</target>
</project>

list.txt

foobar
  1. Launch build.xml in Phing

Actual result: Fatal error

Argument 2 passed to ForeachTask::process() must be an instance of PhingFile, null given, called in phar://D:/var/bin/phing-3.0.0-alpha2.phar/classes/phing/tasks/system/ForeachTask.php on line 181

@mrook mrook self-assigned this Aug 1, 2019
@mrook mrook added this to the 3.0.0-alpha3 milestone Aug 1, 2019
@mrook
Copy link
Member

mrook commented Aug 1, 2019

Confirmed.

@mrook
Copy link
Member

mrook commented Aug 1, 2019

This is caused by filelist expecting a dir attribute to be filled, but it's not actively checked or enforced. I'll see how we can improve that :-)

@mrook mrook closed this as completed in 643d73c Aug 2, 2019
@siad007 siad007 added the defect label Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants