GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
FileWriteTask Class Reference

Public Member Functions

 __construct ($path, $contents, $flags=0)
 
 onRun ()
 
- Public Member Functions inherited from AsyncTask
 isGarbage ()
 
 setGarbage ()
 
 isFinished ()
 
 run ()
 
 isCrashed ()
 
 getResult ()
 
 cancelRun ()
 
 hasCancelledRun ()
 
 hasResult ()
 
 setResult ($result, $serialize=true)
 
 setTaskId ($taskId)
 
 getTaskId ()
 
 getFromThreadStore ($identifier)
 
 saveToThreadStore ($identifier, $value)
 
 onRun ()
 
 onCompletion (Server $server)
 
 cleanObject ()
 
- Public Member Functions inherited from Threaded
 chunk ($size, bool $preserve=false)
 
 count ()
 
 isRunning ()
 
 isTerminated ()
 
 merge ($from, $overwrite=true)
 
 notify ()
 
 notifyOne ()
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 pop ()
 
 run ()
 
 shift ()
 
 synchronized (\Closure $function, $args=null)
 
 wait ($timeout)
 
 getRefCount ()
 
 addRef ()
 
 delRef ()
 
 isGarbage ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Threaded
static extend ($obj)
 
- Data Fields inherited from AsyncTask
 $worker = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $path,
  $contents,
  $flags = 0 
)

FileWriteTask constructor.

Parameters
$path
$contents
int$flags
37  {
38  $this->path = $path;
39  $this->contents = $contents;
40  $this->flags = (int) $flags;
41  }

Member Function Documentation

◆ onRun()

onRun ( )
43  {
44  try{
45  file_put_contents($this->path, $this->contents, (int) $this->flags);
46  }catch(\Throwable $e){
47 
48  }
49  }

The documentation for this class was generated from the following file: