Download the PHP package dunglas/php-socialshare without Composer

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

PHP SocialShare

SocialShare is a PHP library allowing to retrieve the number of shares of URLs on major social networks. It is also able to generate valid sharing links.

It currently supports:

Build Status SensioLabsInsight Scrutinizer Code Quality HHVM Status

Key features

Drawbacks

For most social networks, the number of shares is retrieved through services not officially approved by social networks. These services can be shut down without warning.

Service Official way?
Facebook yes
Twitter no
Google no
LinkedIn yes
Pinterest no
Scoop.it! no
StumbleUpon no

Google returns only an estimate when there is more than 1000 shares (something like >10K). PHP Social Share converts this estimate to an integer.

Tumblr share count cannot be retrieved for an arbitrary URL, and is therefore unavailable through this library.

Installation

Use Composer to install SocialShare:

composer require dunglas/php-socialshare

Usage

Cache

SocialShare relies on the Doctrine Cache library to store data retrieved from social networks. Doctrine Cache supports a lot of caching systems including but not limited to file, Memcache, MongoDB, Redis and APC. Use the one that suit your needs.

Delayed updates

When the third parameter of the \SocialShare\SocialShare::getShares() method is set to true, the number of share counts is never retrieved from social networks: If a value is already in the cache (how old it is doesn't matter) it is used, otherwise 0 is returned

To force the update of share counts, the \SocialShare\SocialShare::update() method must be called.

Thanks to this tweak, HTTP requests retrieving shares counts from social networks will be issued after the page load. Of course, only the next visitor will see updated counts, but it allows fast pages load even in the worst case: when the data must be updated from social networks servers.

If you use PHP FPM, the call to this method should be done after the end of the network connection with the client using the fastcgi_finish_request() function.

Other social networks

You can add support for new social networks by creating a class implementing the SocialShare\Provider\ProviderInterface interface. Pull Requests are appreciated.

They are using PHP SocialShare

Credits

This library has been written by Kévin Dunglas and awesome contributors.


All versions of php-socialshare with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
ext-json Version *
doctrine/cache Version ~1.3.0
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 dunglas/php-socialshare contains the following files

Loading the files please wait ....