HugeGlobal PHP Functions
HugeGlobal offers a number of utilies for managing clusters, servers, disks, files, databases, and performance metrics:
Adds an Ubuntu command to be run as the sudo user during the next heartbeat
After RunCommand is called, GetCommandResult checks the status of the command's execution and returns the output if completed. $commandIds can be an array of command id strings or a single command id string.
$HugeGlobal->CopyFileIn($fileLoc, $fileDetails, $options)
Adds a file to the HugeGlobal file repository from elsewhere on disk and keeps the original file.
$HugeGlobal->MoveFileIn($fileLoc, $fileDetails, $options)
Adds a file to the HugeGlobal file repository from elsewhere on disk and deletes the original file. This should be used if the developer wants to import some files and free up space by deleting the original file.
To optimize performance, HugeGlobal uses a Redis cache to decease data lookup times for common objects. Call ClearCache to clear the cache completely so that the next data retrieval will be guaranteed to come from the database directly.
The host details(information about the server) is stored ina file called hostdetails and is cached in Redis for faster data retrieval.
GetConfig gets all the information about the host details(see getHostDetails) but also returns all of the other info about the server that is stored in the database.
This method provides a simple war for the developer to check if the PostgreSQL and Redis PHP modules are properly installed and if the Database is configured. Always ensure hugeGlobalConfig.php is properly configured and that the database you reference exists with permissions granted for your user.