faustbrian/ark-symfony

This package is abandoned and no longer maintained. The author suggests using the arkx/ark-bundle package instead.

An ARK bridge for Symfony.

1.0.0 2018-02-02 14:56 UTC

README

banner.png

An ARK bridge for Symfony.

StyleCI Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/ark-symfony

Go to config/packages/ark_bundle.yml and fill out your configuration similar to this.

<?php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // ...
    BrianFaust\ArkBundle\ArkBundle::class => ['all' => true],
];

Configuration

Go to config/packages/ark_bundle.yml and fill out your configuration similar to this.

ark_bundle:
  protocol: 'http'
  ip: 'your-node-ip'
  port: 4001
  nethash: '6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988'
  version: '1.0.1'
  networkAddress: 0x17 // or 0x1E for devnet

Usage

<?php

namespace App\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class CoolStuffController extends Controller
{
    /**
     * @Route("/cool/stuff", name="cool_stuff")
     */
    public function index()
    {
        $peers = $this->container->get('ark_bundle.client')->api('Peer')->peers();

        return new Response($peers['peers']);
    }
}

Documentation

There are other classes in this package that are not documented here. This is because the package is a Symfony wrapper of the Ark-PHP package.

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust