Commit 47a36f1b authored by David Morley's avatar David Morley Committed by dmorley

index (#126)

* index

* spiders ignore

* clean
parent 5d32f001
{
"require": {
"noplanman/xec": "0.1.0",
"gabordemooij/redbean": "^4.3"
"gabordemooij/redbean": "^4.3",
"jaybizzle/crawler-detect" :"1.*"
}
}
......@@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "8e8b0627248a269ae9d624bef32e61d6",
"hash": "bc5abd96addbeeb7bbb644b518cbb065",
"content-hash": "f9ad6b81330128ff4847301b4835b7c2",
"packages": [
{
"name": "gabordemooij/redbean",
......@@ -45,7 +46,55 @@
"keywords": [
"orm"
],
"time": "2016-10-03T21:25:17+00:00"
"time": "2016-10-03 21:25:17"
},
{
"name": "jaybizzle/crawler-detect",
"version": "v1.2.36",
"source": {
"type": "git",
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
"reference": "186cdc021f972a7e06963a84ef692d75f5b325c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/186cdc021f972a7e06963a84ef692d75f5b325c6",
"reference": "186cdc021f972a7e06963a84ef692d75f5b325c6",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"psr-4": {
"Jaybizzle\\CrawlerDetect\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Beech",
"email": "m@rkbee.ch",
"role": "Developer"
}
],
"description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
"homepage": "https://github.com/JayBizzle/Crawler-Detect/",
"keywords": [
"crawler",
"crawler detect",
"crawler detector",
"crawlerdetect",
"php crawler detect"
],
"time": "2017-03-03 21:13:00"
},
{
"name": "noplanman/xec",
......@@ -97,7 +146,7 @@
"shell",
"timeout"
],
"time": "2017-03-12T19:16:23+00:00"
"time": "2017-03-12 19:16:23"
}
],
"packages-dev": [],
......
CREATE INDEX idx_clicks ON clicks (domain);
......@@ -3,7 +3,7 @@ If new install import tables.sql and do not perform migrations
If upgrading migrations are:
v1.0 -> v2.0 = migration00001.sql
v2.0 -> v2.1 = migration00002.sql
v2.1 -> v2.x = migration00003.sql
To support the original apiv1 you should import:
pods_apiv1.sql
......
<?php
use RedBeanPHP\R;
use Jaybizzle\CrawlerDetect\CrawlerDetect;
// Other parameters.
$_domain = $_GET['domain'] ?? '';
......@@ -36,7 +37,9 @@ try {
$c = R::dispense('clicks');
$c['domain'] = $domain;
$c[$click] = 1;
R::store($c);
if (!(new CrawlerDetect())->isCrawler()) {
R::store($c);
}
header('Location: https://' . $domain);
} catch (\RedBeanPHP\RedException $e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment