chore(composer): pull version from composer.json

Replaces #6766

Added error handling and apparently missing file_get_contents call.