This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from tomschlick/analysis-qvk1vz
Applied fixes from StyleCI
- Loading branch information
Showing
3 changed files
with
447 additions
and
473 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,49 @@ | ||
<?php | ||
class Example_memcached extends Controller | ||
{ | ||
function Example_memcached() | ||
{ | ||
parent::Controller(); | ||
} | ||
|
||
function test() | ||
{ | ||
// Load library | ||
$this->load->library('memcached_library'); | ||
|
||
// Lets try to get the key | ||
$results = $this->memcached_library->get('test'); | ||
|
||
// If the key does not exist it could mean the key was never set or expired | ||
if (!$results) | ||
{ | ||
// Modify this Query to your liking! | ||
$query = $this->db->get('members', 7000); | ||
|
||
// Lets store the results | ||
$this->memcached_library->add('test', $query->result()); | ||
|
||
// Output a basic msg | ||
echo "Alright! Stored some results from the Query... Refresh Your Browser"; | ||
} | ||
else | ||
{ | ||
// Output | ||
var_dump($results); | ||
|
||
// Now let us delete the key for demonstration sake! | ||
$this->memcached_library->delete('test'); | ||
} | ||
|
||
} | ||
|
||
function stats() | ||
{ | ||
$this->load->library('memcached_library'); | ||
|
||
echo $this->memcached_library->getversion(); | ||
echo "<br/>"; | ||
|
||
// We can use any of the following "reset, malloc, maps, cachedump, slabs, items, sizes" | ||
$p = $this->memcached_library->getstats("sizes"); | ||
|
||
var_dump($p); | ||
} | ||
} | ||
|
||
class Example_memcached extends Controller | ||
{ | ||
public function Example_memcached() | ||
{ | ||
parent::Controller(); | ||
} | ||
|
||
public function test() | ||
{ | ||
// Load library | ||
$this->load->library('memcached_library'); | ||
|
||
// Lets try to get the key | ||
$results = $this->memcached_library->get('test'); | ||
|
||
// If the key does not exist it could mean the key was never set or expired | ||
if (!$results) { | ||
// Modify this Query to your liking! | ||
$query = $this->db->get('members', 7000); | ||
|
||
// Lets store the results | ||
$this->memcached_library->add('test', $query->result()); | ||
|
||
// Output a basic msg | ||
echo 'Alright! Stored some results from the Query... Refresh Your Browser'; | ||
} else { | ||
// Output | ||
var_dump($results); | ||
|
||
// Now let us delete the key for demonstration sake! | ||
$this->memcached_library->delete('test'); | ||
} | ||
} | ||
|
||
public function stats() | ||
{ | ||
$this->load->library('memcached_library'); | ||
|
||
echo $this->memcached_library->getversion(); | ||
echo '<br/>'; | ||
|
||
// We can use any of the following "reset, malloc, maps, cachedump, slabs, items, sizes" | ||
$p = $this->memcached_library->getstats('sizes'); | ||
|
||
var_dump($p); | ||
} | ||
} |
Oops, something went wrong.