Skip to content

add route to fetch the current pod count#31

Open
ylebre wants to merge 1 commit into
mainfrom
feature/pod-count
Open

add route to fetch the current pod count#31
ylebre wants to merge 1 commit into
mainfrom
feature/pod-count

Conversation

@ylebre

@ylebre ylebre commented Jun 1, 2026

Copy link
Copy Markdown
Member

To fetch it, the request should pass a pod-count-key header that matches the POD_COUNT_KEY constant defined in the config.php;

The endpoint returns a {"count":xxx} json result which can then be used in all kinds of fun graph-things.

@Potherca Potherca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is okay.
Two minor comments. Resolve or ignore at will.


public static function respondToPodCount() {
$requestFactory = new ServerRequestFactory();
$rawRequest = $requestFactory->fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Dynamic call to static method ServerRequestFactory::fromGlobals().
  • Unused variable $rawRequest (and $requestFactory).

Was this meant to be used below (instead of $_SERVER?)

Comment thread lib/StorageServer.php
if (sizeof($result) === 1) {
return $result[0]['podCount'];
}
return false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the JSON return of SolidStorageProvider::respondToPodCount, shouldn't this be 0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants