Fixed a static warning (#172)

This commit is contained in:
Tobias Reich 2014-06-25 14:50:49 +02:00
parent 60c1948abd
commit 33446c30e8
5 changed files with 35 additions and 35 deletions

View File

@ -29,7 +29,7 @@ class Album extends Module {
public function add($title = 'Untitled', $public = 0, $visible = 1) { public function add($title = 'Untitled', $public = 0, $visible = 1) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -55,7 +55,7 @@ class Album extends Module {
public function get() { public function get() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->settings, $this->albumIDs)); self::dependencies(isset($this->database, $this->settings, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -135,7 +135,7 @@ class Album extends Module {
public function getAll($public) { public function getAll($public) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->settings, $public)); self::dependencies(isset($this->database, $this->settings, $public));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -190,7 +190,7 @@ class Album extends Module {
private function getSmartInfo() { private function getSmartInfo() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->settings)); self::dependencies(isset($this->database, $this->settings));
# Unsorted # Unsorted
$unsorted = $this->database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $this->settings['sorting']); $unsorted = $this->database->query("SELECT thumbUrl FROM lychee_photos WHERE album = 0 " . $this->settings['sorting']);
@ -232,7 +232,7 @@ class Album extends Module {
public function getArchive() { public function getArchive() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -346,7 +346,7 @@ class Album extends Module {
public function setTitle($title = 'Untitled') { public function setTitle($title = 'Untitled') {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -371,7 +371,7 @@ class Album extends Module {
public function setDescription($description = '') { public function setDescription($description = '') {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -397,7 +397,7 @@ class Album extends Module {
public function getPublic() { public function getPublic() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -419,7 +419,7 @@ class Album extends Module {
public function setPublic($password) { public function setPublic($password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -463,7 +463,7 @@ class Album extends Module {
public function setPassword($password) { public function setPassword($password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -497,7 +497,7 @@ class Album extends Module {
public function checkPassword($password) { public function checkPassword($password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -518,7 +518,7 @@ class Album extends Module {
public function delete($albumIDs) { public function delete($albumIDs) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->albumIDs)); self::dependencies(isset($this->database, $this->albumIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());

View File

@ -26,7 +26,7 @@ class Module {
} }
public function dependencies($available = false) { public static function dependencies($available = false) {
if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.'); if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');

View File

@ -41,7 +41,7 @@ class Photo extends Module {
public function add($files, $albumID, $description = '', $tags = '') { public function add($files, $albumID, $description = '', $tags = '') {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
# Check permissions # Check permissions
if (hasPermissions(LYCHEE_UPLOADS_BIG)===false||hasPermissions(LYCHEE_UPLOADS_THUMB)===false) { if (hasPermissions(LYCHEE_UPLOADS_BIG)===false||hasPermissions(LYCHEE_UPLOADS_THUMB)===false) {
@ -171,7 +171,7 @@ class Photo extends Module {
private function createThumb($url, $filename, $width = 200, $height = 200) { private function createThumb($url, $filename, $width = 200, $height = 200) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->settings, $url, $filename)); self::dependencies(isset($this->database, $this->settings, $url, $filename));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -255,7 +255,7 @@ class Photo extends Module {
private function adjustFile($path, $info) { private function adjustFile($path, $info) {
# Check dependencies # Check dependencies
$this->dependencies(isset($path, $info)); self::dependencies(isset($path, $info));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -369,7 +369,7 @@ class Photo extends Module {
public function get($albumID) { public function get($albumID) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -410,7 +410,7 @@ class Photo extends Module {
private function getInfo($url) { private function getInfo($url) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $url)); self::dependencies(isset($this->database, $url));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -504,7 +504,7 @@ class Photo extends Module {
public function getArchive() { public function getArchive() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -541,7 +541,7 @@ class Photo extends Module {
public function setTitle($title) { public function setTitle($title) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -566,7 +566,7 @@ class Photo extends Module {
public function setDescription($description) { public function setDescription($description) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -592,7 +592,7 @@ class Photo extends Module {
public function setStar() { public function setStar() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -629,7 +629,7 @@ class Photo extends Module {
public function getPublic($password) { public function getPublic($password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -657,7 +657,7 @@ class Photo extends Module {
public function setPublic() { public function setPublic() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -686,7 +686,7 @@ class Photo extends Module {
function setAlbum($albumID) { function setAlbum($albumID) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -708,7 +708,7 @@ class Photo extends Module {
public function setTags($tags) { public function setTags($tags) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -738,7 +738,7 @@ class Photo extends Module {
public function delete() { public function delete() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $this->photoIDs)); self::dependencies(isset($this->database, $this->photoIDs));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());

View File

@ -25,7 +25,7 @@ class Session extends Module {
public function init($database, $dbName, $public, $version) { public function init($database, $dbName, $public, $version) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->settings, $public, $version)); self::dependencies(isset($this->settings, $public, $version));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());
@ -75,7 +75,7 @@ class Session extends Module {
public function login($username, $password) { public function login($username, $password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->settings, $username, $password)); self::dependencies(isset($this->settings, $username, $password));
# Call plugins # Call plugins
$this->plugins(__METHOD__, 0, func_get_args()); $this->plugins(__METHOD__, 0, func_get_args());

View File

@ -24,7 +24,7 @@ class Settings extends Module {
public function get() { public function get() {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
# Execute query # Execute query
$settings = $this->database->query('SELECT * FROM lychee_settings;'); $settings = $this->database->query('SELECT * FROM lychee_settings;');
@ -42,7 +42,7 @@ class Settings extends Module {
public function setLogin($oldPassword = '', $username, $password) { public function setLogin($oldPassword = '', $username, $password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
# Load settings # Load settings
$settings = $this->get(); $settings = $this->get();
@ -66,7 +66,7 @@ class Settings extends Module {
private function setUsername($username) { private function setUsername($username) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
# Parse # Parse
$username = htmlentities($username); $username = htmlentities($username);
@ -89,7 +89,7 @@ class Settings extends Module {
private function setPassword($password) { private function setPassword($password) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database)); self::dependencies(isset($this->database));
$password = get_hashed_password($password); $password = get_hashed_password($password);
@ -107,7 +107,7 @@ class Settings extends Module {
public function setDropboxKey($key) { public function setDropboxKey($key) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $key)); self::dependencies(isset($this->database, $key));
if (strlen($key)<1||strlen($key)>50) { if (strlen($key)<1||strlen($key)>50) {
Log::notice($this->database, __METHOD__, __LINE__, 'Dropbox key is either too short or too long'); Log::notice($this->database, __METHOD__, __LINE__, 'Dropbox key is either too short or too long');
@ -128,7 +128,7 @@ class Settings extends Module {
public function setSorting($type, $order) { public function setSorting($type, $order) {
# Check dependencies # Check dependencies
$this->dependencies(isset($this->database, $type, $order)); self::dependencies(isset($this->database, $type, $order));
$sorting = 'ORDER BY '; $sorting = 'ORDER BY ';