Overview

Classes

  • Packager_Common_Base
  • Packager_Common_StaticCopies
  • Packager_Phar
  • Packager_Phar_ResultCompleter
  • Packager_Php
  • Packager_Php_Base
  • Packager_Php_Completer
  • Packager_Php_Scripts_Completer
  • Packager_Php_Scripts_Dependencies
  • Packager_Php_Scripts_Order
  • Packager_Php_Scripts_Replacer
  • Packager_Php_Wrapper
  • Packager_Php_Wrapper_DirectoryIterator
  • Packager_Php_Wrapper_SplFileInfo

Exceptions

  • Packager_Php_Scripts_Throwable
  • Overview
  • Class
  • Tree
  • Todo
  • Deprecated
  • Download

Class Packager_Php

Packager_Common_Base
Extended by Packager_Common_StaticCopies
Extended by Packager_Php_Base
Extended by Packager_Php_Scripts_Completer
Extended by Packager_Php_Scripts_Order
Extended by Packager_Php_Scripts_Dependencies
Extended by Packager_Php_Completer
Extended by Packager_Php
Located at src/Packager/Php.php
Methods summary
public static Packager_Php
# Create( array $cfg = [] )

Create singleton instance with configuration

Create singleton instance with configuration

Parameters

$cfg

Returns

Packager_Php

Overrides

Packager_Common_Base::Create()
public static Packager_Php
# Get( array $cfg = [] )

Get instance and merge configuration or create singleton instance with configuration

Get instance and merge configuration or create singleton instance with configuration

Parameters

$cfg

Returns

Packager_Php

Overrides

Packager_Common_Base::Get()
public Packager_Php
# SetSourceDir( string $fullOrRelativePath = '' )

Set application sources directory

Set application sources directory

Parameters

$fullOrRelativePath

Returns

Packager_Php

Overrides

Packager_Common_Base::SetSourceDir()
public Packager_Phar
# SetReleaseDir( string $fullOrRelativePath = '' )

Set compilation result(s) directory, all files will be removed first.

Set compilation result(s) directory, all files will be removed first.

Parameters

$fullOrRelativePath

Returns

Packager_Phar

Overrides

Packager_Common_Base::SetReleaseDir()
public Packager_Phar
# SetReleaseFileName( string $releaseFileName = '/index.php' )

Set compilation result PHP script file name, '/index.php` by default.

Set compilation result PHP script file name, '/index.php` by default.

Parameters

$releaseFileName

Returns

Packager_Phar

Overrides

Packager_Common_Base::SetReleaseFileName()
public Packager_Php
# SetExcludePatterns( array|string $excludePatterns = [] )

Set preg_replace() patterns array or single string about which files or folders will be excluded from result file. Function replace all previous configuration records.

Set preg_replace() patterns array or single string about which files or folders will be excluded from result file. Function replace all previous configuration records.

Parameters

$excludePatterns

Returns

Packager_Php

Overrides

Packager_Common_Base::SetExcludePatterns()
public Packager_Php
# AddExcludePatterns( array|string $excludePatterns = [] )

Add preg_replace() patterns array or single string about which files or folders will be excluded from result file.

Add preg_replace() patterns array or single string about which files or folders will be excluded from result file.

Parameters

$excludePatterns

Returns

Packager_Php

Overrides

Packager_Common_Base::AddExcludePatterns()
public Packager_Php
# SetPatternReplacements( array $patternReplacements = [] )

Set patterns/replacements array about what will be replaced in *.php and *.phtml files by preg_replace(pattern, replacement, source) before possible minification process. Function replace all previous configuration records.

Set patterns/replacements array about what will be replaced in *.php and *.phtml files by preg_replace(pattern, replacement, source) before possible minification process. Function replace all previous configuration records.

Parameters

$patternReplacements

Returns

Packager_Php

Overrides

Packager_Common_Base::SetPatternReplacements()
public Packager_Php
# AddPatternReplacements( array $patternReplacements = [] )

Add patterns/replacements array about what will be replaced in *.php and *.phtml files by preg_replace(pattern, replacement, source) before possible minification process.

Add patterns/replacements array about what will be replaced in *.php and *.phtml files by preg_replace(pattern, replacement, source) before possible minification process.

Parameters

$patternReplacements

Returns

Packager_Php

Overrides

Packager_Common_Base::AddPatternReplacements()
public Packager_Php
# SetStringReplacements( array $stringReplacements = [] )

Set str_replace() key/value array about what will be simply replaced in result file. Function replace all previous configuration records.

Set str_replace() key/value array about what will be simply replaced in result file. Function replace all previous configuration records.

Parameters

$stringReplacements

Returns

Packager_Php

Overrides

Packager_Common_Base::SetStringReplacements()
public Packager_Php
# AddStringReplacements( array $stringReplacements = [] )

Add str_replace() key/value array about what will be simply replaced in result file.

Add str_replace() key/value array about what will be simply replaced in result file.

Parameters

$stringReplacements

Returns

Packager_Php

