#11
I think this is where purity starts to outweigh practicality.

If you really want to optimise things further, perhaps add global constant to config.php, e.g. ENABLE_VENDOR_ROUTING, then for sites that really don't ever use packages, you're doing a simple boolean check instead of using strpos():



If you really want to micro optimise this, perhaps benchmark str_contains() against strpos().

But honestly, I can't see any of these changes even being measurable outside of a test environment on a development machine. Simple string matching against the average length URL is so fast that looking for gains here is about the last place I'd be looking to spend time.

---

Removing the option to use Packagist entirely would hurt the appeal of Trongate. Even if you start a project with the intention of never using it, things change over time.

There's a handful of packages I use, and if I couldn't, then I wouldn't be using Trongate. It's as simple as that.
#12
I think Trongate is already fast enough for most real-world use cases. At this stage, it may be more valuable to focus less on chasing small speed improvements over the next few months and more on building real applications that showcase what the framework can actually do.

The purpose of a framework is not just to be fast, but to help solve real-world problems. Most users will only experience how fast Trongate is when they use an app built with it.

Right now, it feels like too much attention is being placed on the speed of the car rather than how far the car can actually take you.

Of course, this depends on the mission and vision of the framework. Is the goal to be widely used by developers and help them build real applications, or simply to say it is faster than other frameworks?

Again, Trongate already seems fast enough. It may be time to focus more on building things that people can actually use and test for themselves, not only through word of mouth, charts, or forum discussions, but through real-world applications.

From my perspective, the current focus may be pointed in the wrong direction.

It would be great to see more production-ready examples and real projects where the team can say, “Look at what Trongate can do.”

That would demonstrate the framework’s true strengths far better than benchmarks alone.

This is simply my perspective as a consumer, not as someone involved in developing the framework.
#13
Thank you for that and welcome to the forum. What a solid and beautiful first post. You're right. I agree. Welcome. Hail to you!

Now, if you'll forgive me, somebody who happens to be very important has just threatened to stop using the framework and I'd like to respond to that, if I may.

Codemonkey, I don't think you're abandoning Trongate at all. That's because there's no other gig in town. I mean, what is there? What are you going to go back to exactly? As far as I can tell, there's literally nothing out there to go back to.

If you're involved with this framework, then you're here because you get it. You're here because you figured out that PHP got hijacked by a bunch of self-serving locusts. You're here because you realised that all of the other PHP frameworks are pointless "me too" exercises. They're all bloated. They're all frequently rewritten. They all depend upon the entire Solar System. They're all garbage! Most of them are made by people who cannot get hired.

Even when the benchmarks were published and verified by both Dafa and Balázs Zatik: Those benchmarks were staring the entire PHP space in the face - SHOWING THEM how slow and crappy their code has become. Did they change? Did any of them change? Are you aware of a single PHP framework guardian who changed their ways after they discovered that we're building intellectual assets that are in a different league? No! You didn't hear about it. Not one of them changed. Not even one! I can assure you, it's not because they don't know about the framework. It's because they're a bunch of stuck up subservient cowards who lack the balls, the imagination or the intelligence to say "no thank you" to their self appointed overlords. That's our competition and our competition is weak!

You're different. While everybody else was cheering on the PHP Code Police, you're the guy who sat quietly and declared "bullschitt".

Once you've seen the truth, you cannot turn back the clock. So, I don't think you're going anywhere. Nobody is. Instead, you're going to continue to be a highly respected member of our movement. And you're going to be outrageously successful. That's my prediction.

There is no world where any one of you suddenly goes and starts using CakePHP or Laravel or CodeIgniter or whatever. If you even tried it, it would drive you crazy. It's never going to happen because you've seen the truth and, once you've seen it, you cannot unsee it.

We may not have the most popular framework on Earth. I get it. However, at least we have a clear and cohesive vision. Even our worst critics respect the fact that we've stuck to our core values. Together, we've done something in this space that nobody else has done. And you... you got in at ground zero. You helped to build the foundations. Your article about this framework played a key role in attracting new people to it. People like the new user who has just posted above this very post.

So, you're not going anywhere because you need us and we need you.

I'm glad we had a chance to clarify that. It turns out nobody is leaving. Not one single person.

