Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add this package to composer #6

Open
iNilo opened this issue Sep 13, 2016 · 6 comments
Open

Add this package to composer #6

iNilo opened this issue Sep 13, 2016 · 6 comments

Comments

@iNilo
Copy link

iNilo commented Sep 13, 2016

It would be nice to have this added to packagist.org

iNilo added a commit to iNilo/vdf-parser that referenced this issue Sep 13, 2016
@iNilo iNilo mentioned this issue Sep 13, 2016
@rossengeorgiev
Copy link
Owner

rossengeorgiev commented Sep 13, 2016

Hi,
I am not familiar with packagist.org

Can you give me an example of importing the library in some php code?

Thanks

@kbkk
Copy link
Contributor

kbkk commented Oct 12, 2016

Usually PHP applications using Composer also use its autoloader. In this case the file vdf.php will be autoloaded. However this is polluting the global namespace (you can't do exports like JS) so I'd wrap it in a class.

Importing a library with composer is as simple as running:

composer require rossengeorgiev/vdf-parser

@rossengeorgiev
Copy link
Owner

From what I've looked briefly, there are namespaces and such, so this PR needs more work.

@kbkk
Copy link
Contributor

kbkk commented Oct 12, 2016

Yeah, this would need to follow some PSR and have its own repository or at least branch so people don't download unnecessary files.

Here's an example of my PSR-4 package: https://github.com/kbkk/php-steam-auth/blob/master/composer.json

@rossengeorgiev
Copy link
Owner

Does it download all files? Can I put the php stuff in a separate directory?

@kbkk
Copy link
Contributor

kbkk commented Oct 14, 2016

Seems like it will always download the whole repository branch/tag. So the best option would be to open another repository for the PHP version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants