Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Create your own composer package
Search
Lattapon Yodsuwan
December 16, 2015
Programming
89
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Create your own composer package
Gentle introduction to php package to use with composer
Lattapon Yodsuwan
December 16, 2015
Other Decks in Programming
See All in Programming
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
APNsからLive Activityを開始する話
yumnumm
0
170
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
450
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
AWSに止められる覚悟してますか?
morizo_1984
2
530
Featured
See All Featured
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Making Projects Easy
brettharned
120
6.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
Transcript
Create your own composer package
Why • Easy to manage dependencies • Easy to use
with 3rd party library
normally `require` <?php require_once ‘pantip/pantip.class.php’; require_once ‘twitter/twitter.class.php’; require_once ‘facebook/facebook.class.php’; require_once
‘instagram/instagram.class.php’;
the composer way <?php require_once ‘vendor/autoload.php’;
Create Package $ composer init // composer.json { "name": “clozed2u/hello-composer",
"authors": [ { "name": "Lattapon Yodsuwan", "email": "
[email protected]
" } ], "require": {} }
Directory Structure hello-composer | |__src | |__Hello.php | |__tests |
|__HelloTest.php | |__composer.json | |__optional(circle.yml, .travis.yml, phpunit.xml)
Hello class <?php namespace Hello; class Hello { public function
sayAnything($message) { return $message; } }
Hello Tests <?php use \Hello\Hello; class HelloTest extends PHPUnit_Framework_TestCase {
public function testSayAnything() { $said = new Hello(); $this->assertEquals( "X JAPAN ROCK!!”, $said->sayAnything("X JAPAN ROCK!!”) ); } }
Add autoload to composer // composer.json { …, "require-dev": {
"phpunit/phpunit": "*" }, "autoload": { "psr-4": {"Hello\\": "src/"} } }
Push to git and release
Use package $ composer install // composer.json { "repositories": [
{ "type": "vcs", "url": "https://github.com/clozed2u/hello-composer.git" } ], "require": { "clozed2u/hello-composer": "1.0.0" } }
Push to packagist.org $ composer require clozed2u/hello-composer
Don’t forget continuous integration
/clozed2u/hello-composer
Me Name: Lattapon Yodsuwan Github/Twitter: @clozed2u Email:
[email protected]
We are hiring