Browse Source

Fixed a static warning (#172)

Tobias Reich 10 years ago
parent
commit
33446c30e8
5 changed files with 35 additions and 35 deletions
  1. 12 12
      php/modules/Album.php
  2. 1 1
      php/modules/Module.php
  3. 14 14
      php/modules/Photo.php
  4. 2 2
      php/modules/Session.php
  5. 6 6
      php/modules/Settings.php

+ 12 - 12
php/modules/Album.php

@@ -29,7 +29,7 @@ class Album extends Module {
 	public function add($title = 'Untitled', $public = 0, $visible = 1) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database));
+		self::dependencies(isset($this->database));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -55,7 +55,7 @@ class Album extends Module {
 	public function get() {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->settings, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->settings, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -135,7 +135,7 @@ class Album extends Module {
 	public function getAll($public) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->settings, $public));
+		self::dependencies(isset($this->database, $this->settings, $public));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -190,7 +190,7 @@ class Album extends Module {
 	private function getSmartInfo() {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->settings));
+		self::dependencies(isset($this->database, $this->settings));
 
 		# Unsorted
 		$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() {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -346,7 +346,7 @@ class Album extends Module {
 	public function setTitle($title = 'Untitled') {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -371,7 +371,7 @@ class Album extends Module {
 	public function setDescription($description = '') {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -397,7 +397,7 @@ class Album extends Module {
 	public function getPublic() {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -419,7 +419,7 @@ class Album extends Module {
 	public function setPublic($password) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -463,7 +463,7 @@ class Album extends Module {
 	public function setPassword($password) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -497,7 +497,7 @@ class Album extends Module {
 	public function checkPassword($password) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());
@@ -518,7 +518,7 @@ class Album extends Module {
 	public function delete($albumIDs) {
 
 		# Check dependencies
-		$this->dependencies(isset($this->database, $this->albumIDs));
+		self::dependencies(isset($this->database, $this->albumIDs));
 
 		# Call plugins
 		$this->plugins(__METHOD__, 0, func_get_args());

+ 1 - 1
php/modules/Module.php

@@ -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.');
 

+ 14 - 14
php/modules/Photo.php

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

+ 2 - 2
php/modules/Session.php

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

+ 6 - 6
php/modules/Settings.php

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