{"repo":"humbug/php-scoper","free":true,"listed":false,"github":"https://github.com/humbug/php-scoper","clone":"git clone https://github.com/humbug/php-scoper.git","description":"🔨 Prefixes all PHP namespaces in a file/directory to isolate the code bundled in PHARs.","language":"PHP","stars":807,"topics":["phar","php","phar-prefixer","php-console","command-line","archive"],"license":"MIT","category":"cli-tools","readme_excerpt":"PHP-Scoper PHP-Scoper is a tool which essentially moves any body of code, including all dependencies such as vendor directories, to a new and distinct namespace. Goal PHP-Scoper's goal is to make sure that all code for a project lies in a distinct PHP namespace. This is necessary, for example, when building PHARs that: - Bundle their own vendor dependencies; and - Load/execute code from arbitrary PHP projects with similar dependencies When a package (of possibly different versions) exists, and is found in both a PHAR and the executed code, the one from the PHAR will be used. This means these PHARs run the risk of raising conflicts between their bundled vendors and the vendors of the project they are interacting with, leading to issues that are potentially very difficult to debug due to dissimilar or unsupported package versions. Table of Contents - Installation - Phive - Composer - Docker - GitHub - Usage - Configuration - Prefix - PHP Version - Output directory - Finders and paths - Patchers - Excluded files - Excluded Symbols - Excluding namespaces - Exposed Symbols - Exposing namespaces - Exposing classes - Exposing functions - Exposing constants - Building a scoped PHAR - With Box - Without Box - Step 1: Configure build location and prep vendors - Step 2: Run PHP-Scoper - Recommendations - Debugging - Further Reading - How to deal with unknown third-party symbols - Autoload aliases - Class aliases - Function aliases - Laravel support - Symfony support - Wordpress support ","default_branch":null,"files":null,"tree":[],"storefront":"/r/humbug","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/humbug/php-scoper/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}