Overview

This project is closed and read-only.

This FLOW3 package is useful to process exisisting PHP 5.3+ based code to another code pase. Concretely we use this for example to keep the Fluid extension shipped with TYPO3 in sync with the corresponding FLOW3 package

Usage

  1. Checkout the latest version of this package from the git repository
  2. Create a new FLOW3 package and create a Command that makes use of the provided CodeProcessors (have a look at the Fluid Backporter for an example

Example:

class BackporterCommandController extends \TYPO3\FLOW3\Cli\CommandController {

    /**
     * @var \TYPO3\Backporter\Backporter
     * @FLOW3\Inject
     */
    protected $backporter;

    /**
     * Describe your command
     *
     * @return string
     */
    public function runCommand() {

            // Key of the target extension
        $this->backporter->setExtensionKey('<extensionKey>');

            // remove all files from target directory whenever backporter is invoked?
        $this->backporter->emptyTargetPath(FALSE);

            // global replacements
        $this->backporter->setReplacePairs(array(
            'replace' => 'me'
        ));

            // file specific replacements
        $this->backporter->setFileSpecificReplacePairs(array(
            'Classes/SomeClass.php' => array(
                'replace' => 'me'
            )
        ));

            // which files to include for the backport (regular expressions)
        $this->backporter->setIncludeFilePatterns(array(
            '#^Classes/.*$#',
            '#^Resources/.*$#',
        ));

            // which files to exclude from backporting (regular expressions)
        $this->backporter->setIncludeFilePatterns(array(
            '#^Classes/IgnoreThisClass.php*$#',
        ));

            // start backporter
        $this->backporter->processFiles('PackagePath', 'ExtensionPath');

        $this->outputLine('Ready.');
    }

Issue tracking

View all issues | Calendar | Gantt

Members

Leader

Bastian Waidelich (bwaidelich)
Sebastian Kurfuerst (sebastian)

Member

Christian Kuhn (lolli)