-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYonnaStream.php
50 lines (42 loc) · 1.14 KB
/
YonnaStream.php
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
<?php
namespace Yonna\Foundation;
class YonnaStream
{
private $string;
private $position;
public function stream_open($path)
{
$path = str_replace(_____ . '://', '', $path);
$this->string = $fileData = base64_decode(openssl_decrypt($path, 'aes-256-cfb', ______, 0, _______));
$this->position = 0;
return true;
}
public function stream_read($count)
{
$ret = substr($this->string, $this->position, $count);
$this->position += strlen($ret);
return $ret;
}
public function stream_eof()
{
}
public function stream_stat()
{
}
}
stream_wrapper_register(_____, ____);
function hap($res)
{
$res = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $res);
foreach ([PATH_APP, PATH_H_PHP, PATH_PLUGINS] as $path) {
$file = $path . DIRECTORY_SEPARATOR . $res . '.dll';
$file_p = $path . DIRECTORY_SEPARATOR . $res . PHP_EXT;
if (is_file($file)) {
require(_____ . '://' . file_get_contents($file));
break;
} elseif (is_file($file_p)) {
require($file_p);
break;
}
}
}