Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Populating bag-info.txt #3
I can't figure out how to populate bag-info.txt. I've tried the following, but bag-info.txt is not populated:
I've taken a look at the bagit.php code and can see the _createExtendedBag() function, but at the end of the function it looks like an empty file is created by touch() and $this->bagInfoData = array() isn't populated with any values. Any help would be appreciated.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
Either way. I'll want to add a method to read the bag-info.txt file and
On Tue, Feb 7, 2012 at 9:49 AM, Mark Jordan <
Here's the patch. Let me know if you have problems applying it (I've tested it and it applies against a clean checkout of your repo).
----- Original Message -----
Unfortunately, github seemed to strip the patch out. Why don't you email it
On Tue, Feb 7, 2012 at 10:34 AM, Mark Jordan <
Sorry, user error... looking at the code a bit more closely I figured out how to write fetch.txt entries:
Glad you figured out how to work with the fetch system. It's not the most straight-forward, but it seemed to work OK, from an interface point-of-view.
The most complete "documentation" right now is probably either asking me or looking in the use-case tests. https://github.com/scholarslab/BagItPHP/blob/master/test/testusecases.php
You're probably the first main user, so please let me know if you have any feedback on this.
About this issue, I need to do some more testing, but I should get it pushed up today. I realized that the parser for the bag-info.txt file populates the bagInfoData with three versions of each key to handle accessing it using different cases. This is a complete hack.
Right now, I'm going to leave bagInfoData as is, but only with lower-cased keys, and I'll provide some accessor methods to handle case folding for the keys.
Let me know if that throws a wrench in your plans at all.
Eric, tested the new code in the develop branch by setting bag-info data both in the bag constructor and also with setBagInfoData(), and everything worked as expected:
produces the following bag-info.txt file: