phar.getstub(3) php man page | unix.com

Man Page: phar.getstub

Operating Environment: php

Section: 3

PHAR.GETSTUB(3) 							 1							   PHAR.GETSTUB(3)

Phar::getStub - Return the PHP loader or bootstrap stub of a Phar archive

SYNOPSIS
public string Phar::getStub (void )
DESCRIPTION
Phar archives contain a bootstrap loader, or stub written in PHP that is executed when the archive is executed in PHP either via include: <?php include 'myphar.phar'; ?> php myphar.phar
RETURN VALUES
Returns a string containing the contents of the bootstrap loader (stub) of the current Phar archive.
ERRORS
/EXCEPTIONS Throws RuntimeException if it is not possible to read the stub from the Phar archive.
EXAMPLES
Example #1 A Phar.getStub(3) example <?php $p = new Phar('/path/to/my.phar', 0, 'my.phar'); echo $p->getStub(); echo "==NEXT== "; $p->setStub("<?php function __autoload($class) { include 'phar://' . str_replace('_', '/', $class); } Phar::mapPhar('myphar.phar'); include 'phar://myphar.phar/startup.php'; __HALT_COMPILER(); ?>"); echo $p->getStub(); ?> The above example will output: <?php __HALT_COMPILER(); ?> ==NEXT== <?php function __autoload($class) { include 'phar://' . str_replace('_', '/', $class); } Phar::mapPhar('myphar.phar'); include 'phar://myphar.phar/startup.php'; __HALT_COMPILER(); ?>
SEE ALSO
Phar.setStub(3), Phar.createDefaultStub(3). PHP Documentation Group PHAR.GETSTUB(3)
Related Man Pages
pharfileinfo.delmetadata(3) - php
phar.setstub(3) - php
phar.setmetadata(3) - php
phar.getmetadata(3) - php
phar.extractto(3) - php
Similar Topics in the Unix Linux Community
Compile error for PHP with msql
TCPDF 2.2.003 (PHP5 branch)
Need Number Format Help in PHP
php file is not executed
Validation in php help !