Phing, звоните, команда получают ее вывод в свойство

Большая причина это удобно, когда Вы должны обновить данные в многомиллионной таблице строки, но не хотите восстанавливать их. "Удалите *", взял бы навсегда, тогда как влияние производительности Усеченных будет незначительно.

6
задан Stefano Borini 4 December 2009 в 03:37
поделиться

1 ответ

You might need to create your own task for this. The task may look something like...

<?php
require_once "phing/Task.php";

class VersionNumberTask extends Task
{
    private $versionprop;

    public function setVersionProp($versionprop)
    {
        $this->versionprop = $versionprop;
    }

    public function init()
    {
    }

    public function main()
    {
        // read the version text file in to a variable
        $version = file_get_contents("version.txt");
        $this->project->setProperty($this->versionprop, $version);
    }
}

Then you would define the task in your build xml

<taskdef classname="VersionNumberTask" name="versiontask" />

Then call the task

<target name="dist">
    <versiontask versionprop="version.number"/>
</target>

At this point, you should be able to access the version number using ${version.number} throughout your build xml.

Hope this helps!

6
ответ дан 8 December 2019 в 04:08
поделиться
Другие вопросы по тегам:

Похожие вопросы: