xrstfComposer52Generator

The Yoast SEO xrstf Composer52 Generator class.

Defined (1)

The class is defined in the following location(s).

/vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php  
  1. class Generator { 
  2. public static function onPostInstallCmd(Event $event) { 
  3. $composer = $event->getComposer(); 
  4. $installationManager = $composer->getInstallationManager(); 
  5. $repoManager = $composer->getRepositoryManager(); 
  6. $localRepo = $repoManager->getLocalRepository(); 
  7. $package = $composer->getPackage(); 
  8. $config = $composer->getConfig(); 
  9.  
  10. // We can't gain access to the Command's input object, so we have to look 
  11. // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works 
  12. // (always returns an empty array), nor does Symfony's Console Input, as 
  13. // it expects a full definition of the current command line and we can't 
  14. // provide that. 
  15.  
  16. $args = $_SERVER['argv']; 
  17. $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args); 
  18.  
  19. $suffix = $config->get('autoloader-suffix'); 
  20.  
  21. $generator = new AutoloadGenerator(); 
  22. $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);