Initializes the task operations, i.e.
- Required information validation
- Working directory

@return void
@throws \BuildException
@throws IOException
423080
protected function prepare()
    {
        // Log
        $this->log('Initializing started ', $this->loglevel);

        ///// Validating the required parameters /////

        if (!in_array($this->type, self::$types)) {
            throw new BuildException('Type must be one of \'file\', \'dir\' or \'both\'.');
        }

        // Executable
        if ($this->commandline->getExecutable() === null) {
            $this->throwBuildException('Please provide "executable" information');
        }

        // Retrieving the current working directory
        $this->currentdirectory = getcwd();

        // Directory (in which the command should be executed)
        if ($this->dir !== null) {
            // Try expanding (any) symbolic links
            if (!$this->dir->getCanonicalFile()->isDirectory()) {
                $this->throwBuildException("'" . $this->dir . "' is not a valid directory");
            }

            // Change working directory
            $dirchangestatus = @chdir($this->dir->getPath());

            // Log
            $this->log(
                'Working directory change ' . ($dirchangestatus ? 'successful' : 'failed') . ' to ' . $this->dir->getPath(),
                $this->loglevel
            );
        }

        ///// Preparing the task environment /////

        // Getting current operationg system
        $this->currentos = Phing::getProperty('os.name');

        // Log
        $this->log('Operating System identified : ' . $this->currentos, $this->loglevel);

        // Getting the O.S. type identifier
        // Validating the 'filesystem' for determining the OS type [UNIX, WINNT and WIN32]
        // (Another usage could be with 'os.name' for determination)
        if ('WIN' === strtoupper(substr(Phing::getProperty('host.fstype'), 0, 3))) {
            $this->osvariant = 'WIN'; // Probable Windows flavour
        } else {
            $this->osvariant = 'LIN'; // Probable GNU/Linux flavour
        }

        // Log
        $this->log('Operating System variant identified : ' . $this->osvariant, $this->loglevel);

        if (count($this->filesets) === 0 && count($this->filelists) === 0 && count($this->getDirSets()) === 0) {
            throw new BuildException(
                "no resources specified",
                $this->getLocation()
            );
        }
        if ($this->targetFilePos !== null && $this->mapperElement === null) {
            throw new BuildException(
                "targetfile specified without mapper",
                $this->getLocation()
            );
        }
        if ($this->destDir !== null && $this->mapperElement === null) {
            throw new BuildException(
                "dest specified without mapper",
                $this->getLocation()
            );
        }

        if ($this->mapperElement !== null) {
            $this->mapper = $this->mapperElement->getImplementation();
            $this->log('Mapper identified : ' . get_class($this->mapper), $this->loglevel);
        }

        $this->commandline->setEscape($this->escape);

        // Log
        $this->log('Initializing completed ', $this->loglevel);
    }
611388
protected function initialize(): void
	{
		// Create container instance and register it in itself so that it can be injected

		$this->container = $this->containerFactory();

		$this->container->registerInstance([Container::class, 'container'], $this->container);

		// Register self so that the application instance can be injected

		$this->container->registerInstance([Application::class, 'app'], $this);

		// Register file system instance

		$this->container->registerInstance([FileSystem::class, 'fileSystem'], new FileSystem);

		// Register config instance

		$this->config = $this->configFactory();

		$this->container->registerInstance([Config::class, 'config'], $this->config);
	}
19253
public function init()
    {
        $paths = Phing::explodeIncludePath();
        foreach ($paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . 'Net' . DIRECTORY_SEPARATOR . 'FTP.php')) {
                return true;
            }
        }
        throw new BuildException('The FTP Deploy task requires the Net_FTP PEAR package.');
    }
1255268
protected function initProject() {
        $this->showHeader();
        Utils::getInstance()->createDirectory(['apps', 'bootstrap', 'config', 'public', 'tmp/tpl_compile', 'plugins']);
        foreach (self::FILES_BASE as $pathname => $contents) {
            Utils::getInstance()->createFile($pathname, $contents);
        }
        chmod("tmp", 775);
        chmod("tmp/tpl_compile", 775);
    }
116040
private function buildInitialize() {
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('Initializer, only called once per page load');
        $method->setName('initialize');
        $method->setReturnType('void');
        $method->setContent(
            '$this->setConnectionService(\'' . $this->getConfiguration()->getConnectionService() . '\');
		parent::initialize();
' . $this->buildValidation() . '
' . $this->buildRelationshipsBuffer() . '
' . $this->buildUpdateSkips()
        );
        $this->getAbstractClass()->addMethod($method);
    }
1186540
protected function init()
    {
        $this->data = new Collection();

        if ($this->defaultFile) {
            $file = $this->buildLangFilePath($this->defaultFile . '.' . $this->format);

            if (is_file($file)) {
                $this->data->load($file, $this->format);
            }
        }
    }
