Giter Club home page Giter Club logo

youtrack's Introduction

YouTrack Client PHP Library

Build Status Packagist

The bugtracker YouTrack provides a REST-API. Because a lot of web applications are written in PHP I decided to write a client library for it. To make it easier for developers to write connectors to YouTrack.

The initial development was sponsored by Telematika GmbH. The current development is made by nepda.

The source of this library is released under the BSD license (see LICENSE for details).

Requirements

  • PHP >= 5.4 (Tested with >= 5.4, Travis runs tests with 5.4, 5.5, 5.6 and 7.0)
  • curl
  • simplexml
  • json
  • YouTrack 3.0+ with REST-API enabled (currently, the production system runs with YouTrack 6.5)

Changelog

Please look into CHANGELOG for a list of the past releases.

Usage

<?php
require_once("YouTrack/Connection.php");
$youtrack = new \YouTrack\Connection("http://example.com", "login", "password");
$issue = $youtrack->getIssue("TEST-1");
...

See ./examples folder for more usage examples.

Usage with ZF2 ZendSkeletonApplication

In your /init_autoloader.php

<?php
// ... snip
if ($zf2Path) {
    if (isset($loader)) {
        $loader->add('Zend', $zf2Path);
    } else {
        include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
        Zend\Loader\AutoloaderFactory::factory(array(
            'Zend\Loader\StandardAutoloader' => array(
                'autoregister_zf' => true,
                'namespaces' => [                            // add this
                    'YouTrack' => 'vendor/YouTrack'          // ...
                ],                                           // ...
            )
        ));
    }
}
// ... snip

From now on you can use YouTrack-Client-PHP-Library from any file in you ZF2-App.

<?php
// ...
// example
use YouTrack\Connection as YouTrackConnection;

class ExampleController extends AbstractActionController
{

    public function anyAction()
    {
        $youtrack = new YouTrackConnection("http://example.com", "login", "password");
        $issue = $youtrack->getIssue("TEST-1");
        // ...
    }
}

Tests

The testsuite depends on PHPUnit. You can install it with composer.phar:

curl -sS https://getcomposer.org/installer | php --
php composer.phar install

The unit tests are incomplete but you can run them using phpunit like this:

./vendor/bin/phpunit ./test

Contributors

(and more: https://github.com/nepda/youtrack/network/members)

youtrack's People

Contributors

nepda avatar sergsu avatar chabberwock avatar boneio avatar fmancardi avatar stingmu avatar shyru avatar 1ed avatar mtotheikle avatar richardhinkamp avatar wdamien avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar John Holt Ripley avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.