Beispiel #1
0
 /**
  * Number of file operations.
  * @return array
  * @static
  * @final
  */
 public static final function NumberFileOperations()
 {
     if (FileSystem::FolderDeletion() === false || FileSystem::FileDeletion() === false) {
         return false;
     }
     if (file_exists("{$_SERVER['DOCUMENT_ROOT']}/test_operations")) {
         for ($j = 0; $j < 100; $j++) {
             @unlink("{$_SERVER['DOCUMENT_ROOT']}/test_operations/test_file_{$j}.php");
         }
         @rmdir("{$_SERVER['DOCUMENT_ROOT']}/test_operations");
     }
     $operations = array();
     @mkdir("{$_SERVER['DOCUMENT_ROOT']}/test_operations");
     $fileName = "{$_SERVER['DOCUMENT_ROOT']}/test_operations/test_file_#j#.php";
     $body = "<?\$a='" . str_repeat("q", 1024) . "';?><?/*" . str_repeat("w", 1024) . "*/?><?\$b='" . str_repeat("e", 1024) . "';?>";
     for ($i = 0; $i < 4; $i++) {
         $time = Tools::getTime();
         for ($j = 0; $j < 100; $j++) {
             $file = str_replace("#j#", $j, $fileName);
         }
         $firstResult = Tools::getTime() - $time;
         $time = Tools::getTime();
         for ($j = 0; $j < 100; $j++) {
             $file = str_replace("#j#", $j, $fileName);
             $fileRes = @fopen($file, "wb");
             @fwrite($fileRes, $body);
             @fclose($fileRes);
             @(include $file);
             @unlink($file);
         }
         $secondResult = Tools::getTime() - $time;
         if ($secondResult > $firstResult) {
             $operations[] = 100 / ($secondResult - $firstResult);
         }
     }
     if (file_exists("{$_SERVER['DOCUMENT_ROOT']}/test_operations")) {
         for ($j = 0; $j < 100; $j++) {
             @unlink("{$_SERVER['DOCUMENT_ROOT']}/test_operations/test_file_{$j}.php");
         }
         @rmdir("{$_SERVER['DOCUMENT_ROOT']}/test_operations");
     }
     return array('value' => number_format(count($operations) > 0 ? array_sum($operations) / (double) count($operations) : 0, 1, '.', ''), 'postfix' => 'FOPS');
 }
Beispiel #2
0
$b->add('Sending Big Emails', HighLoad::SendingBigEmails(), null, null, 'Checking the sending big emails.');
$b->add('Uploads Big File', HighLoad::UploadsBigFile(1000), null, null, 'Checking upload big files to the server.');
$b->addHeader('Http server.');
$b->add('Server', Http::Server(), null, null, 'Finds the current http server.');
$b->add('Protocol', Http::Protocol(), null, null, 'Gets the protocol HTTP.');
$b->add('Real IP', Http::RealIP(), null, null, 'Gets real ip address of the server.');
$b->add('Authorization', Http::Authorization(), null, null, 'Checks authorization via http.');
$b->add('Sessions', Http::Sessions(), null, null, 'Checks work sessions via http.');
$b->add('SSL', Http::SSL('www.google.com'), null, null, 'Checks operation ssl via http.');
$b->add('SSL Lib Version', Http::SSLLibVersion(), null, null, 'Checks ssl Version.');
$b->add('Local Redirect', Http::LocalRedirect(), null, null, 'Checks work local redirect via http.');
$b->addHeader('File system.');
$b->add('Disk Space', FileSystem::DiskSpace(), '255', '<', 'Checking disk space.');
$b->add('Permissions Folder', FileSystem::PermissionsFolder(), '0777', '>', 'Checking access rights to the folder.');
$b->add('Folder Creation', FileSystem::FolderCreation(), true, '=', 'Checking folder creation.');
$b->add('Folder Deletion', FileSystem::FolderDeletion(), true, '=', 'Checking delete the folder.');
$b->add('Permissions Folder Creation', FileSystem::PermissionsFolderCreation(), null, null, 'Checking access rights to the new folder.');
$b->add('File Creation', FileSystem::FileCreation(), null, null, 'Checking file creation.');
$b->add('File Deletion', FileSystem::FileDeletion(), true, '=', 'Checking delete the file.');
$b->add('Permissions File Creation', FileSystem::PermissionsFileCreation(), null, null, 'Checking access rights to the new file.');
$b->add('File Execution', FileSystem::FileExecution(), true, '=', 'Checking the execution file.');
$b->add('Processing Htaccess', FileSystem::ProcessingHtaccess(), true, '=', 'Checking processing htaccess.');
$b->add('Time To Create 1000 File', FileSystem::TimeToCreateFile(1000), 1, '<', 'Checking the time required to create the file.');
$b->add('File Uploads', FileSystem::FileUploads(), null, null, 'Checking upload files to the server.');
if (isset($platformdb['driver']) && isset($platformdb['host']) && isset($platformdb['user']) && isset($platformdb['password']) && isset($platformdb['dbname'])) {
    $db = new DB($platformdb['user'], $platformdb['password'], $platformdb['dbname'], $platformdb['host'], $platformdb['driver']);
    $b->addHeader('Data Base.');
    $b->add('Version', $db->Version());
    $b->add('UpTime', $db->UpTime(), null, null, 'Working time database startup.');
    $b->add('Global Buffers', $db->GlobalBuffers(), null, null, 'Size of global buffers.');
    $b->add('Connection Buffers', $db->ConnectionBuffers(), null, null, 'Single connection buffer size.');