NOTE: Perform each test on PHP 5 and on PHP 7 AND restart Memcached service when switching PHP version AND results must match, unless otherwise noted.
# Part 1 (general test on PHP5)
# confirm, that Memcached service is installed and started on the server
# re-install In-Portal and on "Step 9 - System Configuration" confirm, that these option is available choice for "Output Caching Engine" dropdown:start Memcached service
# re-install In-Portal and on "Step 11 - System Configuration" confirm, * on PHP 5: Memcachethat option "Memcached (via "Memcache" extension)" is available choice for "Output Caching Engine" dropdown.
* on PHP 7: Memcached# choose this option.
# login to Administrative Console
# go to {nav Tools > System Tools} section
# confirm, that "Memory Cache" sub-section is visible
# Part 2 (fallback for PHP 5 configurationgeneral test on PHP 77)
# configure Memcache using PHP 5-style setting (ensure `$_CONFIG['Misc']['CacheHandler'] = 'Memcache';` is present in the `/system/config.php`)rm, that Memcached service is installed and started on the server
# restart Memcached service
# re-install In-Portal and on "Step 11 - System Configuration" confirm, that option "Memcached (via "Memcached" extension)" is available choice for "Output Caching Engine" dropdown.
# choose this option.
# login to Administrative Console
# go to {nav Tools > System Tools} section
# confirm, that "Memory Cache" sub-section is visible
NOTE: Perform following tests twice - once after Part 1 installation, and once after Part 2 installation.
# Preparation for following tests
1. create `/memcache_test.php` file with following content:
```
lang=php
<?php
<?php
$start = microtime(true);
define('FULL_PATH', realpath(dirname(__FILE__)));
include_once(FULL_PATH.'/core/kernel/startup.php');
$application =& kApplication::Instance();
$application->Init();
echo 'PHP ' . PHP_VERSION . '<br/><br/>';
switch ( $application->GetVar('step') ) {
case 'delete':
echo 'Deleting Infinite Key<br/>' . PHP_EOL;
$application->deleteCache('infinite_key');
echo 'Deleting Expiring Key<br/>' . PHP_EOL;
$application->deleteCache('expiring_key');
echo 'Deleting Infinite Added Key<br/>' . PHP_EOL;
$application->deleteCache('infinite_added_key');
echo 'Deleting Expiring Added Key<br/>' . PHP_EOL;
$application->deleteCache('expiring_added_key');
break;
case 'set':
$result = $application->setCache('infinite_key', 'infinite value');
echo 'Setting Infinite Key: ';
var_dump($result);
$result = $application->setCache('expiring_key', 'expiring value', 30);
echo 'Setting Expiring Key: ';
var_dump($result);
$result = $application->addCache('infinite_added_key', 'infinite added value');
echo 'Adding Infinite Adding Key: ';
var_dump($result);
$result = $application->addCache('expiring_added_key', 'expiring added value', 30);
echo 'Adding Expiring Adding Key: ';
var_dump($result);
break;
default:
echo 'Getting Infinite Key:' . PHP_EOL;
var_dump($application->getCache('infinite_key'));
echo 'Getting Expiring Key:' . PHP_EOL;
var_dump($application->getCache('expiring_key'));
echo 'Getting Infinite Added Key:' . PHP_EOL;
var_dump($application->getCache('infinite_added_key'));
echo 'Getting Expiring Added Key:' . PHP_EOL;
var_dump($application->getCache('expiring_added_key'));
break;
}
$end = microtime(true);
```
2. this is URL for showing: `.../memcache_test.php?step=show`
3. this is URL for setting: `.../memcache_test.php?step=set`
4. this is URL for deleting: `.../memcache_test.php?step=delete`
## Part 3 (no cached value by default)
1. open showing URL couple of times
2. confirm, that output is similar to this:
```
PHP ...
Getting Infinite Key:
boolean false
Getting Expiring Key:
boolean false
Getting Infinite Added Key:
boolean false
Getting Expiring Added Key:
boolean false
```
## Part 4 (value is persistent upon setting/adding)
1. open setting URL
2. confirm, that output is similar to this:
```
PHP ...
Setting Infinite Key:
boolean true
Setting Expiring Key:
boolean true
Adding Infinite Adding Key:
boolean true
Adding Expiring Adding Key:
boolean true
```
3. open setting URL
4. confirm, that output is similar to this:
```
PHP ...
Setting Infinite Key:
boolean true
Setting Expiring Key:
boolean true
Adding Infinite Adding Key:
boolean false
Adding Expiring Adding Key:
boolean false
```
5. open getting URL couple of times
6. confirm, that output is similar to this:
```
PHP ...
Getting Infinite Key:
string 'infinite value' (length=14)
Getting Expiring Key:
string 'expiring value' (length=14)
Getting Infinite Added Key:
string 'infinite added value' (length=20)
Getting Expiring Added Key:
string 'expiring added value' (length=20)
```
7. wait 35 seconds (because auto-expiration is set to 30 seconds)
8. open getting URL couple of times
9. confirm, that output is similar to this:
```
PHP ...
Getting Infinite Key:
string 'infinite value' (length=14)
Getting Expiring Key:
boolean false
Getting Infinite Added Key:
string 'infinite added value' (length=20)
Getting Expiring Added Key:
boolean false
```
10. open deleting URL
11. open showing URL couple of times
12. confirm, that output is similar to this:
```
PHP ...
Getting Infinite Key:
boolean false
Getting Expiring Key:
boolean false
Getting Infinite Added Key:
boolean false
Getting Expiring Added Key:
boolean false
```