Skip to content

Conversation

@scottchiefbaker
Copy link

This should address #430. It ended up being simpler than I thought it would be. We do need an include() target so I went with src/mustache.php but it could be anything.

  • start.php
  • loader.php
  • etc

This makes the path human consumable / parseable require_once("/path/to/mustache/src/mustache.php");. This should facilitate a user cloning the repository or downloading the latest release .zip file.

@bobthecow
Copy link
Owner

Mustache.php used to come with its own autoloader (up until ~3 months ago). I removed it in v3.x because in the year 2025 everyone's either using Composer, or has some other way of loading PHP files. I'm not sure we need to maintain another autoloader :)

@scottchiefbaker
Copy link
Author

Personally I would definitely use a non-composer loader if it were an option. Smarty makes it easy to not use composer, so I was looking at feature parity. Often I'm working on small projects with no dependencies and bringing composer into the mix just complicates things.

@FullName
Copy link

FullName commented Nov 7, 2025

Composer makes DLL hells from the 90s look like cakewalks in the park, people just refuse to face their own responsibilities for all things happening deep down in the depedency stack, potentially leading to things breaking in ways which are hard to discover. Security isn't part of the composer concept at all, which is, IMHO, a big step backwards. Not having any unnecessary dependency is one of the reason why I prefer mustache over other solutions.

Yet this autoloader is opening an issue: There are also people using php on systems where 'directory separator is not /', lines 9 and 24 break that. There's "DIRECTORY_SEPARATOR", if you need a directory separator for the current system php is running on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants