XML : How should I include XML data file in a composer package?

I'm working on a PHP library (as a composer package) that needs a XML file to work. I'm using simplexml_load_file to load the XML file, but I'm wondering where I should put the file and how to get a path that always works. The current file structure looks like this is:

  /    src/      Vendor/        Library.php    tests/      LibraryTest.php    composer.json    composer.lock    

My composer.json file :

  {      "name": "vendor/library",      "require": {          "php": ">=5.3.0"      },      "autoload": {          "psr-0": {              "Vendor": "src/"          }      }  }    

No comments:

Post a Comment