PHP Classes

MIME Stub: Generate PHP script that can self-execute the code

Recommend this page to a friend!
  Info   Example   Demos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 134 All time: 9,300 This week: 206Up
Version Licenses PHP version Categories
mime-stub 1.0.2BSD License, MIT/...5PHP 5, Language, Parsers
Description 

Authors

Romain Cambien
Riverline
Till Wehowski


Contributor

This package can generate a PHP script that can self-execute the code.

It generate PHP script files that have a section after the code that calls PHP __halt_compiler function, so scripts may append data that includes other PHP script files.

The generated files have a MIME structure to include multiple parts of files of the scripts to be loaded and executed by the first part of the generated script before calling the __halt_compiler function.

Innovation Award
PHP Programming Innovation award nominee
September 2017
Number 6
This package can generate a PHP script that can self-execute the code.

Manuel Lemos
Picture of Till Wehowski
  Performance   Level  
Name: Till Wehowski <contact>
Classes: 30 packages by
Country: Germany Germany
Age: 45
All time rank: 107269 in Germany Germany
Week rank: 49 Up3 in Germany Germany Up
Innovation award
Innovation award
Nominee: 12x

Example

<?php
$vm
= \webfan\MimeStubAPC::vm();

// echo print_r($vm, true);


$newFile = __DIR__. DIRECTORY_SEPARATOR . 'test-my-install-index.php';

$a = <<<PHPE
echo '<br />TEST-modified.';
PHPE;

$vm->get_file($vm->document, '$HOME/index.php', 'stub index.php')
  ->
append($a)
;


$fcont = <<<PHP
Content-Type: image/x-icon
Content-Disposition: httpd ;filename="\$HOME/\$WEB/images/apc.ico";name="\$WEB /images/apc.ico"




PHP;
 
$fcont.= file_get_contents('http://webfan.de/cdn/frdl/flow/components/frdl/webfan/icon.ico');
$attachPart = $vm->get_file($vm->document, '$__FILE__/attach.zip', 'archive attach.zip');
$attachPart->append($fcont); // test-my-install-index.php?web=/images/apc.ico



    
 
$fcont = <<<PHP
Content-Type: application/x-httpd-php;charset=utf-8
Content-Disposition: httpd ;filename="\$HOME/\$WEBtest.php";name="\$WEB test.php"




<?php
\$test = new \webfan\InstallShield\apc\Test();
\$test->run();

PHP;
 

$attachPart->append($fcont); // test-my-install-index.php?web=test.php

    
    



$vm->location = $newFile; // this saves the stub-php-file to $newFile

//Test the new stub and call/run the $newFile, should be like calling the file in the browser!
require $newFile;
$run($newFile);


  APC Install Demo [old version, replaced soon]External page  
  Files folder image Files (22)  
File Role Description
Files folder imagesrc (1 file, 2 directories)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (22)  /  src  
File Role Description
Files folder imageRiverline (1 directory)
Files folder imagewebfan (2 files, 2 directories)
  Accessible without login Plain text file MimeStubIndex.php Class Class source

  Files folder image Files (22)  /  src  /  Riverline  
File Role Description
Files folder imageMultiPartParser (1 file)

  Files folder image Files (22)  /  src  /  Riverline  /  MultiPartParser  
File Role Description
  Accessible without login Plain text file Part.php Class Class source

  Files folder image Files (22)  /  src  /  webfan  
File Role Description
Files folder imagehps (1 directory)
Files folder imageMime (1 file)
  Accessible without login Plain text file MimeStub.php Class Class source
  Accessible without login Plain text file MimeStubAPC.php Class Class source

  Files folder image Files (22)  /  src  /  webfan  /  hps  
File Role Description
Files folder imageCompile (2 files)

  Files folder image Files (22)  /  src  /  webfan  /  hps  /  Compile  
File Role Description
  Accessible without login Plain text file MimeStub.php Class Class source
  Accessible without login Plain text file MimeStub2.php Class Class source

  Files folder image Files (22)  /  src  /  webfan  /  Mime  
File Role Description
  Accessible without login Plain text file vm.php Class Class source

  Files folder image Files (22)  /  tests  
File Role Description
Files folder imagedata (7 files)
Files folder imageRiverline (1 directory)
  Accessible without login Plain text file bootstrap.php Example Example script
  Accessible without login Plain text file test.mime-stub.php Example Example script

  Files folder image Files (22)  /  tests  /  data  
File Role Description
  Accessible without login Plain text file email_base64.txt Doc. Documentation
  Accessible without login Plain text file nested_multipart.txt Doc. Documentation
  Accessible without login Plain text file no_boundary.txt Doc. Documentation
  Accessible without login Plain text file no_first_boundary.txt Doc. Documentation
  Accessible without login Plain text file no_last_boundary.txt Doc. Documentation
  Accessible without login Plain text file no_multipart.txt Doc. Documentation
  Accessible without login Plain text file simple_multipart.txt Doc. Documentation

  Files folder image Files (22)  /  tests  /  Riverline  
File Role Description
Files folder imageMultiPartParser (1 file)

  Files folder image Files (22)  /  tests  /  Riverline  /  MultiPartParser  
File Role Description
  Accessible without login Plain text file PartTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:134
This week:0
All time:9,300
This week:206Up