PHPackages                             d9magai/ec2-metadata-getter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. d9magai/ec2-metadata-getter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

d9magai/ec2-metadata-getter
===========================

This tool is a rewrite of the EC2 Instance Metadata API for PHP.

1.1.3(11y ago)2833MITPHPPHP &gt;=5.4.0

Since Dec 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/d9magai/Ec2MetadataGetter)[ Packagist](https://packagist.org/packages/d9magai/ec2-metadata-getter)[ RSS](/packages/d9magai-ec2-metadata-getter/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (9)Used By (0)

ec2-metadata [![Build Status](https://camo.githubusercontent.com/9486dec3262ae5be8eba4f9eb187746934885e5c509f4322ad89b95a790cbed3/68747470733a2f2f7472617669732d63692e6f72672f72617a6f727061792f6563322d6d657461646174612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/razorpay/ec2-metadata)
===========================================================================================================================================================================================================================================================================================================

[](#ec2-metadata-)

This tool is a rewrite of the [EC2 Instance Metadata API](http://aws.amazon.com/code/1825) for PHP.

This is a fork of [d9magai/Ec2MetadataGetter](https://github.com/d9magai/Ec2MetadataGetter).

The differences from the fork are:

- An additional method called `getMultiple` which fetches multiple instance attributes specified in an array
- Caching support. The same request repeated twice on the same machine will give a cached response.
- Custom caching directory. The constructor now takes a cache storage directory and uses that.
- Support for returning dummy data

### Usage:

[](#usage)

In composer.json

```
"require": {
	"razorpay/ec2-metadata": "dev-master"
}
```

In your code:

```
