Skip to content

Commit

Permalink
Collections broke ping.
Browse files Browse the repository at this point in the history
Since the collection API has changed to accomodate new versions of PHP,
ping has broken.
  • Loading branch information
Csardelacal committed May 25, 2023
1 parent 08d01a4 commit cb7354e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/models/authapp.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use auth\Context;
use connection\AuthModel;
use spitfire\collection\Collection;
use spitfire\Model;
use spitfire\storage\database\Schema;

Expand Down Expand Up @@ -54,7 +55,7 @@ public function definitions(Schema $schema)
$schema->appID->setUnique(true);
}

public function canAccess($app, $user, $context)
public function canAccess($app, $user, Collection $context)
{

$db = $this->getTable()->getDb();
Expand Down Expand Up @@ -100,7 +101,7 @@ public function canAccess($app, $user, $context)
return $c;
}
return $e;
}, $result->rewind());
}, $result->first());

return $_r? $_r->state : AuthModel::STATE_PENDING;
}
Expand Down
4 changes: 2 additions & 2 deletions spitfire/io/session/FileSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ public function read($__garbage) : string|false
//The system can only read the first 8MB of the session.
//We do hardcode to improve the performance since PHP will stop at EOF
fseek($this->getHandle(), 0);
return $this->data = (string) fread($this->getHandle(), 8 * 1024 * 1024);
return $this->data = (string) fread($this->getHandle(), 4 * 1024 * 1024);
}

public function write($__garbage, $data) : bool
{
//If your session contains more than 8MB of data you're probably doing
//something wrong.
if (isset($data[8*1024*1024])) {
if (isset($data[4*1024*1024])) {
throw new PrivateException('Session length overflow', 171228);
}

Expand Down

0 comments on commit cb7354e

Please sign in to comment.