Overrides

Packager_Common_Base::AddStringReplacements()
public Packager_Php
# SetIncludeFirst( array|string $includeFirst = [] )

Set list of relative PHP file path(s) from application document root to include in result file as first, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param Function replace all previous configuration records.

Set list of relative PHP file path(s) from application document root to include in result file as first, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param Function replace all previous configuration records.

Parameters

$includeFirst

Returns

Packager_Php

Overrides

Packager_Common_Base::SetIncludeFirst()
public Packager_Php
# AddIncludeFirst( array|string $includeFirst = [], string $mode = 'append' )

Add list of relative PHP file path(s) from application document root to include in result file as first, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param.

Add list of relative PHP file path(s) from application document root to include in result file as first, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param.

Parameters

$includeFirst
$mode
'append' or 'prepend'

Returns

Packager_Php

Overrides

Packager_Common_Base::AddIncludeFirst()
public Packager_Php
# SetIncludeLast( array|string $includeLast = [] )

Set list of relative PHP file path(s) from application document root to include in result file as last, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param Function replace all previous configuration records.

Set list of relative PHP file path(s) from application document root to include in result file as last, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param Function replace all previous configuration records.

Parameters

$includeLast

Returns

Packager_Php

Overrides

Packager_Common_Base::SetIncludeLast()
public Packager_Php
# AddIncludeLast( array|string $includeLast = [], string $mode = 'append' )

Add list of relative PHP file path(s) from application document root to include in result file as last, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param. By default, there is initialized by default "index.php" file to include as last, see Packager_Php::SetIncludeLastDefault() to overwrite it or use (new Packager_Php)->SetIncludeLast() to overwrite it.

Add list of relative PHP file path(s) from application document root to include in result file as last, after everything will be included by automatic order determination. List will be prepended or appended before or after existing list by second param. By default, there is initialized by default "index.php" file to include as last, see Packager_Php::SetIncludeLastDefault() to overwrite it or use (new Packager_Php)->SetIncludeLast() to overwrite it.

Parameters

$includeLast
$mode
'append' or 'prepend'

Returns

Packager_Php

Overrides

Packager_Common_Base::AddIncludeLast()
public Packager_Php
# SetMinifyTemplates( string $minifyTemplates = TRUE )

Set boolean if *.phtml templates will be minimized before saving into result file

Set boolean if *.phtml templates will be minimized before saving into result file

Parameters

$minifyTemplates

Returns

Packager_Php

Overrides

Packager_Common_Base::SetMinifyTemplates()
public Packager_Php
# SetMinifyPhp( string $minifyPhp = TRUE )

Set boolean if *.php scripts will be minimized before saving into result file

Set boolean if *.php scripts will be minimized before saving into result file

Parameters

$minifyPhp

Returns

Packager_Php

Overrides

Packager_Common_Base::SetMinifyPhp()
public Packager_Php
# SetPhpFileSystemMode( string $fsMode = self::FS_MODE_PRESERVE_HDD )

Set mode for wrapper class how to behave when any replaced file system php function will be called - it here will be searching in memory and after in HDD or HDD first and then memory or no memory or no HDD.

Set mode for wrapper class how to behave when any replaced file system php function will be called - it here will be searching in memory and after in HDD or HDD first and then memory or no memory or no HDD.

Parameters

$fsMode

Returns

Packager_Php

Overrides

Packager_Common_Base::SetPhpFileSystemMode()
public Packager_Php
# SetAutoloadingOrderDetection( boolean $enabled = TRUE )

Enable or disable PHP files order detection by autoloader(s), by MvcCore startup.php autoloader or by startup.php and composer autoloader.

Enable or disable PHP files order detection by autoloader(s), by MvcCore startup.php autoloader or by startup.php and composer autoloader.

Parameters

$enabled

Returns

Packager_Php

Overrides

Packager_Common_Base::SetAutoloadingOrderDetection()
public Packager_Php
# ReplacePhpFunctions( )

Define all php functions you want to replace with internal php file calls as strings, named functions will not be used in original way to read/write anything from hard drive, all specified functions will be replaced with wrapper calls to give results from memory variables. It's possible to name 'include' and 'require', but all 'include_once' and 'require_once' are replaced automatically if there is safely detected line content - string only, no variables inside

Define all php functions you want to replace with internal php file calls as strings, named functions will not be used in original way to read/write anything from hard drive, all specified functions will be replaced with wrapper calls to give results from memory variables. It's possible to name 'include' and 'require', but all 'include_once' and 'require_once' are replaced automatically if there is safely detected line content - string only, no variables inside

Returns

Packager_Php

Overrides

Packager_Common_Base::ReplacePhpFunctions()
public Packager_Php
# KeepPhpFunctions( string $phpFuncStr,… )

Define all php functions you don't want to replace with internal php file calls as strings, named functions will be used in original way to read/write anything from hard drive. It's possible to name 'include' and 'require', but all 'include_once' and 'require_once' are replaced automatically if there is safely detected line content - string only, no variables inside

Define all php functions you don't want to replace with internal php file calls as strings, named functions will be used in original way to read/write anything from hard drive. It's possible to name 'include' and 'require', but all 'include_once' and 'require_once' are replaced automatically if there is safely detected line content - string only, no variables inside

Parameters

$phpFuncStr,…

Returns

Packager_Php

Overrides

Packager_Common_Base::KeepPhpFunctions()
public Packager_Php
# SetStaticCopies( array $staticCopies = [/* '/from-dir' => '/to-dir', '/filename', '/dirname' */] )

Set array with statically copied files or directories from ./development to ./release directory. If key is numeric, source and destination relative path are the same. If key is string, source relative path is defined by array key and destination relative path is defined by array value.

Set array with statically copied files or directories from ./development to ./release directory. If key is numeric, source and destination relative path are the same. If key is string, source relative path is defined by array key and destination relative path is defined by array value.

Parameters

$staticCopies

Returns

Packager_Php

Overrides

Packager_Common_Base::SetStaticCopies()
public Packager_Php
# MergeConfiguration( array $cfg = [] )

Merge multilevel configuration array with previously initialized values. New values sent into this function will be used as preferred.

Merge multilevel configuration array with previously initialized values. New values sent into this function will be used as preferred.

Parameters

$cfg

Returns

Packager_Php

Overrides

Packager_Common_Base::MergeConfiguration()
public Packager_Php
# Run( )

Run PHP compilation process, print output to CLI or browser.

Run PHP compilation process, print output to CLI or browser.

Returns

Packager_Php

Overrides

Packager_Php_Base::Run()
Methods inherited from Packager_Php_Completer
autoloadJob(), mainJob(), notify()
Methods inherited from Packager_Php_Scripts_Dependencies
AutoloadCall(), CompleteIncludedFilesByTargetFile(), completePhpFilesDependencies(), completePhpFilesDependenciesByAutoloadDeclaration()
Methods inherited from Packager_Php_Scripts_Order
completePhpFilesOrder()
Methods inherited from Packager_Php_Scripts_Completer
completeWrapperCode(), processPatternAndStringReplacements(), processScriptsPhpCode()
Methods inherited from Packager_Php_Base
SetExcludePatternsDefault(), SetIncludeFirstDefault(), SetIncludeLastDefault(), __construct()
Methods inherited from Packager_Common_StaticCopies
cleanReleaseDir(), copyStaticFilesAndFolders()
Methods inherited from Packager_Common_Base
AddIncludePatterns(), ErrorHandler(), ExceptionHandler(), PreRun(), PrintFilesToPack(), SetIncludePatterns(), SetKeepPhpDocComments(), ShutdownHandler(), completeAllFiles(), completeJobAndParams(), decodeJson(), encodeFilesToUtf8(), excludeFilesByCfg(), executeJobAndGetResult(), sendJsonResultAndExit(), sendResult(), shrinkPhpCode(), shrinkPhpCodeReducePhpDocComment()
Constants summary
string FS_MODE_PRESERVE_HDD
# 'PHP_PRESERVE_HDD'
string FS_MODE_PRESERVE_PACKAGE
# 'PHP_PRESERVE_PACKAGE'
string FS_MODE_STRICT_HDD
# 'PHP_STRICT_HDD'
string FS_MODE_STRICT_PACKAGE
# 'PHP_STRICT_PACKAGE'
string FS_MODE_PHP_LIBRARY
# 'PHP_LIBRARY'
Constants inherited from Packager_Php_Base
NAMESPACE_GLOBAL_CURLY_BRACKETS, NAMESPACE_NAMED_CURLY_BRACKETS, NAMESPACE_NAMED_SEMICOLONS, NAMESPACE_NONE, PACKAGER_COMMAND_FUNCTION, PACKAGER_COMMAND_REPLACEMENTS_OFF, PACKAGER_COMMAND_REPLACEMENTS_ON
Properties inherited from Packager_Php_Scripts_Dependencies
$composerClassLoader, $includedFiles
Properties inherited from Packager_Php_Base
$anyPhpContainsNamespace, $errorReportingLevelDefault, $excludePatternsDefault, $filesPhpDependencies, $filesPhpOrder, $globalNamespaceOpened, $includeFirstDefault, $includeLastDefault, $phpReplacementsStatistics, $result, $resultFilesContents, $resultFilesInfo, $unsafeOrderDetection, $wrapperClassName, $wrapperCode, $wrapperInternalElementsDependencies, $wrapperReplacements, $wrapperStringDeclarator
Properties inherited from Packager_Common_StaticCopies
$staticallyCopiedFiles
Properties inherited from Packager_Common_Base
$autoLoadedFiles, $cfg, $cliScriptName, $compilationType, $errorHandlerData, $errorResponse, $exceptionsMessages, $exceptionsTraces, $fileTypesStoringTypes, $files, $includedFilesCountTillNow, $instance, $templatesExtensions
Packager API Documentation API documentation generated by ApiGen