本文整理汇总了PHP中Uploader::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Uploader::getName方法的具体用法?PHP Uploader::getName怎么用?PHP Uploader::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uploader
的用法示例。
在下文中一共展示了Uploader::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factory
public static function factory($accountType)
{
if (Instructor::getName() === $accountType) {
return new Instructor();
}
if (Uploader::getName() === $accountType) {
return new Uploader();
}
return new Student();
}
示例2: getUploadersForCourse
public static function getUploadersForCourse($courseID)
{
$args = array($courseID, Uploader::getName());
$conn = self::connect();
$stmt = $conn->prepare("SELECT userID AS id FROM Account WHERE courseID=? AND accountType=?");
$stmt->execute($args);
return $stmt->fetchAll();
}
示例3: urlencode
if ($myAcc === NULL || !$myAcc->canPromote()) {
$message = urlencode("You do not have permission to add uploaders for this course.");
header("Location: error.php?error={$message}");
exit;
}
$id = Database::getUserId($_POST['user']);
if ($id === -1) {
$id = Database::createUser($_POST['user']);
}
$acc = Database::getAccount($id, $_POST['course']);
if ($acc !== NULL && $acc->canUpload()) {
$message = urlencode("The uploader you want to add is already an uploader.");
header("Location: error.php?error={$message}");
exit;
}
Database::createAccount($id, $_POST['course'], Uploader::getName());
header("Location: admin.php?course={$courseInfo['id']}");
exit;
} else {
if (isset($_POST['remove']) && isset($_POST['removed']) && isset($_POST['token'])) {
if (!Session::verifyToken($_POST['token'])) {
$message = urlencode("The token provided does not match.");
header("Location: error.php?error={$message}");
exit;
}
$courseInfo = Database::getCourseByID($_POST['remove']);
//if the course with the id provided is not in the database then redirect and exit
if (!isset($courseInfo['id'])) {
$message = urlencode("The course provided is not valid.");
header("Location: error.php?error={$message}");
exit;