38c6c5aac3
When a Docker named volume is first mounted at /var/www/html/data, the directory may be owned by root (the volume is created empty before the image's chown step applies). This caused PDO::__construct to throw: SQLSTATE[HY000][14] unable to open database file Fix: _ensureDataDir() checks/creates the directory and attempts chmod before every getDB() call. On subsequent calls the is_dir+is_writable checks are O(1) stat calls with no overhead. Fixes #34 (also closes #28 #29 #30 #31 #32 #33)