PHP code example of droath / robo-google-lighthouse

1. Go to this page and download the library: Download droath/robo-google-lighthouse 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/ */

    

droath / robo-google-lighthouse example snippets


 
	use Droath\RoboGoogleLighthouse\Task\loadTasks;
   	
   $url = 'https://google.com';
   $path = '/tmp/example.html';
   $this->taskGoogleLighthouse()
        ->setUrl($url)
        ->performanceTestOnly()
        ->setOutputPath($path)
        ->run();

 
	use Droath\RoboGoogleLighthouse\Task\loadTasks;
   	
   $url = 'https://google.com';
   $path = '/tmp/example.json';
   $this->taskGoogleLighthouse()
        ->setUrl($url)
        ->setOutput('json')
        ->setOutputPath($path)
        ->run();