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

Shorten API calls #506

Merged
merged 3 commits into from Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions public_html/lists/.htaccess
@@ -1,4 +1,3 @@

DirectoryIndex index.php

<FilesMatch "\.(php|inc)$">
Expand All @@ -14,7 +13,7 @@ DirectoryIndex index.php
</IfModule>
</FilesMatch>
# app.php is the entrypoint for phpList4
<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php|app.php)$">
<FilesMatch "(index.php|dl.php|ut.php|lt.php|download.php|connector.php|api.php)$">
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order allow,deny
Expand All @@ -27,6 +26,13 @@ DirectoryIndex index.php
</IfModule>
</FilesMatch>

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteRule api/v2/ api.php [L]
</IfModule>


# if you want more than this for attachments, you can increase these values
# but you really, really should consider uploading them somewhere
# and only sending a link in your mails
Expand Down
12 changes: 12 additions & 0 deletions public_html/lists/api.php
@@ -0,0 +1,12 @@
<?php

use PhpList\Core\Core\Bootstrap;

if (version_compare(phpversion(), '7.0.0', '<')) {
die('API is not supported on this PHP version.');
}
require_once __DIR__ . '/base/vendor/autoload.php';

Bootstrap::getInstance()
->configure()
->dispatch();