dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
363

JAAulde
Web Developer
MVM
join:2001-05-09
Frederick, MD
ARRIS SB6141
Ubiquiti EdgeRouter Lite
Ubiquiti UniFi AP

1 recommendation

JAAulde

MVM

PHP IPV4 networking; and my first package published for composer

I've been playing around with various web package managers lately. I moved my JavaScript cookies library to github and made it installable with bower and npm.

The last few days I was modernizing some PHP code I wrote many years ago for working with IP addresses, address blocks, filtering, etc. I decided to get familiar with the current trendy PHP package manager, composer, by setting it up to be published to packagist.

So, here's the code if you want it: »github.com/JAAulde/php-ipv4 (phpdocs available in docs/, readme content coming.)
And here's the packagist listing: »packagist.org/packages/j ··· php-ipv4

I really liked working with composer. My favorite thing about it is that you don't put version info in the package file (composer.json). It relies strictly on version control release tagging. When working with bower one of the biggest gotchas was that people would push new releases without updating the version number in the bower.json file, so it's cool that composer mitigated this.
JAAulde

JAAulde

MVM

I've been continuing to play around with this as I work on learning more modern PHP development methodologies. I've been reading through the requirements for adding a package to The League of Extraordinary Packages in order to prioritize what I work on learning.

I last left off having worked out how to package for Composer/Packagist and using PSR-4 autoloading. I've now added PHPUnit tests, Travis CI integration, and Coveralls test coverage reporting. In order to keep my code formatting up to PSR-2 standards I've been running it through PHP-CS-Fixer. I also switched the documentation generator from PHP Documentor to ApiGen.

My last larger task is to write more information into the README file. I have some of those nifty live badges in there now, along with install instructions and a single very basic usage example. I need to add in more usage examples and some other bits. Once I'm done that I'll tag a new release.

This little utility library isn't anything special, but it's been a great starting point for learning a lot of these things as it's very simple and doesn't have any dependencies I'd need to mock for testing, etc. This has been a really fun project and has helped me immensely in my day job in becoming more productive and in producing more solid, reliable, and maintainable code.