{"id":13562944,"url":"https://github.com/bobthecow/mustache.php","last_synced_at":"2026-10-19T01:03:38.570Z","repository":{"id":844438,"uuid":"569670","full_name":"bobthecow/mustache.php","owner":"bobthecow","description":"A Mustache implementation in PHP.","archived":false,"fork":false,"pushed_at":"2026-07-28T06:29:58.000Z","size":1375,"stargazers_count":3284,"open_issues_count":4,"forks_count":430,"subscribers_count":108,"default_branch":"main","last_synced_at":"2026-10-16T07:03:16.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mustache.github.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobthecow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-03-19T10:58:58.000Z","updated_at":"2026-10-14T22:15:42.000Z","dependencies_parsed_at":"2024-06-18T10:37:20.443Z","dependency_job_id":"ae994a2b-8a1e-4907-a876-b754058ea814","html_url":"https://github.com/bobthecow/mustache.php","commit_stats":{"total_commits":664,"total_committers":52,"mean_commits":12.76923076923077,"dds":"0.21385542168674698","last_synced_commit":"23f43cded6ca7fb0d296df95ce744a843d744631"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/bobthecow/mustache.php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobthecow","download_url":"https://codeload.github.com/bobthecow/mustache.php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobthecow%2Fmustache.php/sbom","scorecard":{"id":246504,"data":{"date":"2025-08-11","repo":{"name":"github.com/bobthecow/mustache.php","commit":"47b888325e7b6ffc1a6aeb451aa2deeae06d5856"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/bobthecow/mustache.php/tests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/bobthecow/mustache.php/tests.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T07:42:45.888Z","repository_id":844438,"created_at":"2025-08-17T07:42:45.888Z","updated_at":"2025-08-17T07:42:45.888Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344836268,"owners_count":38330725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-16T02:00:06.653Z","response_time":55,"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-08-01T13:01:13.680Z","updated_at":"2026-10-19T01:03:38.561Z","avatar_url":"https://github.com/bobthecow.png","language":"PHP","funding_links":[],"categories":["Templating","模板","PHP","模板 Templating","Table of Contents","目录","Utilities","模板引擎( Templating )","类库"],"sub_categories":["Templating","模板 Templating","Text Processing","模板引擎","Globalization"],"readme":"# Mustache.php\n\nA [Mustache][mustache] implementation in PHP.\n\n[![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)][packagist]\n[![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)][packagist]\n\n\n## Installation\n\n```\ncomposer require mustache/mustache\n```\n\n## Usage\n\nA quick example:\n\n```php\n\u003c?php\n$m = new \\Mustache\\Engine(['entity_flags' =\u003e ENT_QUOTES]);\necho $m-\u003erender('Hello {{planet}}', ['planet' =\u003e 'World!']); // \"Hello World!\"\n```\n\n\nAnd a more in-depth example -- this is the canonical Mustache template:\n\n```php\n\u003c?php\n$template = '\nHello {{name}}\nYou have just won {{value}} dollars!\n{{#in_ca}}\nWell, {{taxed_value}} dollars, after taxes.\n{{/in_ca}}';\n```\n\n\nCreate a view \"context\" object -- which could also be an associative array, but those don't do functions quite as well:\n\n```php\n\u003c?php\nclass Chris {\n    public $name  = \"Chris\";\n    public $value = 10000;\n\n    public function taxed_value() {\n        return $this-\u003evalue - ($this-\u003evalue * 0.4);\n    }\n\n    public $in_ca = true;\n}\n```\n\n\nAnd render it:\n\n```php\n\u003c?php\n$m = new \\Mustache\\Engine(['entity_flags' =\u003e ENT_QUOTES]);\n$chris = new \\Chris;\necho $m-\u003erender($template, $chris);\n```\n\n*Note:* we recommend using `ENT_QUOTES` as a default of [entity_flags][entity_flags] to decrease the chance of Cross-site scripting vulnerability.\n\n\n## And That's Not All!\n\nRead [the Mustache.php documentation][docs] for more information.\n\n\n## Upgrading from v2.x\n_Mustache.php v3.x drops support for PHP 5.2–5.5_, but is otherwise backwards compatible with v2.x.\n\nTo ease the transition, previous behavior can be preserved via configuration:\n\n - The `strict_callables` config option now defaults to `true`. Lambda sections should use closures or callable objects. To continue supporting array-style callables for lambda sections (e.g. `[$this, 'foo']`), set `strict_callables` to `false`.\n - [A context shadowing bug from v2.x has been fixed](https://github.com/bobthecow/mustache.php/commit/66ecb327ce15b9efa0cfcb7026fdc62c6659b27f), but if you depend on the previous buggy behavior you can preserve it via the `buggy_property_shadowing` config option.\n - By default the return value of higher-order sections that are rendered via the lambda helper will no longer be double-rendered. To preserve the previous behavior, set `double_render_lambdas` to `true`. _This is not recommended._\n\nIn order to maintain a wide PHP version support range, there are minor changes to a few interfaces, which you might need to handle if you extend Mustache (see [c0453be](https://github.com/bobthecow/mustache.php/commit/c0453be5c09e7d988b396982e29218fcb25b7304)).\n\n\n## See Also\n\n - [mustache(5)][manpage] man page.\n - [Readme for the Ruby Mustache implementation][ruby].\n\n\n[mustache]:     https://mustache.github.io/\n[packagist]:    https://packagist.org/packages/mustache/mustache\n[entity_flags]: https://github.com/bobthecow/mustache.php/wiki#entity_flags\n[docs]:         https://github.com/bobthecow/mustache.php/wiki/Home\n[manpage]:      https://mustache.github.io/mustache.5.html\n[ruby]:         https://github.com/mustache/mustache/blob/master/README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobthecow%2Fmustache.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobthecow%2Fmustache.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobthecow%2Fmustache.php/lists"}