Download the PHP package black/yo-php without Composer

On this page you can find all versions of the php package black/yo-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yo-php

Yo PHP

Yo PHP is a Yo client written in PHP. This library is still a work in progress.

Build Status HHVM Status Scrutinizer Code Quality SensioLabsInsight

Installation

The recomanded way to install Yo PHP is through Composer:

Protip: You should browse the black/yo-php page to choose a stable version to use, avoid the @stable meta constraint.

Yotip: You want to know when yo-php is updated? Add YOPHPCLIENT \o/!

Usage

yoAll nutshell:

The yoAll method will send a yo to all your friends.

yo nutshell:

The yo method will send a yo to a dedicated username. This username MUST be in uppercase and this is your responsibility.

subscribers_count nutshell:

The subscribersCount method will retrieve the number of your subscribers. This is just a GET request with a json response.

If you want to convert the json to an array just replace $status->subscribersCount() by $status->subscribersCount()->json()

Send a link:

It is possible to send a link through Yo since 08/15/2014. Just add a link key to the constructor of new Yo() or use $yo->addLink('url://myurl.com');.

Send a location:

It is possible to send your location since 10/07/2014. Just add a location key to the constructor of new Yo() or use this code.

Warning 1 It is not possible to receive or send link and location at the same time. When you construct a Yo with link and location, link is always overrided to null.

If you use ->add(Location|Link) function, the class will set the other parameter to null. The code is very simple so take your time and look at the src/spec/Yo/YoSpec.php.

Warning 2 Yo api not using a valid format for coordinates. They use ";" instead of "," so be aware of this and don't forget to explode/convert your values (see example below).

Receive a yo:

During the registration process, Yo will ask to if you want to know when an Yo user Yo you. This pingback send you a GET request with the Yo username and location query parameters.

So... You need to create a dedicated controller. For example:

As you can see, the ReceiveYoService will dispatch an event named yo.receive and getting his information from a YoUser.

I made the choice of create a true model because you maybe want to persist all your Yo friends in a database or anything you want.

A "default" subscriber is located in Yo/Event directory. This YoSubscriber will add a new line in your Monolog logs. If you want to use it, use this sample code (or see the ./tests/Yo/ReceiveYoServiceTest:

Running the tests

There is no development key for Yo so the only way to pass the tests suite is to replace the fake token and run the tests.

Contributing

See CONTRIBUTING file.

Credits

This README is heavily inspired by Hateoas library by the great @willdurand. This guy needs your PR for the sake of the REST in PHP.

Alexandre "pocky" Balmes buy me gift or hire me!

License

Yo PHP is released under the MIT License. See the bundled LICENSE file for details.


All versions of yo-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/options-resolver Version ~2.5
symfony/event-dispatcher Version ~2.5
guzzlehttp/guzzle Version ~4
monolog/monolog Version ~1.10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package black/yo-php contains the following files

Loading the files please wait ....