News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell:
Using Composer in an Existing Project
August 20, 2013 @ 10:18:38

Lorna Mitchell has a recent post to her site showing you how to use Composer within an existing project that might not have the same Composer-expected structure. Composer is a package and dependency manager for PHP.

I've got an application (okay, scratty PHP script) which glues together some API things and shows them onto a dashboard for me. Recently, I updated it to use Guzzle as the consuming client, since twitter now needs me to authenticate (I wrote about that if you're interested), and I used Composer to bring the new library in. It was very simple so I thought I'd share it as it's quite minimal example, and those are my favourite kind.

She includes a brief "getting started" for those not already familiar with Composer and shows a sample composer.json file that pulls in the Guzzle HTTP library. Then calling the "install" with Composer pulls in the files in the right place and all you have to do is add the needed require_once include to your autoloading process. Composer handles the rest.

0 comments voice your opinion now!
composer existing project guzzle install introduction requireonce

Link: http://www.lornajane.net/posts/2013/using-composer-in-an-existing-project

blog comments powered by Disqus

Similar Posts

Adam Culp: PHPUnit, Composer, PHPStorm, Oh my!

Hasin Hayder: Installing gearmand, libgearman & pecl gearman for php from source in Debian 6 & 7

Clay Loveless' Blog: Ohloh Reports May Paint an Inaccurate Picture

Lukas Smith's Blog: Who is using namespaces in PHP already?

Ryan Malesevich's Blog: WP Plugins: iG:Syntax Hiliter


Community Events





Don't see your event here?
Let us know!


conference composer language symfony list series version release opinion laravel voicesoftheelephpant community introduction configure unittest api framework podcast tool interview

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework