Skip to content
Snippets Groups Projects
Commit 9b03120d authored by ale's avatar ale
Browse files

Show shard in "noblogs info", not host

parent dce802fa
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,7 @@ function do_info($args) {
echo "ID: {$blog->blog_id}\n";
echo "Name: {$blog->domain}\n";
echo "Host: {$dbinfo['host']}\n";
echo "Shard: {$dbinfo['shard']}\n";
echo "Status: {$status}\n";
echo "Registered: {$blog->registered}\n";
echo "Last Update: {$blog->last_updated}\n";
......
noblogs-cli (0.2) unstable; urgency=medium
* Bump version.
-- Autistici/Inventati <debian@autistici.org> Thu, 07 Oct 2021 11:51:35 +0100
noblogs-cli (0.1) unstable; urgency=low
* Initial Release.
......
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
%:
dh $@ --with autotools-dev
......
......@@ -42,16 +42,18 @@ function noblogs_get_backend_for_blog($blog_id) {
$backend = $wpdb_reverse_backend_map[$lookup];
// Be nice and split the database host into 'host' and 'port' elements.
$result = array();
$result = array(
"shard" => $lookup,
"user" => $backend['user'],
"password" => $backend['password'],
"db" => $backend['name']
);
if (preg_match('/^(.*):([0-9]*)$/', $backend['host'], $matches)) {
$result['host'] = $matches[1];
$result['port'] = $matches[2];
} else {
$result['host'] = $backend['host'];
}
$result['user'] = $backend['user'];
$result['password'] = $backend['password'];
$result['db'] = $backend['name'];
return $result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment