PHP code example of pfaciana / includefile
1. Go to this page and download the library: Download pfaciana/includefile library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pfaciana / includefile example snippets
use Render\IncludeFile;
$!node_modules',
'!tests',
'!vendor',
] );
$baseDir = IncludeFile::add_trailing_slash( IncludeFile::normalize( __DIR__ ) );
$files = IncludeFile::get_files( $baseDir, [
'filter' => $
IncludeFile::get_files( string|array $directories, array|callable|string|null $config = NULL ): \Generator
$phpFiles = IncludeFile::get_files( $baseDir, 'php' );
$assetFiles = IncludeFile::get_files( $baseDir, [ 'php', 'json', 'md' ] );
$
'dir' => function ( $iterator, $fileInfo, string $absPath, string $relPath, string $baseDir, IncludeFile|false $de, IncludeFile|false $
$filter = $ function ( $fileInfo, $iterator, string $absPath, string $relPath ): ?bool {
if ( str_contains( $relPath, '/generated/' ) ) {
return FALSE;
}
return NULL;
},
] );
$ '@file:README',
'src',
'!src/private',
] );
if ( $
$filesToProcess = $
$result = $ 'luded' => true,
// 'pattern' => '!src/private',
// ]
$$
$text
src lude PHP files anywhere
!vendor exclude the vendor directory and descendants
text
!vendor/*
!vendor/**