{"id":19401382,"url":"https://github.com/onthegosystems/twig-scoper","last_synced_at":"2025-08-26T09:06:54.191Z","repository":{"id":73986881,"uuid":"196228770","full_name":"OnTheGoSystems/twig-scoper","owner":"OnTheGoSystems","description":"Utility that uses php-scoper to add a namespace to Twig.","archived":false,"fork":false,"pushed_at":"2023-09-22T08:36:41.000Z","size":4452,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-21T18:35:00.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OnTheGoSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-10T15:16:34.000Z","updated_at":"2023-09-22T08:36:46.000Z","dependencies_parsed_at":"2023-09-22T20:42:46.413Z","dependency_job_id":null,"html_url":"https://github.com/OnTheGoSystems/twig-scoper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OnTheGoSystems/twig-scoper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Ftwig-scoper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Ftwig-scoper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Ftwig-scoper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Ftwig-scoper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OnTheGoSystems","download_url":"https://codeload.github.com/OnTheGoSystems/twig-scoper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Ftwig-scoper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272200571,"owners_count":24890816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T11:18:16.635Z","updated_at":"2025-08-26T09:06:54.161Z","avatar_url":"https://github.com/OnTheGoSystems.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twig scoper\n\nUtility that uses [php-scoper](https://github.com/humbug/php-scoper) to add a \nnamespace to [Twig](https://github.com/twigphp/Twig) 1.42.*\n\nIt applies a series of patches to make sure things keep working despite Twig's \ncodebase, which presents several pleasant surprises (global functions, hardcoded class\nnames, dynamically rendered PHP code, etc).\n\nThe (dark) magic happens in [scoper.inc.php](./scoper.inc.php)\n\n![](demo.gif)\n\n## Installation\n\n1. Clone from git\n2. `composer install`\n\n## Usage\n\nRunning this command will produce the scoped version of \nTwig in the `build` directory:\n\n```bash\nvendor/bin/php-scoper add-prefix --prefix='My\\Safe\\Namespace' \n```\n\nAlternatively, you can run the `run-toolset.sh` script if you're dealing with\n[Toolset](https://toolset.com) development directly ([see the script](./run-toolset.sh) for further \ndetails). For [WPML](https://wpml.org) development, use [`run-wpml-core.sh`](./run-wpml-core.sh).\n\n## Considerations\n\nObviously, the patching is ridiculously hacky and may not work well between \ndifferent Twig versions (that's also why is the version hardcoded in `composer.json`).\n**Be very careful if you upgrade Twig and test everything before putting it into\nproduction.** Otherwise, no guarantees are provided! \n\nMade with :heart: for [Toolset](http://toolset.com) and [OnTheGoSystems](http://onthegosystems.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonthegosystems%2Ftwig-scoper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonthegosystems%2Ftwig-scoper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonthegosystems%2Ftwig-scoper/lists"}