Merge branch 'develop'

This commit is contained in:
Shish 2017-09-18 23:40:46 +01:00
commit aef0d15783
34 changed files with 428 additions and 255 deletions

250
composer.lock generated
View file

@ -18,23 +18,11 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/jquery/jquery-dist/zipball/3a43d7e563314bf32970b773dd31ecf2b90813dd", "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/3a43d7e563314bf32970b773dd31ecf2b90813dd",
"reference": "3a43d7e563314bf32970b773dd31ecf2b90813dd", "reference": "3a43d7e563314bf32970b773dd31ecf2b90813dd",
"shasum": "" "shasum": null
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "dist/jquery.js",
"bower-asset-ignore": [
"package.json"
]
}, },
"type": "bower-asset",
"license": [ "license": [
"MIT" "MIT"
],
"keywords": [
"browser",
"javascript",
"jquery",
"library"
] ]
}, },
{ {
@ -49,19 +37,12 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rmm5t/jquery-timeago/zipball/67c11951ae9b6020341c1056a42b5406162db40c", "url": "https://api.github.com/repos/rmm5t/jquery-timeago/zipball/67c11951ae9b6020341c1056a42b5406162db40c",
"reference": "67c11951ae9b6020341c1056a42b5406162db40c", "reference": "67c11951ae9b6020341c1056a42b5406162db40c",
"shasum": "" "shasum": null
}, },
"require": { "require": {
"bower-asset/jquery": ">=1.4" "bower-asset/jquery": ">=1.4"
}, },
"type": "bower-asset-library", "type": "bower-asset",
"extra": {
"bower-asset-main": "jquery.timeago.js",
"bower-asset-ignore": [
"test",
"vendor"
]
},
"license": [ "license": [
"MIT" "MIT"
] ]
@ -78,25 +59,9 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/js-cookie/js-cookie/zipball/5c830fb71a2bd3acce9cb733d692e13316991891", "url": "https://api.github.com/repos/js-cookie/js-cookie/zipball/5c830fb71a2bd3acce9cb733d692e13316991891",
"reference": "5c830fb71a2bd3acce9cb733d692e13316991891", "reference": "5c830fb71a2bd3acce9cb733d692e13316991891",
"shasum": "" "shasum": null
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"src/js.cookie.js"
],
"bower-asset-ignore": [
"travis.sh",
"test",
"Gruntfile.js",
"package.json",
".gitignore",
".jshintignore",
".jshintrc",
".tm_properties",
".travis.yml"
]
}, },
"type": "bower-asset",
"license": [ "license": [
"MIT" "MIT"
] ]
@ -106,38 +71,18 @@
"version": "2.21.1", "version": "2.21.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/johndyer/mediaelement.git", "url": "https://github.com/mediaelement/mediaelement.git",
"reference": "6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7" "reference": "6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/johndyer/mediaelement/zipball/6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7", "url": "https://api.github.com/repos/mediaelement/mediaelement/zipball/6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7",
"reference": "6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7", "reference": "6e80b260172f4ddc3b0bbee046775d2ba4c6f9b7",
"shasum": "" "shasum": null
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"./build/mediaelement-and-player.js",
"./build/mediaelementplayer.css"
],
"bower-asset-ignore": [
"**",
"!/build/**",
"!/bower.json",
"!/README*",
"!/changelog*"
]
}, },
"type": "bower-asset",
"license": [ "license": [
"MIT" "MIT"
],
"description": "HTML5 <video> and <audio> made easy.",
"keywords": [
"audio",
"html5",
"shim",
"video"
] ]
}, },
{ {
@ -180,7 +125,7 @@
"sort", "sort",
"table" "table"
], ],
"time": "2015-12-03 01:22:52" "time": "2015-12-03T01:22:52+00:00"
}, },
{ {
"name": "dapphp/securimage", "name": "dapphp/securimage",
@ -325,7 +270,7 @@
"recaptcha", "recaptcha",
"spam" "spam"
], ],
"time": "2017-03-09 18:57:45" "time": "2017-03-09T18:57:45+00:00"
}, },
{ {
"name": "ifixit/php-akismet", "name": "ifixit/php-akismet",
@ -345,28 +290,28 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/instantiator.git", "url": "https://github.com/doctrine/instantiator.git",
"reference": "5acd2bd8c2b600ad5cc4c9180ebf0a930604d6a5" "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/5acd2bd8c2b600ad5cc4c9180ebf0a930604d6a5", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"reference": "5acd2bd8c2b600ad5cc4c9180ebf0a930604d6a5", "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3,<8.0-DEV" "php": "^7.1"
}, },
"require-dev": { "require-dev": {
"athletic/athletic": "~0.1.8", "athletic/athletic": "~0.1.8",
"ext-pdo": "*", "ext-pdo": "*",
"ext-phar": "*", "ext-phar": "*",
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "^6.2.3",
"squizlabs/php_codesniffer": "~2.0" "squizlabs/php_codesniffer": "^3.0.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-master": "1.2.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -391,20 +336,20 @@
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"time": "2017-02-16 16:15:51" "time": "2017-07-22T11:58:36+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.6.0", "version": "1.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102",
"reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -433,7 +378,7 @@
"object", "object",
"object graph" "object graph"
], ],
"time": "2017-01-26T22:05:40+00:00" "time": "2017-04-12T18:52:22+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
@ -441,12 +386,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -487,26 +432,26 @@
"reflection", "reflection",
"static analysis" "static analysis"
], ],
"time": "2015-12-27 11:43:31" "time": "2017-09-11T18:02:19+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "3.1.1", "version": "4.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2",
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": "^7.0",
"phpdocumentor/reflection-common": "^1.0@dev", "phpdocumentor/reflection-common": "^1.0@dev",
"phpdocumentor/type-resolver": "^0.2.0", "phpdocumentor/type-resolver": "^0.4.0",
"webmozart/assert": "^1.0" "webmozart/assert": "^1.0"
}, },
"require-dev": { "require-dev": {
@ -532,24 +477,24 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2016-09-30T07:12:33+00:00" "time": "2017-08-30T18:51:59+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "0.2.1", "version": "0.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
"reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5", "php": "^5.5 || ^7.0",
"phpdocumentor/reflection-common": "^1.0" "phpdocumentor/reflection-common": "^1.0"
}, },
"require-dev": { "require-dev": {
@ -579,7 +524,7 @@
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
} }
], ],
"time": "2016-11-25T06:54:22+00:00" "time": "2017-07-14T14:27:02+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
@ -587,18 +532,18 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "abe41cb27f4e4207c6f54a09272969fe55e0bbff" "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/abe41cb27f4e4207c6f54a09272969fe55e0bbff", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
"reference": "abe41cb27f4e4207c6f54a09272969fe55e0bbff", "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
"sebastian/comparator": "^1.1|^2.0", "sebastian/comparator": "^1.1|^2.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0" "sebastian/recursion-context": "^1.0|^2.0|^3.0"
}, },
@ -642,7 +587,7 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2017-03-03 17:09:02" "time": "2017-09-04T11:05:03+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@ -650,12 +595,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "cb9dd0ea37df29fa3c6ae5ac26c3408a7609cb4f" "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cb9dd0ea37df29fa3c6ae5ac26c3408a7609cb4f", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"reference": "cb9dd0ea37df29fa3c6ae5ac26c3408a7609cb4f", "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -705,7 +650,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2017-03-07 10:28:00" "time": "2017-04-02T07:44:40+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -752,7 +697,7 @@
"filesystem", "filesystem",
"iterator" "iterator"
], ],
"time": "2016-10-03 07:40:28" "time": "2016-10-03T07:40:28+00:00"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
@ -842,7 +787,7 @@
"keywords": [ "keywords": [
"timer" "timer"
], ],
"time": "2017-03-07 15:42:04" "time": "2017-03-07T15:42:04+00:00"
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
@ -850,20 +795,20 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "9ddb181faa4a3841fe131c357fd01de75cbb4da9" "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9ddb181faa4a3841fe131c357fd01de75cbb4da9", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0",
"reference": "9ddb181faa4a3841fe131c357fd01de75cbb4da9", "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
"php": "^5.6 || ^7.0" "php": "^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7 || ^6.0" "phpunit/phpunit": "^6.2.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -891,7 +836,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2017-03-07 07:36:57" "time": "2017-08-20T05:47:52+00:00"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@ -899,12 +844,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "d421807ce5f372ecaf0bff3a5d41f5c60a18329f" "reference": "4eba3374803c6c0903145e8940844e6f1d665c07"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d421807ce5f372ecaf0bff3a5d41f5c60a18329f", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4eba3374803c6c0903145e8940844e6f1d665c07",
"reference": "d421807ce5f372ecaf0bff3a5d41f5c60a18329f", "reference": "4eba3374803c6c0903145e8940844e6f1d665c07",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -922,7 +867,7 @@
"phpunit/php-timer": "^1.0.6", "phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^3.2", "phpunit/phpunit-mock-objects": "^3.2",
"sebastian/comparator": "^1.2.4", "sebastian/comparator": "^1.2.4",
"sebastian/diff": "~1.2", "sebastian/diff": "^1.4.3",
"sebastian/environment": "^1.3.4 || ^2.0", "sebastian/environment": "^1.3.4 || ^2.0",
"sebastian/exporter": "~2.0", "sebastian/exporter": "~2.0",
"sebastian/global-state": "^1.1", "sebastian/global-state": "^1.1",
@ -973,7 +918,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2017-03-09 13:47:42" "time": "2017-09-01T08:38:37+00:00"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
@ -981,12 +926,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "4001a301f86fc006c32f532a741ab613f2bd8990" "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/4001a301f86fc006c32f532a741ab613f2bd8990", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
"reference": "4001a301f86fc006c32f532a741ab613f2bd8990", "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1032,7 +977,7 @@
"mock", "mock",
"xunit" "xunit"
], ],
"time": "2017-03-07 08:47:31" "time": "2017-06-30T09:13:00+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -1077,7 +1022,7 @@
], ],
"description": "Looks up which function or method a line of code belongs to", "description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"time": "2017-03-04 10:23:55" "time": "2017-03-04T10:23:55+00:00"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
@ -1141,20 +1086,20 @@
"compare", "compare",
"equality" "equality"
], ],
"time": "2017-03-07 10:34:43" "time": "2017-03-07T10:34:43+00:00"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
"version": "dev-master", "version": "1.4.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "763d7adeb8c35d2af2b04c0f6cafeee059074dfb" "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/763d7adeb8c35d2af2b04c0f6cafeee059074dfb", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "763d7adeb8c35d2af2b04c0f6cafeee059074dfb", "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1193,27 +1138,27 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"time": "2017-03-07 07:26:53" "time": "2017-05-22T07:24:03+00:00"
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "dev-master", "version": "2.0.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "144fedf9aa8e3f1c52199f3634eb699cb59741d9" "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/144fedf9aa8e3f1c52199f3634eb699cb59741d9", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"reference": "144fedf9aa8e3f1c52199f3634eb699cb59741d9", "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.6 || ^7.0" "php": "^5.6 || ^7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7 || ^6.0" "phpunit/phpunit": "^5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -1243,7 +1188,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2017-03-07 12:59:58" "time": "2016-11-26T07:53:53+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@ -1310,7 +1255,7 @@
"export", "export",
"exporter" "exporter"
], ],
"time": "2017-03-07 10:36:49" "time": "2017-03-07T10:36:49+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@ -1361,7 +1306,7 @@
"keywords": [ "keywords": [
"global state" "global state"
], ],
"time": "2017-02-23 14:11:06" "time": "2017-02-23T14:11:06+00:00"
}, },
{ {
"name": "sebastian/object-enumerator", "name": "sebastian/object-enumerator",
@ -1407,7 +1352,7 @@
], ],
"description": "Traverses array structures and object graphs to enumerate all referenced objects", "description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/", "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"time": "2017-03-07 10:37:45" "time": "2017-03-07T10:37:45+00:00"
}, },
{ {
"name": "sebastian/recursion-context", "name": "sebastian/recursion-context",
@ -1460,7 +1405,7 @@
], ],
"description": "Provides functionality to recursively process PHP variables", "description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2017-03-08 08:21:15" "time": "2017-03-08T08:21:15+00:00"
}, },
{ {
"name": "sebastian/resource-operations", "name": "sebastian/resource-operations",
@ -1502,7 +1447,7 @@
], ],
"description": "Provides a list of PHP built-in functions that operate on resources", "description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations", "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"time": "2016-10-03 07:43:09" "time": "2016-10-03T07:43:09+00:00"
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
@ -1545,27 +1490,30 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-10-03 07:35:21" "time": "2016-10-03T07:35:21+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "dev-master", "version": "3.4.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "d1abb473764f82339862b114b45b3cd424b2d1a3" "reference": "a0e15688972f012156cf1ffa076fe1203bce6bc9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/d1abb473764f82339862b114b45b3cd424b2d1a3", "url": "https://api.github.com/repos/symfony/yaml/zipball/a0e15688972f012156cf1ffa076fe1203bce6bc9",
"reference": "d1abb473764f82339862b114b45b3cd424b2d1a3", "reference": "a0e15688972f012156cf1ffa076fe1203bce6bc9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5.9" "php": "^5.5.9|>=7.0.8"
},
"conflict": {
"symfony/console": "<3.4"
}, },
"require-dev": { "require-dev": {
"symfony/console": "~2.8|~3.0" "symfony/console": "~3.4|~4.0"
}, },
"suggest": { "suggest": {
"symfony/console": "For validating YAML files using the lint command" "symfony/console": "For validating YAML files using the lint command"
@ -1573,7 +1521,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.3-dev" "dev-master": "3.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -1600,7 +1548,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-07 16:54:31" "time": "2017-09-17T10:10:45+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
@ -1650,7 +1598,7 @@
"check", "check",
"validate" "validate"
], ],
"time": "2016-11-23 20:04:41" "time": "2016-11-23T20:04:41+00:00"
} }
], ],
"aliases": [], "aliases": [],

