Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Oct 1, 2014
1 parent 795a0b7 commit 3091054
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 164 deletions.
36 changes: 18 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update guzzlehttp/guzzle:~4.0; fi;'
- composer install --prefer-source

script: phpunit --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update guzzlehttp/guzzle:~4.0; fi;'
- composer install --prefer-source

script: phpunit --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
208 changes: 104 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
# ZenstruckCacheBundle

Provides a httpcache warmup command for Symfony2. The command simply executes a `GET` request on a list of urls.
One or more url providers must be registered.

## Installation

1. Add to your `composer.json`:

```
$ composer require zenstruck/cache-bundle
```

2. Register this bundle with Symfony2:

```php
// app/AppKernel.php

public function registerBundles()
{
$bundles = array(
// ...
new Zenstruck\CacheBundle\ZenstruckCacheBundle(),
);
// ...
}
```

## HttpCache Warmup Command

```
Usage:
zenstruck:http-cache:warmup [-p|--parallel-requests="..."] [-t|--timeout="..."] [-r|--follow-redirects]

Options:
--parallel-requests (-p) The number of requests to send in parallel (default: "10")
--timeout (-t) The timeout in seconds (default: "10")
--follow-redirects (-r) Follow redirects?

Help:
The zenstruck:http-cache:warmup command warms up the http cache.
```
## Sitemap Provider
This bundle comes with URL provider that looks at a site's `sitemap.xml` to retrieve a list of urls. The provider
first looks for a `sitemap_index.xml` to find a set of sitemap files. If no index is found, it defaults to using
`sitemap.xml`.
* See http://www.sitemaps.org/ for information on how to create a sitemap.
* See [DpnXmlSitemapBundle](https://github.com/bjo3rnf/DpnXmlSitemapBundle) for creating a sitemap with Symfony2.
To enable the sitemap provider, configure it in your `config.yml`:
```yaml
zenstruck_cache:
sitemap_provider:
host: http://www.example.com
```

## Add a Custom URL Provider

1. Create a class that implements `Zenstruck\CacheBundle\UrlProvider\UrlProvider`:

```php
use Zenstruck\CacheBundle\UrlProvider\UrlProvider;

namespace Acme;

class MyUrlProvider implements UrlProvider
{
public function getUrls()
{
$urls = array();

// fetch from a datasource

return $urls;
}

public function count()
{
return count($this->getUrls());
}
}
```

2. Register the class as a service tagged with `zenstruck_cache.url_provider`:

```yaml
my_url_provider:
class: Acme\MyUrlProvider
tags:
- { name: zenstruck_cache.url_provider }
```

## Full Default Config

```yaml
zenstruck_cache:
sitemap_provider:
enabled: false
host: ~ # Required
```
# ZenstruckCacheBundle

Provides a httpcache warmup command for Symfony2. The command simply executes a `GET` request on a list of urls.
One or more url providers must be registered.

## Installation

1. Add to your `composer.json`:

```
$ composer require zenstruck/cache-bundle
```

2. Register this bundle with Symfony2:

```php
// app/AppKernel.php

public function registerBundles()
{
$bundles = array(
// ...
new Zenstruck\CacheBundle\ZenstruckCacheBundle(),
);
// ...
}
```

## HttpCache Warmup Command

```
Usage:
zenstruck:http-cache:warmup [-p|--parallel-requests="..."] [-t|--timeout="..."] [-r|--follow-redirects]

Options:
--parallel-requests (-p) The number of requests to send in parallel (default: "10")
--timeout (-t) The timeout in seconds (default: "10")
--follow-redirects (-r) Follow redirects?

Help:
The zenstruck:http-cache:warmup command warms up the http cache.
```
## Sitemap Provider
This bundle comes with URL provider that looks at a site's `sitemap.xml` to retrieve a list of urls. The provider
first looks for a `sitemap_index.xml` to find a set of sitemap files. If no index is found, it defaults to using
`sitemap.xml`.
* See http://www.sitemaps.org/ for information on how to create a sitemap.
* See [DpnXmlSitemapBundle](https://github.com/bjo3rnf/DpnXmlSitemapBundle) for creating a sitemap with Symfony2.
To enable the sitemap provider, configure it in your `config.yml`:
```yaml
zenstruck_cache:
sitemap_provider:
host: http://www.example.com
```

## Add a Custom URL Provider

1. Create a class that implements `Zenstruck\CacheBundle\UrlProvider\UrlProvider`:

```php
use Zenstruck\CacheBundle\UrlProvider\UrlProvider;

namespace Acme;

class MyUrlProvider implements UrlProvider
{
public function getUrls()
{
$urls = array();

// fetch from a datasource

return $urls;
}

public function count()
{
return count($this->getUrls());
}
}
```

2. Register the class as a service tagged with `zenstruck_cache.url_provider`:

```yaml
my_url_provider:
class: Acme\MyUrlProvider
tags:
- { name: zenstruck_cache.url_provider }
```

## Full Default Config

```yaml
zenstruck_cache:
sitemap_provider:
enabled: false
host: ~ # Required
```
84 changes: 42 additions & 42 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"name": "zenstruck/cache-bundle",
"description": "Provides a httpcache warmup command for Symfony2",
"keywords": ["cache", "caching", "httpcache"],
"homepage": "http://zenstruck.com/project/ZenstruckCacheBundle",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
{
"name": "Kevin Bond",
"email": "kevinbond@gmail.com"
}
],
"require": {
"symfony/http-foundation": "~2.5",
"symfony/http-kernel": "~2.5",
"symfony/console": "~2.5",
"symfony/config": "~2.5",
"symfony/dependency-injection": "~2.5"
},
"require-dev": {
"symfony/dom-crawler": "~2.5",
"symfony/css-selector": "~2.5",
"guzzle/http": "~3.0",
"guzzle/plugin-mock": "~3.0",
"matthiasnoback/symfony-dependency-injection-test": "~0.4"
},
"autoload": {
"psr-0": { "Zenstruck\\CacheBundle": "" }
},
"suggest": {
"guzzle/http": "To use Guzzle3 to fetch urls",
"guzzlehttp/guzzle": "To use Guzzle4 to fetch urls",
"dpn/xml-sitemap-bundle": "Create a sitemap with Symfony"
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"target-dir": "Zenstruck/CacheBundle"
}
{
"name": "zenstruck/cache-bundle",
"description": "Provides a httpcache warmup command for Symfony2",
"keywords": ["cache", "caching", "httpcache"],
"homepage": "http://zenstruck.com/project/ZenstruckCacheBundle",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
{
"name": "Kevin Bond",
"email": "kevinbond@gmail.com"
}
],
"require": {
"symfony/http-foundation": "~2.5",
"symfony/http-kernel": "~2.5",
"symfony/console": "~2.5",
"symfony/config": "~2.5",
"symfony/dependency-injection": "~2.5"
},
"require-dev": {
"symfony/dom-crawler": "~2.5",
"symfony/css-selector": "~2.5",
"guzzle/http": "~3.0",
"guzzle/plugin-mock": "~3.0",
"matthiasnoback/symfony-dependency-injection-test": "~0.4"
},
"autoload": {
"psr-0": { "Zenstruck\\CacheBundle": "" }
},
"suggest": {
"guzzle/http": "To use Guzzle3 to fetch urls",
"guzzlehttp/guzzle": "To use Guzzle4 to fetch urls",
"dpn/xml-sitemap-bundle": "Create a sitemap with Symfony"
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"target-dir": "Zenstruck/CacheBundle"
}

0 comments on commit 3091054

Please sign in to comment.