Skip to content

Commit

Permalink
Merge pull request #18 from poef/master
Browse files Browse the repository at this point in the history
updated exceptions to the new names
  • Loading branch information
poef committed Jan 28, 2016
2 parents 72fa212 + e684cee commit 377f3d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"require": {
"php": ">=5.4",
"arc/base": "~1.0||~2.0"
"arc/base": "~2.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion docs/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ But you can influence the cache time per call:

<?php
$cachedHTTPClient = \arc\cache::proxy( \arc\http::client(), function($params) {
return ( \arc\http::parseCacheTime( $params['target']->responseHeaders ) - time() );
return ( \arc\http\headers::parseCacheTime( $params['target']->responseHeaders ) );
});

This will create a caching http client that reads the cache-control and expires headers from each request and caches
Expand Down
8 changes: 4 additions & 4 deletions src/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public static function create($prefix = null, $timeout = 7200)
@mkdir( ARC_CACHE_DIR, 0770, true );
}
if (!file_exists( ARC_CACHE_DIR )) {
throw new \arc\ExceptionConfigError('Cache Directory does not exist ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
throw new \arc\ConfigError('Cache Directory does not exist ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
}
if (!is_dir( ARC_CACHE_DIR )) {
throw new \arc\ExceptionConfigError('Cache Directory is not a directory ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
throw new \arc\ConfigError('Cache Directory is not a directory ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
}
if (!is_writable( ARC_CACHE_DIR )) {
throw new \arc\ExceptionConfigError('Cache Directory is not writable ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
throw new \arc\ConfigError('Cache Directory is not writable ( '.ARC_CACHE_DIR.' )', \arc\exceptions::CONFIGURATION_ERROR);
}
if (!$prefix) { // make sure you have a default prefix, so you won't clear other prefixes unintended
$prefix = 'default';
Expand Down Expand Up @@ -81,7 +81,7 @@ public static function __callStatic($name, $args)
if (method_exists( $store, $name )) {
return call_user_func_array( array( $store, $name), $args);
} else {
throw new \arc\ExceptionMethodNotFound('Method ' . $name . ' not found in Cache Store', \arc\exceptions::OBJECT_NOT_FOUND);
throw new \arc\MethodNotFound('Method ' . $name . ' not found in Cache Store', \arc\exceptions::OBJECT_NOT_FOUND);
}
}

Expand Down

0 comments on commit 377f3d8

Please sign in to comment.