Skip to content

Commit

Permalink
Merge pull request #18 from jonjomckay/develop
Browse files Browse the repository at this point in the history
Merge to master for v2.0
  • Loading branch information
jonjomckay authored Dec 7, 2016
2 parents eb5990c + 4ce2c8d commit ce2c1fb
Show file tree
Hide file tree
Showing 10 changed files with 1,411 additions and 112 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/composer.phar
/build
/.idea
/*.iml
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ before_install:
- sudo apt-get install -qq clamav-daemon
- sudo freshclam
- sudo /etc/init.d/clamav-daemon start

cache:
directories:
- $HOME/.composer/cache

install:
- composer install

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0

script:
- phpunit
- vendor/bin/phpunit
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Quahog
======

[![Build Status](https://travis-ci.org/jonjo-blur/quahog.png?branch=develop)](https://travis-ci.org/jonjo-blur/quahog)

[![Build Status](https://travis-ci.org/jonjomckay/quahog.png?branch=develop)](https://travis-ci.org/jonjomckay/quahog)

Quahog is a simple PHP library to interface with the clamd anti-virus daemon. It was written as all of the libraries out
there for interfacing with ClamAV from PHP use ```exec('clamscan')```, which isn't exactly an ideal solution, as
Expand All @@ -14,23 +15,19 @@ It is recommended to install Quahog through [composer](http://getcomposer.org).
```JSON
{
"require": {
"blurgroup/quahog": "0.*"
"xenolope/quahog": "2.*"
}
}
```

## Usage

```php
// Create a new socket instance in PHP 5.3
$factory = new Factory();
$socket = $factory->createClient('unix:///var/run/clamav/clamd.ctl');

// Create a new socket instance in PHP >=5.4
$socket = (new Factory())->createClient('unix:///var/run/clamav/clamd.ctl');
// Create a new socket instance
$socket = (new \Socket\Raw\Factory())->createClient('unix:///var/run/clamav/clamd.ctl');

// Create a new instance of the Client
$quahog = new \Quahog\Client($socket);
$quahog = new \Xenolope\Quahog\Client($socket);

// Scan a file
$result = $quahog->scanFile('/tmp/virusfile');
Expand Down Expand Up @@ -67,12 +64,6 @@ To run the test suite you will need PHPUnit installed. Go to the project root an
$ phpunit
````

## Credits

![blur Group](http://i.imgur.com/5kko4VT.png)

[Jonjo McKay](mailto:[email protected]) and [blur Group](http://blurgroup.com)

## License

Quahog is released under the [MIT License](http://www.opensource.org/licenses/MIT)
Quahog is released under the [MIT License](http://www.opensource.org/licenses/MIT)
43 changes: 27 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
{
"name": "blurgroup/quahog",
"description": "A PHP client library for ClamAV clamd daemon",
"license": "MIT",
"authors": [
{
"name": "Jonjo McKay",
"email": "[email protected]"
}
],
"autoload": {
"psr-0": {"Quahog": "src/"}
},
"require": {
"php": ">=5.3",
"clue/socket-raw": "0.1.*"
"name": "xenolope/quahog",
"description": "A PHP client library for ClamAV clamd daemon",
"license": "MIT",
"authors": [
{
"name": "Jonjo McKay",
"email": "[email protected]"
}
}
],
"autoload": {
"psr-4": {
"Xenolope\\Quahog\\": "src/Quahog"
}
},
"autoload-dev": {
"psr-4": {
"Xenolope\\Quahog\\Tests\\": "tests/"
}
},
"require": {
"php": ">=5.6",
"clue/socket-raw": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"mikey179/vfsStream": "^1.6"
}
}
Loading

0 comments on commit ce2c1fb

Please sign in to comment.