| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- class bigdata {
-
-
- public $absolutePrefix = '';
- public $relativePrefix = '';
-
-
- static function startDataSession($data='') {
- $this->absolutePrefix = 'static/uploads/temps/';
- $this->relativePrefix = '';
-
- if ($data!='') {
- $temp_file_name = $this->absolutePrefix.time().".dat";
- file_put_contents($this->relativePrefix.$temp_file_name,$data);
- return $temp_file_name;
- }
- else {
- return false;
- }
- }
-
-
- static function appendDataSession($data,$temp_file_name='') {
- if ($data!='' && $temp_file_name!='') {
- $fa = fopen($this->relativePrefix.$temp_file_name,'a');
- fwrite($fa,$data);
- fclose($fa);
- return $temp_file_name;
- }
- else {
- return $temp_file_name;
- }
- }
-
-
- static function loadDataFile($file_name='') {
- if ($file_name!='') {
- $data = file_get_contents($file_name);
- return $data;
- }
- else {
- return false;
- }
- }
-
-
- }
|