View file

@ -10,6 +10,7 @@ require_once "core/sys_config.inc.php";
require_once "core/util.inc.php"; require_once "core/util.inc.php";
require_once "lib/context.php"; require_once "lib/context.php";
require_once "vendor/autoload.php"; require_once "vendor/autoload.php";
require_once "core/imageboard.pack.php";
// set up and purify the environment // set up and purify the environment
_version_check(); _version_check();
@ -17,17 +18,17 @@ _sanitise_environment();
// load base files // load base files
ctx_log_start("Opening files"); ctx_log_start("Opening files");
$files = array_merge( $_shm_files = array_merge(
zglob("core/*.php"), zglob("core/*.php"),
zglob("ext/{".ENABLED_EXTS."}/main.php") zglob("ext/{".ENABLED_EXTS."}/main.php")
); );
foreach($files as $filename) { foreach($_shm_files as $_shm_filename) {
if(basename($filename)[0] != "_") { if(basename($_shm_filename)[0] != "_") {
require_once $filename; require_once $_shm_filename;
} }
} }
unset($files); unset($_shm_files);
unset($filename); unset($_shm_filename);
ctx_log_endok(); ctx_log_endok();
// connect to the database // connect to the database

View file

@ -44,6 +44,14 @@ class Block {
*/ */
public $id; public $id;
/**
* Should this block count as content for the sake of
* the 404 handler
*
* @var boolean
*/
public $is_content = true;
/** /**
* Construct a block. * Construct a block.
* *
@ -58,7 +66,11 @@ class Block {
$this->body = $body; $this->body = $body;
$this->section = $section; $this->section = $section;
$this->position = $position; $this->position = $position;
$this->id = preg_replace('/[^\w]/', '',str_replace(' ', '_', is_null($id) ? (is_null($header) ? md5($body) : $header) . $section : $id));
if(is_null($id)) {
$id = (empty($header) ? md5($body) : $header) . $section;
}
$this->id = preg_replace('/[^\w]/', '',str_replace(' ', '_', $id));
} }
/** /**

View file

@ -314,14 +314,9 @@ class MemcacheCache implements CacheEngine {
*/ */
public function __construct($args) { public function __construct($args) {
$hp = explode(":", $args); $hp = explode(":", $args);
if(class_exists("Memcache")) {
$this->memcache = new Memcache; $this->memcache = new Memcache;
@$this->memcache->pconnect($hp[0], $hp[1]); @$this->memcache->pconnect($hp[0], $hp[1]);
} }
else {
print "no memcache"; exit;
}
}
/** /**
* @param string $key * @param string $key
@ -378,6 +373,100 @@ class MemcacheCache implements CacheEngine {
*/ */
public function get_misses() {return $this->misses;} public function get_misses() {return $this->misses;}
} }
class MemcachedCache implements CacheEngine {
/** @var \Memcached|null */
public $memcache=null;
/** @var int */
private $hits=0;
/** @var int */
private $misses=0;
/**
* @param string $args
*/
public function __construct($args) {
$hp = explode(":", $args);
$this->memcache = new Memcached;
#$this->memcache->setOption(Memcached::OPT_COMPRESSION, False);
#$this->memcache->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP);
#$this->memcache->setOption(Memcached::OPT_PREFIX_KEY, phpversion());
$this->memcache->addServer($hp[0], $hp[1]);
}
/**
* @param string $key
* @return array|bool|string
*/
public function get($key) {
assert('!is_null($key)');
$key = urlencode($key);
$val = $this->memcache->get($key);
$res = $this->memcache->getResultCode();
if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) {
$hit = $res == Memcached::RES_SUCCESS ? "hit" : "miss";
file_put_contents("data/cache.log", "Cache $hit: $key\n", FILE_APPEND);
}
if($res == Memcached::RES_SUCCESS) {
$this->hits++;
return $val;
}
else if($res == Memcached::RES_NOTFOUND) {
$this->misses++;
return false;
}
else {
error_log("Memcached error during get($key): $res");
}
}
/**
* @param string $key
* @param mixed $val
* @param int $time
*/
public function set($key, $val, $time=0) {
assert('!is_null($key)');
$key = urlencode($key);
$this->memcache->set($key, $val, $time);
$res = $this->memcache->getResultCode();
if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) {
file_put_contents("data/cache.log", "Cache set: $key ($time)\n", FILE_APPEND);
}
if($res != Memcached::RES_SUCCESS) {
error_log("Memcached error during set($key): $res");
}
}
/**
* @param string $key
*/
public function delete($key) {
assert('!is_null($key)');
$key = urlencode($key);
$this->memcache->delete($key);
$res = $this->memcache->getResultCode();
if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) {
file_put_contents("data/cache.log", "Cache delete: $key\n", FILE_APPEND);
}
if($res != Memcached::RES_SUCCESS && $res != Memcached::RES_NOTFOUND) {
error_log("Memcached error during delete($key): $res");
}
}
/**
* @return int
*/
public function get_hits() {return $this->hits;}
/**
* @return int
*/
public function get_misses() {return $this->misses;}
}
class APCCache implements CacheEngine { class APCCache implements CacheEngine {
public $hits=0, $misses=0; public $hits=0, $misses=0;
@ -466,10 +555,13 @@ class Database {
private function connect_cache() { private function connect_cache() {
$matches = array(); $matches = array();
if(defined("CACHE_DSN") && CACHE_DSN && preg_match("#(memcache|apc)://(.*)#", CACHE_DSN, $matches)) { if(defined("CACHE_DSN") && CACHE_DSN && preg_match("#(memcache|memcached|apc)://(.*)#", CACHE_DSN, $matches)) {
if($matches[1] == "memcache") { if($matches[1] == "memcache") {
$this->cache = new MemcacheCache($matches[2]); $this->cache = new MemcacheCache($matches[2]);
} }
else if($matches[1] == "memcached") {
$this->cache = new MemcachedCache($matches[2]);
}
else if($matches[1] == "apc") { else if($matches[1] == "apc") {
$this->cache = new APCCache($matches[2]); $this->cache = new APCCache($matches[2]);
} }
@ -598,18 +690,15 @@ class Database {
* @param string $sql * @param string $sql
*/ */
private function count_execs($db, $sql, $inputarray) { private function count_execs($db, $sql, $inputarray) {
if ((defined('DEBUG_SQL') && DEBUG_SQL === true) || (!defined('DEBUG_SQL') && @$_GET['DEBUG_SQL'])) { if((DEBUG_SQL === true) || (is_null(DEBUG_SQL) && @$_GET['DEBUG_SQL'])) {
$fp = @fopen("data/sql.log", "a");
if($fp) {
$sql = trim(preg_replace('/\s+/msi', ' ', $sql)); $sql = trim(preg_replace('/\s+/msi', ' ', $sql));
if(isset($inputarray) && is_array($inputarray) && !empty($inputarray)) { if(isset($inputarray) && is_array($inputarray) && !empty($inputarray)) {
fwrite($fp, $sql." -- ".join(", ", $inputarray)."\n"); $text = $sql." -- ".join(", ", $inputarray)."\n";
} }
else { else {
fwrite($fp, $sql."\n"); $text = $sql."\n";
}
fclose($fp);
} }
file_put_contents("data/sql.log", $text, FILE_APPEND);
} }
if(!is_array($inputarray)) $this->query_count++; if(!is_array($inputarray)) $this->query_count++;
# handle 2-dimensional input arrays # handle 2-dimensional input arrays
@ -617,6 +706,14 @@ class Database {
else $this->query_count++; else $this->query_count++;
} }
private function count_time($method, $start) {
if((DEBUG_SQL === true) || (is_null(DEBUG_SQL) && @$_GET['DEBUG_SQL'])) {
$text = $method.":".(microtime(true) - $start)."\n";
file_put_contents("data/sql.log", $text, FILE_APPEND);
}
$this->dbtime += microtime(true) - $start;
}
/** /**
* Execute an SQL query and return an PDO result-set. * Execute an SQL query and return an PDO result-set.
* *
@ -661,7 +758,7 @@ class Database {
public function get_all($query, $args=array()) { public function get_all($query, $args=array()) {
$_start = microtime(true); $_start = microtime(true);
$data = $this->execute($query, $args)->fetchAll(); $data = $this->execute($query, $args)->fetchAll();
$this->dbtime += microtime(true) - $_start; $this->count_time("get_all", $_start);
return $data; return $data;
} }
@ -675,7 +772,7 @@ class Database {
public function get_row($query, $args=array()) { public function get_row($query, $args=array()) {
$_start = microtime(true); $_start = microtime(true);
$row = $this->execute($query, $args)->fetch(); $row = $this->execute($query, $args)->fetch();
$this->dbtime += microtime(true) - $_start; $this->count_time("get_row", $_start);
return $row ? $row : null; return $row ? $row : null;
} }
@ -693,7 +790,7 @@ class Database {
foreach($stmt as $row) { foreach($stmt as $row) {
$res[] = $row[0]; $res[] = $row[0];
} }
$this->dbtime += microtime(true) - $_start; $this->count_time("get_col", $_start);
return $res; return $res;
} }
@ -711,7 +808,7 @@ class Database {
foreach($stmt as $row) { foreach($stmt as $row) {
$res[$row[0]] = $row[1]; $res[$row[0]] = $row[1];
} }
$this->dbtime += microtime(true) - $_start; $this->count_time("get_pairs", $_start);
return $res; return $res;
} }
@ -725,7 +822,7 @@ class Database {
public function get_one($query, $args=array()) { public function get_one($query, $args=array()) {
$_start = microtime(true); $_start = microtime(true);
$row = $this->execute($query, $args)->fetch(); $row = $this->execute($query, $args)->fetch();
$this->dbtime += microtime(true) - $_start; $this->count_time("get_one", $_start);
return $row[0]; return $row[0];
} }

View file

@ -189,7 +189,7 @@ class Image {
* @param string[] $tags * @param string[] $tags
* @return boolean * @return boolean
*/ */
public function validate_accel($tags) { public static function validate_accel($tags) {
$yays = 0; $yays = 0;
$nays = 0; $nays = 0;
foreach($tags as $tag) { foreach($tags as $tag) {
@ -209,7 +209,7 @@ class Image {
* @return null|PDOStatement * @return null|PDOStatement
* @throws SCoreException * @throws SCoreException
*/ */
public function get_accelerated_result($tags, $offset, $limit) { public static function get_accelerated_result($tags, $offset, $limit) {
global $database; global $database;
if(!Image::validate_accel($tags)) { if(!Image::validate_accel($tags)) {
@ -282,8 +282,7 @@ class Image {
} }
else { else {
$querylet = Image::build_search_querylet($tags); $querylet = Image::build_search_querylet($tags);
$result = $database->execute($querylet->sql, $querylet->variables); return $database->get_one("SELECT COUNT(*) AS cnt FROM ($querylet->sql) AS tbl", $querylet->variables);
return $result->rowCount();
} }
} }
@ -967,7 +966,7 @@ class Image {
} }
} }
assert('$positive_tag_id_array || $negative_tag_id_array'); assert('$positive_tag_id_array || $negative_tag_id_array', @$_GET['q']);
$wheres = array(); $wheres = array();
if (!empty($positive_tag_id_array)) { if (!empty($positive_tag_id_array)) {
$positive_tag_id_list = join(', ', $positive_tag_id_array); $positive_tag_id_list = join(', ', $positive_tag_id_array);
@ -1210,7 +1209,7 @@ function move_upload_to_archive(DataUploadEvent $event) {
* Add a directory full of images * Add a directory full of images
* *
* @param $base string * @param $base string
* @return array * @return array|string[]
*/ */
function add_dir($base) { function add_dir($base) {
$results = array(); $results = array();
@ -1250,7 +1249,7 @@ function add_image($tmpname, $filename, $tags) {
$metadata = array(); $metadata = array();
$metadata['filename'] = $pathinfo['basename']; $metadata['filename'] = $pathinfo['basename'];
$metadata['extension'] = $pathinfo['extension']; $metadata['extension'] = $pathinfo['extension'];
$metadata['tags'] = $tags; $metadata['tags'] = Tag::explode($tags);
$metadata['source'] = null; $metadata['source'] = null;
$event = new DataUploadEvent($tmpname, $metadata); $event = new DataUploadEvent($tmpname, $metadata);
send_event($event); send_event($event);

View file

@ -36,7 +36,7 @@ _d("COMPILE_ELS", false); // boolean pre-build the list of event listeners
_d("NICE_URLS", false); // boolean force niceurl mode _d("NICE_URLS", false); // boolean force niceurl mode
_d("SEARCH_ACCEL", false); // boolean use search accelerator _d("SEARCH_ACCEL", false); // boolean use search accelerator
_d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse _d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse
_d("VERSION", '2.6.0'); // string shimmie version _d("VERSION", '2.6.0+'); // string shimmie version
_d("TIMEZONE", null); // string timezone _d("TIMEZONE", null); // string timezone
_d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable _d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable
_d("EXTRA_EXTS", ""); // string optional extra extensions _d("EXTRA_EXTS", ""); // string optional extra extensions

View file

@ -140,19 +140,6 @@ class User {
} }
} }
/**
* @param int $offset
* @param int $limit
* @return array
*/
public static function by_list(/*int*/ $offset, /*int*/ $limit=50) {
assert('is_numeric($offset)', var_export($offset, true));
assert('is_numeric($limit)', var_export($limit, true));
global $database;
$rows = $database->get_all("SELECT * FROM users WHERE id >= :start AND id < :end", array("start"=>$offset, "end"=>$offset+$limit));
return array_map("_new_user", $rows);
}
/* useful user object functions start here */ /* useful user object functions start here */

View file

@ -555,7 +555,15 @@ function make_http(/*string*/ $link) {
*/ */
function make_form($target, $method="POST", $multipart=False, $form_id="", $onsubmit="") { function make_form($target, $method="POST", $multipart=False, $form_id="", $onsubmit="") {
global $user; global $user;
$auth = $user->get_auth_html(); if($method == "GET") {
$link = html_escape($target);
$target = make_link($target);
$extra_inputs = "<input type='hidden' name='q' value='$link'>";
}
else {
$extra_inputs = $user->get_auth_html();
}
$extra = empty($form_id) ? '' : 'id="'. $form_id .'"'; $extra = empty($form_id) ? '' : 'id="'. $form_id .'"';
if($multipart) { if($multipart) {
$extra .= " enctype='multipart/form-data'"; $extra .= " enctype='multipart/form-data'";
@ -563,7 +571,7 @@ function make_form($target, $method="POST", $multipart=False, $form_id="", $onsu
if($onsubmit) { if($onsubmit) {
$extra .= ' onsubmit="'.$onsubmit.'"'; $extra .= ' onsubmit="'.$onsubmit.'"';
} }
return '<form action="'.$target.'" method="'.$method.'" '.$extra.'>'.$auth; return '<form action="'.$target.'" method="'.$method.'" '.$extra.'>'.$extra_inputs;
} }
/** /**
@ -958,6 +966,17 @@ function data_path($filename) {
return $filename; return $filename;
} }
if (!function_exists('mb_strlen')) {
// TODO: we should warn the admin that they are missing multibyte support
function mb_strlen($str, $encoding) {
return strlen($str);
}
function mb_internal_encoding($encoding) {}
function mb_strtolower($str) {
return strtolower($str);
}
}
/** /**
* @param string $url * @param string $url
* @param string $mfile * @param string $mfile

View file

@ -42,7 +42,9 @@ class Blocks extends Extension {
foreach($blocks as $block) { foreach($blocks as $block) {
$path = implode("/", $event->args); $path = implode("/", $event->args);
if(strlen($path) < 4000 && fnmatch($block['pages'], $path)) { if(strlen($path) < 4000 && fnmatch($block['pages'], $path)) {
$page->add_block(new Block($block['title'], $block['content'], $block['area'], $block['priority'])); $b = new Block($block['title'], $block['content'], $block['area'], $block['priority']);
$b->is_content = false;
$page->add_block($b);
} }
} }

View file

@ -73,7 +73,7 @@ class BulkAddCSV extends Extension {
$metadata = array(); $metadata = array();
$metadata['filename'] = $pathinfo['basename']; $metadata['filename'] = $pathinfo['basename'];
$metadata['extension'] = $pathinfo['extension']; $metadata['extension'] = $pathinfo['extension'];
$metadata['tags'] = $tags; $metadata['tags'] = Tag::explode($tags);
$metadata['source'] = $source; $metadata['source'] = $source;
$event = new DataUploadEvent($tmpname, $metadata); $event = new DataUploadEvent($tmpname, $metadata);
send_event($event); send_event($event);

View file

@ -30,6 +30,7 @@ class Chatbox extends Extension {
// loads the chatbox at the set location // loads the chatbox at the set location
$html = "<div id=\"yshout\"></div>"; $html = "<div id=\"yshout\"></div>";
$chatblock = new Block("Chatbox", $html, "main", 97); $chatblock = new Block("Chatbox", $html, "main", 97);
$chatblock->is_content = false;
$page->add_block($chatblock); $page->add_block($chatblock);
} }
} }

View file

@ -304,9 +304,14 @@ class CronUploader extends Extension {
/** /**
* Generate the necessary DataUploadEvent for a given image and tags. * Generate the necessary DataUploadEvent for a given image and tags.
*
* @param string $tmpname
* @param string $filename
* @param string $tags
*/ */
private function add_image($tmpname, $filename, $tags) { private function add_image($tmpname, $filename, $tags) {
assert ( file_exists ( $tmpname ) ); assert ( file_exists ( $tmpname ) );
assert('is_string($tags)');
$pathinfo = pathinfo ( $filename ); $pathinfo = pathinfo ( $filename );
if (! array_key_exists ( 'extension', $pathinfo )) { if (! array_key_exists ( 'extension', $pathinfo )) {
@ -315,7 +320,7 @@ class CronUploader extends Extension {
$metadata = array(); $metadata = array();
$metadata ['filename'] = $pathinfo ['basename']; $metadata ['filename'] = $pathinfo ['basename'];
$metadata ['extension'] = $pathinfo ['extension']; $metadata ['extension'] = $pathinfo ['extension'];
$metadata ['tags'] = ""; // = $tags; doesn't work when not logged in here $metadata ['tags'] = array(); // = $tags; doesn't work when not logged in here
$metadata ['source'] = null; $metadata ['source'] = null;
$event = new DataUploadEvent ( $tmpname, $metadata ); $event = new DataUploadEvent ( $tmpname, $metadata );
send_event ( $event ); send_event ( $event );
@ -329,7 +334,7 @@ class CronUploader extends Extension {
// Set tags // Set tags
$img = Image::by_id($event->image_id); $img = Image::by_id($event->image_id);
$img->set_tags($tags); $img->set_tags(Tag::explode($tags));
} }
private function generate_image_queue($base = "", $subdir = "") { private function generate_image_queue($base = "", $subdir = "") {

View file

@ -43,10 +43,7 @@ class Handle404 extends Extension {
private function count_main($blocks) { private function count_main($blocks) {
$n = 0; $n = 0;
foreach($blocks as $block) { foreach($blocks as $block) {
if($block->section == "main") $n++; // more hax. if($block->section == "main" && $block->is_content) $n++; // more hax.
}
if(ext_is_live("Chatbox")) {
$n--; // even more hax.
} }
return $n; return $n;
} }

View file

@ -35,9 +35,11 @@ class ArchiveFileHandler extends Extension {
exec($cmd); exec($cmd);
$results = add_dir($tmpdir); $results = add_dir($tmpdir);
if(count($results) > 0) { if(count($results) > 0) {
// FIXME no theme? // Not all themes have the add_status() method, so need to check before calling.
if (method_exists($this->theme, "add_status")) {
$this->theme->add_status("Adding files", $results); $this->theme->add_status("Adding files", $results);
} }
}
deltree($tmpdir); deltree($tmpdir);
$event->image_id = -2; // default -1 = upload wasn't handled $event->image_id = -2; // default -1 = upload wasn't handled
} }

View file

@ -37,7 +37,7 @@ class FlashFileHandler extends DataHandlerExtension {
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];
$image->filename = $metadata['filename']; $image->filename = $metadata['filename'];
$image->ext = $metadata['extension']; $image->ext = $metadata['extension'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
$info = getimagesize($filename); $info = getimagesize($filename);

View file

@ -67,7 +67,7 @@ class IcoFileHandler extends Extension {
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];
$image->filename = $metadata['filename']; $image->filename = $metadata['filename'];
$image->ext = $metadata['extension']; $image->ext = $metadata['extension'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
return $image; return $image;

View file

@ -43,7 +43,7 @@ class MP3FileHandler extends DataHandlerExtension {
$image->filename = $metadata['filename']; $image->filename = $metadata['filename'];
$image->ext = $metadata['extension']; $image->ext = $metadata['extension'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
return $image; return $image;

View file

@ -35,7 +35,7 @@ class PixelFileHandler extends DataHandlerExtension {
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];
$image->filename = (($pos = strpos($metadata['filename'],'?')) !== false) ? substr($metadata['filename'],0,$pos) : $metadata['filename']; $image->filename = (($pos = strpos($metadata['filename'],'?')) !== false) ? substr($metadata['filename'],0,$pos) : $metadata['filename'];
$image->ext = (($pos = strpos($metadata['extension'],'?')) !== false) ? substr($metadata['extension'],0,$pos) : $metadata['extension']; $image->ext = (($pos = strpos($metadata['extension'],'?')) !== false) ? substr($metadata['extension'],0,$pos) : $metadata['extension'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
return $image; return $image;

View file

@ -75,7 +75,7 @@ class SVGFileHandler extends Extension {
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];
$image->filename = $metadata['filename']; $image->filename = $metadata['filename'];
$image->ext = $metadata['extension']; $image->ext = $metadata['extension'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
return $image; return $image;

View file

@ -170,7 +170,7 @@ class VideoFileHandler extends DataHandlerExtension {
$image->filesize = $metadata['size']; $image->filesize = $metadata['size'];
$image->hash = $metadata['hash']; $image->hash = $metadata['hash'];
$image->filename = $metadata['filename']; $image->filename = $metadata['filename'];
$image->tag_array = $metadata['tags']; $image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source']; $image->source = $metadata['source'];
return $image; return $image;

View file

@ -9,8 +9,9 @@ class VideoFileHandlerTheme extends Themelet {
$full_url = make_http($ilink); $full_url = make_http($ilink);
$autoplay = $config->get_bool("video_playback_autoplay"); $autoplay = $config->get_bool("video_playback_autoplay");
$loop = $config->get_bool("video_playback_loop"); $loop = $config->get_bool("video_playback_loop");
$player = make_link('lib/vendor/swf/flashmediaelement.swf');
$html = "Video not playing? <a href='" . $image->parse_link_template(make_link('image/$id/$id%20-%20$tags.$ext')) . "'>Click here</a> to download the file.<br/>"; $html = "Video not playing? <a href='$ilink'>Click here</a> to download the file.<br/>";
//Browser media format support: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats //Browser media format support: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
$supportedExts = ['mp4' => 'video/mp4', 'm4v' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm', 'flv' => 'video/flv']; $supportedExts = ['mp4' => 'video/mp4', 'm4v' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm', 'flv' => 'video/flv'];
@ -22,8 +23,8 @@ class VideoFileHandlerTheme extends Themelet {
} }
$html_fallback = " $html_fallback = "
<object width=\"100%\" height=\"480px\" type=\"application/x-shockwave-flash\" data=\"lib/vendor/swf/flashmediaelement.swf\"> <object width=\"100%\" height=\"480px\" type=\"application/x-shockwave-flash\" data=\"$player\">
<param name=\"movie\" value=\"lib/vendor/swf/flashmediaelement.swf\" /> <param name=\"movie\" value=\"$player\" />
<param name=\"allowFullScreen\" value=\"true\" /> <param name=\"allowFullScreen\" value=\"true\" />
<param name=\"wmode\" value=\"opaque\" /> <param name=\"wmode\" value=\"opaque\" />

View file

@ -265,7 +265,7 @@ class Index extends Extension {
$images = $database->cache->get("post-list:$page_number"); $images = $database->cache->get("post-list:$page_number");
if(!$images) { if(!$images) {
$images = Image::find_images(($page_number-1)*$page_size, $page_size, $search_terms); $images = Image::find_images(($page_number-1)*$page_size, $page_size, $search_terms);
$database->cache->set("post-list:$page_number", $images, 600); $database->cache->set("post-list:$page_number", $images, 60);
} }
} }
else { else {

View file

@ -31,7 +31,7 @@ class Oekaki extends Extension {
$metadata = array(); $metadata = array();
$metadata['filename'] = 'oekaki.png'; $metadata['filename'] = 'oekaki.png';
$metadata['extension'] = $pathinfo['extension']; $metadata['extension'] = $pathinfo['extension'];
$metadata['tags'] = 'oekaki tagme'; $metadata['tags'] = Tag::explode('oekaki tagme');
$metadata['source'] = null; $metadata['source'] = null;
$duev = new DataUploadEvent($tmpname, $metadata); $duev = new DataUploadEvent($tmpname, $metadata);
send_event($duev); send_event($duev);

View file

@ -500,7 +500,7 @@ class OuroborosAPI extends Extension
} }
} }
$meta = array(); $meta = array();
$meta['tags'] = $post->tags; $meta['tags'] = is_array($post->tags) ? $post->tags : Tag::explode($post->tags);
$meta['source'] = $post->source; $meta['source'] = $post->source;
if (defined('ENABLED_EXTS')) { if (defined('ENABLED_EXTS')) {
if (strstr(ENABLED_EXTS, 'rating') !== false) { if (strstr(ENABLED_EXTS, 'rating') !== false) {
@ -536,7 +536,8 @@ class OuroborosAPI extends Extension
if (!is_null($img)) { if (!is_null($img)) {
$handler = $config->get_string("upload_collision_handler"); $handler = $config->get_string("upload_collision_handler");
if($handler == "merge") { if($handler == "merge") {
$merged = array_merge(Tag::explode($post->tags), $img->get_tag_array()); $postTags = is_array($post->tags) ? $post->tags : Tag::explode($post->tags);
$merged = array_merge($postTags, $img->get_tag_array());
send_event(new TagSetEvent($img, $merged)); send_event(new TagSetEvent($img, $merged));
// This is really the only thing besides tags we should care // This is really the only thing besides tags we should care

View file

@ -15,13 +15,24 @@
class RegenThumb extends Extension { class RegenThumb extends Extension {
public function onPageRequest(PageRequestEvent $event) { public function onPageRequest(PageRequestEvent $event) {
global $page, $user; global $database, $page, $user;
if($event->page_matches("regen_thumb") && $user->can("delete_image") && isset($_POST['image_id'])) { if($event->page_matches("regen_thumb/one") && $user->can("delete_image") && isset($_POST['image_id'])) {
$image = Image::by_id(int_escape($_POST['image_id'])); $image = Image::by_id(int_escape($_POST['image_id']));
send_event(new ThumbnailGenerationEvent($image->hash, $image->ext, true)); send_event(new ThumbnailGenerationEvent($image->hash, $image->ext, true));
$this->theme->display_results($page, $image); $this->theme->display_results($page, $image);
} }
if($event->page_matches("regen_thumb/mass") && $user->can("delete_image") && isset($_POST['tags'])) {
$tags = Tag::explode(strtolower($_POST['tags']), false);
$images = Image::find_images(0, 10000, $tags);
foreach($images as $image) {
send_event(new ThumbnailGenerationEvent($image->hash, $image->ext, true));
}
$page->set_mode("redirect");
$page->set_redirect(make_link("post/list"));
}
} }
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) {
@ -30,5 +41,12 @@ class RegenThumb extends Extension {
$event->add_part($this->theme->get_buttons_html($event->image->id)); $event->add_part($this->theme->get_buttons_html($event->image->id));
} }
} }
public function onPostListBuilding(PostListBuildingEvent $event) {
global $user;
if($user->can("delete_image") && !empty($event->search_terms)) {
$event->add_control($this->theme->mtr_html(implode(" ", $event->search_terms)));
}
}
} }

View file

@ -6,7 +6,7 @@ class RegenThumbTest extends ShimmiePHPUnitTestCase {
$this->get_page("post/view/$image_id"); $this->get_page("post/view/$image_id");
$_POST['image_id'] = $image_id; $_POST['image_id'] = $image_id;
$this->get_page("regen_thumb"); $this->get_page("regen_thumb/one");
$this->assert_title("Thumbnail Regenerated"); $this->assert_title("Thumbnail Regenerated");
# FIXME: test that the thumb's modified time has been updated # FIXME: test that the thumb's modified time has been updated

View file

@ -9,7 +9,7 @@ class RegenThumbTheme extends Themelet {
*/ */
public function get_buttons_html($image_id) { public function get_buttons_html($image_id) {
return " return "
".make_form(make_link("regen_thumb"))." ".make_form(make_link("regen_thumb/one"))."
<input type='hidden' name='image_id' value='$image_id'> <input type='hidden' name='image_id' value='$image_id'>
<input type='submit' value='Regenerate Thumbnail'> <input type='submit' value='Regenerate Thumbnail'>
</form> </form>
@ -29,5 +29,15 @@ class RegenThumbTheme extends Themelet {
$page->add_block(new NavBlock()); $page->add_block(new NavBlock());
$page->add_block(new Block("Thumbnail", $this->build_thumb_html($image))); $page->add_block(new Block("Thumbnail", $this->build_thumb_html($image)));
} }
public function mtr_html($terms) {
$h_terms = html_escape($terms);
$html = make_form(make_link("regen_thumb/mass"), "POST") . "
<input type='hidden' name='tags' value='$h_terms'>
<input type='submit' value='Regen all thumbs' onclick='return confirm(\"This can use a lot of CPU time.\\nAre you sure you want to do this?\")'>
</form>
";
return $html;
}
} }

19
ext/resize/script.js Normal file
View file

@ -0,0 +1,19 @@
$(function() {
var original_width = $("#original_width").val();
var original_height = $("#original_height").val();
$("#resize_width").change(function() {
if($("#resize_aspect").prop("checked")) {
$("#resize_height").val(
Math.round($("#resize_width").val() / original_width * original_height)
);
}
});
$("#resize_height").change(function() {
if($("#resize_aspect").prop("checked")) {
$("#resize_width").val(
Math.round($("#resize_height").val() / original_height * original_width)
);
}
});
});

View file

@ -46,7 +46,7 @@ class TagList extends Extension {
$this->theme->display_page($page); $this->theme->display_page($page);
} }
else if($event->page_matches("api/internal/tag_list/complete")) { else if($event->page_matches("api/internal/tag_list/complete")) {
if(!isset($_GET["s"])) return; if(!isset($_GET["s"]) || $_GET["s"] == "" || $_GET["s"] == "_") return;
//$limit = 0; //$limit = 0;
$cache_key = "autocomplete-" . strtolower($_GET["s"]); $cache_key = "autocomplete-" . strtolower($_GET["s"]);
@ -269,7 +269,7 @@ class TagList extends Extension {
$cache_key = data_path("cache/tag_alpha-" . md5("ta" . $tags_min . $starts_with) . ".html"); $cache_key = data_path("cache/tag_alpha-" . md5("ta" . $tags_min . $starts_with) . ".html");
if(file_exists($cache_key)) {return file_get_contents($cache_key);} if(file_exists($cache_key)) {return file_get_contents($cache_key);}
$tag_data = $database->get_all($database->scoreql_to_sql(" $tag_data = $database->get_pairs($database->scoreql_to_sql("
SELECT tag, count SELECT tag, count
FROM tags FROM tags
WHERE count >= :tags_min WHERE count >= :tags_min
@ -296,8 +296,10 @@ class TagList extends Extension {
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
$lastLetter = ""; $lastLetter = "";
foreach($tag_data as $row) { # postres utf8 string sort ignores punctuation, so we get "aza, a-zb, azc"
$tag = $row['tag']; # which breaks down into "az, a-, az" :(
ksort($tag_data, SORT_STRING | SORT_FLAG_CASE);
foreach($tag_data as $tag => $count) {
if($lastLetter != mb_strtolower(substr($tag, 0, count($starts_with)+1))) { if($lastLetter != mb_strtolower(substr($tag, 0, count($starts_with)+1))) {
$lastLetter = mb_strtolower(substr($tag, 0, count($starts_with)+1)); $lastLetter = mb_strtolower(substr($tag, 0, count($starts_with)+1));
$h_lastLetter = html_escape($lastLetter); $h_lastLetter = html_escape($lastLetter);
@ -305,7 +307,6 @@ class TagList extends Extension {
} }
$link = $this->tag_link($tag); $link = $this->tag_link($tag);
$h_tag = html_escape($tag); $h_tag = html_escape($tag);
$count = $row['count'];
$html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n"; $html .= "<a href='$link'>$h_tag&nbsp;($count)</a>\n";
} }

View file

@ -95,7 +95,7 @@ class UserPage extends Extension {
} }
public function onPageRequest(PageRequestEvent $event) { public function onPageRequest(PageRequestEvent $event) {
global $config, $page, $user; global $config, $database, $page, $user;
$this->show_user_info(); $this->show_user_info();
@ -115,15 +115,32 @@ class UserPage extends Extension {
$this->page_create(); $this->page_create();
} }
else if($event->get_arg(0) == "list") { else if($event->get_arg(0) == "list") {
// select users.id,name,joindate,admin, $offset = 0;
// (select count(*) from images where images.owner_id=users.id) as images, $limit = 50;
// (select count(*) from comments where comments.owner_id=users.id) as comments from users;
// select users.id,name,joindate,admin,image_count,comment_count $q = "SELECT * FROM users WHERE 1=1";
// from users $a = array("offset"=>$offset, "limit"=>$limit);
// join (select owner_id,count(*) as image_count from images group by owner_id) as _images on _images.owner_id=users.id
// join (select owner_id,count(*) as comment_count from comments group by owner_id) as _comments on _comments.owner_id=users.id; if(@$_GET['username']) {
$this->theme->display_user_list($page, User::by_list(0), $user); $q .= " AND SCORE_STRNORM(name) LIKE SCORE_STRNORM(:name)";
$a["name"] = '%' . $_GET['username'] . '%';
}
if($user->can('delete_user') && @$_GET['email']) {
$q .= " AND SCORE_STRNORM(name) LIKE SCORE_STRNORM(:email)";
$a["email"] = '%' . $_GET['email'] . '%';
}
if(@$_GET['class']) {
$q .= " AND class LIKE :class";
$a["class"] = $_GET['class'];
}
$q .= " LIMIT :limit OFFSET :offset";
$rows = $database->get_all($database->scoreql_to_sql($q), $a);
$users = array_map("_new_user", $rows);
$this->theme->display_user_list($page, $users, $user);
} }
else if($event->get_arg(0) == "logout") { else if($event->get_arg(0) == "logout") {
$this->page_logout(); $this->page_logout();

View file

@ -9,18 +9,56 @@ class UserPageTheme extends Themelet {
"There should be a login box to the left")); "There should be a login box to the left"));
} }
/**
* @param Page $page
* @param User[] $users
* @param User $user
*/
public function display_user_list(Page $page, $users, User $user) { public function display_user_list(Page $page, $users, User $user) {
$page->set_title("User List"); $page->set_title("User List");
$page->set_heading("User List"); $page->set_heading("User List");
$page->add_block(new NavBlock()); $page->add_block(new NavBlock());
$html = "<table>";
$html .= "<tr><td>Name</td></tr>"; $html = "<table class='zebra'>";
foreach($users as $duser) {
$html .= "<tr>"; $html .= "<tr>";
$html .= "<td><a href='".make_link("user/".url_escape($duser->name))."'>".html_escape($duser->name)."</a></td>"; $html .= "<td>Name</td>";
if($user->can('delete_user'))
$html .= "<td>Email</td>";
$html .= "<td>Class</td>";
$html .= "<td>Action</td>";
$html .= "</tr>";
$h_username = html_escape(@$_GET['username']);
$h_email = html_escape(@$_GET['email']);
$h_class = html_escape(@$_GET['class']);
$html .= "<tr>" . make_form("user_admin/list", "GET");
$html .= "<td><input type='text' name='username' value='$h_username'/></td>";
if($user->can('delete_user'))
$html .= "<td><input type='email' name='email' value='$h_email'/></td>";
$html .= "<td><input type='text' name='class' value='$h_class'/></td>";
$html .= "<td><input type='submit' value='Search'/></td>";
$html .= "</form></tr>";
foreach($users as $duser) {
$h_name = html_escape($duser->name);
$h_email = html_escape($duser->email);
$h_class = html_escape($duser->class->name);
$u_link = make_link("user/" . url_escape($duser->name));
$u_posts = make_link("post/list/user_id=" . url_escape($duser->id) . "/1");
$html .= "<tr>";
$html .= "<td><a href='$u_link'>$h_name</a></td>";
if($user->can('delete_user'))
$html .= "<td>$h_email</td>";
$html .= "<td>$h_class</td>";
$html .= "<td><a href='$u_posts'>Show Posts</a></td>";
$html .= "</tr>"; $html .= "</tr>";
} }
$html .= "</table>"; $html .= "</table>";
$page->add_block(new Block("Users", $html)); $page->add_block(new Block("Users", $html));
} }

View file

@ -30,11 +30,9 @@ class ViewImageTheme extends Themelet {
protected function build_pin(Image $image) { protected function build_pin(Image $image) {
if(isset($_GET['search'])) { if(isset($_GET['search'])) {
$search_terms = explode(' ', $_GET['search']);
$query = "search=".url_escape($_GET['search']); $query = "search=".url_escape($_GET['search']);
} }
else { else {
$search_terms = array();
$query = null; $query = null;
} }

View file

@ -132,7 +132,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit_Framework_TestCase {
// post things // post things
/** /**
* @param string $filename * @param string $filename
* @param string|string[] $tags * @param string $tags
* @return int * @return int
*/ */
protected function post_image($filename, $tags) { protected function post_image($filename, $tags) {

View file

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
php \ php \
-d extension.dir=/usr/lib/php/extensions/no-debug-non-zts-20121212/ \
-d extension=xdebug.so \
-d xdebug.profiler_output_dir=./data/prof/ \ -d xdebug.profiler_output_dir=./data/prof/ \
-d xdebug.profiler_enable=1 \ -d xdebug.profiler_enable=1 \
./phpunit.phar \ ./vendor/bin/phpunit \
--config tests/phpunit.xml \ --config tests/phpunit.xml \
--coverage-clover data/coverage.clover --coverage-clover data/coverage.clover
# -d extension.dir=/usr/local/Cellar/php71-xdebug/2.5.5/ \
# -d extension=xdebug.so \