File: create-phar.php

Recommend this page to a friend!
  Classes of Istvan Dobrentei  >  PHP OpenCart CLI  >  create-phar.php  >  Download  
File: create-phar.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP OpenCart CLI
Control an OpenCart installation from the console
Author: By
Last change:
Date: 1 year ago
Size: 455 bytes
 

Contents

Class file image Download
<?php
//run as php -dphar.readonly=0 create-phar.php
$pharFile = 'opencart-cli.phar';

if(
file_exists($pharFile)){
   
unlink($pharFile);
}
if(
file_exists($pharFile . '.gz')){
   
unlink($pharFile . '.gz');
}
$p = new Phar($pharFile);
$p->buildFromDirectory('src/');
$p->setDefaultStub('index.php', '/index.php');
$p->compress(Phar::GZ);
if(
file_exists($pharFile . '.gz')){
   
unlink($pharFile . '.gz');
}
echo
"$pharFile successfully created" . PHP_EOL;


For more information send a message to info at phpclasses dot org.