Skip to content

Commit e21eccf

Browse files
committed
Cleaning up API and code structure
* Moved code to use psr-4 style * Changed key creator to return an array not a string * Support for generating multiple versions in sami docs * Added 5.5 to travis build * Updated change log to reflect changes * Move to tedivm/stash for cacheing * Update licence to use current year * Move SilverStripe code into namespace * Remove unneeded dev deps * Remove PHP CI file * Fix unit tests
1 parent f18159d commit e21eccf

29 files changed

+1035
-949
lines changed

.sami

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use Sami\Sami;
4+
use Sami\Version\GitVersionCollection;
45
use Symfony\Component\Finder\Finder;
56

67
$iterator = Finder::create()
@@ -12,8 +13,15 @@ $iterator = Finder::create()
1213
->exclude('framework')
1314
->in(__DIR__);
1415

16+
$versions = GitVersionCollection::create($dir)
17+
->addFromTags('*')
18+
->add('master', 'master branch');
19+
1520
return new Sami($iterator, array(
1621
'title' => 'Cache Include API',
17-
'build_dir' => __DIR__ . '/build/api',
18-
'cache_dir' => __DIR__ . '/build/apicache'
22+
'versions' => $versions,
23+
'theme' => 'enhanced',
24+
'build_dir' => __DIR__ . '/build/api/%version%',
25+
'cache_dir' => __DIR__ . '/build/apicache/%version%',
26+
'default_opened_level' => 2,
1927
));

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: php
33
php:
44
- 5.3
55
- 5.4
6+
- 5.5
67

78
before_script:
89
- composer self-update

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 4.0.0
4+
5+
* [BC Break] Use "tedivm/stash" for caching
6+
* [BC Break] Change KeyCreator interface to return an array from getKey
7+
8+
## 3.1.0
9+
10+
* Added special <% cache 'Name' %> syntax for templates
11+
* [BC BREAK] Removed ability to use `CacheIncludePartial`
12+
* Added support for caching by whether a use is logged in (as opposed to caching for a specific user)
13+
* Removed redundant key creation code for page, url-params, controller all combined into one functionality
14+
315
## 3.0.8
416

517
* Only cache 200 status codes in global request cache

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2013 Heyday Limited
1+
Copyright (c) 2012-2014 Heyday Limited
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

_config/config.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,49 @@ Director:
77

88
Injector:
99
SSTemplateParser:
10-
properties:
11-
closedBlocks:
12-
cache: "CacheIncludeExtension::cacheTemplate"
10+
properties:
11+
closedBlocks:
12+
cache: "Heyday\CacheInclude\SilverStripe\CacheIncludeExtension::cacheTemplate"
13+
1314
CacheInclude:
1415
class: Heyday\CacheInclude\CacheInclude
1516
constructor:
1617
0: '%$CacheCache'
17-
1: '%$CacheIncludeKeyCreator'
1818
2: '%$CacheIncludeConfig'
19-
CacheIncludeKeyCreator:
20-
class: Heyday\CacheInclude\KeyCreators\KeyCreator
19+
2120
CacheIncludeConfig:
2221
class: Heyday\CacheInclude\Configs\ArrayConfig
23-
constructor:
24-
0: []
22+
2523
CacheIncludeViewableDataProcessor:
2624
class: Heyday\CacheInclude\Processors\ViewableDataProcessor
27-
CacheCache:
28-
class: CacheCache\Cache
29-
constructor:
30-
0: '%$CacheCacheBackend'
31-
1: cacheinclude
32-
2: null
33-
3: 0
34-
CacheCacheBackend:
35-
class: CacheCache\Backends\File
25+
26+
Stash:
27+
class: Stash\Pool
28+
constructor:
29+
0: '%$StashDriver'
30+
StashDriver:
31+
class: Stash\Driver\FileSystem
3632
constructor:
3733
0:
38-
dir: '../silverstripe-cacheinclude/cache'
39-
file_extension: '.cache'
34+
path: '../silverstripe-cacheinclude/cache'
35+
4036
CacheIncludeExtension:
41-
class: CacheIncludeExtension
37+
class: Heyday\CacheInclude\SilverStripe\CacheIncludeExtension
4238
constructor:
4339
0: '%$CacheInclude'
44-
2: '%$CacheIncludeViewableDataProcessor'
40+
1: '%$CacheIncludeViewableDataProcessor'
41+
4542
CacheIncludeController:
46-
class: CacheIncludeController
43+
class: Heyday\CacheInclude\SilverStripe\CacheIncludeController
4744
constructor:
4845
0: '%$CacheInclude'
46+
4947
RequestCache:
5048
class: Heyday\CacheInclude\RequestCache
5149
constructor:
5250
0: '%$CacheInclude'
5351
1: Global
5452

55-
5653
---
5754
Only:
5855
CACHEINCLUDE_FORCE_EXPIRE: true
@@ -64,6 +61,5 @@ Injector:
6461
class: Heyday\CacheInclude\CacheInclude
6562
constructor:
6663
0: '%$CacheCache'
67-
1: '%$CacheIncludeKeyCreator'
68-
2: '%$CacheIncludeConfig'
69-
3: true
64+
1: '%$CacheIncludeConfig'
65+
2: true

code/CacheIncludeSiteTreeExtension.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
"require": {
55
"php": ">=5.3.2",
66
"composer/installers": "~1.0",
7-
"maximebf/cachecache": "~1.0",
7+
"tedivm/stash": "~0.11.4",
88
"symfony/yaml": "~2.1"
99
},
1010
"require-dev": {
11-
"silverstripe/framework": "3.1.x-dev",
11+
"silverstripe/framework": "~3.1.2",
1212
"symfony/class-loader": "~2.2",
13-
"phpmd/phpmd": "~1.4",
14-
"phploc/phploc": "dev-master",
15-
"symfony/finder": "@dev",
16-
"zetacomponents/console-tools": "@dev",
17-
"theseer/fdomdocument": "@dev",
18-
"pdepend/pdepend": "~1.1",
19-
"sami/sami": "dev-master"
13+
"sami/sami": "dev-master",
14+
"phpunit/phpunit": "~3.7",
15+
"mikey179/vfsStream": "~1.2"
2016
},
2117
"autoload": {
22-
"psr-0": { "Heyday\\CacheInclude": "src/" }
18+
"psr-4": { "Heyday\\CacheInclude\\": "src/" }
2319
},
2420
"authors": [{
2521
"name": "Cam Spiers",
2622
"email": "[email protected]",
2723
"homepage": "https://github.com/camspiers/"
24+
}, {
25+
"name": "Stephen Holdaway",
26+
"email": "[email protected]",
27+
"homepage": "https://github.com/stecman/"
2828
}]
2929
}

0 commit comments

Comments
 (0)