Modify ↓
Ticket #422 (closed defect: invalid)
Using TaskDef with file gives error
| Reported by: | kontakt@… | Owned by: | mrook |
|---|---|---|---|
| Priority: | major | Milestone: | 2.4.1 |
| Component: | phing-core | Version: | devel |
| Keywords: | Cc: |
Description
I use a task-def like this:
<taskdef file="./library/Doctrine/Extensions/Phing/Task/InstallSql.php" classname="Doctrine\Extensions\Phing\Task\InstallSql" />
With a Task:
class InstallSql extends AbstractDoctrineTask
{
protected $taskName = "dc2-install-sql";
//...
It gives me an error:
benny@benny-pc:~/code/php/wsnetbeans/whitewashing$ phing
Buildfile: /home/benny/code/php/wsnetbeans/whitewashing/build.xml
Task has no class defined.
[PHP Error] include_once("dc2-install-sql";.php): failed to open stream: No such file or directory [line 1017 of /usr/local/php531/lib/php/phing/Phing.php]
[PHP Error] include_once(): Failed opening '"dc2-install-sql";.php' for inclusion (include_path='/usr/local/php531/lib/php/Pearanha/Pearanha/Phing:/home/benny/code/php/wsnetbeans/whitewashing/library/Whitewashing/Phing:.:/usr/local/php531/lib/php') [line 1017 of /usr/local/php531/lib/php/phing/Phing.php]
[taskdef] Error importing "dc2-install-sql";.php
BUILD FAILED
Error reading project file [wrapped: Error importing "dc2-install-sql";.php]
Total time: 0.0736 seconds
Attachments
Change History
comment:2 Changed 2 years ago by mrook
- Status changed from new to closed
- Resolution set to invalid
When the 'file' attribute is specified, taskdef expects that attribute to point to a file listing task definitions, in the form of "mytask=My.Namespace.MyTask". Both dot-notation and PEAR style naming (My_Namespace_MyTask) are supported.
Note: See
TracTickets for help on using
tickets.

Either the docs or the code is wrong. TaskDef seems to include a properties file and load tasks from there, the docs say otherwise.
The problem is, namespaced code is not supported and i want to include the file and have the class registered automatically.