1361829
public function main()
    {
        if (!$this->defaultrequested && $this->add === "" && $this->remove === "" && !$this->echo) {
            throw new BuildException(
                "<defaultexcludes> task must set at least one attribute (echo=\"false\")"
                . " doesn't count since that is the default"
            );
        }
        if ($this->defaultrequested) {
            DirectoryScanner::resetDefaultExcludes();
        }
        if ($this->add !== "") {
            DirectoryScanner::addDefaultExclude($this->add);
        }
        if ($this->remove !== "") {
            DirectoryScanner::removeDefaultExclude($this->remove);
        }
        if ($this->echo) {
            $lineSep = Phing::getProperty('line.separator');
            $message = "Current Default Excludes:";
            $message .= $lineSep;
            $excludes = DirectoryScanner::getDefaultExcludes();
            $message .= "  ";
            $message .= implode($lineSep . "  ", $excludes);
            $this->log($message, $this->logLevel);
        }
    }
489491
public function init()
    {
        $this->cookiesFile = tempnam(sys_get_temp_dir(), 'WikiPublish.' . uniqid('', true) . '.cookies');

        $this->curl = curl_init();
        if (false === is_resource($this->curl)) {
            throw new BuildException('Curl init failed (' . $this->apiUrl . ')');
        }

        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookiesFile);
        curl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookiesFile);
    }
112270
protected function init(){
        //Carga las dependencias en base a la lista de archivos definidos en configuracion global
        $this->dependencies= array();
        foreach ($this->context->getDependenciesFile() as $nameFile) {
            $this->dependencies= array_merge($this->dependencies, $this->context->readConfigurationFile($nameFile));
        }
        //Define las dependencias que se cargan segun Type
        $this->loadDependencies= array();
        foreach ($this->dependencies as $key => $value) {
            if(isset($value['load_in'])){
                $this->loadDependencies[$key]= $value;
            }
        }
    }
53587
protected function initialize()
    {
        if ($this->initialized) {
            return;
        }

        $this->ensureDirectoryExists($this->directory, $this->create);
        $this->initialized = true;
    }
698565
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Automation::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Automation::class
        );
    }
1210837
protected function init()
    {
        foreach($this->excludePaths as $i => $path)
        {
            if(!$this->excludePaths[$i] = realpath($path))
            {
                unset($this->excludePaths[$i]);
            }
        }
        $this->excludeRule = implode('|', array_map('\Imi\Util\Imi::parseRule', $this->excludePaths));
        foreach($this->includePaths as $i => $path)
        {
            if(!$this->includePaths[$i] = $path = realpath($path))
            {
                unset($this->includePaths[$i]);
                continue;
            }
            $directory = new \RecursiveDirectoryIterator($path, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS);
            $iterator = new \RecursiveIteratorIterator($directory);
            if('' === $this->excludeRule)
            {
                foreach($iterator as $fileName => $fileInfo)
                {
                    $this->parseInitFile($fileName);
                }
            }
            else
            {
                $rule = "/^(?!{$this->excludeRule}).+$/i";
                $regex = new \RegexIterator($iterator, $rule, \RecursiveRegexIterator::GET_MATCH);
                foreach ($regex as $item)
                {
                    $this->parseInitFile($item[0]);
                }
            }
        }
    }
1029358
public function init()
    {
        $this->buildStore = Store\Factory::getStore('Build');
        $this->projectStore = Store\Factory::getStore('Project');
        $this->buildService = new BuildService($this->buildStore);
    }
426562
public function prepare()
    {
        $this->taskFileSystemStack()
             ->mkdir($this->getDistDir())
             ->mkdir($this->getTargetDir())
             ->mkdir($this->getReportsDir())
             ->run();
    }
140419
public function initialize()
    {
        $paths = App::path('Shell/Task', 'CodeBlastrQueue');
        foreach ($paths as $path) {
            $Folder = new Folder($path);
            $res = array_merge($this->tasks, $Folder->find('Queue.+\.php'));
            foreach ($res as &$r) {
                $r = 'CodeBlastrQueue.' . basename($r, 'Task.php');
            }
            $this->tasks = $res;
        }
        parent::initialize();
    }
951002
public void initialize() {
        val pair = buildLoggerContext(environment, resourceLoader);
        pair.ifPresent(it -> {
            this.logConfigurationFile = it.getKey();
            this.loggerContext = it.getValue();
        });
    }
1181852
private function initialize()
    {
        if ($this->initialized) {
            return;
        }

        if ($this->session->isStarted() && $this->session->get('stack') !== null) {
            $paths = $this->session->get('stack');
            $this->files = $this->hydrateList($paths);
        } else {
            $paths = $this->users->getCurrentUser()['stack'];
            $this->files = $this->hydrateList($paths);
            $this->session->set('stack', $this->persistableList());
        }

        $this->initialized = true;
    }