Example #1
0
 $a = 0;
 $b = $a + $bitrate;
 $mp3_title = $offset = NULL;
 $time_start = time();
 $i = 1;
 $m = 0;
 $cache = 4;
 for (;;) {
     if (connection_aborted()) {
         exit;
     }
     if ($b > $mp3_length) {
         $b = $mp3_length;
     }
     $data = substr($mp3_data, $a, $b - $a) . $offset;
     echo_block($data);
     ob_flush();
     if ($b == $mp3_length) {
         break;
     }
     $a += $bitrate;
     $b = $a + $bitrate;
     if ($i > $cache) {
         $time_wake_up = $time_start + $i;
         @sleep($time_wake_up - $m - time());
     } else {
         $time_wake_up = $time_start + $i;
         @sleep($time_wake_up - $m + 0.5 - time());
         ++$m;
     }
     ++$i;
Example #2
0
        echo_style('green', '.');
    }
}
$checkPassed = empty($messages['error']);
foreach ($symfonyRequirements->getRecommendations() as $req) {
    if ($helpText = get_error_message($req, $lineSize)) {
        echo_style('yellow', 'W');
        $messages['warning'][] = $helpText;
    } else {
        echo_style('green', '.');
    }
}
if ($checkPassed) {
    echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects');
} else {
    echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects');
    echo_title('Fix the following mandatory requirements', 'red');
    foreach ($messages['error'] as $helpText) {
        echo ' * ' . $helpText . PHP_EOL;
    }
}
if (!empty($messages['warning'])) {
    echo_title('Optional recommendations to improve your setup', 'yellow');
    foreach ($messages['warning'] as $helpText) {
        echo ' * ' . $helpText . PHP_EOL;
    }
}
echo PHP_EOL;
echo_style('title', 'Note');
echo '  The command console could use a different php.ini file' . PHP_EOL;
echo_style('title', '~~~~');