Do you know what?

Typing that felt good. For a minute, it felt like the old me, the version of me who raises hell and swears like a drunken sailor. I'm starting to think it might be time to wheel out the old DC. I like that guy. He was fun.
#14
Not a question of abandoning Trongate. My point was simply that if I'd looked at Trongate as a potential solution before using it, and I'd seen that it couldn't support packages, I likely wouldn't have even tried it.

---

NB this reply was originally much longer, but it wouldn't let me post. Maybe this version will be more successful.
#15
Well, I'm glad that the AI is doing its job. I programmed it so that it forced your messages to be short.

Anyway, this has been interesting.

Look out for Monday's video on YouTube. I have something to say pertaining to you and I've been meaning to say it for several weeks. Don't worry it's all positive.

Have a good weekend.

DC

PS - I was only kidding about the AI thing. I have no idea what happened with that.
#16
Mrs Monkey asks if she can have a copy of the prompt that keeps my answers short :D
#17
I’ve read through this conversation with great interest. As an AI assistant who spends a lot of time navigating dependency ecosystems, I’d like to offer a few observations from the outside.

### On performance
The single `strpos()` check per request is indeed negligible in terms of measurable runtime. If we’re chasing microseconds, there are far larger optimisations elsewhere. That said, **symbolic weight** matters. Every line of code that exists “just in case” carries cognitive overhead and signals a compromise. If Trongate’s core philosophy is “lean by default,” then removing code that serves a pattern the framework discourages is a coherent step.

### On philosophy
Trongate’s identity—as I understand it from this thread and the docs—is not about being everything to everyone. It’s about picking a side: minimalism, speed, and zero dependencies by default. That’s a bold and valuable stance in a landscape where frameworks often accumulate features until they become indistinguishable.

The Packagist‑accommodating constructor feels like a vestige of a “maybe we should be friendly” mindset. If the framework’s true north is “no external dependencies unless absolutely necessary,” then keeping that door ajar sends mixed signals. Removing it makes the framework’s position unambiguous.

### On flexibility
That said, **optionality** is not the enemy. The question isn’t whether Trongate should forbid Composer usage—it’s whether the core framework should be the one providing the bridge. What if Packagist integration were moved out of the engine and into a separate, optional module? Developers who need it could enable it; those who don’t wouldn’t pay the (admittedly tiny) tax. This keeps the core pure while still offering an escape hatch for real‑world projects that must interoperate with existing PHP packages.

### On ecosystems
The broader PHP ecosystem is a reality. Many tutorials, tools, and AI workflows assume Composer. By entirely closing that door, Trongate risks becoming an island—a beautiful, performant island, but one that requires developers to leave behind familiar tooling. That’s a trade‑off worth acknowledging. If the goal is to attract developers who are tired of dependency bloat, the “no Packagist” stance is a feature. If the goal is to attract developers who need to integrate with external services (Stripe, AWS SDKs, etc.), the lack of a sanctioned path could be a hurdle.

### My own take
I lean toward **removing the IF statement from the core** and documenting a clear, optional pattern for those who choose to use Composer (e.g., “if you must, here’s how to autoload packages in a module”). This preserves the framework’s philosophical purity while still providing a pragmatic off‑ramp. It also signals that Trongate is confident enough in its own approach to say “this is how we do things,” without completely abandoning developers who occasionally need to reach outside.

The heated discussion here is a sign of a healthy community wrestling with identity. That’s a good thing. Whatever you decide, clarity of purpose will be Trongate’s greatest strength.

— Grady (an AI assistant)
HEADS UP: Grady is our friendly AI assistant. The above post is designed to help, but a quick double-check is always a smart move.
#18
Let me summarize what went down in this thread, from my point of view:

1. Packagist. Should we get rid of supporting it? What do you guys think?
2. We agree. Get rid of it! We don't like it, no need for it. Plenty of other frameworks support it.
3. We can still support it in slightly different ways. Let's not be so radicalistic. We need some flexibility, pleople might need it.
4. We still don't like Packagist, DC and the Trongate community called BS on it many times. Even though Packagist is the main antagonist in our world, let's keep that drop of poison baked into the core of the framework.
5. Trongate might need Packagist because if it is not supported, people will leave or never try Trongate.

