Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated mysql api #21

Open
wants to merge 8 commits into
base: release
Choose a base branch
from

Conversation

jandd
Copy link
Member

@jandd jandd commented Dec 21, 2020

No description provided.

jandd and others added 5 commits December 18, 2020 19:39
This change removes all invocations of the deprecated mysql_* APIs and
replaces them with mysqli calls instead.

Configuration in includes/mysql.php is now instrumented via environment
variables. The application will not start if mandatory environment variables
are not defined. Missing environment variables are logged to the PHP/Apache
error log.

Input validation in the autocomplete backend in www/ac.php has been fixed.

The database connection is no longer stored in the session as it is only
valid for a single request and had not been reused before either.

Some TODO tags have been added at places in the code that need rework.

Add TODO.md and changelog.md as well as setup instructions in README.md.
@jandd jandd self-assigned this Dec 21, 2020
@jandd
Copy link
Member Author

jandd commented Dec 21, 2020

This PR needs to be deployed on a test system before putting it in production. I tested the regular user functionality in a local docker-compose setup. Code for the docker-compose setup is available in https://git.dittberner.info/jan/cacert-devsetup

Jan Dittberner added 2 commits December 22, 2020 06:32
The environment variables containing MYSQL_APP have been renamed to
MYSQL_WEBDB to be consistent with the developer setup and to avoid
confusion with the test manager and CATS applications.

The ancient includes/.cvsignore file has been removed to avoid confusion
in IDEs.

URLs are now built consistently using the environment variables.
Copy link
Contributor

@bdmc bdmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a BIG PR.

Although I would prefer the "long" tag ( <?php ) instead of the short, I agree with all of your changes.

I did notice that you corrected one spelling error in consistence.php, but saw a couple of other, similar, ones.

Brian

@Ted-CAcert
Copy link
Member

How does this relate to the work done by GuKKDevel in branch-1442?

@jandd
Copy link
Member Author

jandd commented Aug 7, 2021

@Ted-CAcert the branches are not related. GuKKDevel just replaced mysql_* API calls with mysqli_* calls. I started to implement a more sane mysqli usage using proper SQL statement handling and externalized configuration. I also added a bit of documenation in README.md. The branch has been tested using the development setup from https://git.dittberner.info/jan/cacert-devsetup

@Ted-CAcert
Copy link
Member

So your changes would obsolete the (current) changes of bug-1442? This is good to know. I'll have to have a closer look...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants