Status_network.php

Summary
Status_network.php
Status_networkTable Definition for status_network
Status_networkSuperclass representing an entry for a single status_network in a multi- site install.
getKVStatic get
setupDBSets up the DB for a given multisite server.
cacheKeyReturns a cache key for a given status network.
memGetGet a cached segment for a given status network.
decacheRemove a cached segment for a given status network.
updateUpdate a cached segment for a given status network
updateKeysDB_DataObject doesn’t allow updating keys (even non-primary), so this is a workaround
deleteDelete a site from a multi-site install
getFromHostnameReturns a site in a multi-site install based on its hostname
setupSiteSets up an uninitialized site in a multi-site install.
redirectToPerform a 301 redirect.
getServerNameReturn the server name of the current status network on a multi- site install.
getTagsReturn site meta-info tags as an array
saveTagsSave a given set of tags for a status network on a multi-site install.
clearTagsDelete all the tags for a status network on a multi-site install.
hasTagCheck if this site record has a particular meta-info tag attached.

Status_network

Table Definition for status_network

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Table Definition for status_network

PHP version

Tested with PHP 7

File Authors

Web

Status_network

Superclass representing an entry for a single status_network in a multi- site install.

Properties

  • __table = ‘status_network’ - table name
  • site_id - int(4) primary_key not_null
  • nickname - varchar(64) unique_key not_null
  • hostname - varchar(191) unique_key not 255 because utf8mb4 takes more space
  • pathname - varchar(191) unique_key not 255 because utf8mb4 takes more space
  • dbhost - varchar(191) not 255 because utf8mb4 takes more space
  • dbuser - varchar(191) not 255 because utf8mb4 takes more space
  • dbpass - varchar(191) not 255 because utf8mb4 takes more space
  • dbname - varchar(191) not 255 because utf8mb4 takes more space
  • sitename - varchar(191) not 255 because utf8mb4 takes more space
  • theme - varchar(191) not 255 because utf8mb4 takes more space
  • logo - varchar(191) not 255 because utf8mb4 takes more space
  • created - datetime() not_null
  • modified - timestamp() not_null default_CURRENT_TIMESTAMP
Summary
getKVStatic get
setupDBSets up the DB for a given multisite server.
cacheKeyReturns a cache key for a given status network.
memGetGet a cached segment for a given status network.
decacheRemove a cached segment for a given status network.
updateUpdate a cached segment for a given status network
updateKeysDB_DataObject doesn’t allow updating keys (even non-primary), so this is a workaround
deleteDelete a site from a multi-site install
getFromHostnameReturns a site in a multi-site install based on its hostname
setupSiteSets up an uninitialized site in a multi-site install.
redirectToPerform a 301 redirect.
getServerNameReturn the server name of the current status network on a multi- site install.
getTagsReturn site meta-info tags as an array
saveTagsSave a given set of tags for a status network on a multi-site install.
clearTagsDelete all the tags for a status network on a multi-site install.
hasTagCheck if this site record has a particular meta-info tag attached.

getKV

static function getKV($k,  
$v = NULL)

Static get

setupDB

static function setupDB( $dbhost,
 $dbuser,
 $dbpass,
 $dbname,
array $servers)

Sets up the DB for a given multisite server.  This is every bit as insecure as it looks and mostly kept as a legacy function.  You probably shouldn’t use it.

Parameters

  • string $dbhost
  • string $dbuser
  • string $dbpass
  • string $dbname
  • array $servers memcached servers to use for caching config info

cacheKey

static function cacheKey($k,
$v)

Returns a cache key for a given status network.

memGet

static function memGet($k,
$v)

Get a cached segment for a given status network.

decache

function decache()

Remove a cached segment for a given status network.

update

function update($dataObject = false)

Update a cached segment for a given status network

updateKeys

function updateKeys(&$orig)

DB_DataObject doesn’t allow updating keys (even non-primary), so this is a workaround

delete

function delete($useWhere = false)

Delete a site from a multi-site install

getFromHostname

static function getFromHostname($servername,
$wildcard)

Returns a site in a multi-site install based on its hostname

Parameters

  • string $servername hostname
  • string $wildcard hostname suffix to match wildcard config

Returns

  • mixed Status_network or null

setupSite

static function setupSite($servername,
$pathname,
$wildcard)

Sets up an uninitialized site in a multi-site install.

Parameters

  • string $servername hostname
  • string $pathname URL base path
  • string $wildcard hostname suffix to match wildcard config

Returns

  • the created site’s object class if successful, null if not

redirectTo

function redirectTo($destination)

Perform a 301 redirect.

Code partially mooked from http://www.richler.de/en/php-redirect/ © 2006 by Heiko Richler http://www.richler.de/ LGPL

getServerName

function getServerName()

Return the server name of the current status network on a multi- site install.

getTags

function getTags()

Return site meta-info tags as an array

Returns

  • array of strings

saveTags

Save a given set of tags for a status network on a multi-site install.

Parameters

  • array tags

clearTags

function clearTags()

Delete all the tags for a status network on a multi-site install.

hasTag

function hasTag($tag)

Check if this site record has a particular meta-info tag attached.

Parameters

  • string $tag

Returns

  • boolean
static function getKV($k,  
$v = NULL)
Static get
static function setupDB( $dbhost,
 $dbuser,
 $dbpass,
 $dbname,
array $servers)
Sets up the DB for a given multisite server.
static function cacheKey($k,
$v)
Returns a cache key for a given status network.
static function memGet($k,
$v)
Get a cached segment for a given status network.
function decache()
Remove a cached segment for a given status network.
function update($dataObject = false)
Update a cached segment for a given status network
function updateKeys(&$orig)
DB_DataObject doesn’t allow updating keys (even non-primary), so this is a workaround
function delete($useWhere = false)
Delete a site from a multi-site install
static function getFromHostname($servername,
$wildcard)
Returns a site in a multi-site install based on its hostname
static function setupSite($servername,
$pathname,
$wildcard)
Sets up an uninitialized site in a multi-site install.
function redirectTo($destination)
Perform a 301 redirect.
function getServerName()
Return the server name of the current status network on a multi- site install.
function getTags()
Return site meta-info tags as an array
function clearTags()
Delete all the tags for a status network on a multi-site install.
function hasTag($tag)
Check if this site record has a particular meta-info tag attached.