Overview

Classes

  • Packager_Common_Base
  • 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
  • Overview
  • Class
  • Tree

Class Packager_Php

Packager_Common_Base
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 packager/src/Packager/Php.php
Methods summary
public static Packager_Php
# Create( array $cfg = array() )

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 = array() )

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_Php
# SetReleaseFile( string $releaseFileFullPath = '' )

Set compilation result file, if exist, it will be overwriten

Set compilation result file, if exist, it will be overwriten

Parameters

$releaseFileFullPath

Returns

Packager_Php

Overrides

Packager_Common_Base::SetReleaseFile()
public Packager_Php
# SetExcludePatterns( array|string $excludePatterns = array() )

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 = array() )

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 = array() )

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 = array() )

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 = array() )

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 = array() )

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 = array() )

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 = array(), 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 = array() )

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 = array(), 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 automaticly 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 automaticly 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 automaticly 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 automaticly 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
# MergeConfiguration( array $cfg = array() )

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

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

Parameters

$cfg

Returns

Packager_Php

Overrides

Packager_Common_Base::MergeConfiguration()
public Packager_Php
# Run( array $cfg = array() )

Run PHP compilation process, print output to CLI or browser

Run PHP compilation process, print output to CLI or browser

Parameters

$cfg

Returns

Packager_Php

Overrides

Packager_Php_Base::Run()
public
# PrintFilesToPack( array $cfg = array() )

Print all files included by exclude/include pattern rules directly to output

Print all files included by exclude/include pattern rules directly to output

Parameters

$cfg
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(), processPhpCode()
Methods inherited from Packager_Php_Base
SetExcludePatternsDefault(), SetIncludeFirstDefault(), SetIncludeLastDefault(), __construct()
Methods inherited from Packager_Common_Base
AddIncludePatterns(), ErrorHandler(), ExceptionHandler(), SetIncludePatterns(), SetRemovePhpDocComments(), ShutdownHandler(), completeAllFiles(), completeJobAndParams(), decodeJson(), 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'
Constants inherited from Packager_Php_Base
NAMESPACE_GLOBAL_CURLY_BRACKETS, NAMESPACE_NAMED_CURLY_BRACKETS, NAMESPACE_NAMED_SEMICOLONS, NAMESPACE_NONE
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_Base
$autoLoadedFiles, $cfg, $cliScriptName, $compilationType, $errorHandlerData, $errorResponse, $exceptionsMessages, $exceptionsTraces, $fileTypesStoringTypes, $files, $includedFilesCountTillNow, $instance, $templatesExtensions
MvcCore API documentation generated by ApiGen