This page starts the install proces of one task or all tasks in "todo" state.

@Action
@Logged

@param string $selfedit If true, we are in self-edit mode
14250
public function install($selfedit = 'false', $task = null) {
		$this->selfedit = $selfedit;
		$this->installService = new ComposerInstaller($selfedit == 'true');
		
		if ($task !== null) {
			$taskArray = unserialize($task);
		} else {
			$taskArray = null;
		}
		
		if ($taskArray == null) {
			$this->installService->installAll();
		} else {
			$this->installService->install($taskArray);
		}
		// The call to install or installAll redirects to printInstallationScreen.
	}
124157
protected function executeRebuildActions($action = 'beforeRebuild')
    {
        if (!isset($this->rebuildActionClasses)) {
            $this->initRebuildActions();
        }

        if (isset($this->rebuildActionClasses[$action])) {
            foreach ($this->rebuildActionClasses[$action] as $rebuildActionClass) {
                $rebuildActionClass->$action();
            }
        }
    }
526253
public function onUpdatedProposeUpdateTask()
    {
        /* @var $task Task */
        $task = $this->em
            ->getRepository('AnimeDbAppBundle:Task')
            ->findOneBy(['command' => 'animedb:propose-update']);

        $next_run = new \DateTime();
        $next_run->modify(sprintf('+%s seconds  01:00:00', ProposeUpdateCommand::INERVAL_UPDATE));

        $this->em->persist($task->setNextRun($next_run));
        $this->em->flush();
    }
1005145
public function delete(Task $task): void
    {
        $id = $task->getId();

        $task->setId(null);

        $this->client->delete($this->prepareUrlForKey('delete-task', ['id' => $id]));
    }
606033
public function register_task($task)
    {
        if ($this->api->register_task($task, $this->ID)) {
            $this->mytask = $task;
        }
    }
283953
public function edit(TaskRequest $request, Task $task)
    {
        return $this->response->title(trans('app.edit') . ' ' . trans('task::task.name'))
            ->view('task::task.edit', true)
            ->data(compact('task'))
            ->output();
    }
291245
public function index($selfedit = false) {
		$this->selfedit = $selfedit;
		$this->installService = new ComposerInstaller($selfedit == 'true');
		$this->installs = $this->installService->getInstallTasks();
		//var_dump($this->installs);exit;
		$this->countNbTodo = 0;
		foreach ($this->installs as $installTask) {
			if ($installTask->getStatus() == AbstractInstallTask::STATUS_TODO) {
				$this->countNbTodo++;
			}
		}

		$this->contentBlock->addFile(dirname(__FILE__)."/../../views/installer/installTasksList.php", $this);
		$this->template->toHtml();	
	}
561933
public function addTask(Task $t)
    {
        if ($this->nestedTask !== null) {
            throw new BuildException(
                'The retry task container accepts a single nested task'
                . ' (which may be a sequential task container)'
            );
        }
        $this->nestedTask = $t;
    }
665265
public function getRedirectUrl($selfEdit) {
		$url = $this->getUrl();
		if (strpos($url, "?") !== false) {
			$url .= "&selfedit=".($selfEdit?"true":"false");
		} else {
			$url .= "?selfedit=".($selfEdit?"true":"false");
		}
		return $url;
	}
1324861
private function spawn(Task $task)
    {
        $config      = $this->getTensideConfig();
        $home        = $this->getTensideHome();
        $commandline = PhpProcessSpawner::create($config, $home)->spawn(
            [
                $this->get('tenside.cli_script')->cliExecutable(),
                'tenside:runtask',
                $task->getId(),
                '-v',
                '--no-interaction'
            ]
        );

        $this->get('logger')->debug('SPAWN CLI: ' . $commandline->getCommandLine());
        $commandline->setTimeout(0);
        $commandline->start();
        if (!$commandline->isRunning()) {
            // We might end up here when the process has been forked.
            // If exit code is neither 0 nor null, we have a problem here.
            if ($exitCode = $commandline->getExitCode()) {
                /** @var LoggerInterface $logger */
                $logger = $this->get('logger');
                $logger->error('Failed to execute "' . $commandline->getCommandLine() . '"');
                $logger->error('Exit code: ' . $commandline->getExitCode());
                $logger->error('Output: ' . $commandline->getOutput());
                $logger->error('Error output: ' . $commandline->getErrorOutput());
                throw new \RuntimeException(
                    sprintf(
                        'Spawning process task %s resulted in exit code %s',
                        $task->getId(),
                        $exitCode
                    )
                );
            }
        }

        $commandline->wait();
    }
