Browse Source

add config option to enable caching

pull/39/head
Aaron Parecki 8 years ago
parent
commit
9006718ca5
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      config.template.php
  2. +1
    -1
      controllers/Parse.php

+ 1
- 0
config.template.php View File

@ -1,4 +1,5 @@
<?php <?php
class Config { class Config {
public static $base = 'http://example.com'; public static $base = 'http://example.com';
public static $cache = false;
} }

+ 1
- 1
controllers/Parse.php View File

@ -13,7 +13,7 @@ class Parse {
public function __construct() { public function __construct() {
$this->http = new p3k\HTTP(); $this->http = new p3k\HTTP();
if(class_exists('Memcache')) {
if(Config::$cache && class_exists('Memcache')) {
$this->mc = new Memcache(); $this->mc = new Memcache();
$this->mc->addServer('127.0.0.1'); $this->mc->addServer('127.0.0.1');
} }

Loading…
Cancel
Save