PHP code example of zero1 / magento2-release-library
1. Go to this page and download the library: Download zero1/magento2-release-library 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/ */
zero1 / magento2-release-library example snippets
/** @var \Zero1\ReleaseLibrary\Utility **/
protected $setupUtility;
public function __construct(
\Zero1\ReleaseLibrary\Utility $setupUtility
){
$this->setupUtility = $setupUtility;
}
// configure setup utility to use my module
$this->setupUtility->setSourceModule('My_ReleaseModule);
// create all the blocks in `1.0.1`
$this->setupUtility->createBlocksFromDir(
$this->setupUtility->getBlockSourceDirectory().'/1.0.1/'
);
// configure setup utility to use my module
$this->setupUtility->setSourceModule('My_ReleaseModule);
// create all the pages in `1.0.1`
$this->setupUtility->createPagesFromDir(
$this->setupUtility->getPageSourceDirectory().'/1.0.1/'
);
$this->setupUtility->setConfig([
['design/head/demonotice', 1], // will be set at default
['web/cookie/cookie_httponly', 1] // will be set at default
['web/cookie/cookie_path', '/', 'stores', 1], // will be set for store 1
['web/cookie/cookie_path', '/', 'stores', 2], // will be set for store 2
]);