Since PHP 5.1.0 (when the date/time functions were rewritten), we need to specify the default timezone.
Otherwise the timezone will always set to UTC that may cause problem or cause confusion.
We set the default timezone to Asia/Shanghai. If you are not at the area of this timezone, you can change it manually.
When managing data, there will be a preview of test data or validator binary file.
But in PHP7 the prefiew of test data text file or problem.conf text file is not shown.
After my test it is caused by file_get_contents() when passing offset with -1.
It is strange that the manual on php.net in Chinese the default of $offset is -1,
but in English the default of $offset is 0. Use -1 will get nothing, 0 instead is fine.
The commit also change uojFilePreview() that can also be used as viewing binary file.
For backwards compatibility, we just set text as the default file type and no need to specify.
When printing the table of Judgement Failed items at super-manage, there is nothing shown.
It caused by using echoSubmissionsList(), arguments that 3 passed but exactly 4 expected.
So add the missing argument, and let the result hidden because we select an exact result.
Also, because of the typo of "Judgement", there will be nothing shown if
only fixed too few arguments. This commit changes it too.
After we changed the detection of the real httpHost value, the token check will fail when register.
A long time ago we just simply added "Session_Start();" at the beginning of uoj/1/app/index.php.
It temporally solved the problem but caused another series of issues that we can't see outside.
There is also a session_start() when executing Session::init() at importing app/libs/uoj-lib.php.
So, when we add one more "Session_Start();" it will execute this one more time, just cause warning:
> session_name(): Cannot change session name when session is active
> PHP Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time
And, the session name and session path, session domain will not be set so may cause other problems.
The reason is that using UOJContext::httpHost() as web hostname when default, it will add the port at the end.
When using IP the validateIP() will return false, or using domain with port the cookie domain will be set wrongly.
As a result the register process throws out the "Expired" error and refuses to register, and other uses token will fail too.
We made it cut out the port when setting cookie domain, and also changed the style of UOJContext::httpHost() to make it easier to read.
With this problem known and solved the "Session_Start();" in index.php will also say bye-bye, and there will be no multiple session_start()s.
NOTICE: If you have set all your information to yours in .config.php, and not using address with port other than 80, you may not face this problem.
But the warning of php will consistently shown in the error log file. So kick the annoying warning information out if you are angry with this ;-)
This is an old enough bug while using MySQL version 5.5 with Ubuntu 14.04.
According to these issues form docker or moby repository:
https://github.com/docker/for-linux/issues/72https://github.com/moby/moby/issues/35503
overlayfs only supports a subset of the POSIX standard.
But the problem does not arise when using aufs.
We do a little trick to MAKE MYSQL GREAT AGAIN.
NOTICE: Only people who are using docker may face this problem.
If you are using a bare-metal system or just running a virtual machine,
executing the installation script without using container works fine.
When logout by clicking logout button on the top of /user/modify-profile link, you will be redirected to the login page.
But if you login immediately then you will get the login page again and loop.
It is caused by an address checking error. Now try to fix.
The compilers are all updated in Ubuntu 18.04 basesystem.
Add some defines for judger on compiling and replace web's display version to the real version.
To support new compilers we must modify the syscall list to let them run properly, otherwise they will error with "Dangerous Syscalls".
The Oracle JDK8 will read usagetracker profiles and record usage infomation, so disable it in order to not making junk files which may cause DGS.
Due to historic reasons, the version and path of compilers are specified.
This will remove these specifications to make judger more adaptable.
Also provide defines to specify new version and keep for default.
Update base system to Ubuntu 18.04.
.htaccess file's session path changed correctly.
Add gnupg install choice, due to base system has no gpg support.
Set DEBIAN_FRONTEND to noninteractive in order to prevent tzdata stuck.
Change Dockerfile's verion and buanch checkout method, in order to save space.
Fix mysql conf when not restart service and the database can't import judger info.
Change install.sh, support PHP7.2, update libv8 repo to artful, with missing php-mbstring.
The old JDK distfile mirrors are deprecated, changed to official.sed modded to get the latest jdk8.
BREAKING CHANGE: Ubuntu 14/16 users shouln't execute this script, due to config files and packages not the same.
In order to support PHP7 and Ubuntu 16.04, there must be some changes to make it runs properly.
The install script added php7 and mysql 5.7, newer v8js packages and supports, adjusted some config files.
Also used new way to detect install args, and change tab to 4-char-long space char.
BREAKING CHANGE: This branch can only be used for PHP7, and Ubuntu 14.04 users shouln't execute this script.
The last commit changed the installation script a lot, but made some mistakes on the genration of config.
It gens the $_svn_ourroot_password_ to $_svn_certroot_password_. Just fix it.
According to the version from @vfleaking, the judger_socket password and the our-root password is 32 chars long. Strengthen it.
There is also a *** space char on the end of a line. Kick it out.
Change the base Docker image to ubuntu16.04 and change the LAMP
packages to support PHP7.
BREAKING CHANGE: the packages which will be installed has changed.
In order to support PHP7, change the way to operate database. PHP7
removed the mysql extension, so the old way to operate database is
not usable. This commit use a new way to operate database.
BREAKING CHANGE: the way to operate database has changed.