New Addon Bot detection #846

Merged
nupplaphil merged 4 commits from features/6948-bot_detection into develop 2019-04-22 13:49:18 +02:00
5 changed files with 12 additions and 10 deletions
Showing only changes of commit 95e075865f - Show all commits

View file

@ -12,6 +12,8 @@ use Friendica\Core\Hook;
use Friendica\Core\System; use Friendica\Core\System;
use Jaybizzle\CrawlerDetect\CrawlerDetect; use Jaybizzle\CrawlerDetect\CrawlerDetect;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
function blockbot_install() { function blockbot_install() {
Hook::register('init_1', 'addon/blockbot/blockbot.php', 'blockbot_init_1'); Hook::register('init_1', 'addon/blockbot/blockbot.php', 'blockbot_init_1');
} }

View file

@ -18,7 +18,7 @@
"minimum-stability": "stable", "minimum-stability": "stable",
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,
"autoloader-suffix": "AdvancedContentFilterAddon", "autoloader-suffix": "BlockBotAddon",
"preferred-install": "dist" "preferred-install": "dist"
} }
} }

View file

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitAdvancedContentFilterAddon::getLoader(); return ComposerAutoloaderInitBlockBotAddon::getLoader();

View file

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInitAdvancedContentFilterAddon class ComposerAutoloaderInitBlockBotAddon
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInitAdvancedContentFilterAddon
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInitAdvancedContentFilterAddon', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitBlockBotAddon', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitAdvancedContentFilterAddon', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitBlockBotAddon', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitAdvancedContentFilterAddon::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitBlockBotAddon::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {

View file

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInitAdvancedContentFilterAddon class ComposerStaticInitBlockBotAddon
{ {
public static $prefixLengthsPsr4 = array ( public static $prefixLengthsPsr4 = array (
'J' => 'J' =>
@ -31,9 +31,9 @@ class ComposerStaticInitAdvancedContentFilterAddon
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitAdvancedContentFilterAddon::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitBlockBotAddon::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitAdvancedContentFilterAddon::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitBlockBotAddon::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitAdvancedContentFilterAddon::$classMap; $loader->classMap = ComposerStaticInitBlockBotAddon::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }