1. Go to this page and download the library: Download codebase-dump/php 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/ */
codebase-dump / php example snippets
odebaseDump\Core\CodebaseAnalysis;
use CodebaseDump\Core\IgnorePatternManager;
use CodebaseDump\Core\PlainTextOutputFormatter;
$path = '/path/to/your/project';
$ignorePatternManager = new IgnorePatternManager($path);
$codebaseAnalysis = new CodebaseAnalysis();
// Single directory
$data = $codebaseAnalysis->analyzeDirectory(
path: $path,
ignorePatternManager: $ignorePatternManager,
basePath: $path
);
// Multiple directories (merged into one tree)
$data = $codebaseAnalysis->analyzeDirectories(
paths: ['/path/to/project1', '/path/to/project2'],
ignorePatternManager: $ignorePatternManager
);
$formatter = new PlainTextOutputFormatter();
$output = $formatter->format($data, $ignorePatternManager->getIgnorePatternsAsArray());
file_put_contents('output.txt', $output);
bash
# Install dependencies
cd php
composer install