Repository navigation
Expand file tree
/
Copy pathtest.php
More file actions
127 lines (87 loc) · 3.14 KB
/
Copy pathtest.php
File metadata and controls
127 lines (87 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
use Method\Common\Config\DBConfig;
use Method\Common\DB\MysqliDB;
require_once('vendor/autoload.php');
$dbConfig = new DBConfig('tests/data/MysqliDBTest1.json');
$example = new MysqliDB($dbConfig);
/* @var mysqli $db */
//$db = $example->getMysqli();
$query = "SELECT * FROM `test`";
$result = $example->Query($query);
//$result = $db->query($query);
//$res = $result->getResult();
//$res->free();
//$result = $example->Query($query);
//$result->free();
//this file's sole purpose is to test all things within; comment or uncomment that which you don't want to test...
// use Method\Common\Cache\Cache;
// function TestCache(){
// // to test the cache we should do a few things
// // 1. a. Loading the cache that we know doesn't exist
// // b. Loading the cache that we know does exist
// //
// // 2. a. Access data we know is not there
// // b. Access data we know is there
// //
// // 3. Check the remove works
// // 4. Check the clear works
// $cacheOne = new Cache("cacheOne",false,false,false,10);
// $cacheTwo = new Cache("cacheTwo");
// $cacheOneFile = $cacheOne->GetCacheLocation();
// $cacheTwoFile = $cacheTwo->GetCacheLocation();
// if(file_exists($cacheTwoFile)){
// unlink($cacheTwoFile);
// // cache two is now gone.
// }
// // force the loading
// $cacheOne->Load();
// $cacheTwo->Load();
// echo "Caches Loaded:\n<br />";
// echo "<pre>\n";
// var_dump($cacheOne->IsLoaded(),$cacheTwo->IsLoaded());
// echo "</pre>\n";
// //access data
// $dataOneOne = $cacheOne->Get('data_one');
// $dataOneTwo = $cacheOne->Get('data_two');
// $dataTwoOne = $cacheTwo->Get('data_one');
// $dataTwoTwo = $cacheTwo->Get('data_two');
// echo "Data Retrieved:\n<br />";
// echo "<pre>\n";
// var_dump($dataOneOne,$dataOneTwo,$dataTwoOne,$dataTwoTwo);
// echo "</pre>\n";
// //now try storing the data
// $cacheOne->Store('data_one',1.1);
// $cacheOne->Store('data_two',1.2);
// $cacheTwo->Store('data_one',2.1);
// $cacheTwo->Store('data_two',2.2);
// echo "Data Stored.\n<br />\n<br />";
// echo "Caches Cachable:\n<br />";
// echo "<pre>\n";
// var_dump($cacheOne->IsCachable(),$cacheTwo->IsCachable());
// echo "</pre>\n";
// //now quickly retrieve what we stored and we can see if the cache worked by reloading
// //access data
// $dataOneOne = $cacheOne->Get('data_one');
// $dataOneTwo = $cacheOne->Get('data_two');
// $dataTwoOne = $cacheTwo->Get('data_one');
// $dataTwoTwo = $cacheTwo->Get('data_two');
// echo "Data Retrieved (again):\n<br />";
// echo "<pre>\n";
// var_dump($dataOneOne,$dataOneTwo,$dataTwoOne,$dataTwoTwo);
// echo "</pre>\n";
// }
// TestCache();
// echo "<br/>\nTests Complete\n<br/>";
//
//use Method\Common\Remote\Server;
//// use Method\Config\JSONConfig;
//
//
//
//$testServer = new Server();
//$testServer->SetUsername('codeserver');
//$testServer->SetHost('codeserver');
//$testServer->SetPassword('none');
//$testServer->Connect();
//$result = $testServer->Run('ls -al');
//var_dump($result);