SQLite database inside Phar archive-Collection of common programming errors

After some research, I realized, that problem can be solved by a little hack.

  1. Copy database file to system’s temporary directory
  2. Connect PDO to database copy and do your operations
  3. Overwrite original database file with modified copy.

Not very reliable solution – you need to be careful about unhandled errors or exceptions, because you may lose your changes.