PHPackages                             cloudmunch/sdk-php - 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. cloudmunch/sdk-php

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

cloudmunch/sdk-php
==================

CloudMunch SDK for PHP

01.0kPHP

Since Oct 18Pushed 8y ago3 watchersCompare

[ Source](https://github.com/cloudmunch1/Cloudmunch-SDK-PHP)[ Packagist](https://packagist.org/packages/cloudmunch/sdk-php)[ RSS](/packages/cloudmunch-sdk-php/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

CloudMunch-SDK-PHP
==================

[](#cloudmunch-sdk-php)

CloudMunch SDK for PHP provides helper classes for CloudMunch plugin development.

### Download SDK

[](#download-sdk)

We recommend using [Composer](https://getcomposer.org/ "Composer") as package manager. All you need to install the sdk is to have the following entry in your composer.json file.

```
"require":
  {
    "cloudmunch/sdk-php":"dev-master"
  }
```

Cloudmunch SDK Details
----------------------

[](#cloudmunch-sdk-details)

### AppAbstract class

[](#appabstract-class)

This is a base abstract class that should be extended by any plugin. This class, provides methods to read parameters, create plugin context object and retrieve service objects. This class has the following lifecycle methods that the plugin need to invoke,

- initialize() This method handles the input parameters and make this available for plugin.
- getProcessInput() This method returns the list of inputs to the plugin.
- process() This is an abstract method to be implemented by every plugin.
- performAppcompletion() This method handles the completion of a plugin execution.

Here is the list of helper methods that can be used by plugin,

- getAppContext() This method returns AppContext object for this runtime.
- getCloudmunchServerHelper() This method returns the Cloudmunch Server Helper class to manage servers registered with cloudmunch.
- getCloudmunchAssetHelper() This method returns Asset helper to manage assets registered with cloudmunch.
- getCloudmunchService() This method returns Cloudmunch Service helper needed to invoke any services in cloudmunch.
- outputPipelineVariables() Plugin uses this method to output variables to pipeline.

### AppContext class

[](#appcontext-class)

Plugins can get the context or environment information from this class. Here is the list of some methods available,

- getWorkSpaceLocation() This methods returns the absolute path to the workspace of the job.
- getArchiveLocation() This method returns the absolute path to the archive location.
- getTargetServer() This method returns the target server id on which the step is getting executed.
- getProject() This method returns the project name in which the plugin is being executed.
- getJob() This method returns the job name in which the plugin is being executed.
- getRunNumber() This method returns the current build number.

Helper classes
--------------

[](#helper-classes)

### CloudmunchService

[](#cloudmunchservice)

This helper class provides method to retreive/update data from cloudmunch. Below is the list of methods that can be used.

- getCloudmunchData($context,$contextid,$filterdata)
- updateCloudmunchData($context,$contextid,$data)
- addCloudmunchData($context,$data)
- deleteCloudmunchData($context,$contextid) -downloadKeys($filekey, $context, $contextid)

### AssetHelper

[](#assethelper)

This is a helper class to manage assets in cloudmunch.

### EnvironmentHelper

[](#environmenthelper)

This is a helper class to manage environments in cloudmunch.

### RoleHelper

[](#rolehelper)

This is a helper class to manage roles in cloudmunch.

### InsightHelper

[](#insighthelper)

This is a helper to retrieve insight data from cloudmunch data base or generate different type of reports.

#### Terminologies

[](#terminologies)

- resource : This will have information on integration and any other details needed to gather information from external source
- datastore : This is a child of resource which will hold smaller units of data retrieved from source
- extract : This is the smallest unit of data stored in cloudmunch data base.
- The hierarchy is resource-&gt;datastores-&gt;extracts
- insight\_report : This is a child of resource which will hold smaller units of reports
- insight\_card : This is a child of insight\_report which will contain report related data. Can be used by user interface to render different type of graphs
- The hierarchy is resource-&gt;insight\_reports-&gt;insight\_cards

#### Methods

[](#methods)

- getExtractData() - This method will return extracts from cloudmunch database
- createLineGraph() - Can be used to generate line trend graph
- createBarGraph() - Can be used to generate Bar graph
- createDoughnutGraph() - Can be used to generate doughnut/pi graph
- createkanbanGraph() - Can be used to generate kanban graph

Sample Plugin
-------------

[](#sample-plugin)

Let us look at a sample plugin that prints "Hello "+ "string passed at runtime" on execution. Plugin name : Hello Input: helloname: This need to be printed out with Hello.

Step1: Create a folder "Hello" Step2: Create a file plugin.json with the following contents,

```
{
  "id": "Hello",
  "name": "Hello",
  "author": "you@emailaddress.com",
  "version": "1",
  "status": "enabled",
  "tags": ["git","checkout"],
  "inputs": {
    "helloname": {
      "type": "text",
        "mandatory": "yes",
      "display": "yes",
      "label": "Name",
      "hint": "Give the name to be printed"
    }
  },
  "outputs": {
    "param1": {
      "name": "",
      "format": ""
    }
  },
  "execute": {
    "main": "Hello/src/HelloDisplay.php",
    "language": "PHP",
    "options": "-debug"
  },
  "documentation": {
    "description": "Prints Hello"
  },
  "_created_by": "rosmi@cloudmunch.com",
  "_create_time": "2015-10-01 06:23:25.0474",
  "_updated_by": "rosmi@cloudmunch.com",
  "_update_time": ""
}
```

Step 3: Create composer.json to download Cloudmunch PHP SDK

```
 {
"require":
   {
    "cloudmunch/sdk-php":"dev-master"
   }
}
```

Step 4: Create a folder 'src'. Create a file , HelloDisplay.php. This file will have all the life cycle methods to control the plugin execution.

```

```

Step 5: Create a file HelloDisplay.class.php

```

```

Step 6: Create file install.sh, this will have scripts to install dependencies for your plugin.

```
#!/bin/bash
BASEDIR=$(dirname "$0")
echo "Script location: ${BASEDIR}"
cd "${BASEDIR}"
#Install composer
if hash composer 2>/dev/null; then
echo "Composer is available"
else
echo "Installing composer ..."
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
fi
composer install
```

Using Integrations
------------------

[](#using-integrations)

Cloudmunch has an integration framework using which plugins can interact with any external service providers. For example if the plugin need to interact with Amazon web services, the account can be registered in cloudmunch integrations page. This integration will now be available for the plugin at runtime. The details can be retrieved in the plugin with the following code sample,

```
public function process($processparameters)
   {
       $inputparameters    = $processparameters['appInput'];
       $integrationdetails = $processparameters['integrationdetails'];

       $awsacesskey = $integrationdetails['accessKey'];

       $secretkey   = $integrationdetails['secretKey'];
   }
```

\##Logging framework

Any event in the plugin has to be logged so that the plugin report will give enough information to the end user. There is a logging framework in the SDK and this has to be used. Following types of messages are supported, DEBUG, INFO and ERROR. Here is the sample code to output log messages,

```
$this->getLogHandler()->log(INFO, “Info message”);
$this->getLogHandler()->log(DEBUG, “Debug message”);

```

Handling failure scenarios
--------------------------

[](#handling-failure-scenarios)

The plugin should exit with error on any failure scenarios.To enable this SDK provides a method to exit with error. The format to invoke the event is as below,

```
    $message = "Error message”;
    trigger_error($message, E_USER_ERROR);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb6725b7e5da4b94a8071e8372e7d7d193b118237654fd126111b6e855f65ea1?d=identicon)[Rosmi](/maintainers/Rosmi)

---

Top Contributors

[![cloudmunch1](https://avatars.githubusercontent.com/u/2164157?v=4)](https://github.com/cloudmunch1 "cloudmunch1 (4 commits)")[![rosmi](https://avatars.githubusercontent.com/u/4190570?v=4)](https://github.com/rosmi "rosmi (4 commits)")

### Embed Badge

![Health badge](/badges/cloudmunch-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/cloudmunch-sdk-php/health.svg)](https://phpackages.com/packages/cloudmunch-sdk-php)
```

###  Alternatives

[slexx/laravel-webp

Detect webp support in laravel framework

104.6k](/packages/slexx-laravel-webp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
