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

Ifarchive-tuid-report: normalize urls #346

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dfabulich
Copy link
Collaborator

This required me to add composer support, but I struggled with it mightily. I'm not at all sure I'm handling that the "right way."

I'm checking in the vendor directory. There's some debate online about whether that's the "right way," but it means that other developers won't have to run composer, which is maybe a good thing.

To facilitate this, I've set up some scripts that allow me to install composer in the Docker instance, run composer there, then clean up, (so we don't expose our composer.json or composer.lock file publicly).

Copy link
Collaborator

@salty-horse salty-horse left a comment

Choose a reason for hiding this comment

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

I don't know anything about composer and PHP package management.

Based on other packaging systems, I find it odd that the package is mentioned in composer.json but is also checked into the repository.

$row = mysqli_fetch_row($result);
if (!$row) {
// normalize the path using URL normalizer. First we make it an absolute URL, normalize it, then we strip the absolute part off
$path = substr((new URL\Normalizer("https://ifarchive.org/$path"))->normalize(), strlen("https://ifarchive.org/"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would put https://ifarchive.org/ in a variable since it's used twice, and explicitly required to be identical for this "get suffix" technique.

@dfabulich dfabulich marked this pull request as draft November 6, 2024 21:52
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.

2 participants