114910
public function docs($dest = null)
    {
        if (!$dest) {
            $dest = __DIR__ . '/../peridot-php.github.io';
        }
        $src = __DIR__ . '/docs';
        $this->taskDeleteDir([
            $dest . '/docs',
            $src
        ])->run();
        $this->taskExec('apigen generate')->run();
        $this->taskCopyDir([
            $src => $dest . '/docs'
        ])->run();
        $this->taskDeleteDir([$src])->run();
    }
746678
public function tasksEdit($task, $site = null)
    {
        if (!count($task)) {
            throw new \InvalidArgumentException(
                'Parameter `task` must contain a data'
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            "/tasks/{$task['id']}/edit",
            "POST",
            $this->fillSite(
                $site,
                ['task' => json_encode($task)]
            )
        );
    }
146656
public function deleteConstant($name, $selfedit = "false") {
		$this->selfedit = $selfedit;
		
		if ($selfedit == "true") {
			$this->moufManager = MoufManager::getMoufManager();
		} else {
			$this->moufManager = MoufManager::getMoufManagerHiddenInstance();
		}
		$this->configManager = $this->moufManager->getConfigManager();
		
		$this->configManager->unregisterConstant($name);
		
		$this->moufManager->rewriteMouf();

		// Now, let's write the constant for our environment:
		$this->constantsList = $this->configManager->getDefinedConstants();
		unset($this->constantsList[$name]);
		$this->configManager->setDefinedConstants($this->constantsList);
		
		
		header("Location: .?selfedit=".$selfedit);
	}
393269
public function restart($taskId) {
		if ($this->TaskClient->restart($taskId)) {
			$this->Session->setFlash("Task $taskId will be restarted shortly", 'alert/simple', array(
				'class' => 'alert-success', 'title' => 'Ok!'
			));
		} else {
			$this->Session->setFlash("Can't restart task $taskId!", 'alert/simple', array(
				'class' => 'alert-error', 'title' => 'Error!'
			));
		}
		$this->redirect($this->referer());
	}
1005890
public function newInstance($selfedit = "false", $instanceName=null, $instanceClass=null) {
        //$componentsList = Moufspector::getComponentsList();
        $this->selfedit = $selfedit;
        $componentsList = MoufReflectionProxy::getComponentsList($selfedit=="true");
        sort($componentsList);

        $template = $this->template;
        $template->addContentFunction(array($this, "displayNewInstanceScreen"), $componentsList, $selfedit, $instanceName, $instanceClass);
        //$template->addContentFile(dirname(__FILE__)."/../views/displayNewInstance.php", $this);
        $template->toHtml();
    }
543
public void addTask (ExecutorTask task)
    {
        for (int ii=0, nn=_queue.size(); ii < nn; ii++) {
            ExecutorTask taskOnQueue = _queue.get(ii);
            if (taskOnQueue.merge(task)) {
                return;
            }
        }

        // otherwise, add it on
        _queue.add(task);

        // and perhaps start it going now
        if (!_executingNow) {
            checkNext();
        }
    }
563745
public function newInstanceByCallback($selfedit = "false", $instanceName=null) {
        $this->instanceName = $instanceName;
        $this->selfedit = $selfedit;

        $this->contentBlock->addFile(dirname(__FILE__)."/../../views/instances/newInstanceByCallback.php", $this);
        $this->template->toHtml();
    }