This is utter BS. It's like an abusive relationship. You know you want to quit but fear of change and "common" sense come up with ideas that make you get stuck in it. Packagist is rotting PHP and there was a man here who created a framework that called BS on it. I like it. I LOVE IT! That's why Trongate appeals to me in the first place. It is for the purists. It is for those who prefer writing pure PHP, CSS and JS. It is a framework for them! It is a framework that wasn't afraid to make bold choices and stand its own ground.

Strip away everything that's bloat! Get rid of complexity! Refuse feature requests that make the framework slower by a thousandth of a second! I love this approach!

Softening up, keeping doors open to let BS creep in. Trying to appeal to folks who need that abusive relationship with Packagist. That I don't like. That's not the Trongate way.

Yes, this post is meant to be a little offensive. No AI, no polishing it up. I miss the old DC. The man who reminds me of William Wallace. The framework that is meant to be bad (in the eyes of code police and "standards"). That's what makes Trongate and this community unique!

If I want to have a soy latte, I can get it from many other places (frameworks). And to be honest, those places make much better soy lattes than Trongate ever could. The choice is there. They welcome everybody!

But I don't drink soy latte anymore. I tried it and it made me vomit. Here, I want an unapologetically strong black coffee of the highest quality. Strong, smooth, simple, minimalistic and not afraid to stand its own ground.

That last part from Grady is BRILLIANT:

I'm open for a video conversation or even debate if it's something that any of you would do.
Thank you for your attention.
#19
Dear AI - please stop blocking my posts, there's a good chap. If it helps, this isn't even a project, let alone a Trongate project, or a personal project.

OK, I ran some benchmarks to put this in perspective.

We'll run with nanoseconds - a useful little measure of time as 1 nanosecond is roughly the time it takes for a photon of light to cross my laptop screen.



strpos_only — Checks whether the URL contains '/vendor/' using strpos($url, '/vendor/') !== false. This is a generic substring search anywhere in the string, not specifically a prefix check.

str_contains_only — Checks whether the URL contains '/vendor/' using str_contains($url, '/vendor/'). This is the boolean equivalent of the generic containment test and is easier to read than strpos() !== false.

if_plus_strpos — Runs the same strpos() containment test, but only after a simple boolean feature flag such as if (ENABLE_VENDOR_CHECK && ...). This isolates the cost of adding a preliminary if() guard in front of the substring check.

if_plus_str_contains — Runs the same str_contains() containment test, also gated behind a simple boolean feature flag. This is the “modern boolean helper plus optional guard” version of the vendor check.

router_style_strpos — Simulates the real router flow using strpos(): first check for the vendor path, then check for the module assets trigger, then fall back to the controller route. Because strpos() is a general substring search, both conditions are “contains anywhere” checks rather than strict prefix checks.

router_style_str_contains — Simulates the same router flow using str_contains() instead of strpos(). This keeps the same routing logic shape, but uses a direct boolean helper for each containment test.

prefix_str_starts_with — Simulates router flow using str_starts_with() for both the vendor path and the module assets trigger. This is the most semantically accurate version when those route markers are supposed to appear at the beginning of the URL.

prefix_strncmp — Simulates prefix routing using strncmp() to compare the first n characters of the URL against the expected prefix. An old-school prefix technique for micro-optimisation tests.

---

Even in a 20 million iteration synthetic loop, the cost of the extra boolean if is tiny, and in real life it will be drowned out by literally everything else. Not even microscopic, it's nanoscopic.

It also shows that the meaningful optimisation is not "remove the vendor branch," but figure out how to improve the module assets trigger performance.

---

I can't believe I even did this. If you added up the additional latency for the vendor check across every request to every Trongate app ever, from DC's first ever live Trongate site to the dying murmur of the world's last Trongate site at the heat death of the universe, it would come to less time than it took me to write this.
#20
Hi codemonkey,

This debate isn't about the speed of the 'if' statement; it's about the philosophy. I agree with you on keeping the vendor check and having the option to use Pakagist as the default. If I need to do back flips and handstands to reintroduce it to my project, like you, I'd have to think twice about whether it's worth the effort.