本文整理匯總了PHP中Stream::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stream::all方法的具體用法?PHP Stream::all怎麽用?PHP Stream::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stream
的用法示例。
在下文中一共展示了Stream::all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
}
if (isset($_POST['mass_start'])) {
if (isset($_POST['mselect'])) {
foreach ($_POST['mselect'] as $streamids) {
start_stream($streamids);
}
}
$message['type'] = "success";
$message['message'] = "Streams started";
}
if (isset($_POST['mass_stop'])) {
if (isset($_POST['mselect'])) {
foreach ($_POST['mselect'] as $streamids) {
stop_stream($streamids);
}
}
$message['type'] = "success";
$message['message'] = "Streams stopped";
}
if (isset($_GET['running']) && $_GET['running'] == 1) {
$title = "Running Streams";
$stream = Stream::where('status', '=', 1)->get();
} else {
if (isset($_GET['running']) && $_GET['running'] == 2) {
$title = "Stopped Streams";
$stream = Stream::where('status', '=', 2)->get();
} else {
$stream = Stream::all();
}
}
echo $template->view()->make('streams')->with('streams', $stream)->with('message', $message)->with('title', $title)->render();
示例2: logincheck
<?php
/**
* Created by Tyfix 2015
*/
include 'config.php';
logincheck();
//Create settings if not exists
$settings = Setting::first();
if (is_null($settings)) {
$settings = new Setting();
$settings->webip = $_SERVER['SERVER_ADDR'];
$settings->webport = 8000;
$settings->save();
}
$all = Stream::all()->count();
$online = Stream::where('running', '=', 1)->count();
$offline = Stream::where('running', '=', 0)->count();
//space
$space_pr = 0;
$space_free = round(disk_free_space('/') / 1048576, 1);
$space_total = round(disk_total_space('/') / 1048576, 1);
$space_pr = (int) (100 * ($space_free / $space_total));
if (stristr(PHP_OS, 'win')) {
//cpu
$cpu_usage = 2;
$cpu_total = 10;
$cpu_pr = $cpu_usage / $cpu_total * 100;
//memory
$mem_usage = 20;
$mem_total = 120;