Skip to content

Commit

Permalink
Moving to SupervisorPHP
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Jan 13, 2015
1 parent b6b696f commit 41b52b9
Show file tree
Hide file tree
Showing 37 changed files with 169 additions and 177 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2015 Indigo Development Team
Copyright (c) 2013-2015 Márk Sági-Kazár <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 16 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Indigo Supervisor
# Supervisor

[![Latest Version](https://img.shields.io/github/release/indigophp/supervisor.svg?style=flat-square)](https://github.com/indigophp/supervisor/releases)
[![Latest Version](https://img.shields.io/github/release/supervisorphp/supervisor.svg?style=flat-square)](https://github.com/supervisorphp/supervisor/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/travis/indigophp/supervisor.svg?style=flat-square)](https://travis-ci.org/indigophp/supervisor)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/indigophp/supervisor.svg?style=flat-square)](https://scrutinizer-ci.com/g/indigophp/supervisor)
[![Quality Score](https://img.shields.io/scrutinizer/g/indigophp/supervisor.svg?style=flat-square)](https://scrutinizer-ci.com/g/indigophp/supervisor)
[![HHVM Status](https://img.shields.io/hhvm/indigophp/supervisor.svg?style=flat-square)](http://hhvm.h4cc.de/package/indigophp/supervisor)
[![Total Downloads](https://img.shields.io/packagist/dt/indigophp/supervisor.svg?style=flat-square)](https://packagist.org/packages/indigophp/supervisor)
[![Dependency Status](https://img.shields.io/versioneye/d/php/indigophp:supervisor.svg?style=flat-square)](https://www.versioneye.com/php/indigophp:supervisor)
[![Build Status](https://img.shields.io/travis/supervisorphp/supervisor.svg?style=flat-square)](https://travis-ci.org/supervisorphp/supervisor)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/supervisorphp/supervisor.svg?style=flat-square)](https://scrutinizer-ci.com/g/supervisorphp/supervisor)
[![Quality Score](https://img.shields.io/scrutinizer/g/supervisorphp/supervisor.svg?style=flat-square)](https://scrutinizer-ci.com/g/supervisorphp/supervisor)
[![HHVM Status](https://img.shields.io/hhvm/supervisorphp/supervisor.svg?style=flat-square)](http://hhvm.h4cc.de/package/supervisorphp/supervisor)
[![Total Downloads](https://img.shields.io/packagist/dt/supervisorphp/supervisor.svg?style=flat-square)](https://packagist.org/packages/supervisorphp/supervisor)
[![Dependency Status](https://img.shields.io/versioneye/d/php/supervisorphp:supervisor.svg?style=flat-square)](https://www.versioneye.com/php/supervisorphp:supervisor)

**PHP library for managing supervisord through XML-RPC API.**
**PHP library for managing Supervisor through XML-RPC API.**


## Install

Via Composer

``` bash
$ composer require indigophp/supervisor
$ composer require supervisorphp/supervisor
```


## Usage

``` php
use Indigo\Supervisor\Supervisor;
use Indigo\Supervisor\Connector\XmlRpc;
use Supervisor\Supervisor;
use Supervisor\Connector\XmlRpc;
use fXmlRpc\Client;
use fXmlRpc\Transport\Guzzle4Bridge;

Expand Down Expand Up @@ -82,8 +82,8 @@ As of version 3.0.0 `setCredentials` is no longer part of the `Connector` interf
For each possible fault response there is an exception. These exceptions extend a [common exception](src/Exception/Fault.php), so you are able to catch a specific fault or all. When an unknown fault is returned from the server, an instance if the common exception is thrown. The list of fault responses and the appropriate exception can be found in the class.

``` php
use Indigo\Supervisor\Exception\Fault;
use Indigo\Supervisor\Exception\Fault\BadName;
use Supervisor\Exception\Fault;
use Supervisor\Exception\Fault\BadName;

try {
$supervisor->restart('process');
Expand All @@ -99,7 +99,7 @@ try {

## Configuration and Event listening

[Configuration](https://github.com/indigophp/supervisor-configuration) and [Event](https://github.com/indigophp/supervisor-event) components have been moved into their own repository. See [#24](https://github.com/indigophp/supervisor/issues/24) for explanation.
[Configuration](https://github.com/supervisorphp/configuration) and [Event](https://github.com/supervisorphp/event) components have been moved into their own repository.


## Further info
Expand All @@ -115,14 +115,6 @@ If you use PHP XML-RPC extension to parse responses (which is marked as *EXPERIM
You will also have to make sure that you always call the functions with correct parameters. `Zend` connector will trigger an error when incorrect parameters are passed. See [this](https://github.com/zendframework/zf2/issues/6455) issue for details. (Probably this won't change in near future based on my inspections of the code.) Other connectors will throw a `Fault` exception.


## Bundles

Here is a list of framework specific bundle packages:

- [HumusSupervisorModule](https://github.com/prolic/HumusSupervisorModule) *(Zend Framework 2)*
- [Fuel Supervisor](https://github.com/indigophp/fuel-supervisor) *(FuelPHP 1.x)*


## Testing

``` bash
Expand All @@ -138,7 +130,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits

- [Márk Sági-Kazár](https://github.com/sagikazarmark)
- [All Contributors](https://github.com/indigophp/supervisor/contributors)
- [All Contributors](https://github.com/supervisorphp/supervisor/contributors)


## License
Expand Down
2 changes: 1 addition & 1 deletion RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RoboFile extends \Robo\Tasks
*/
public function faults()
{
$faultReflection = new \ReflectionClass('Indigo\Supervisor\Exception\Fault');
$faultReflection = new \ReflectionClass('Supervisor\Exception\Fault');
$faults = array_flip($faultReflection->getConstants());

$this->taskCleanDir([__DIR__.'/src/Exception/Fault'])->run();
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "indigophp/supervisor",
"description": "PHP library for Supervisor",
"name": "supervisorphp/supervisor",
"description": "PHP library for managing Supervisor through XML-RPC API",
"license": "MIT",
"keywords": ["supervisor", "process manager"],
"homepage": "https://indigophp.com",
"homepage": "https://supervisorphp.com",
"authors": [
{
"name": "Márk Sági-Kazár",
Expand All @@ -21,15 +21,15 @@
"henrikbjorn/phpspec-code-coverage" : "~1.0.0",
"behat/behat": "~3.0.0",
"rhumsaa/array_column": "~1.1.0",
"indigophp/supervisor-configuration": "~0.1.0"
"supervisorphp/configuration": "~0.1.0"
},
"suggest": {
"lstrojny/fxmlrpc": "A modern, super fast XML/RPC client for PHP >=5.4",
"zendframework/zend-xmlrpc": "XmlRpc component from Zend Framework 2"
},
"autoload": {
"psr-4": {
"Indigo\\Supervisor\\": "src/"
"Supervisor\\": "src/"
}
},
"extra": {
Expand Down
10 changes: 5 additions & 5 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use Behat\Behat\Hook\Scope\AfterScenarioScope;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Indigo\Supervisor\Configuration\Parser\File as Parser;
use Indigo\Supervisor\Configuration\Writer\File as Writer;
use Indigo\Supervisor\Configuration\Section;
use Indigo\Supervisor\Connector\XmlRpc;
use Indigo\Supervisor\Supervisor;
use Supervisor\Configuration\Parser\File as Parser;
use Supervisor\Configuration\Writer\File as Writer;
use Supervisor\Configuration\Section;
use Supervisor\Connector\XmlRpc;
use Supervisor\Supervisor;
use fXmlRpc\Client;
use fXmlRpc\Transport\Guzzle4Bridge;
use GuzzleHttp\Client as GuzzleClient;
Expand Down
4 changes: 2 additions & 2 deletions features/bootstrap/ZendContext.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Indigo\Supervisor\Connector\Zend;
use Indigo\Supervisor\Supervisor;
use Supervisor\Connector\Zend;
use Supervisor\Supervisor;
use Zend\XmlRpc\Client;
use Zend\Http\Client as HttpClient;

Expand Down
4 changes: 2 additions & 2 deletions phpspec.yml.ci
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
suites:
supervisor_suite:
namespace: Indigo\Supervisor
psr4_prefix: Indigo\Supervisor
namespace: Supervisor
psr4_prefix: Supervisor
extensions:
- PhpSpec\Extension\CodeCoverageExtension
formatter.name: pretty
Expand Down
4 changes: 2 additions & 2 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
suites:
supervisor_suite:
namespace: Indigo\Supervisor
psr4_prefix: Indigo\Supervisor
namespace: Supervisor
psr4_prefix: Supervisor
formatter.name: pretty
8 changes: 4 additions & 4 deletions resources/FaultTemplate.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

/*
* This file is part of the Indigo Supervisor package.
* This file is part of the Supervisor package.
*
* (c) Indigo Development Team
* (c) Márk Sági-Kazár <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indigo\Supervisor\Exception\Fault;
namespace Supervisor\Exception\Fault;

use Indigo\Supervisor\Exception\Fault;
use Supervisor\Exception\Fault;

/**
* Implements {FAULT_NAME} Fault exception
Expand Down
10 changes: 5 additions & 5 deletions spec/Connector/XmlRpcSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace spec\Indigo\Supervisor\Connector;
namespace spec\Supervisor\Connector;

use fXmlRpc\ClientInterface;
use fXmlRpc\Exception\ResponseException;
Expand All @@ -15,12 +15,12 @@ function let(ClientInterface $client)

function it_is_initializable()
{
$this->shouldHaveType('Indigo\Supervisor\Connector\XmlRpc');
$this->shouldHaveType('Supervisor\Connector\XmlRpc');
}

function it_is_a_conncetor()
{
$this->shouldImplement('Indigo\Supervisor\Connector');
$this->shouldImplement('Supervisor\Connector');
}

function it_calls_a_method(ClientInterface $client)
Expand All @@ -39,7 +39,7 @@ function it_throws_an_exception_when_the_call_fails(ClientInterface $client)

$client->call('namespace.method', [])->willThrow($e);

$this->shouldThrow('Indigo\Supervisor\Exception\Fault')->duringCall('namespace', 'method');
$this->shouldThrow('Supervisor\Exception\Fault')->duringCall('namespace', 'method');
}

function it_throws_a_known_exception_when_proper_fault_returned(ClientInterface $client)
Expand All @@ -51,6 +51,6 @@ function it_throws_a_known_exception_when_proper_fault_returned(ClientInterface

$client->call('namespace.method', [])->willThrow($e);

$this->shouldThrow('Indigo\Supervisor\Exception\Fault\UnknownMethod')->duringCall('namespace', 'method');
$this->shouldThrow('Supervisor\Exception\Fault\UnknownMethod')->duringCall('namespace', 'method');
}
}
10 changes: 5 additions & 5 deletions spec/Connector/ZendSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace spec\Indigo\Supervisor\Connector;
namespace spec\Supervisor\Connector;

use Zend\XmlRpc\Client;
use Zend\XmlRpc\Client\Exception\FaultException;
Expand All @@ -15,12 +15,12 @@ function let(Client $client)

function it_is_initializable()
{
$this->shouldHaveType('Indigo\Supervisor\Connector\Zend');
$this->shouldHaveType('Supervisor\Connector\Zend');
}

function it_is_a_conncetor()
{
$this->shouldImplement('Indigo\Supervisor\Connector');
$this->shouldImplement('Supervisor\Connector');
}

function it_calls_a_method(Client $client)
Expand All @@ -36,7 +36,7 @@ function it_throws_an_exception_when_the_call_fails(Client $client)

$client->call('namespace.method', [])->willThrow($e);

$this->shouldThrow('Indigo\Supervisor\Exception\Fault')->duringCall('namespace', 'method');
$this->shouldThrow('Supervisor\Exception\Fault')->duringCall('namespace', 'method');
}

function it_throws_a_known_exception_when_proper_fault_returned(Client $client)
Expand All @@ -45,6 +45,6 @@ function it_throws_a_known_exception_when_proper_fault_returned(Client $client)

$client->call('namespace.method', [])->willThrow($e);

$this->shouldThrow('Indigo\Supervisor\Exception\Fault\UnknownMethod')->duringCall('namespace', 'method');
$this->shouldThrow('Supervisor\Exception\Fault\UnknownMethod')->duringCall('namespace', 'method');
}
}
6 changes: 3 additions & 3 deletions spec/ProcessSpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace spec\Indigo\Supervisor;
namespace spec\Supervisor;

use Indigo\Supervisor\Connector;
use Supervisor\Connector;
use PhpSpec\ObjectBehavior;

class ProcessSpec extends ObjectBehavior
Expand All @@ -29,7 +29,7 @@ function let(Connector $connector)

function it_is_initializable()
{
$this->shouldHaveType('Indigo\Supervisor\Process');
$this->shouldHaveType('Supervisor\Process');
}

function it_has_payload()
Expand Down
12 changes: 6 additions & 6 deletions spec/SupervisorSpec.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace spec\Indigo\Supervisor;
namespace spec\Supervisor;

use Indigo\Supervisor\Connector;
use Indigo\Supervisor\Process;
use Supervisor\Connector;
use Supervisor\Process;
use PhpSpec\ObjectBehavior;

class SupervisorSpec extends ObjectBehavior
Expand All @@ -15,7 +15,7 @@ function let(Connector $connector)

function it_is_initializable()
{
$this->shouldHaveType('Indigo\Supervisor\Supervisor');
$this->shouldHaveType('Supervisor\Supervisor');
}

function it_checks_connection(Connector $connector)
Expand Down Expand Up @@ -61,7 +61,7 @@ function it_returns_all_processes(Connector $connector)
$processes = $this->getAllProcesses();

$processes->shouldBeArray();
$processes[0]->shouldHaveType('Indigo\Supervisor\Process');
$processes[0]->shouldHaveType('Supervisor\Process');
$processes[0]->getName()->shouldReturn('process_name');
}

Expand All @@ -71,7 +71,7 @@ function it_returns_a_process_(Connector $connector)

$process = $this->getProcess('process_name');

$process->shouldHaveType('Indigo\Supervisor\Process');
$process->shouldHaveType('Supervisor\Process');
$process->getName()->shouldReturn('process_name');
}
}
6 changes: 3 additions & 3 deletions src/Connector.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* This file is part of the Indigo Supervisor package.
* This file is part of the Supervisor package.
*
* (c) Indigo Development Team
* (c) Márk Sági-Kazár <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indigo\Supervisor;
namespace Supervisor;

/**
* Handles requests/responses to/from the Supervisor XML-RPC API
Expand Down
10 changes: 5 additions & 5 deletions src/Connector/XmlRpc.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

/*
* This file is part of the Indigo Supervisor package.
* This file is part of the Supervisor package.
*
* (c) Indigo Development Team
* (c) Márk Sági-Kazár <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Indigo\Supervisor\Connector;
namespace Supervisor\Connector;

use Indigo\Supervisor\Connector;
use Indigo\Supervisor\Exception\Fault;
use Supervisor\Connector;
use Supervisor\Exception\Fault;
use fXmlRpc\ClientInterface;
use fXmlRpc\Exception\ResponseException;

Expand Down
Loading

0 comments on commit 41b52b9

Please sign in to comment.