View parse_query_string.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Similar to parse_str, parses a query string and returns the resulting array. | |
* Does not replace '.' and ' ' with underscores. | |
* | |
* @param string $string | |
* @return array | |
*/ | |
function parse_query_string($string) { | |
$parts = explode('&', $string); |
View .php_cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get more info and examples by running "php-cs-fixer describe rule_name" | |
$fixer = PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
/* | |
* Each line of multi-line DocComments must have an asterisk [PSR-5] and must |
View purgeTemp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
/* Config */ | |
const days = 7; | |
const protectedFileName = `items older than ${days} day${ | |
days == 1 ? '' : 's' | |
} are automatically deleted`; | |
const shouldCreateProtectedFile = true; |
View PageController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use SilverStripe\CMS\Controllers\ContentController; | |
use SilverStripe\Core\Flushable; | |
use SilverStripe\Core\Path; | |
use SilverStripe\View\Requirements; | |
use SilverStripe\View\ThemeResourceLoader; | |
class PageController extends ContentController implements Flushable | |
{ |