TQ
dev.com

Blog about software development

Subscribe

MintyPHP v3 is released

30 Oct 2022 - by 'Maurits van der Schee'

I use MintyPHP to quickly build web applications on the LAMP stack and I just released version 3 this month. Since v3 it relies solely on the composer generated autoloader, making the software faster and making it integrate even better with your IDE. Now the IDE can detect missing dependencies and can autocomplete the PHPunit tests. Also, since version 3 the config format has changed, allowing easier use of environment variables (via getenv) in the config files.

Battle tested

I have created MintyPHP in 2013 and it is on packagist since 2018. I use it daily to build and maintain web applications on the LAMP stack and currently I run a handful of commercial web applications on the framework. There are a few web shops, a Hugo CMS, this blog and some administrative applications. I tend to make as little changes as possible to the framework (to reduce maintenance costs). After using MintyPHP in production for 9 years this web framework has matured to version 3.

Recommended IDE

I use Visual Studio Code with the "PHP Intelephense" plugin. I hardly use other plugins. I'm confident that the development experience in PhpStorm or other IDEs will be great too. Settings I use (in settings.json) are:

{
  "editor.formatOnSave": true,
  "intelephense.telemetry.enabled": false
}

I love the auto-completion, it makes me a lot faster and also the red underlines when a dependency is missing is great.

Migration

I have migrated all relevant projects now to v3 and it was some work. This was mainly due to the stricter autoloader and all I had to do is add the "use" statements. For example, most .phtml files (views) need "use MintyPHP\Session", while most .php files (actions) also need "use MintyPHP\DB" to access the database. This work will pay off with some faster development times and less errors due to better understanding of the code by the IDE (highlighting problems).

Philosophy

Note that MintyPHP is not your usual OOP framework and not for everyone. It's goals are: (1) Easy to learn (and debug) (2) Secure by design and (3) Light-weight. All functionality is implemented in static functions and classes are used as function libraries. The router is path and filename based. This means that by creating files and directories you create routes. Views are identified by the ".phtml" extension, containing PHP as templating language. Controller actions have the ".php" extension and are not allowed to send output. There is no ORM and no DBAL, so you will have to write (MariaDB) SQL queries.

Try it?

If you are interested, you may look up the site at mintyphp.github.io and download the latest release. You may also follow/star the project on Github. Any feedback on Github issues is appreciated.

Links


PS: Liked this article? Please share it on Facebook, Twitter or LinkedIn.