Download the PHP package knplabs/knp-last-tweets-bundle without Composer

On this page you can find all versions of the php package knplabs/knp-last-tweets-bundle. 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 knp-last-tweets-bundle

DEPRECATED

Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to [email protected].

KnpLastTweetsBundles

Warning

the bundle is working only with OAuth driver because of twitter api v.1 retirement old users needs update abraham/twitteroauth using composer update abraham/twitteroauth

This Symfony2 bundle will allow you to easily add a visual widget with the last tweets of the Twitter users to your page.

Build Status

Note that tweets are transformed so that links are clickable.

Installation

Add KnpLastTweetsBundle in your composer.json

Register the bundle in your app/AppKernel.php:

Buzz is required to use this bundle.

Usage

After installing the bundle, just do:

Or if you want use combined feed:

In that case tweets will be sorted by date.

Configuration

You will now have to configure the bundle to use one of the three available drivers.

Api driver

The simplest driver is the api driver: it calls twitter API at each request.

This is the default - you don't even have to add the previous config to app/config.yml.
But it's obviously not peformant in production.

OAuth driver

The oauth_driver uses InoriTwitterAppBundle. First you should configure and install it.

Then you are freely to set it in config:

Doctrine Cache driver

The doctrine_driver uses DoctrineCache. First you should configure and install it.

Then you are freely to set it in config:

you could use LiipDoctrineCacheBundle for configuring your caches.

Zend_Cache driver

The zend_cache driver uses Zend_Cache to cache the last tweets in a Zend_Cache_Backend (file, APC, memcached…).

You will need to install KnpZendCacheBundle first and configure it:

This will only call the twitter api after a minimum of 300 seconds.

The force-fetch command

Caching is good. But once in a while (well one every 5 minutes in the previous case and if you have a continuous flow a visits), one of your visitor will have to wait 2 unnecessary seconds while the server calls twitter API.

To avoid that, you should launch a cron job every 4 minutes which will force the fetching and caching of the new tweets

php app/console knp-last-tweets:force-fetch knplabs

This way, you will never make your visitors wait!

Array driver

The array driver uses dummy data and does not call the twitter API.

It will return you 10 fake tweets - perfect in development.

Recommendations

Advanced usage: HTTP caching

Please note that the following is not necessary: you should be perfectly fine without it.

You can use HTTP caching and ESI if you want the lastTweets action to be rendered as an ESI tag.

This will improve performance by using a cached version of the whole rendered block - even in a dynamic page.

Follow the instructions on symfony.com and use the following code in your templates:

Credits

License

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


All versions of knp-last-tweets-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/framework-bundle Version >=2.0.0
kriswallsmith/buzz Version >=v0.5
twig/twig Version >=1.6.5
symfony/yaml Version *
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 knplabs/knp-last-tweets-bundle contains the following files

Loading the files please wait ....