Skip to content

Commit 72c0119

Browse files
committed
Remove memcached
1 parent 19f3dcd commit 72c0119

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

index.php

-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,4 @@
2828

2929
$app = new CmOta();
3030
$app
31-
->setConfig( 'basePath', 'https://'.$_SERVER['HTTP_HOST'] )
32-
->setConfig( 'memcached.host', 'localhost' )
33-
->setConfig( 'memcached.port', 11211 )
34-
->enableMemcached()
3531
->run();

src/CmOta.php

-13
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ public function __construct() {
3939
$this->initBuilds();
4040
}
4141

42-
/**
43-
* Enable memcached feature
44-
* @return class Return always itself, so it can be chained within calls
45-
*/
46-
public function enableMemcached() {
47-
Flight::register( 'mc', 'Memcached', array(), function( $mc ) {
48-
$mc->addServer( Flight::cfg()->get( 'memcached.host' ) , Flight::cfg()->get( 'memcached.port' ) );
49-
Flight::cfg()->set( 'memcached.enabled', true );
50-
});
51-
52-
return $this;
53-
}
54-
5542
/**
5643
* Get the global configuration
5744
* @return array The whole configuration until this moment

src/Helpers/Builds.php

+1-16
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,7 @@ private function getBuilds() {
108108
$files = preg_grep( '/^([^.Thumbs])/', scandir( $path ) );
109109
if ( count( $files ) > 0 ) {
110110
foreach ( $files as $file ) {
111-
112-
// Try to find the build using memcached
113-
if ( Flight::cfg()->get( 'memcached.enabled') ) {
114-
$build = Flight::mc()->get( $file );
115-
116-
// If not found there, we have to find it with the old fashion method...
117-
if ( !$build && Flight::mc()->getResultCode() == Memcached::RES_NOTFOUND ) {
118-
$build = new Build( $file, $path);
119-
// ...and then save it for the next lookup
120-
Flight::mc()->set( $file, serialize($build), MEMCACHE_COMPRESSED );
121-
// If we have found it, just unserialize it and continue
122-
} else {
123-
$build = unserialize( $build );
124-
}
125-
} else
126-
$build = new Build( $file, $path);
111+
$build = new Build( $file, $path);
127112

128113
if ( $build->isValid( $this->postData['params'] ) ) {
129114
array_push( $this->builds , $build );

0 commit comments

Comments
 (0)