dompdf / php-font-lib

A library to read, parse, export and make subsets of different types of font files.
GNU Lesser General Public License v2.1
1.74k stars 253 forks source link

Add composer support #2

Closed amacneil closed 11 years ago

amacneil commented 11 years ago

I've added a basic composer.json to this project so that we can list it as a dependency of DOMPDF.

You can now generate a valid autoload.php file by running composer update in the package root. Originally I went through the existing classes and removed all the require_once statements, but I decided it's probably better to leave them there for now, to support anyone still manually including this package.

PhenX commented 11 years ago

I must admit I prefer this version ;)

amacneil commented 11 years ago

Cool. Can you create a tag for this version (just anything like "v0.9" will do), then make sure you push the tag to github (git push --tags) so that the tag appears here: https://github.com/PhenX/php-font-lib/tags

Then submit this to packagist.org so I can list it as a dependency for dompdf :)

PhenX commented 11 years ago

Hey, I added it to packagist https://packagist.org/packages/phenx/php-font-lib after making the tag: https://github.com/PhenX/php-font-lib/tags Is it OK ?

amacneil commented 11 years ago

You tagged the version before by recent pull request (so packagist can't see the composer.json file). Can you git pull down the latest changes, then tag the latest commit v0.1.1 or something, then packagist should start working fine :)

PhenX commented 11 years ago

No I tagged it after your pull request (https://github.com/PhenX/php-font-lib/commit/39a6d597b936471823b15ae6d07b637e4b09016f). But it looks like tagging only makes a zip. Which URL should I submit in packagist ? I submitted https://github.com/PhenX/php-font-lib, it didn't accept https://github.com/PhenX/php-font-lib/tags

amacneil commented 11 years ago

No, you tagged it correctly, but your tag points to 6346e06afd337a64308506c349531411c685ee52 (see here: https://github.com/PhenX/php-font-lib/commits/0.1 )

You submitted it to packagist correctly. The only problem is that packagist can only see the "dev-master" branch, since the 0.1 tag doesn't contain a composer.json file.

If you want to give me access to the repo I'm happy to fix up the tag for you. Otherwise you just need to make sure your local git repo is at the correct commit (check with "git log") before you run "git tag". Also don't try to re-tag 0.1, that will make a mess since that tag is already public and re-writing history is bad. Just call the new tag 0.1.1 or something :)

PhenX commented 11 years ago

Oh, sh\ ! :) I didn't sync my local repo before making the tag ! I'm fixing it.