Skip to content

Commit

Permalink
feat!: add support for PHP 8.x and switch to composer
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenrikur committed Feb 11, 2024
1 parent 95ae3dc commit 3cf216c
Show file tree
Hide file tree
Showing 9 changed files with 464 additions and 184 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.idea
.vscode
archive
# Will be created during generation and contains only generated files
svg
view.html
*.local.php
*.local.php
.vendor
*.tar.gz
index_files
vendor
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 2 additions & 6 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
# Prevent access to git related files
RedirectMatch 404 /\.git
# Prevent generation from external hosts
RedirectMatch 404 generate
# Prevent access to archive files (people should really use the official API for getting that data)
RedirectMatch 404 archive
# Prevent access to all but .html and .svg files
RedirectMatch 404 ".*(?<!\/|\.html|\.svg)$"
545 changes: 376 additions & 169 deletions Nosecounter.php

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion SVGGraph
Submodule SVGGraph deleted from 88bc48
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "eurofurence/nosecounter",
"type": "project",
"description": "Eurofurence Nosecounter",
"keywords": ["eurofurence", "visualisation"],
"license": "MIT",
"require": {
"php": "^8.1",
"goat1000/svggraph": "^3"
},
}
61 changes: 61 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
/**
* Example for using the Nosecounter class to generate a HTML output file.
*
* (c) 2016 by Fenrikur <nosecounter@fenrikur.de>
* (c) 2024 by Fenrikur <nosecounter(at)fenrikur.de>
*/

require_once 'Nosecounter.php';
namespace Eurofurence\Nosecounter;

$nosecounter = new \nosecounter\Nosecounter();
require __DIR__ . '/vendor/autoload.php';
require "Nosecounter.php";

use DateTime;
use DateTimeZone;

echo $nosecounter->setApiUrl('%insert_your_api_endpoint_url_here%')
->setApiToken('%insert_your_api_token_here%')
Expand Down
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Simple HTML template for displaying the generated SVG.
*
* Copyright 2016 by Dominik "Fenrikur" Schöner <nosecounter@fenrikur.de>
* Copyright 2024 by Fenrikur <nosecounter(at)fenrikur.de>
*/

$output = <<< EOF
Expand Down

0 comments on commit 3cf216c

Please sign in to comment.