PHP code example of flyokai / magento-amp-mate

1. Go to this page and download the library: Download flyokai/magento-amp-mate 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/ */

    

flyokai / magento-amp-mate example snippets


use Flyokai\MagentoAmpMate\MageCache\Data\AmpStreamReader;

$reader = new AmpStreamReader();
$reader->parseStream($stream);

$meta = $reader->getMeta();   // first line: serialised metadata
$data = $reader->getData();   // remainder: cache payload