Download the PHP package itlessons/php-social without Composer

On this page you can find all versions of the php package itlessons/php-social. 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 php-social

php-social

The library to make work with social networks easy. They can auth with OAuth 2.0 or OAuth 1+ protocols and retrieve user profile info. Support Vkontakte, Facebook, Twitter, Github, MailRu. Works with PHP 5.3.3 or later.

Usage

You can see base example.

Auth in vk.com:

// config.php
$APP_ID_VK = -1; // app id
$APP_SECRET_VK = 'some secret code';
$APP_SCOPE_VK = ''; //some permissions
$REDIRECT_URL_VK = 'http://domain.ltd/auth_callback_vk.php';

// auth_vk.php
require __DIR__.'/config.php';
$auth = new \Social\Auth\AuthVk($APP_ID_VK, $APP_SECRET_VK, $APP_SCOPE_VK);
$url = $auth->getAuthorizeUrl($REDIRECT_URL_VK);
stopAndRedirect($url);

Now create callback file and get first api call:

// auth_callback_vk.php
require __DIR__.'/config.php';
$auth = new \Social\Auth\AuthVk($APP_ID_VK, $APP_SECRET_VK, $APP_SCOPE_VK);
$token = $auth->authenticate($_REQUEST, $REDIRECT_URL_VK);

if($token == null){
    var_dump($auth->getError());
    //exit
}

//call api with access_token
$api = new \Social\Api\ApiVk($token);
$user = $api->getProfile();

//use user data

// $user->id
// $user->firstName
// $user->lastName
// $user->nickname
// $user->screenName
// $user->photoUrl
// $user->photoBigUrl
// ...

Installation

The recommended way to install php-social is through Composer. Just create a composer.json file and run the php composer.phar install command to install it:

{
    "require": {
        "itlessons/php-social": "*"
    }
}

Alternatively, you can download the php-social.zip file and extract it.

Read


All versions of php-social with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 itlessons/php-social contains the following files

Loading the files please wait ....