mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 07:11:42 +09:00
Add helpful error messages to 3 most common error types
최근 커뮤니티 검색에서 가장 자주 발견되는 에러 타입 3가지: - 문자열에 따옴표 안 씀 - stdClass 정의 안 함 - 배열이 아닌 것에 배열 함수 사용
This commit is contained in:
parent
a36177d772
commit
76fdcea292
3 changed files with 9 additions and 0 deletions
|
|
@ -3,3 +3,6 @@ $lang->message = 'Display Errors';
|
|||
$lang->about_skin = 'You may select skins for error messages.';
|
||||
$lang->msg_administrator_login = 'Administrator Login';
|
||||
$lang->error_help['baseobject'] = 'Object → BaseObject conversion is required in a third-party program. Please fix it by consulting the file name and line number shown above.';
|
||||
$lang->error_help['undef_constant'] = 'This error occurs because of missing "quotes". This syntax was often used in the past, but it is not allowed in recent versions of PHP. Please fix the incorrect syntax by consulting the file name and line number shown above.';
|
||||
$lang->error_help['undef_object'] = 'This code is trying to add an attribute to an undefined object. This coding style was often used in the past, but it is not allowed in recent versions of PHP. Please fix the incorrect code by consulting the file name and line number shown above.';
|
||||
$lang->error_help['not_array'] = 'This code is trying to use an array function on something that is not an array. This coding style was often used in the past, but it is not allowed in recent versions of PHP. Please fix the incorrect code by consulting the file name and line number shown above.';
|
||||
|
|
|
|||
|
|
@ -3,3 +3,6 @@ $lang->message = '오류 표시';
|
|||
$lang->about_skin = '오류 메시지용 스킨을 지정할 수 있습니다.';
|
||||
$lang->msg_administrator_login = '관리자 로그인';
|
||||
$lang->error_help['baseobject'] = 'Object → BaseObject 변환이 필요한 서드파티 자료가 있습니다. 위의 에러 메시지에 포함된 파일명과 줄 번호를 참고하여 수정하세요.';
|
||||
$lang->error_help['undef_constant'] = '문자열을 따옴표로 감싸지 않아서 발생하는 오류입니다. 오래된 자료에서 종종 사용하던 문법이나 최근 PHP에서는 허용되지 않으니, 에러 메시지에 포함된 파일명과 줄 번호를 참고하여 수정하세요.';
|
||||
$lang->error_help['undef_object'] = '객체를 먼저 선언하지 않고 속성을 추가하려 하고 있습니다. 오래된 자료에서 종종 사용하던 코딩 방식이나 최근 PHP에서는 허용되지 않으니, 에러 메시지에 포함된 파일명과 줄 번호를 참고하여 수정하세요.';
|
||||
$lang->error_help['not_array'] = '배열이 아닌 변수에 배열 함수를 사용하려 하고 있습니다. 오래된 자료에서 종종 사용하던 코딩 방식이나 최근 PHP에서는 허용되지 않으니, 에러 메시지에 포함된 파일명과 줄 번호를 참고하여 수정하세요.';
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ class MessageView extends Message
|
|||
{
|
||||
$regexp_list = [
|
||||
'/Class [\'"]Object[\'"] not found/' => 'baseobject',
|
||||
'/Undefined constant [\'"][^\'"]+?[\'"]/' => 'undef_constant',
|
||||
'/Attempt to assign property [\'"][^\'"]+?[\'"] on null/' => 'undef_object',
|
||||
'/Argument #\d+ \(\$\w+\) must be of type (Countable\|)?array, \w+ given ?/' => 'not_array',
|
||||
];
|
||||
|
||||
foreach ($regexp_list as $regexp => $key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue