2017 © Pedro Peláez
 

library lib-varnish

Varnish library of the Ride framework.

image

ride/lib-varnish

Varnish library of the Ride framework.

  • Tuesday, October 10, 2017
  • by ride-user
  • Repository
  • 11 Watchers
  • 3 Stars
  • 5,631 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

Ride: Varnish Library

Varnish library of the PHP Ride framework., (*1)

What's In This Library

VarnishServer

The VarnishServer interface is used to manipulate a single Varnish server or a pool of servers transparantly., (*2)

VarnishAdmin

The VarnishAdmin class connects to a single Varnish server directly to send commands., (*3)

VarnishPool

The VarnishPool class can be used to create a pool of different VarnishAdmin instances. All commands of the VarnishServer interface will be invoked on all available servers in the pool., (*4)

Code Sample

Check this code sample to see some of this library's functionality:, (*5)

<?php

use ride\library\varnish\exception\V arnishException;
use ride\library\varnish\VarnishAdmin;
use ride\library\varnish\VarnishPool;

try {
    // create a single server
    $varnish = new VarnishAdmin('localhost', 6082, 'your-secret');

    // check if worker process is running
    $varnish->isRunning(); // true | false

    // start the cache process, this will call isRunning() internally
    $varnish->start();

    // stop the cache process, this will call isRunning() internally
    $varnish->stop();

    // ban with a URL and everything underneath it
    $varnish->banUrl('http://example.com/path', true);

    // ban with an expression
    $varnish->ban('req.http.host == "example.com" && req.url == "/path/to/page"');

    // create a pool of servers
    $pool = new VarnishPool();
    $pool->addServer($varnish);
    $pool->addServer(new VarnishAdmin('example.com', 6082, 'sneaky sneaky');

    // ban with a URL or with an expression on all servers
    $pool->banUrl('http://example.com/path');
    $pool->ban('req.http.host == "example.com" && req.url == "/path/to/page"');
} catch (VarnishException $exception) {
    // something went wrong
}

Implementations

For more examples, you can check the following implementations of this library: - ride/app-varnish - ride/wba-varnish - ride/wba-cms-varnish - ride/web-cms-varnish, (*6)

Installation

You can use Composer to install this library., (*7)

composer require ride/lib-varnish

The Versions

10/10 2017

dev-master

9999999-dev

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

10/10 2017

dev-develop

dev-develop

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

10/10 2017

1.0.2

1.0.2.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

19/10 2016

1.0.1

1.0.1.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

19/10 2016

dev-mitchvdl-fix-challange-response

dev-mitchvdl-fix-challange-response

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

07/10 2016

1.0.0

1.0.0.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

19/11 2015

0.4.3

0.4.3.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

06/11 2015

0.4.2

0.4.2.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

09/09 2015

0.4.1

0.4.1.0

Varnish library of the Ride framework.

  Sources   Download

MIT

The Requires

 

by Joris Vandeweerd

17/07 2015

0.4.0

0.4.0.0

Varnish library of the Ride framework.

  Sources   Download

The Requires

 

by Joris Vandeweerd

17/07 2015

0.3.0

0.3.0.0

Varnish library of the Ride framework.

  Sources   Download

The Requires

 

by Joris Vandeweerd

27/03 2015

0.2.2

0.2.2.0

Varnish library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

05/03 2015

0.2.1

0.2.1.0

Varnish library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

04/03 2015

0.2.0

0.2.0.0

Varnish library of the Ride framework.

  Sources   Download

by Joris Vandeweerd

27/02 2015

0.1.0

0.1.0.0

Varnish library of the Ride framework.

  Sources   Download

by Joris Vandeweerd