| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Original Repos:
- PHP Code Lib: https://github.com/a19836/php-code-lib/
- Bloxtor: https://github.com/a19836/bloxtor/
PHP Code Lib is a comprehensive library for analyzing, validating, executing, editing, beautifying, and obfuscating PHP code.
It is designed for advanced code introspection, automation, refactoring, security hardening, and developer tooling.
This library allows you to safely inspect and manipulate PHP source code at a structural level. You can extract classes, properties, methods, functions, namespaces, comments, and dependencies from files, folders, raw strings, or tokens. It also provides powerful utilities to validate syntax, execute code in controlled environments, beautify formatting, and obfuscate source code for distribution or protection.
The library allows you to:
This library provides a powerful foundation for building advanced PHP developer tools, code automation platforms, and secure execution environments.
To see a working example, open index.php on your server.
Parse PHP code into logical components for inspection and automation.
Some features:
Edit PHP code components programmatically.
Some features:
Validate PHP code safely in different execution modes.
Some features:
Execute PHP code dynamically with fine-grained control.
Some features:
Improve PHP code readability automatically.
Some features:
Protect your PHP source code by converting it into non-readable code.
Some features:
See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPScriptHandler");
$is_valid_1 = PHPScriptHandler::isValidPHPCode('echo "Foo";return false;', $error_message_1 = "");
$is_valid_2 = PHPScriptHandler::isValidPHPContents('Hello<?= " My"; ?> World', $error_message_2 = "");
echo $is_valid_1 && $is_valid_2 ? "OK" : "$error_message_1\n$error_message_2";See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPScriptHandler");
$contents = 'Hello<?= " My"; ?> World';
$output = PHPScriptHandler::parseContent($contents);See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPCodeBeautifier");
$PHPCodeBeautifier = new PHPCodeBeautifier();
$contents = 'Hello <? $x=0;if(false){return true;}$x = "World"; ?>...';
$pretty_contents = $PHPCodeBeautifier->beautifyCode($contents);See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPCodePrintingHandler");
$classes = PHPCodePrintingHandler::getPHPClassesFromFile($file_path); //Get classes from file
$classes_by_file_path = PHPCodePrintingHandler::getPHPClassesFromFolderRecursively($folder_path); //Get classes from folder and sub-folders
//... To get other components, read more at `examples/code_parser.php`See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPCodePrintingHandler");
$status = PHPCodePrintingHandler::addClassToFile($file_path, $class_settings);
$status = PHPCodePrintingHandler::editClassFromFile($file_path, $old_class_settings, $new_class_settings);
$status = PHPCodePrintingHandler::renameClassFromFile($file_path, $old_class_path, $new_class_path);
$status = PHPCodePrintingHandler::removeClassFromFile($file_path, $class_path);
//... To edit other components, read more at `examples/code_edition.php`See more examples here
include __DIR__ . "/lib/app.php";
include get_lib("phpscript.PHPCodeObfuscator");
$files_settings = array(
//set default configurations for all files inside of folder
"/some/folder/" => array(
1 => array(
"save_path" => "/tmp/obfuscated_folder/",
"all_functions" => array("obfuscate_code" => 1),
"all_properties" => array("obfuscate_name_private" => 1),
"all_methods" => array("obfuscate_code" => 1, "obfuscate_name_private" => 1),
),
)
);
$PHPCodeObfuscator = new PHPCodeObfuscator($files_settings);
$status = $PHPCodeObfuscator->obfuscateFiles(null);| Back | FazBrowse Home | New Git URL |