本文整理汇总了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;