PHP code example of massive / build-bundle

1. Go to this page and download the library: Download massive/build-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

massive / build-bundle example snippets




namespace My\Web\Application;

use Massive\Bundle\BuildBundle\Build\BuilderInterface;

class MyBuilder implements BuilderInterface
{
    protected $context;

    public function getName()
    {
        return 'mybuildername';
    }

    public function getDependencies()
    {
        return array();
    }

    public function build()
    {
        $application = $this->context->getApplication();
        $input = $this->context->getInput();
        $output = $this->context->getOutput();

        $output->writeln('Hello World!');
    }

    public function setContext(BuilderContext $context)
    {
        $this->context = $context;
    }
}



namespace Sulu\Bundle\CoreBundle\Command;

use Massive\Bundle\BuildBundle\Command\BuildCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

class SuluBuildCommand extends BuildCommand
{
    public function configure()
    {
        parent::configure();

        // change the name of the command from "massive:build"
        $this->setName('myapp:build');

        // add an option
        $this->addOption('destroy', null, InputOption::VALUE_NONE, 'Destroy existing data');
    }
}