Skip to content

Commit

Permalink
Merge pull request #1 from CloCkWeRX/master
Browse files Browse the repository at this point in the history
QA fixes & cleanup
  • Loading branch information
cweiske committed Nov 15, 2011
2 parents 2080cae + 85e1cb0 commit 4eb620f
Show file tree
Hide file tree
Showing 36 changed files with 846 additions and 821 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
756 changes: 756 additions & 0 deletions package.xml

Large diffs are not rendered by default.

718 changes: 0 additions & 718 deletions package2.xml

This file was deleted.

6 changes: 3 additions & 3 deletions tests/Cache_Lite_File_classical.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite_File (classical)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_file_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_file_base.inc';

$master = tmpDir() . '/' . 'foobar.masterfile';
$options = array(
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_Function_classical.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite_Function (classical)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_function_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_function_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_Function_dontcache.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite_Function (dont cache)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_function_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_function_base.inc';

// Classical
$options = array(
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_Function_drop.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite_Function (drop() method)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_function_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_function_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_Output_classical.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite_Output (classical)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_output_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_output_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_automaticCleaning.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (automaticCleaning)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_classical.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (classical)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (error)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '31451992gjhgjh'. '/', # I hope there will be no directory with that silly name
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (error2)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '31451992gjhgjh'. '/', # I hope there will be no directory with that silly name
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_error3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (error3)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '31451992gjhgjh'. '/', # I hope there will be no directory with that silly name
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_eternal.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (eternal)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_fatest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (fatest, no control, no lock)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_hashed.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (hashed level 2)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_lifetime.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (lifetime)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_memorycache.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (memory cache on)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/Cache_Lite_serialization.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Cache_Lite::Cache_Lite (automatic serialization on)
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
2 changes: 1 addition & 1 deletion tests/NestedOutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Markus Tacker <tacker@php.net>
*/

require_once '../Lite/NestedOutput.php';
require_once 'Cache/Lite/NestedOutput.php';

class NestedOutputTest extends PHPUnit_Framework_TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Bench script of Cache_Lite
// $Id$

require_once('Cache/Lite.php');
require_once 'Cache/Lite.php';

$options = array(
'caching' => true,
Expand Down
2 changes: 1 addition & 1 deletion tests/bench2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Bench script of Cache_Lite_Output
// $Id$

require_once('Cache/Lite/Output.php');
require_once 'Cache/Lite/Output.php';

$options = array(
'caching' => true,
Expand Down
10 changes: 5 additions & 5 deletions tests/bench3.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Bench script of Cache_Lite_Function
// $Id$

require_once('Cache/Lite/Function.php');
require_once 'Cache/Lite/Function.php';

$options = array(
'caching' => true,
Expand All @@ -24,7 +24,7 @@
$data = $cache->call('bench::static_method_to_bench', 23, 66);
echo($data);

function function_to_bench($arg1, $arg2)
function function_to_bench($arg1, $arg2)
{
for($i=0;$i<10000;$i++) {
$tmp = md5(md5(md5('Loosing time...')));
Expand All @@ -43,10 +43,10 @@ function method_to_bench($arg1, $arg2)
$tmp = md5(md5(md5('Loosing time...')));
}
echo "\$obj->test = $this->test and this is the output of the method \$obj->method_to_bench($arg1, $arg2) !<br>";
return "\$obj->test = $this->test and this is the result of the method \$obj->method_to_bench($arg1, $arg2) !<br>";
return "\$obj->test = $this->test and this is the result of the method \$obj->method_to_bench($arg1, $arg2) !<br>";
}
function static_method_to_bench($arg1, $arg2)

function static_method_to_bench($arg1, $arg2)
{
for($i=0;$i<10000;$i++) {
$tmp = md5(md5(md5('Loosing time...')));
Expand Down
3 changes: 0 additions & 3 deletions tests/cache_lite_base.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<?php

error_reporting(E_ALL);
require_once('Cache/Lite.php');

?>
3 changes: 0 additions & 3 deletions tests/cache_lite_file_base.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<?php

error_reporting(E_ALL);
require_once('Cache/Lite/File.php');

?>
3 changes: 0 additions & 3 deletions tests/cache_lite_function_base.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<?php

error_reporting(E_ALL);
require_once('Cache/Lite/Function.php');

?>
5 changes: 1 addition & 4 deletions tests/cache_lite_output_base.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<?php

error_reporting(E_ALL);
require_once('Cache/Lite/Output.php');

require_once 'Cache/Lite/Output.php';
?>
43 changes: 21 additions & 22 deletions tests/pearbug13693.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
pearbug13693
--FILE--
<?php
require_once 'Cache/Lite.php';

require_once 'Cache/Lite.php';

// Create temp dir
$dir = dirname( __FILE__ ) . '/' . uniqid();
mkdir( $dir );

$options = array(
'cacheDir' => $dir,
'lifeTime' => 60,
);
$id = '#13693';
$cache = new Cache_Lite($options);
$cache->save('stuff', $id);
// Must be true
echo ( $cache->remove($id) === true ) ? "OK\n" : "ERROR\n";
// Will return a PEAR Error
echo ( $cache->remove($id) instanceof PEAR_Error ) ? "OK\n" : "ERROR\n";
// Will return true
echo ( $cache->remove($id, 'default', true) === true ) ? "OK\n" : "ERROR\n";

// Remove temp dir
rmdir( $dir );
// Create temp dir
$dir = dirname( __FILE__ ) . '/' . uniqid();
mkdir($dir);

$options = array(
'cacheDir' => $dir,
'lifeTime' => 60,
);
$id = '#13693';
$cache = new Cache_Lite($options);
$cache->save('stuff', $id);
// Must be true
echo $cache->remove($id) === true ? "OK\n" : "ERROR\n";
// Will return a PEAR Error
echo $cache->remove($id) instanceof PEAR_Error ? "OK\n" : "ERROR\n";
// Will return true
echo $cache->remove($id, 'default', true) === true ? "OK\n" : "ERROR\n";

// Remove temp dir
rmdir($dir);
--EXPECT--
OK
OK
Expand Down
10 changes: 5 additions & 5 deletions tests/pearbug18192.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

/**
* Process for test pearbug18192
*
*
* @see https://pear.php.net/bugs/bug.php?id=18192
* @author Markus Tacker <tacker@php.net>
*/

require_once 'Cache/Lite.php';
$c = new Cache_Lite(array('cacheDir' => '.', 'lifeTime' => 60,));
$id = '#18192';
require_once 'Cache/Lite.php';
$c = new Cache_Lite(array('cacheDir' => '.', 'lifeTime' => 60));
$id = '#18192';
for ($i = 0; $i < 100000; $i++) {
$str = uniqid('some-string', true);
$str = uniqid('some-string', true);
if (!$c->save($str, $id)) fputs(STDERR, "Error saving.\n");
if ($c->get($id) !== $str) fputs(STDERR, "Wrong data.\n");
}
6 changes: 3 additions & 3 deletions tests/pearbug513.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pearbug513
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
6 changes: 3 additions & 3 deletions tests/pearbug7618.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pearbug7618
--FILE--
<?php

require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_base.inc');
require_once 'callcache.inc';
require_once 'tmpdir.inc';
require_once 'cache_lite_base.inc';

$options = array(
'cacheDir' => tmpDir() . '/',
Expand Down
Loading

0 comments on commit 4eb620f

Please sign in to comment.