本文整理汇总了PHP中f::append方法的典型用法代码示例。如果您正苦于以下问题:PHP f::append方法的具体用法?PHP f::append怎么用?PHP f::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类f
的用法示例。
在下文中一共展示了f::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAppend
public function testAppend()
{
$this->assertTrue(f::append($this->tmpFile, ' is awesome'));
}
示例2: site
//if page is accessed thorugh ajax
if (r::ajax()) {
//store sanitized $_POST variables
$currentTestData = r::postData(array('test', 'user', 'data'));
//get logged user (if any)
if ($user = Auth::loggedUser()) {
//get user's session page
$userSession = site()->find(implode(DS, array(c::get('sessions.folder'), $user->session())));
//istantiate testSession object
$tSession = new testSession($userSession, $user->username());
//get user's current session status
$userSessionStatus = $user->status();
//if ajaxed $currentTestData equals user's current session status
if (str::lower($currentTestData['test']) == str::lower($userSessionStatus)) {
//if it was possitble to update user's results file (by appending $currentTestData)
if (f::append($tSession->getUserResultsFile(), PHP_EOL . a::json($currentTestData))) {
//set updated user's session status to next avalibale test
$updatedStatus = $tSession->getNextTest($currentTestData['test']);
//if there aren't tests available, set user's session statuts to completed session
if (!$updatedStatus) {
$updatedStatus = c::get('session.status.completed');
}
//update user's session status to next avalibale test
$user->update(array('status' => $updatedStatus));
//return to tests page
$url = $pages->find(c::get('tests.folder'))->url();
}
}
}
} else {
//go to errorPage, since page wasn't accessed through ajax