protected function tearDown() { $database_ipc = Database_Ipc::getInstance(); $database_ipc->trim(); $session_logic = Session_Logic::getInstance(); $session_logic->setUsername(""); }
public static function getInstance() { if (empty(self::$instance)) { self::$instance = new Database_Ipc(); } return self::$instance; }
public function alive($alive = false) { $session_logic = Session_Logic::getInstance(); $user = $session_logic->currentUser(); $database_ipc = Database_Ipc::getInstance(); if (func_num_args() == 0) { $alive = $database_ipc->getNotesAlive(); return $alive; } else { $alive = Filter_Bool::int($alive); $database_ipc->storeMessage($user, "", "notesalive", $alive); } }
function set($book, $chapter, $verse) { $set = false; if ($book != $this->getBook()) { $set = true; } if ($chapter != $this->getChapter()) { $set = true; } if ($verse != $this->getVerse()) { $set = true; } if ($set) { $database_ipc = Database_Ipc::getInstance(); $database_config_user = Database_Config_User::getInstance(); $session_logic = Session_Logic::getInstance(); $user = $session_logic->currentUser(); $database_ipc->storeMessage($user, "", "focus", "{$book}.{$chapter}.{$verse}"); $database_config_user->setFocusedBook($book); $database_config_user->setFocusedChapter($chapter); $database_config_user->setFocusedVerse($verse); } }
/* Copyright (©) 2003-2014 Teus Benschop. This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ require_once "../bootstrap/bootstrap.php"; page_access_level(Filter_Roles::TRANSLATOR_LEVEL); // Update the timestamp indicating that the Bible editor is alive. $session_logic = Session_Logic::getInstance(); $user = $session_logic->currentUser(); $database_ipc = Database_Ipc::getInstance(); $database_ipc->storeMessage($user, "", "biblealive", time()); $bible = $_GET['bible']; $book = $_GET['book']; $chapter = $_GET['chapter']; $database_bibles = Database_Bibles::getInstance(); $id = $database_bibles->getChapterId($bible, $book, $chapter); echo $id;
public function testBibleAlive() { $database_ipc = Database_Ipc::getInstance(); $id = 1; $user = "******"; $session_logic = Session_Logic::getInstance(); $session_logic->setUsername($user); $channel = "channel"; $command = "biblealive"; $alive = $database_ipc->getBibleAlive(); $this->assertFalse($alive); $message = "1"; $database_ipc->storeMessage($user, $channel, $command, $message); $alive = $database_ipc->getBibleAlive(); $this->assertEquals($message, $alive); $message = "0"; $database_ipc->storeMessage($user, $channel, $command, $message); $alive = $database_ipc->getBibleAlive(); $this->assertEquals($message, $alive); }