PHPackages                             ehime/hello-world - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ehime/hello-world

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ehime/hello-world
=================

Sample Composer project

1.0.5(10y ago)2158.7k1MITPHPPHP &gt;=5.4.0

Since Jul 29Pushed 10y agoCompare

[ Source](https://github.com/ehime/hello-world)[ Packagist](https://packagist.org/packages/ehime/hello-world)[ RSS](/packages/ehime-hello-world/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (9)Used By (1)

Creating your first Composer/Packagist package
==============================================

[](#creating-your-first-composerpackagist-package)

Hi everybody! Today I'll write about how you can contribute with PHP community creating packages (or updating your's) using [Composer](http://getcomposer.org/) and [Packagist](http://packagist.org/).

### Using Composer

[](#using-composer)

Composer is a package manager for PHP. You can use packages the community developed and you can contribute with your packages too. Here I'll show how to create a project/package, install Composer inside it and send to Packagist, where others developers can use it inside their projects.

### Creating the Package

[](#creating-the-package)

You can create a new project or update one to use Composer. I'll create a hello world class. It's a simple class but you can create complex projects and share them with the others developers. I'll use "hello-world" as project's name. Composer work in "vendor/package" name format. Here we can set as "vendor" name my name: "ehime" and as package name "hello-world", the name of the project.

### Files Structure

[](#files-structure)

You can put all files inside the main dir, but I strongly recommend to create another dir, as "src" to be easier to understand and maintain your code organized. The project structure will start with the follow: \* hello-world (root dir) \* src \* HelloWorld \* SayHello.php Our SayHello.php file will have:

```
