},
{
"name": "nikic/php-parser",
- "version": "v5.3.1",
+ "version": "v5.4.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b"
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b",
- "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0"
},
- "time": "2024-10-08T18:51:32+00:00"
+ "time": "2024-12-30T11:07:19+00:00"
},
{
"name": "phar-io/manifest",
},
{
"name": "phpunit/php-code-coverage",
- "version": "11.0.7",
+ "version": "11.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca"
+ "reference": "418c59fd080954f8c4aa5631d9502ecda2387118"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7f08030e8811582cc459871d28d6f5a1a4d35ca",
- "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118",
+ "reference": "418c59fd080954f8c4aa5631d9502ecda2387118",
"shasum": ""
},
"require": {
"theseer/tokenizer": "^1.2.3"
},
"require-dev": {
- "phpunit/phpunit": "^11.4.1"
+ "phpunit/phpunit": "^11.5.0"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.7"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.8"
},
"funding": [
{
"type": "github"
}
],
- "time": "2024-10-09T06:21:38+00:00"
+ "time": "2024-12-11T12:34:27+00:00"
},
{
"name": "phpunit/php-file-iterator",
},
{
"name": "phpunit/phpunit",
- "version": "11.4.3",
+ "version": "11.5.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76"
+ "reference": "3c3ae14c90f244cdda95028c3e469028e8d1c02c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e8e8ed1854de5d36c088ec1833beae40d2dedd76",
- "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3c3ae14c90f244cdda95028c3e469028e8d1c02c",
+ "reference": "3c3ae14c90f244cdda95028c3e469028e8d1c02c",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.12.0",
+ "myclabs/deep-copy": "^1.12.1",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=8.2",
- "phpunit/php-code-coverage": "^11.0.7",
+ "phpunit/php-code-coverage": "^11.0.8",
"phpunit/php-file-iterator": "^5.1.0",
"phpunit/php-invoker": "^5.0.1",
"phpunit/php-text-template": "^4.0.1",
"phpunit/php-timer": "^7.0.1",
"sebastian/cli-parser": "^3.0.2",
- "sebastian/code-unit": "^3.0.1",
- "sebastian/comparator": "^6.1.1",
+ "sebastian/code-unit": "^3.0.2",
+ "sebastian/comparator": "^6.3.0",
"sebastian/diff": "^6.0.2",
"sebastian/environment": "^7.2.0",
- "sebastian/exporter": "^6.1.3",
+ "sebastian/exporter": "^6.3.0",
"sebastian/global-state": "^7.0.2",
"sebastian/object-enumerator": "^6.0.1",
"sebastian/type": "^5.1.0",
- "sebastian/version": "^5.0.2"
+ "sebastian/version": "^5.0.2",
+ "staabm/side-effects-detector": "^1.0.5"
},
"suggest": {
"ext-soap": "To be able to generate mocks based on WSDL files"
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "11.4-dev"
+ "dev-main": "11.5-dev"
}
},
"autoload": {
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/11.4.3"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.6"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2024-10-28T13:07:50+00:00"
+ "time": "2025-01-31T07:03:30+00:00"
},
{
"name": "sebastian/cli-parser",
},
{
"name": "sebastian/code-unit",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "6bb7d09d6623567178cf54126afa9c2310114268"
+ "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268",
- "reference": "6bb7d09d6623567178cf54126afa9c2310114268",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca",
+ "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca",
"shasum": ""
},
"require": {
"php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^11.0"
+ "phpunit/phpunit": "^11.5"
},
"type": "library",
"extra": {
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit/issues",
"security": "https://github.com/sebastianbergmann/code-unit/security/policy",
- "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1"
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2"
},
"funding": [
{
"type": "github"
}
],
- "time": "2024-07-03T04:44:28+00:00"
+ "time": "2024-12-12T09:59:06+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
},
{
"name": "sebastian/comparator",
- "version": "6.2.1",
+ "version": "6.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739"
+ "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739",
- "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d4e47a769525c4dd38cea90e5dcd435ddbbc7115",
+ "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115",
"shasum": ""
},
"require": {
"require-dev": {
"phpunit/phpunit": "^11.4"
},
+ "suggest": {
+ "ext-bcmath": "For comparing BcMath\\Number objects"
+ },
"type": "library",
"extra": {
"branch-alias": {
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"security": "https://github.com/sebastianbergmann/comparator/security/policy",
- "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.0"
},
"funding": [
{
"type": "github"
}
],
- "time": "2024-10-31T05:30:08+00:00"
+ "time": "2025-01-06T10:28:19+00:00"
},
{
"name": "sebastian/complexity",
},
{
"name": "sebastian/exporter",
- "version": "6.1.3",
+ "version": "6.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e"
+ "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",
- "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3",
+ "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3",
"shasum": ""
},
"require": {
"sebastian/recursion-context": "^6.0"
},
"require-dev": {
- "phpunit/phpunit": "^11.2"
+ "phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"security": "https://github.com/sebastianbergmann/exporter/security/policy",
- "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0"
},
"funding": [
{
"type": "github"
}
],
- "time": "2024-07-03T04:56:19+00:00"
+ "time": "2024-12-05T09:17:50+00:00"
},
{
"name": "sebastian/global-state",
],
"time": "2024-10-09T05:16:32+00:00"
},
+ {
+ "name": "staabm/side-effects-detector",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/staabm/side-effects-detector.git",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^1.12.6",
+ "phpunit/phpunit": "^9.6.21",
+ "symfony/var-dumper": "^5.4.43",
+ "tomasvotruba/type-coverage": "1.0.0",
+ "tomasvotruba/unused-public": "1.0.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "lib/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "A static analysis tool to detect side effects in PHP code",
+ "keywords": [
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/staabm/side-effects-detector/issues",
+ "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/staabm",
+ "type": "github"
+ }
+ ],
+ "time": "2024-10-20T05:08:20+00:00"
+ },
{
"name": "theseer/tokenizer",
"version": "1.2.3",
* @param $responseInstance An instance of a Responseable class
* @return $loginInstance An instance of this login class
*/
- public static final function createCookieAuth (Responseable $responseInstance) {
+ public static final function createCookieAuth (Responseable $responseInstance): Authorizeable {
// Get a new instance
$loginInstance = new CookieAuth();
* @param $userName The username from request we shall set
* @return void
*/
- public function setUserAuth (string $userName) {
+ public function setUserAuth (string $userName): void {
FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName);
}
* @param $passHash The hashed password from request we shall set
* @return void
*/
- public function setPasswordAuth (string $passHash) {
+ public function setPasswordAuth (string $passHash): void {
FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash);
}
*
* @return $userName Username to get from cookie
*/
- public function getUserAuth () {
+ public function getUserAuth (): string {
// Get the username from cookie
$userName = FrameworkBootstrap::getRequestInstance()->readCookie('username');
*
* @return $passHash Password hash to get from cookie
*/
- public function getPasswordAuth () {
+ public function getPasswordAuth (): string {
// Get the username from cookie
$passHash = FrameworkBootstrap::getRequestInstance()->readCookie('u_hash');
*
* @return void
*/
- public function destroyAuthData () {
+ public function destroyAuthData (): void {
// Expire both cookies
FrameworkBootstrap::getResponseInstance()->expireCookie('username');
FrameworkBootstrap::getResponseInstance()->expireCookie('u_hash');
*
* @return void
*/
- public function updateAuthData () {
+ public function updateAuthData (): void {
FrameworkBootstrap::getResponseInstance()->refreshCookie('username');
FrameworkBootstrap::getResponseInstance()->refreshCookie('u_hash');
}
*
* @return $cacheInstance An instance of this cache class
*/
- public static final function createMemoryCache () {
+ public static final function createMemoryCache (): Cacheable {
// Get a new instance
$cacheInstance = new MemoryCache();
*
* @return void
*/
- protected function initCache () {
+ protected function initCache (): void {
// Now create the "data cache"
$this->dataCache = new FrameworkArrayObject('FakedDataCache');
}
* @param $minimumCount If array element is found then this count must at least match
* @return $exists Whether the offset exists
*/
- public function offsetExists ($offset, $arrayElement = NULL, $minimumCount = 0) {
+ public function offsetExists (int $offset, $arrayElement = NULL, int $minimumCount = 0): bool {
// Is it there?
$exists = $this->dataCache->offsetExists($offset);
* @param $data Data to store in cache
* @return void
*/
- public function offsetSet ($offset, $data) {
+ public function offsetSet (int $offset, $data): void {
$this->dataCache->offsetSet($offset, $data);
}
* @param $offset The offset we shall set
* @return $data Data to store in cache
*/
- public function offsetGet ($offset) {
+ public function offsetGet (int $offset): mixed {
// Default is offset not found
$data = NULL;
* @param $offset The offset we shall set
* @return void
*/
- public function purgeOffset ($offset) {
+ public function purgeOffset (int $offset): mixed {
// Is the offset there?
if ($this->offsetExists($offset)) {
// Purge only existing keys
- //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHE: Unsetting cache ' . $offset);
+ //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('CACHE: Unsetting cache ' . $offset);
$this->dataCache->offsetUnset($offset);
}
}
$responseArray = $this->doConnectRequest($host, $port);
// Check array
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray)));
if (count($responseArray) < 2) {
// Not expected count
throw new UnexpectedValueException(sprintf('responseArray()=%d must have at least two elements', count($responseArray)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HTTP-CLIENT: rawRequest=' . $rawRequest);
// Write request
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Sending %d bytes to this->socketResource=%s ...', strlen($rawRequest), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Sending %d bytes to this->socketResource=%s ...', strlen($rawRequest), $this->getSocketResource()));
fwrite($this->getSocketResource(), $rawRequest);
// Got response?
$feof = feof($this->getSocketResource());
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s,feof=%d', $this->getSocketResource(), intval($feof)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: this->socketResource=%s,feof=%d', $this->getSocketResource(), intval($feof)));
if ($feof) {
// No response received
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: this->socketResource=%s has reached EOF - EXIT!', $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('HTTP-CLIENT: this->socketResource=%s has reached EOF - EXIT!', $this->getSocketResource()));
return $response;
}
$rawResponse = trim(fgets($this->getSocketResource(), 10240));
// "Explode" the string to an array
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Received %d bytes back from this->socketResource=%s ...', strlen($rawResponse), $this->getSocketResource()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Received %d bytes back from this->socketResource=%s ...', strlen($rawResponse), $this->getSocketResource()));
$responseArray = explode(' ', $rawResponse);
// And return it
];
// Prepare raw request
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: Invoking this->sendRawHttpRequest(CONNECT,%s,%d,headers()=%d) ...', $host, $port, count($headers)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('HTTP-CLIENT: Invoking this->sendRawHttpRequest(CONNECT,%s,%d,headers()=%d) ...', $host, $port, count($headers)));
$responseArray = $this->sendRawHttpRequest('CONNECT', $host, $port, $headers);
// Return response array
*/
public function processFilters (Requestable $requestInstance, Responseable $responseInstance) {
// Run all filters
- //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COUNT=' . $this->countGenericArray('filters'));
+ //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('COUNT=' . $this->countGenericArray('filters'));
foreach ($this->getFilters() as $filterInstance) {
// Try to execute this filter
try {
- //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
+ //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
$filterInstance->execute($requestInstance, $responseInstance);
- //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
+ //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
} catch (FilterChainException $e) {
// This exception can be thrown to just skip any further processing
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
+ self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
break;
}
}
+
+ // Trace message
+ /* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('EXIT!');
}
}
$headerSize = $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize();
// Then read it (see constructor for calculation)
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: headerSize=%d', $headerSize));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: headerSize=%d', $headerSize));
$data = $this->getIteratorInstance()->getBinaryFileInstance()->read($headerSize);
// Have all requested bytes been read?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Read %d bytes (%d wanted).', strlen($data), $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Read %d bytes (%d wanted).', strlen($data), $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()));
if (strlen($data) != $this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()) {
// Invalid header length
throw new UnexpectedValueException(sprintf('data(%d)=%s is not expected length %d',
$header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data);
// Map numeric entries to associative (alpha-numeric) elements
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
- //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
+ //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true)));
$header = ArrayUtils::mapNumericKeysToAssociative($header, [
BinaryFile::HEADER_NAME_MAGIC,
BinaryFile::HEADER_NAME_TOTAL_ENTRIES,
]);
// Check if the array has only 2 elements
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header)));
if (count($header) != BinaryFile::HEADER_INDEX_ELEMENT_COUNT) {
// Bad header
throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
);
// Write it to disk (header is always at seek position 0)
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
$this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
// Trace message
);
// Set it
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Setting headerSize=%d ...', $headerSize));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Setting headerSize=%d ...', $headerSize));
$this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize);
// Init counters and gaps array
$this->readIndexHeader();
// Freshly created?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: created=%d', intval($created)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: created=%d', intval($created)));
if (!$created) {
// Analyze file structure
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...');
}
// Call iterated object's method
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
$status = $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition($seekPosition, $dataStream);
// Return status
Indexable::SEPARATOR_GAP_LENGTH,
$data[StackableFile::ARRAY_NAME_DATA_LENGTH]
);
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData));
// Search for next free gap
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
$gapPosition = $this->getIteratorInstance()->getBinaryFileInstance()->searchNextGap(strlen($rawData));
// Gap position cannot be smaller or equal than header length
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition));
if ($gapPosition <= ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)) {
// Not valid gap position returned
throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Then write the data at that gap
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
$this->getIteratorInstance()->getBinaryFileInstance()->writeData($gapPosition, $rawData);
// Trace message
*/
public function seek (int $seekPosition): void {
// Validate parameter
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-ITERATOR: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('FILE-ITERATOR: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
if ($seekPosition < 0) {
// Throw IAE
throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid', $seekPosition));
$xmlParser = xml_parser_create();
// Force case-folding to on
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Created xmlParser=%s ...', $xmlParser));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Created xmlParser=%s ...', $xmlParser));
xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE);
// Set UTF-8
xml_set_character_data_handler($xmlParser, 'characterHandler');
// Now parse the XML tree
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Invoking xml_parse(%s, content()=%d) ...', $xmlParser, strlen($content)));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Invoking xml_parse(%s, content()=%d) ...', $xmlParser, strlen($content)));
if (!xml_parse($xmlParser, $content)) {
// Error found in XML
//* DEBUG: */ exit(__METHOD__ . ':<pre>'.htmlentities($content).'</pre>');
}
// Free the parser
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('XML-PARSER: Freeing xmlParser=%s ...', $xmlParser));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('XML-PARSER: Freeing xmlParser=%s ...', $xmlParser));
xml_parser_free($xmlParser);
// Trace message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('XML-PARSER: EXIT!');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('XML-PARSER: EXIT!');
}
}
* @throws UnsupportedOperationException If this method is called (which is a mistake)
*/
public function streamData (string $data) {
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+ self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Unhandled ' . strlen($data) . ' bytes in this stream.');
throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
}
return $str;
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('OPENSSL-STREAM: key[' . gettype($key) . ']=' . $key);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('OPENSSL-STREAM: key[' . gettype($key) . ']=' . $key);
// Init crypto module
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
* @throws UnsupportedOperationException If this method is called (which is a mistake)
*/
public function streamData (string $data) {
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+ self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Unhandled ' . strlen($data) . ' bytes in this stream.');
throw new UnsupportedOperationException([$this, __FUNCTION__], FrameworkInterface::EXCEPTION_UNSPPORTED_OPERATION);
}
// RECURSIVE PROTECTION! BE CAREFUL HERE!
if ((!isset($this->loadedRawData[$template])) && (!in_array($template, $this->loadedTemplates))) {
// Template not found, but maybe variable assigned?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: template=%s not loaded yet', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: template=%s not loaded yet', $template));
if ($this->getVariableIndex($template) !== false) {
// Use that content here
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Assigning this->loadedTemplateData[%s] from variable template=%s ...', $template, $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Assigning this->loadedTemplateData[%s] from variable template=%s ...', $template, $template));
$this->loadedRawData[$template] = $this->readVariable($template);
// Recursive protection:
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
array_push($this->loadedTemplates, $template);
} else {
// Then try to search for code-templates
$this->loadCodeTemplate($template);
// ... and remember it's contents
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
$this->loadedRawData[$template] = $this->getRawTemplateData();
// Remember this template for recursion detection
// RECURSIVE PROTECTION!
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
array_push($this->loadedTemplates, $template);
} catch (FileNotFoundException $e) {
// Even this is not done... :/
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Marking template=%s as loaded ...', $template));
array_push($this->rawTemplates, $template);
}
}
$this->compileTemplate();
// 4. Remember it's contents
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('BASE-TEMPLATE: Setting this->loadedRawData[%s] from this->rawTemplateData ...', $template));
$this->loadedRawData[$template] = $this->getRawTemplateData();
// 5. Restore the previous raw content from backup variable
// Goes something wrong?
if ((!isset($result)) || (empty($result))) {
// Output eval command
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Failed eval() code: <pre>%s</pre>', $this->markupCode($eval, true)), true);
+ self::createDebugInstance(__CLASS__, __LINE__)->warningMessage(sprintf('Failed eval() code: <pre>%s</pre>', $this->markupCode($eval, true)), true);
// Output backtrace here
$this->debugBackTrace();
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
interface Authorizeable extends FrameworkInterface {
+ /**
+ * "Setter" for username auth data
+ *
+ * @param $userName The username from request we shall set
+ * @return void
+ */
+ function setUserAuth (string $userName): void;
+
+ /**
+ * "Setter" for password hash auth data
+ *
+ * @param $passHash The hashed password from request we shall set
+ * @return void
+ */
+ function setPasswordAuth (string $passHash): void;
+
+ /**
+ * Getter for user auth cookie
+ *
+ * @return $userName Username to get from cookie
+ */
+ function getUserAuth (): string;
+
+ /**
+ * Getter for password hash auth cookie
+ *
+ * @return $passHash Password hash to get from cookie
+ */
+ function getPasswordAuth (): string;
+
/**
* Destroy the authorization data
*
* @param $minimumCount If array element is found then this count must at least match
* @return $exists Whether the offset exists
*/
- function offsetExists($offset, $arrayElement = NULL, $minimumCount = 0);
+ function offsetExists(int $offset, $arrayElement = NULL, int $minimumCount = 0): bool;
/**
* Setter for cache offset
* @param $data Data to store in cache
* @return void
*/
- function offsetSet($offset, $data);
+ function offsetSet(int $offset, $data): void;
/**
* Getter for cache offset or "null" if not found
* @param $offset The offset we shall set
* @return $data Data to store in cache
*/
- function offsetGet($offset);
+ function offsetGet(int $offset): mixed;
/**
* Purges the given cache entry
* @param $offset The offset we shall set
* @return void
*/
- function purgeOffset($offset);
+ function purgeOffset(int $offset): mixed;
}