Correct way of hooking into Kirby from external PHP script

Hi,

I have an external PHP script which is part of my build process that “hooks” directly into Kirby. I wanted to know if there was a safer/better way of doing this.

#!/usr/bin/env php

<?php

require 'dist/kirby/bootstrap.php';

new Kirby;

// The rest of my script that uses kirby() function

I mean, this works perfectly, I’m just not sure if it’s the best way.

Thanks

That’s what we also do here: https://getkirby.com/docs/cookbook/setup/migrate-users#the-migrate-php-script, so yes.

Excellent, thanks Sonja!