Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: frapi/frapi
base: ec4b88428f
...
head fork: frapi/frapi
compare: master
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 3 contributors
Commits on Mar 13, 2013
@trevormorse trevormorse Fix issue #208
Memcache extension add method has an extra parameter to specify compression
compared to the Memcached extension. This commit adds that parameter so built
in Memcache adapter will work. Thanks to @louiemiranda for finding, reporting
and suggesting fix.
44dd395
Commits on Apr 08, 2013
@dshafik dshafik Merge pull request #211 from trevormorse/fix_memcache_issue_208
Fix issue #208
087e068
Commits on Apr 20, 2013
@dshafik dshafik Handle mimetype params on input Content-Type header 2dab2b5
Commits on Apr 22, 2013
@epixa epixa Merge pull request #215 from dshafik/handle-content-type-charset
Handle mimetype params on input Content-Type header
ef50192
View
38 src/frapi/library/Frapi/Cache/Adapter/Memcache.php
@@ -17,16 +17,16 @@
* @license New BSD
* @package frapi
*/
-class Frapi_Cache_Adapter_Memcache implements Frapi_Cache_Interface
+class Frapi_Cache_Adapter_Memcache implements Frapi_Cache_Interface
{
- /**
+ /**
* The memcache object.
*
* @var Memcache $memcache The memcache object.
*/
private $memcache = null;
-
- /**
+
+ /**
* Constructor
*
* This is the constructor. The options passed can be the
@@ -39,7 +39,7 @@ class Frapi_Cache_Adapter_Memcache implements Frapi_Cache_Interface
* 'servers' = array(
* '127.0.0.1' => 11211
* )
- * );
+ * );
*
* $cache = Frapi_Cache_Adapter_Memcache($options);
* </code>
@@ -50,18 +50,18 @@ class Frapi_Cache_Adapter_Memcache implements Frapi_Cache_Interface
public function __construct(array $options)
{
$this->memcache = new Memcache();
-
+
if (!isset($options['servers'])) {
$this->memcache->addServer('127.0.0.1', '11211');
}
-
+
if (isset($options['servers'])) {
foreach ($options['servers'] as $server => $port) {
$this->memcache->addServer($server, $port);
}
}
}
-
+
/**
* Get a cache variable
*
@@ -73,7 +73,7 @@ public function __construct(array $options)
* @return mixed The value of the retrieved variable or false if
* variable isn't found.
*/
- public function get($name)
+ public function get($name)
{
return $this->memcache->get($name);
}
@@ -87,15 +87,15 @@ public function get($name)
* @param string $name The name of the cache variable to store.
* @param string $value The value of the cache variable to store.
* @param integer $expire When should it expire? Default: 900 seconds.
- *
- * @return boolean Depending on the success of the operation,
- * either true or false.
+ *
+ * @return boolean Depending on the success of the operation,
+ * either true or false.
*/
- public function add($name, $value, $expiry = 900)
+ public function add($name, $value, $expiry = 900)
{
- return $this->memcache->add($name, $value, $expiry);
+ return $this->memcache->add($name, $value, false, $expiry);
}
-
+
/**
* Delete from the cache
*
@@ -103,11 +103,11 @@ public function add($name, $value, $expiry = 900)
* retrievable by $this->get($name)
*
* @param string $name The name of the cache variable to delete.
- *
- * @return boolean Depending on the success of the operation,
- * either true or false.
+ *
+ * @return boolean Depending on the success of the operation,
+ * either true or false.
*/
- public function delete($name)
+ public function delete($name)
{
return $this->memcache->delete($name);
}
View
5 src/frapi/library/Frapi/Controller/Main.php
@@ -526,6 +526,11 @@ public function setInputFormat()
$contentType = $matches[1];
}
+ if (strpos($contentType, ';') !== false) {
+ $parts = explode(';', $contentType);
+ $contentType = $parts[0];
+ }
+
if(!empty($contentType) &&
isset($this->mimeMaps[$contentType]) &&
in_array($this->mimeMaps[$contentType], $this->allowedInputTypes)) {

No commit comments for this range

Something went wrong with that request. Please try again.