Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

StubGenerator

kherge edited this page Mar 11, 2013 · 6 revisions

To slightly simplify the stub generating process, the Herrera\Box\StubGenerator class was created.

API

StubGenerator alias(string $alias)

Sets the alias to be used in phar:// URLs.

This value is used with either Phar::mapPhar() or Phar::webPhar().

StubGenerator create()

Creates a new instance of the stub generator.

<?php $generator = StubGenerator::create();

StubGenerator index(string $index)

Sets location within the Phar of index script.

  • If using Phar::webPhar(), this value will be passed to that method.
  • If not using Phar::webPhar(), the script will be require()'d at the end of the stub.

StubGenerator intercept(boolean $intercept)

Use the Phar::interceptFileFuncs() method in the stub?

string generate()

Generates the stub.

StubGenerator mimetypes(array $mimetypes)

Sets the map for file extensions and their mimetypes.

This value is requires the use of Phar::webServer().

StubGenerator mung(array $list)

Sets the list of server variables to modify.

This value is passed to Phar::mungServer().

StubGenerator notFound(string $script)

Sets the location of the script to run when a file is not found.

This value is requires the use of Phar::webServer().

StubGenerator rewrite(string $function)

Sets the rewrite function name, since Closures cannot be converted to strings.

This value is requires the use of Phar::webServer().

StubGenerator web(boolean $web)

Use Phar::webPhar() instead of Phar::mapPhar()?