Пример #1
0
 /**
  * @param string $filename
  * @return string
  */
 public function buildAction($filename)
 {
     $parts = pathinfo($filename);
     $name = str_replace('..', '.', $parts['basename']);
     $name = trim($name, '.');
     $extensionKey = pathinfo($filename, PATHINFO_FILENAME);
     $author = 'Your Name <*****@*****.**>';
     $title = 'Provider extension for Fluid Powered TYPO3';
     $description = 'Provides templates for pages and content';
     $controllers = true;
     $pages = true;
     $content = true;
     $backend = false;
     $vhs = true;
     $dry = false;
     $verbose = false;
     $temporaryBaseFolder = GeneralUtility::getFileAbsFileName('typo3temp/builder/' . uniqid('provider_'));
     $temporaryFolder = $temporaryBaseFolder . '/' . $extensionKey;
     $archiveFilePathAndFilename = $temporaryBaseFolder . '/' . $extensionKey . '.zip';
     GeneralUtility::mkdir_deep($temporaryBaseFolder);
     $generator = $this->extensionService->buildProviderExtensionGenerator($extensionKey, $author, $title, $description, $controllers, $pages, $content, $backend, $vhs);
     $generator->setVerbose($verbose);
     $generator->setDry($dry);
     $generator->setTargetFolder($temporaryFolder);
     $generator->generate();
     $packCommand = 'cd ' . $temporaryBaseFolder . ' && zip -r "' . $extensionKey . '.zip" "' . $extensionKey . '"';
     exec($packCommand);
     header('Content-Type: application/zip');
     header('Content-Disposition: attachment; filename=' . $name);
     header('Content-Length: ' . filesize($archiveFilePathAndFilename));
     readfile($archiveFilePathAndFilename);
     exec('rm -rf ' . $temporaryBaseFolder);
     exit;
 }
Пример #2
0
 /**
  * @param string $name
  * @param string $author
  * @param string $title
  * @param string $description
  * @param boolean $controllers
  * @param boolean $pages
  * @param boolean $content
  * @param boolean $backend
  * @param boolean $vhs
  * @param boolean $fluidcontentCore
  * @param boolean $dry
  * @param boolean $verbose
  * @return void
  */
 public function buildAction($name, $author, $title, $description, $controllers, $pages, $content, $backend, $vhs, $fluidcontentCore, $dry, $verbose)
 {
     $generator = $this->extensionService->buildProviderExtensionGenerator($name, $author, $title, $description, $controllers, $pages, $content, $backend, $vhs, $fluidcontentCore);
     $generator->setVerbose($verbose);
     $generator->setDry($dry);
     if (false === $dry) {
         $generator->generate();
     }
     $this->view->assign('boolean', true);
     $this->view->assign('view', 'BuildForm');
     $this->view->assign('attributes', $this->arguments->getArrayCopy());
 }
 /**
  * Builds a ProviderExtension
  *
  * The resulting extension will contain source code
  * and configuration options needed by the various
  * toggles. Each of these toggles enable/disable
  * generation of source code and configuration for
  * that particular feature.
  *
  * @param string $extensionKey The extension key which should be generated. Must not exist.
  * @param string $author The author of the extension, in the format "Name Lastname <*****@*****.**>" with optional
  *                       company name, in which case form is "Name Lastname <*****@*****.**>, Company Name"
  * @param string $title Title of the resulting extension, by default "Provider extension for $enabledFeaturesList"
  * @param string $description Description for extension, by default "Provider extension for $enabledFeaturesList"
  * @param boolean $useVhs If TRUE, adds the VHS extension as dependency - recommended, on by default
  * @param boolean $useFluidcontentCore If TRUE adds FluidcontentCore as dependency - recommended, on by default
  * @param boolean $pages If TRUE, generates basic files for implementing Fluid Page templates
  * @param boolean $content IF TRUE, generates basic files for implementing Fluid Content templates
  * @param boolean $backend If TRUE, generates basic files for implementing Fluid Backend modules
  * @param boolean $controllers If TRUE, generates controllers for each enabled feature. Enabling $backend will
  *                             always generate a controller regardless of this toggle.
  * @param boolean $dry If TRUE performs a dry run without writing files;reports which files would have been written
  * @param boolean $verbose If FALSE, suppresses a lot of the otherwise output messages (to STDOUT)
  * @return void
  */
 public function providerExtensionCommand($extensionKey, $author, $title = null, $description = null, $useVhs = true, $useFluidcontentCore = true, $pages = true, $content = true, $backend = false, $controllers = true, $dry = false, $verbose = true)
 {
     $useVhs = (bool) $useVhs;
     $useFluidcontentCore = (bool) $useFluidcontentCore;
     $pages = (bool) $pages;
     $content = (bool) $content;
     $backend = (bool) $backend;
     $controllers = (bool) $controllers;
     $verbose = (bool) $verbose;
     $dry = (bool) $dry;
     $extensionGenerator = $this->extensionService->buildProviderExtensionGenerator($extensionKey, $author, $title, $description, $controllers, $pages, $content, $backend, $useVhs, $useFluidcontentCore);
     $extensionGenerator->setDry($dry);
     $extensionGenerator->setVerbose($verbose);
     $extensionGenerator->generate();
 }