本文整理汇总了PHP中stream函数的典型用法代码示例。如果您正苦于以下问题:PHP stream函数的具体用法?PHP stream怎么用?PHP stream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stream函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Request $request)
{
$this->validate($request, ['url' => 'required|string', 'metadata' => 'json', 'type_id' => 'integer|exists:flag_types,id', 'text' => 'string']);
\DB::transaction(function () use($request) {
$flag = Flag::create($request->all() + ['user_id' => auth()->id()]);
$object = new Stream_Flag(['id' => $flag->id, 'displayName' => excerpt($request->text)]);
stream(Stream_Create::class, $object);
});
}
示例2: doc
function doc()
{
extract($_REQUEST);
// Retrieve file
db_conn("cubit");
$sql = "SELECT * FROM document_files WHERE id='{$id}'";
$jf_rslt = db_exec($sql) or errDie("Unable to retrieve jobcard files.");
$jf_data = pg_fetch_array($jf_rslt);
stream($jf_data["filename"], base64_decode($jf_data["file"]), $jf_data["type"]);
}
示例3: signout
/**
* Wylogowanie uzytkownika
*
* @return \Illuminate\Http\RedirectResponse
*/
public function signout()
{
$user = User::findOrFail(auth()->user()->id);
$user->ip = request()->ip();
$user->browser = request()->browser();
// metoda browser() nie jest dostepna dla testow funkcjonalnych
$user->visited_at = Carbon::now();
$user->visits = auth()->user()->visits + 1;
$user->save();
stream(Stream_Logout::class);
Auth::logout();
return back();
}
示例4: printDload
function printDload($docid)
{
# Connect to database
db_conn("cubit");
# Query server
$i = 0;
$sql = "SELECT * FROM documents WHERE docid = '{$docid}' AND div = '" . USER_DIV . "'";
$docRslt = db_exec($sql) or errDie("Unable to retrieve Documents from database.");
if (pg_numrows($docRslt) < 1) {
return "<li>Document not found";
}
$doc = pg_fetch_array($docRslt);
$output = doclib_decode($doc['docu']);
stream($doc['filename'], $output, $doc['mimetype']);
}
示例5: testMultiSort
public function testMultiSort()
{
$stream = stream(array(array(1, 3), array(2, 2), array(3, 1), array(4, 2), array(5, 2)))->sort(ComparatorFactory::create(function ($first, $second) {
return $first[1] - $second[1];
}))->sort(ComparatorFactory::create(function ($first, $second) {
return $first[0] - $second[0];
}));
$this->assertEquals(array(3, 1), $stream->first());
$this->assertEquals(array(1, 3), $stream->last());
$stream->rewind();
$stream->next();
$this->assertEquals(array(2, 2), $stream->current());
$stream->next();
$this->assertEquals(array(4, 2), $stream->current());
$stream->next();
$this->assertEquals(array(5, 2), $stream->current());
}
示例6: signup
/**
* Obsluga formularza rejestracji uzytkownika
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function signup(Request $request)
{
$this->validate($request, ['name' => 'required|min:2|max:28|username|unique:users', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:3', 'human' => 'required']);
DB::beginTransaction();
try {
$email = $request->input('email');
$user = User::create(['name' => $request->input('name'), 'email' => $email, 'password' => bcrypt($request->input('password'))]);
$actkey = Actkey::create(['actkey' => str_random(), 'user_id' => $user->id]);
// taki format linku zachowany jest ze wzgledu na wsteczna kompatybilnosc.
// z czasem mozemy zmienic ten format aby wskazywal na /User/Confirm/Email/<id>/<actkey>
$url = route('user.email') . '?id=' . $user->id . '&actkey=' . $actkey->actkey;
Mail::queue('emails.signup', ['url' => $url], function ($message) use($email) {
$message->to($email);
$message->subject('Dziękujemy za rejestrację. Potwierdź autentyczność swojego adresu e-mail');
});
Auth::login($user, true);
stream(Stream_Create::class, new Stream_Person());
DB::commit();
} catch (\Exception $e) {
DB::rollBack();
throw $e;
}
return redirect()->intended(route('home'));
}
示例7: count
$sql2 = "SELECT count(*) as posts FROM comment WHERE {$get}!='' ";
$cntqu = mysql_query($sql2);
$cntrow = mysql_fetch_array($cntqu);
$page = ceil($cntrow['posts'] / POST_PER_PAGE);
while ($row = mysql_fetch_array($tname)) {
$id = $row['uid'];
$name = $row['name'];
$kcom = $row['anew'];
$kclg = $row['college'];
$email = $row['email'];
$strea = $row['stream'];
if ($kcom != null) {
if (isset($_SESSION['femail']) && $_SESSION['femail'] != "") {
$kemail = $_SESSION['femail'];
$ksetclg = $_SESSION['fclg'];
$stre = stream($ksetclg);
} else {
$kemail = "";
}
if ($kemail == $email) {
$delink = "<a href=\"delete.php?ud=" . $id . "\">Delete</a>";
} else {
$delink = "";
}
if ($strea == $stre) {
$img = image($kclg);
echo '<div class="media">
<a class="pull-left" href="#">
<img class="media-object" src="../assets/img/' . $img . '.jpg" alt="...">
</a>
<div class="media-body">
示例8: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="niiith.php?clg=<?php
echo news('Indian Institute of Technology(IIT) Guwahati');
?>
&str=<?php
echo stream('Indian Institute of Technology(IIT) Guwahati');
?>
">
<h4>Post news about your college <small> @ be responsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>
示例9: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</font></small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="nnalsar.php?clg=<?php
echo news('ILS Law College ,Pune');
?>
&str=<?php
echo stream('ILS Law College ,Pune');
?>
">
<h4>Post news about your college <small> @ be rewsponsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>
示例10: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</font></small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="naiimsd.php?clg=<?php
echo news('Armed Forces Medical College(AFMC) ,Pune');
?>
&str=<?php
echo stream('Armed Forces Medical College(AFMC) ,Pune');
?>
">
<h4>Post news about your college <small> @ be responsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>
示例11: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</font></small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="ncmcv.php?clg=<?php
echo news('Kasturba Medical College ,Manipal');
?>
&str=<?php
echo stream('Kasturba Medical College ,Manipal');
?>
">
<h4>Post news about your college <small> @ be responsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>
示例12: pclose
pclose($temp);
} elseif ($rate != 0) {
$temp = @popen($mp3out, "r");
while ($data = @fread($temp, $blocksize)) {
echo $data;
}
pclose($temp);
} elseif ($mode == 1) {
$temp = @fopen($mp3out, "r");
while (!feof($temp) && $totaldata <= $size) {
$data = @fread($temp, $blocksize);
echo $data;
$totaldata += $blocksize;
}
fclose($temp);
} else {
$temp = @fopen($mp3out, "r");
while (!feof($temp)) {
$data = @fread($temp, $blocksize);
echo $data;
}
fclose($temp);
}
}
// end IF for verify IP
exit;
}
fb("Now Playing: i=" . $_GET['i'] . ", b=" . $_GET['b'] . ", s=" . $_GET['s'] . ", u=" . $_GET['u'] . " on: " . $_SERVER['REMOTE_ADDR']);
// Play Now
stream($_GET['i'], $_GET['b'], $_GET['s'], $_GET['u'], $_SERVER['REMOTE_ADDR']);
示例13: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</font></small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="niima.php?clg=<?php
echo news('Management Development Institute(MDI) ,Gurgaon');
?>
&str=<?php
echo stream('Management Development Institute(MDI) ,Gurgaon');
?>
">
<h4>Post news about your college <small> @ be rewsponsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>
示例14: md5
$audio = $json['response'][0];
$fileName = $audio["artist"] . " - " . $audio["title"];
$audioUrl = $audio["url"];
$filePath = "dl/" . md5($audioId) . ".mp3";
//caching mp3s, md5 for unique audioIds
if (file_exists($filePath)) {
if ($isStream) {
stream($filePath, $fileName);
} else {
forceDownload($filePath, $fileName);
}
return;
} else {
if (downloadFile($audioUrl, $filePath)) {
if ($isStream) {
stream($filePath, $fileName);
} else {
forceDownload($filePath, $fileName);
}
}
}
//Functions
/**
* Download file with given name to given path
* @param $url url to download
* @param $path output filepath
* @return true if success, else you know what
*/
function downloadFile($url, $path)
{
$fp = fopen($path, 'wb');
示例15: news
</a>
<div class="media-body">
<h6 class="media-heading"><b>' . $name . ' </b><small>' . $kclg . ' <font face="Latha" size="1px">[posted on ' . $samay . ']</font></small></h6>
' . $kcom . '<br/><small>' . $delink . '</small>
</div>
</div>';
}
$c = $c + 1;
}
?>
</div>
<div class="panel-footer">
<form class="form-horizontal" role="form" method="post" action="niiith.php?clg=<?php
echo news('Indian Institute of Technology(IIT) Kharagpur');
?>
&str=<?php
echo stream('Indian Institute of Technology(IIT) Kharagpur');
?>
">
<h4>Post news about your college <small> @ be responsible and help others</small></h4>
<div class="form-group" style="padding:14px;">
<textarea class="form-control" placeholder="@ feel free" name="niitk"></textarea>
</div>
<button class="btn btn-success pull-right" type="submit" name="subniitk" value="Post">Post</button><ul class="list-inline"><li><a href="#"><i class="glyphicon glyphicon-align-left"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-center"></i></a></li><li><a href="#"><i class="glyphicon glyphicon-align-right"></i></a></li></ul>
</form>
</div>
</div>
</div>
</div>