Easytalk
Whoops \ Exception \ ErrorException
(E_USER_NOTICE)
Stack frames (7)
6
debugging
…/public/lib/classes/deprecation.php276
5
core\deprecation
emit_deprecation_notice
…/public/lib/classes/deprecation.php136
4
core\deprecation
emit_deprecation_if_present
…/public/lib/deprecatedlib.php876
3
file_encode_url
…/public/theme/academi/classes/output/core/course_renderer.php112
2
theme_academi\output\core\course_renderer
available_coursebox
…/public/theme/academi/classes/output/core/course_renderer.php86
1
theme_academi\output\core\course_renderer
frontpage_available_courses
…/public/theme/academi/classes/output/core/course_renderer.php274
0
theme_academi\output\core\course_renderer
frontpage
…/public/index.php142
/www/wwwroot/speaking.yuanyi001.com/moodle/public/lib/classes/deprecation.php
/**
* Emit the relevant deprecation notice.
*
* @param deprecated $attribute
*/
protected static function emit_deprecation_notice(
deprecated $attribute,
): void {
if (!$attribute->emit) {
return;
}
$message = self::get_deprecation_string($attribute);
if ($attribute->final) {
throw new \coding_exception($message);
}
debugging($message, DEBUG_DEVELOPER);
}
}
/www/wwwroot/speaking.yuanyi001.com/moodle/public/lib/classes/deprecation.php
}
/**
* Check if a reference is deprecated.
*
* @param array|string|object $reference
* @return bool
*/
public static function is_deprecated(array|string|object $reference): bool {
return self::from($reference) !== null;
}
/**
* Emit a deprecation notice if the reference is deprecated.
*
* @param array|string|object $reference
*/
public static function emit_deprecation_if_present(array|string|object $reference): void {
if ($attribute = self::from($reference)) {
self::emit_deprecation_notice($attribute);
}
}
/**
* Emit a deprecation notice for a reference.
*
* This will emit a deprecation notice if the reference is deprecated.
* If the reference is not deprecated, the function will emit debugging information.
*
* @param array|string|object $reference
*/
public static function emit_deprecation(array|string|object $reference): void {
if ($attribute = self::from($reference)) {
self::emit_deprecation_notice($attribute);
} else {
// If the reference is not deprecated, we should not emit a notice.
// This is to prevent false positives in tests.
debugging(
"Deprecation notice requested but object is not deprecated.",
DEBUG_DEVELOPER,
/www/wwwroot/speaking.yuanyi001.com/moodle/public/lib/deprecatedlib.php
/**
* Encodes file serving url
*
* @deprecated use moodle_url factory methods instead
* @todo Final deprecation on Moodle 6.0. See MDL-84939.
*
* @param string $urlbase
* @param string $path /filearea/itemid/dir/dir/file.exe
* @param bool $forcedownload
* @param bool $https https url required
* @return string encoded file url
*/
#[\core\attribute\deprecated(
replacement: 'core\url factory methods',
since: '5.1',
mdl: 'MDL-31071'
)]
function file_encode_url($urlbase, $path, $forcedownload = false, $https = false) {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
global $CFG;
if ($CFG->slasharguments) {
$parts = explode('/', $path);
$parts = array_map('rawurlencode', $parts);
$path = implode('/', $parts);
$return = $urlbase . $path;
if ($forcedownload) {
$return .= '?forcedownload=1';
}
} else {
$path = rawurlencode($path);
$return = $urlbase . '?file=' . $path;
if ($forcedownload) {
$return .= '&forcedownload=1';
}
}
if ($https) {
/www/wwwroot/speaking.yuanyi001.com/moodle/public/theme/academi/classes/output/core/course_renderer.php
}
}
/**
* Return contents for the available course block on the frontpage.
*
* @param coursecat_helper $chelper course helper.
* @param array $course course detials.
*
* @return array $data available course data.
*/
public function available_coursebox(\coursecat_helper $chelper, $course) {
global $CFG;
$coursename = $chelper->get_course_formatted_name($course);
$data['name'] = $coursename;
$data['link'] = new \moodle_url('/course/view.php', ['id' => $course->id]);
$noimgurl = $this->output->image_url('no-image', 'theme');
foreach ($course->get_course_overviewfiles() as $file) {
$isimage = $file->is_valid_image();
$imgurl = file_encode_url("$CFG->wwwroot/pluginfile.php",
'/'. $file->get_contextid(). '/'. $file->get_component(). '/'.
$file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage);
if (!$isimage) {
$imgurl = $noimgurl;
}
}
if (empty($imgurl)) {
$imgurl = $noimgurl;
}
$data['imgurl'] = $imgurl;
return $data;
}
/**
* Render the template.
*
* @param string $template name of the template.
* @param array $data Data.
*
* @return string.
/www/wwwroot/speaking.yuanyi001.com/moodle/public/theme/academi/classes/output/core/course_renderer.php
'recursive' => true,
'limit' => $CFG->frontpagecourselimit,
'viewmoreurl' => new moodle_url('/course/index.php'),
'viewmoretext' => new lang_string('fulllistofcourses'),
]);
$chelper->set_attributes(['class' => 'frontpage-course-list-all']);
$courses = \core_course_category::top()->get_courses($chelper->get_courses_display_options());
$totalcount = \core_course_category::top()->get_courses_count($chelper->get_courses_display_options());
if (!$totalcount && !$this->page->user_is_editing() &&
has_capability('moodle/course:create', \context_system::instance())) {
// Print link to create a new course, for the 1st available category.
return $this->add_new_course_button();
}
if (!empty($courses)) {
$data = [];
$attributes = $chelper->get_and_erase_attributes('courses');
$content = \html_writer::start_tag('div', $attributes);
foreach ($courses as $course) {
$data[] = $this->available_coursebox($chelper, $course);
}
$totalcourse = count($data);
$content .= $this->render_template('availablecourses', ['courses' => $data, 'totalavacount' => $totalcourse]);
$content .= \html_writer::end_tag('div');
$this->include_frontslide_js('availablecourses');
return $content;
}
}
/**
* Return contents for the available course block on the frontpage.
*
* @param coursecat_helper $chelper course helper.
* @param array $course course detials.
*
* @return array $data available course data.
*/
public function available_coursebox(\coursecat_helper $chelper, $course) {
global $CFG;
$coursename = $chelper->get_course_formatted_name($course);
/www/wwwroot/speaking.yuanyi001.com/moodle/public/theme/academi/classes/output/core/course_renderer.php
require_once($CFG->dirroot .'/mod/forum/lib.php');
if (($newsforum = forum_get_course_forum($SITE->id, 'news')) &&
($forumcontents = $this->frontpage_news($newsforum))) {
$newsforumcm = get_fast_modinfo($SITE)->instances['forum'][$newsforum->id];
$output .= $this->frontpage_part('skipsitenews', 'site-news-forum',
$newsforumcm->get_formatted_name(), $forumcontents);
}
}
break;
case FRONTPAGEENROLLEDCOURSELIST:
$mycourseshtml = $this->frontpage_my_courses();
if (!empty($mycourseshtml)) {
$output .= $this->frontpage_part('skipmycourses', 'frontpage-course-list',
get_string('mycourses'), $mycourseshtml);
}
break;
case FRONTPAGEALLCOURSELIST:
$availablecourseshtml = $this->frontpage_available_courses();
$output .= $this->frontpage_part('skipavailablecourses', 'frontpage-available-course-list',
get_string('availablecourses'), $availablecourseshtml);
break;
case FRONTPAGECATEGORYNAMES:
$output .= $this->frontpage_part('skipcategories', 'frontpage-category-names',
get_string('categories'), $this->frontpage_categories_list());
break;
case FRONTPAGECATEGORYCOMBO:
$output .= $this->frontpage_part('skipcourses', 'frontpage-category-combo',
get_string('courses'), $this->frontpage_combo_list());
break;
case FRONTPAGECOURSESEARCH:
$output .= $this->box($this->course_search_form(''), 'd-flex justify-content-center');
break;
case FRONTPAGEPROMOTEDCOURSE:
$output .= $this->promoted_courses();
break;
/www/wwwroot/speaking.yuanyi001.com/moodle/public/index.php
$editbutton = $OUTPUT->edit_button($editurl);
$PAGE->set_button($editbutton);
}
echo $OUTPUT->header();
// Print Section or custom info.
if (!empty($CFG->customfrontpageinclude)) {
// Pre-fill some variables that custom front page might use.
$modnames = get_module_types_names();
$modnamesplural = get_module_types_names(true);
$mods = $modinfo->get_cms();
include($CFG->customfrontpageinclude);
} else if ($siteformatoptions['numsections'] > 0) {
echo $courserenderer->frontpage_section1();
}
echo $courserenderer->frontpage();
if ($editing && has_capability('moodle/course:create', context_system::instance())) {
echo $courserenderer->add_new_course_button();
}
echo $OUTPUT->footer();
Environment & details:
| Key | Value |
| lang | en |
| redirect | 0 |
empty
empty
| Key | Value |
| MoodleSession | fvo6fnrv8gs2h31kn5rvejcbgi |
| Key | Value |
| USER | stdClass Object ( [id] => 0 [mnethostid] => 1 [sesskey] => uVKrAucG0u [access] => Array ( [ra] => Array ( [/1] => Array ( [6] => 6 ) ) [time] => 1765361531 [rsw] => Array ( ) ) [enrol] => Array ( [enrolled] => Array ( ) [tempguest] => Array ( ) ) [preference] => Array ( ) ) |
| SESSION | stdClass Object ( [isnewsessioncookie] => 1 [lang] => en [cachestore_session] => Array ( [default_session-core/courseeditorstate] => Array ( ) [default_session-core/navigation_cache] => Array ( [__lastaccess__u0_fvo6fnrv8gs2h31kn5rvejcbgi] => Array ( [0] => 1765361532 [1] => 1765361532 ) ) [default_session-core/coursecat] => Array ( [u0_fvo6fnrv8gs2h31kn5rvejcbgi_93e21b4ef737be862e9c933a60b07e5b7a927100] => Array ( [0] => 1765361531.7064-6939477bac7351.99404628 [1] => 1765361531 ) [u0_fvo6fnrv8gs2h31kn5rvejcbgi_d73c215417feed004aa2bb8b8fa3cc12410f6177] => Array ( [0] => Array ( ) [1] => 1765361531 ) [u0_fvo6fnrv8gs2h31kn5rvejcbgi_86cb63f49c90727dcce714415b10daf4d0f20f9b] => Array ( [0] => Array ( [0] => 1 [1] => 2 ) [1] => 1765361531 ) [__lastaccess__u0_fvo6fnrv8gs2h31kn5rvejcbgi] => Array ( [0] => 1765361532 [1] => 1765361532 ) [u0_fvo6fnrv8gs2h31kn5rvejcbgi_a4469b84a4ab03b83a092fe6eb6df48d56aba78b] => Array ( [0] => Array ( [0] => 3 [1] => 2 ) [1] => 1765361532 ) [u0_fvo6fnrv8gs2h31kn5rvejcbgi_9678c6fde16e383fa93c466f14ce047764b87d18] => Array ( [0] => 2 [1] => 1765361532 ) ) ) ) |
| Key | Value |
| USER | www |
| HOME | /home/www |
| HTTP_COOKIE | MoodleSession=fvo6fnrv8gs2h31kn5rvejcbgi |
| HTTP_ACCEPT_ENCODING | gzip, br, zstd, deflate |
| HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_ACCEPT | */* |
| HTTP_HOST | easytalk.hk |
| PATH_INFO | |
| REDIRECT_STATUS | 200 |
| SERVER_NAME | easytalk.hk |
| SERVER_PORT | 443 |
| SERVER_ADDR | 123.59.28.196 |
| REMOTE_PORT | 41903 |
| REMOTE_ADDR | 216.73.216.122 |
| SERVER_SOFTWARE | nginx/1.14.2 |
| GATEWAY_INTERFACE | CGI/1.1 |
| HTTPS | on |
| REQUEST_SCHEME | https |
| SERVER_PROTOCOL | HTTP/2.0 |
| DOCUMENT_ROOT | /www/wwwroot/speaking.yuanyi001.com/moodle/public |
| DOCUMENT_URI | /index.php |
| REQUEST_URI | /?lang=en&redirect=0 |
| SCRIPT_NAME | /index.php |
| CONTENT_LENGTH | |
| CONTENT_TYPE | |
| REQUEST_METHOD | GET |
| QUERY_STRING | lang=en&redirect=0 |
| SCRIPT_FILENAME | /www/wwwroot/speaking.yuanyi001.com/moodle/public/index.php |
| FCGI_ROLE | RESPONDER |
| PHP_SELF | /index.php |
| REQUEST_TIME_FLOAT | 1765361532.1043 |
| REQUEST_TIME | 1765361532 |
empty
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler