本文整理汇总了PHP中stream函数的典型用法代码示例。如果您正苦于以下问题:PHP stream函数的具体用法?PHP stream怎么用?PHP stream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stream函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
});
}
开发者ID:furious-programming,项目名称:coyote,代码行数:9,代码来源:FlagController.php
示例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"]);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:10,代码来源:getfile.php
示例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();
}
开发者ID:furious-programming,项目名称:coyote,代码行数:18,代码来源:LoginController.php
示例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']);
}
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:15,代码来源:view.php
示例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());
}
开发者ID:hunts,项目名称:stream-php,代码行数:17,代码来源:StreamTest.php
示例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'));
}
开发者ID:furious-programming,项目名称:coyote,代码行数:30,代码来源:RegisterController.php
示例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">
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:reqs.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:iitg.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:ilsp.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:afmc.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:kmcm.php
示例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']);
开发者ID:benbruscella,项目名称:Gramophone,代码行数:30,代码来源:playstream.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:xlri.php
示例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');
开发者ID:javissimo,项目名称:music,代码行数:31,代码来源:download.php
示例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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:iitkgp.php
示例16: 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) Roorkee');
?>
&str=<?php
echo stream('Indian Institute of Technology(IIT) Roorkee');
?>
">
<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>
</div>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:iitr.php
示例17: save
public function save(PostRequest $request, $forum, $topic, $post = null)
{
$url = \DB::transaction(function () use($request, $forum, $topic, $post) {
// parsing text and store it in cache
$text = app()->make('Parser\\Post')->parse($request->text);
// post has been modified...
if ($post !== null) {
$this->authorize('update', [$post, $forum]);
$data = $request->only(['text', 'user_name']) + ['edit_count' => $post->edit_count + 1, 'editor_id' => auth()->id()];
$post->fill($data)->save();
$activity = Stream_Update::class;
// user want to change the subject. we must update topics table
if ($post->id === $topic->first_post_id) {
$path = str_slug($request->get('subject'), '_');
$topic->fill($request->all() + ['path' => $path])->save();
$this->topic->setTags($topic->id, $request->get('tag', []));
}
} else {
$activity = Stream_Create::class;
// create new post and assign it to topic. don't worry about the rest: trigger will do the work
$post = $this->post->create($request->all() + ['user_id' => auth()->id(), 'topic_id' => $topic->id, 'forum_id' => $forum->id, 'ip' => request()->ip(), 'browser' => request()->browser(), 'host' => request()->server('SERVER_NAME')]);
// get id of users that were mentioned in the text
$usersId = (new Ref_Login())->grab($text);
if ($usersId) {
app()->make('Alert\\Post\\Login')->with(['users_id' => $usersId, 'sender_id' => auth()->id(), 'sender_name' => $request->get('user_name', auth()->user()->name), 'subject' => excerpt($topic->subject, 48), 'excerpt' => excerpt($text), 'url' => route('forum.topic', [$forum->path, $topic->id, $topic->path], false)])->notify();
}
}
$url = route('forum.topic', [$forum->path, $topic->id, $topic->path], false);
$url .= '?p=' . $post->id . '#id' . $post->id;
$object = (new Stream_Post(['url' => $url]))->map($post);
stream($activity, $object, (new Stream_Topic())->map($topic, $forum));
return $url;
});
return redirect()->to($url);
}
开发者ID:furious-programming,项目名称:coyote,代码行数:35,代码来源:PostController.php
示例18: news
<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('All Indian Institute Of Medical Science(AIIMS) Delhi');
?>
&str=<?php
echo stream('All Indian Institute Of Medical Science(AIIMS) Delhi');
?>
">
<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>
<?php
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:med_g.php
示例19: 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="nbitm.php?clg=<?php
echo news('Indian Institute Of Information Technology(IIIT) Hyderabad');
?>
&str=<?php
echo stream('Indian Institute Of Information Technology(IIIT) Hyderabad');
?>
">
<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>
开发者ID:abhilash-tango,项目名称:collegeconnect,代码行数:31,代码来源:bitm.php
示例20: get
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program. If not, see <http://www.gnu.org/licenses/>. |
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | stream.php |
// +------------------------------------------------------------------------+
require_once 'include/initialize.inc.php';
require_once 'include/stream.inc.php';
require_once 'include/cache.inc.php';
$action = get('action');
$album_id = get('album_id');
if ($action == 'playlist') {
playlist();
} elseif ($action == 'stream') {
stream();
} elseif ($action == 'shareAlbum') {
shareAlbum($album_id);
} else {
message(__FILE__, __LINE__, 'error', '[b]Unsupported input value for[/b][br]action');
}
exit;
// +------------------------------------------------------------------------+
// | Playlist |
// +------------------------------------------------------------------------+
function playlist()
{
global $cfg, $db;
$stream_id = get('stream_id');
$track_id = get('track_id');
$album_id = get('album_id');
开发者ID:jdeblese,项目名称:ompd-mod,代码行数:31,代码来源:stream.php
注:本文中的stream函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论