Fix phar building with box

Including PR from @sebastianbergmann