-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
583 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
service_name: travis-ci | ||
coverage_clover: build/coverage-clover.xml | ||
json_path: build/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; top-most EditorConfig file | ||
root = true | ||
|
||
; Unix-style newlines | ||
[*] | ||
end_of_line = LF | ||
|
||
[*.php] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/vendor/ | ||
/build/ | ||
/composer.lock | ||
/phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
language: php | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
sudo: false | ||
|
||
notifications: | ||
email: [email protected] | ||
email: [email protected] | ||
|
||
branches: | ||
except: | ||
- /^analysis-.*$/ | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 7.1 | ||
- php: 7.0 | ||
- php: 5.6 | ||
- php: 5.5 | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=2.7.* | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=2.8.* | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=3.0.* | ||
- php: hhvm | ||
sudo: required | ||
dist: trusty | ||
group: edge | ||
|
||
before_install: | ||
- if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then echo 'xdebug.enable = on' >> /etc/hhvm/php.ini; fi | ||
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --dev | ||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi; | ||
- composer install --prefer-dist --no-interaction --no-scripts --no-progress | ||
|
||
script: | ||
- phpunit --verbose --coverage-clover=coverage.clover | ||
- vendor/bin/phpunit --coverage-clover build/coverage-clover.xml | ||
|
||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar | ||
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover | ||
- vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage-clover.xml | ||
- vendor/bin/coveralls -v -c .coveralls.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,90 @@ | ||
<img src="http://anime-db.org/bundles/animedboffsite/images/shikimori.org.png" /><br /> | ||
|
||
[![Latest Stable Version](https://poser.pugx.org/anime-db/shikimori-browser-bundle/v/stable.png)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
[![Latest Unstable Version](https://poser.pugx.org/anime-db/shikimori-browser-bundle/v/unstable.png)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
[![Total Downloads](https://poser.pugx.org/anime-db/shikimori-browser-bundle/downloads)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
[![Build Status](https://travis-ci.org/anime-db/shikimori-browser-bundle.png)](https://travis-ci.org/anime-db/shikimori-browser-bundle) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/anime-db/shikimori-browser-bundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/anime-db/shikimori-browser-bundle/?branch=master) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/anime-db/shikimori-browser-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/anime-db/shikimori-browser-bundle/?branch=master) | ||
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/fde73716-6558-46ff-b3a9-f2f989a59d0c/mini.png)](https://insight.sensiolabs.com/projects/fde73716-6558-46ff-b3a9-f2f989a59d0c) | ||
[![StyleCI](https://styleci.io/repos/18437335/shield)](https://styleci.io/repos/18437335) | ||
[![Dependency Status](https://www.versioneye.com/user/projects/5746f648ce8d0e004130cad7/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5746f648ce8d0e004130cad7) | ||
[![License](https://poser.pugx.org/anime-db/shikimori-browser-bundle/license.png)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
|
||
shikimori-browser-bundle | ||
======================== | ||
[![Shikimori](http://anime-db.org/bundles/animedboffsite/images/shikimori.org.png)](https://shikimori.org) | ||
|
||
[![Latest Stable Version](https://img.shields.io/packagist/v/anime-db/shikimori-browser-bundle.svg?maxAge=3600&label=stable)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/anime-db/shikimori-browser-bundle.svg?maxAge=3600)](https://packagist.org/packages/anime-db/shikimori-browser-bundle) | ||
[![Build Status](https://img.shields.io/travis/anime-db/shikimori-browser-bundle.svg?maxAge=3600)](https://travis-ci.org/anime-db/shikimori-browser-bundle) | ||
[![Coverage Status](https://img.shields.io/coveralls/anime-db/shikimori-browser-bundle.svg?maxAge=3600)](https://coveralls.io/github/anime-db/shikimori-browser-bundle?branch=master) | ||
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/anime-db/shikimori-browser-bundle.svg?maxAge=3600)](https://scrutinizer-ci.com/g/anime-db/shikimori-browser-bundle/?branch=master) | ||
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/fde73716-6558-46ff-b3a9-f2f989a59d0c.svg?maxAge=3600&label=SLInsight)](https://insight.sensiolabs.com/projects/fde73716-6558-46ff-b3a9-f2f989a59d0c) | ||
[![StyleCI](https://styleci.io/repos/18437335/shield?branch=master)](https://styleci.io/repos/18437335) | ||
[![License](https://img.shields.io/packagist/l/anime-db/shikimori-browser-bundle.svg?maxAge=3600)](https://github.com/anime-db/shikimori-browser-bundle) | ||
|
||
Shikimori.org API browser | ||
========================= | ||
|
||
Read API documentation here: http://shikimori.org/api/doc | ||
|
||
Installation | ||
------------ | ||
|
||
Pretty simple with [Composer](http://packagist.org), run: | ||
|
||
```sh | ||
composer anime-db/shikimori-browser-bundle | ||
``` | ||
|
||
Configuration | ||
------------- | ||
|
||
```yml | ||
anime_db_shikimori_browser: | ||
# API host | ||
# As a default used 'https://shikimori.org' | ||
host: 'https://shikimori.org' | ||
|
||
# Prefix for API resurces | ||
# As a default used '/api/' | ||
prefix: '/api/' | ||
``` | ||
Usage | ||
----- | ||
First get browser | ||
```php | ||
$browser = $this->get('anime_db.shikimori.browser'); | ||
``` | ||
|
||
List animes ([docs](https://shikimori.org/api/doc/1.0/animes/index)) | ||
|
||
```php | ||
$animes = $browser->get('animes', ['limit' => 10]); | ||
``` | ||
|
||
Mark all messages as read ([docs](https://shikimori.org/api/doc/1.0/messages/read_all)) | ||
|
||
```php | ||
$response = $browser->post('messages/read_all'); | ||
``` | ||
|
||
Update a message ([docs](https://shikimori.org/api/doc/1.0/messages/update)) | ||
|
||
```php | ||
$response = $browser->patch('messages/12', [ | ||
"message" => [ | ||
"body": "blablabla", | ||
], | ||
]); | ||
``` | ||
|
||
Update a comment ([docs](https://shikimori.org/api/doc/1.0/comments/update)) | ||
|
||
```php | ||
$response = $browser->put('comments/8', [ | ||
"message" => [ | ||
"body": "blablabla", | ||
], | ||
]); | ||
``` | ||
|
||
Destroy a message ([docs](https://shikimori.org/api/doc/1.0/messages/destroy)) | ||
|
||
```php | ||
$browser->delete('messages/12'); | ||
``` | ||
|
||
License | ||
------- | ||
|
||
This bundle is under the [MIT license](http://opensource.org/licenses/MIT). See the complete license in the file: LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
{ | ||
"name" : "anime-db/shikimori-browser-bundle", | ||
"license" : "GPL-3.0", | ||
"type" : "library", | ||
"description" : "Plugin Shikimori for the catalog Anime DB", | ||
"homepage" : "http://github.com/anime-db/shikimori-browser-bundle", | ||
"autoload" : { | ||
"psr-4" : { | ||
"AnimeDb\\Bundle\\ShikimoriBrowserBundle\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"AnimeDb\\Bundle\\ShikimoriBrowserBundle\\Tests\\" : "tests/" | ||
} | ||
}, | ||
"require" : { | ||
"php" : ">=5.3.3", | ||
"guzzle/guzzle" : "3.9.*" | ||
}, | ||
"require-dev" : { | ||
"symfony/dependency-injection" : ">=2.3.17", | ||
"symfony/expression-language" : ">=2.3.17", | ||
"symfony/config" : ">=2.3.17", | ||
"symfony/http-kernel" : ">=2.3.17" | ||
} | ||
"name": "anime-db/shikimori-browser-bundle", | ||
"license": "GPL-3.0", | ||
"type": "library", | ||
"description": "Plugin Shikimori for the catalog Anime DB", | ||
"homepage": "http://github.com/anime-db/shikimori-browser-bundle", | ||
"autoload": { | ||
"psr-4": { | ||
"AnimeDb\\Bundle\\ShikimoriBrowserBundle\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"AnimeDb\\Bundle\\ShikimoriBrowserBundle\\Tests\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=5.5", | ||
"guzzlehttp/guzzle" : "~6.3" | ||
}, | ||
"require-dev": { | ||
"symfony/dependency-injection": "~2.7|~3.0", | ||
"symfony/expression-language": "~2.7|~3.0", | ||
"symfony/config": "~2.7|~3.0", | ||
"symfony/http-kernel": "~2.7|~3.0", | ||
"phpunit/phpunit": "~4.8", | ||
"scrutinizer/ocular": "~1.3", | ||
"satooshi/php-coveralls": "^1.0" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "2.0-dev" | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* AnimeDb package. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* AnimeDb package. | ||
* | ||
* @author Peter Gribanov <[email protected]> | ||
* @copyright Copyright (c) 2011, Peter Gribanov | ||
* @license http://opensource.org/licenses/GPL-3.0 GPL v3 | ||
*/ | ||
|
||
namespace AnimeDb\Bundle\ShikimoriBrowserBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* Config tree builder. | ||
* | ||
* Example config: | ||
* | ||
* anime_db_shikimori_browser: | ||
* host: 'https://shikimori.org' | ||
* prefix: '/api/' | ||
* | ||
* @return TreeBuilder | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
return (new TreeBuilder()) | ||
->root('anime_db_shikimori_browser') | ||
->children() | ||
->scalarNode('host') | ||
->cannotBeEmpty() | ||
->defaultValue('https://shikimori.org') | ||
->end() | ||
->scalarNode('prefix') | ||
->cannotBeEmpty() | ||
->defaultValue('/api/') | ||
->end() | ||
->end() | ||
->end() | ||
; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
services: | ||
anime_db.shikimori.browser: | ||
class: AnimeDb\Bundle\ShikimoriBrowserBundle\Service\Browser | ||
arguments: | ||
- '@anime_db.shikimori.browser.client' | ||
- '%anime_db.shikimori.host%' | ||
- '%anime_db.shikimori.api.prefix%' | ||
arguments: [ '@anime_db.shikimori.browser.client', ~, ~ ] | ||
|
||
anime_db.shikimori.browser.client: | ||
class: Guzzle\Http\Client | ||
arguments: [ '%anime_db.shikimori.api.host%' ] | ||
class: GuzzleHttp\Client | ||
public: false |
Oops, something went wrong.