@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | class MailApi { |
29 | 29 | |
30 | - public static function sendPlainMail ($to, string $subject, string $message, array $options = array(), string $from = "", string $reply_to = "") : bool { |
|
30 | + public static function sendPlainMail($to, string $subject, string $message, array $options = array(), string $from = "", string $reply_to = "") : bool { |
|
31 | 31 | if (!Settings::get("send_mails_enabled", true)) { |
32 | 32 | //send mails is not enabled |
33 | 33 | return false; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | return self::getClass()->sendPlainMail($to, $subject, $message, $options, $from, $reply_to); |
37 | 37 | } |
38 | 38 | |
39 | - public static function sendHTMLMail ($to, string $subject, string $message, array $options = array(), string $from = "", string $reply_to = "") : bool { |
|
39 | + public static function sendHTMLMail($to, string $subject, string $message, array $options = array(), string $from = "", string $reply_to = "") : bool { |
|
40 | 40 | if (!Settings::get("send_mails_enabled", true)) { |
41 | 41 | //send mails is not enabled |
42 | 42 | return false; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | return self::getClass()->sendHTMLMail($to, $subject, $message, $options, $from, $reply_to); |
46 | 46 | } |
47 | 47 | |
48 | - protected static function getClass () : MailSender { |
|
48 | + protected static function getClass() : MailSender { |
|
49 | 49 | //get setting |
50 | 50 | $class_name = Settings::get("sendmail_method", "PHPMail"); |
51 | 51 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return $obj; |
59 | 59 | } |
60 | 60 | |
61 | - public static function getSignature () : string { |
|
61 | + public static function getSignature() : string { |
|
62 | 62 | $signature = Settings::get("mail_signature", ""); |
63 | 63 | |
64 | 64 | Events::throwEvent("get_mail_signature", array( |
@@ -26,48 +26,48 @@ |
||
26 | 26 | |
27 | 27 | //http://www.peterkropff.de/site/php/pdo.htm |
28 | 28 | |
29 | - public function connect ($config_path); |
|
29 | + public function connect($config_path); |
|
30 | 30 | |
31 | - public function update ($sql, $params = array()); |
|
31 | + public function update($sql, $params = array()); |
|
32 | 32 | |
33 | - public function execute ($sql, $params = array()); |
|
33 | + public function execute($sql, $params = array()); |
|
34 | 34 | |
35 | - public function quote ($str) : string; |
|
35 | + public function quote($str) : string; |
|
36 | 36 | |
37 | - public function query ($sql) : PDOStatement; |
|
37 | + public function query($sql) : PDOStatement; |
|
38 | 38 | |
39 | - public function listTables () : array; |
|
39 | + public function listTables() : array; |
|
40 | 40 | |
41 | - public function getRow ($sql, $params = array(), bool $allow_information_schema = false); |
|
41 | + public function getRow($sql, $params = array(), bool $allow_information_schema = false); |
|
42 | 42 | |
43 | - public function listRows ($sql, $params = array(), bool $allow_information_schema = false) : array; |
|
43 | + public function listRows($sql, $params = array(), bool $allow_information_schema = false) : array; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * escape string and add quotes, alias method to quote() |
47 | 47 | * |
48 | 48 | * @deprecated since version 0.1.0 alpha |
49 | 49 | */ |
50 | - public function escape (string $str) : string; |
|
50 | + public function escape(string $str) : string; |
|
51 | 51 | |
52 | - public function countQueries () : int; |
|
52 | + public function countQueries() : int; |
|
53 | 53 | |
54 | - public function beginTransaction (); |
|
54 | + public function beginTransaction(); |
|
55 | 55 | |
56 | - public function rollback (); |
|
56 | + public function rollback(); |
|
57 | 57 | |
58 | - public function commit (); |
|
58 | + public function commit(); |
|
59 | 59 | |
60 | - public function prepare ($sql, bool $allow_information_schema = false) : PDOStatement; |
|
60 | + public function prepare($sql, bool $allow_information_schema = false) : PDOStatement; |
|
61 | 61 | |
62 | - public function lastInsertId () : int; |
|
62 | + public function lastInsertId() : int; |
|
63 | 63 | |
64 | - public function listQueryHistory () : array; |
|
64 | + public function listQueryHistory() : array; |
|
65 | 65 | |
66 | - public function getDatabaseName () : string; |
|
66 | + public function getDatabaseName() : string; |
|
67 | 67 | |
68 | - public function getErrorInfo () : array; |
|
68 | + public function getErrorInfo() : array; |
|
69 | 69 | |
70 | - public function close (); |
|
70 | + public function close(); |
|
71 | 71 | |
72 | 72 | } |
73 | 73 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param $lang_token $lang_token contains language & country, e.q. de_DE |
34 | 34 | */ |
35 | - public function init (string $lang_token); |
|
35 | + public function init(string $lang_token); |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * translate a string |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return string translated message |
45 | 45 | */ |
46 | - public function translate (string $key, string $domain = "", $params = null) : string; |
|
46 | + public function translate(string $key, string $domain = "", $params = null) : string; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * translate a string, plural version of translate() |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return string translated message |
59 | 59 | */ |
60 | - public function n_translate (string $key, string $plural_key, int $n, string $domain = "", $params = null) : string; |
|
60 | + public function n_translate(string $key, string $plural_key, int $n, string $domain = "", $params = null) : string; |
|
61 | 61 | |
62 | - public function bindLangPack (string $domain, string $path); |
|
62 | + public function bindLangPack(string $domain, string $path); |
|
63 | 63 | |
64 | - public function setDefaultDomain (string $domain); |
|
64 | + public function setDefaultDomain(string $domain); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | return $text; |
68 | 68 | } |
69 | 69 | |
70 | - public function n_translate (string $key, string $plural_key, int $n, string $domain = "", $params = null) : string { |
|
70 | + public function n_translate(string $key, string $plural_key, int $n, string $domain = "", $params = null) : string { |
|
71 | 71 | $text = ""; |
72 | 72 | |
73 | 73 | if (empty($domain)) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return string translated message |
47 | 47 | */ |
48 | - public static function translate (string $key, string $domain = "", $params = null) : string { |
|
48 | + public static function translate(string $key, string $domain = "", $params = null) : string { |
|
49 | 49 | return self::getBackend()->translate($key, $domain, $params); |
50 | 50 | } |
51 | 51 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return string translated message |
64 | 64 | */ |
65 | - public static function n_translate (string $key, string $plural_key, int $n, string $domain = "", $params = null) : string { |
|
65 | + public static function n_translate(string $key, string $plural_key, int $n, string $domain = "", $params = null) : string { |
|
66 | 66 | return self::getBackend()->n_translate($key, $plural_key, $n, $domain, $params); |
67 | 67 | } |
68 | 68 | |
69 | - public static function translateTitle (string $token) { |
|
69 | + public static function translateTitle(string $token) { |
|
70 | 70 | //translate title |
71 | 71 | if (strpos($token, "lang_") !== FALSE) { |
72 | 72 | $array1 = explode("_", $token); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return Translator_Backend instance of translator backend |
106 | 106 | */ |
107 | - public static function &getBackend () : Translator_Backend { |
|
107 | + public static function &getBackend() : Translator_Backend { |
|
108 | 108 | if (self::$backend == null) { |
109 | 109 | //get translator backend |
110 | 110 | $class_name = Settings::get("translator_class_name", "GetTextBackend"); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $this->assign("USERNAME", User::current()->getUsername()); |
93 | 93 | |
94 | 94 | $style_name = $registry->getSetting("current_style_name"); |
95 | - $this->assign("STYLE_PATH",DomainUtils::getBaseURL() . "/styles/" . $style_name . "/"); |
|
95 | + $this->assign("STYLE_PATH", DomainUtils::getBaseURL() . "/styles/" . $style_name . "/"); |
|
96 | 96 | |
97 | 97 | $end_time = microtime(true); |
98 | 98 | $exec_time = $end_time - $start_time; |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | self::$benchmark[$this->file] = $exec_time; |
102 | 102 | } |
103 | 103 | |
104 | - public function assign ($var, $value) { |
|
104 | + public function assign($var, $value) { |
|
105 | 105 | //$this->vars[$var] = $value; |
106 | 106 | $this->data->assign($var, $value); |
107 | 107 | } |
108 | 108 | |
109 | - public function parse ($name = "main") { |
|
109 | + public function parse($name = "main") { |
|
110 | 110 | throw new Exception("Method DwooTemplate::parse() is not supported from Dwoo template engine."); |
111 | 111 | } |
112 | 112 | |
113 | - public function getCode ($name = "main") { |
|
113 | + public function getCode($name = "main") { |
|
114 | 114 | $start_time = microtime(true); |
115 | 115 | |
116 | 116 | // Output the result |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return $html; |
130 | 130 | } |
131 | 131 | |
132 | - protected static function initCoreIfAbsent () { |
|
132 | + protected static function initCoreIfAbsent() { |
|
133 | 133 | if (self::$core == null) { |
134 | 134 | self::$core = new Dwoo\Core(); |
135 | 135 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - public static function listFileBenchmark () { |
|
176 | + public static function listFileBenchmark() { |
|
177 | 177 | return self::$benchmark; |
178 | 178 | } |
179 | 179 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | class Plugins { |
29 | 29 | |
30 | - public static function listAvailablePluginNames () : array { |
|
30 | + public static function listAvailablePluginNames() : array { |
|
31 | 31 | $names = array(); |
32 | 32 | |
33 | 33 | //use directory iterator |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return $names; |
43 | 43 | } |
44 | 44 | |
45 | - public static function listInstalledPluginNames () : array { |
|
45 | + public static function listInstalledPluginNames() : array { |
|
46 | 46 | if (Cache::contains("plugins", "installed_plugin_names")) { |
47 | 47 | return Cache::get("plugins", "installed_plugin_names"); |
48 | 48 | } else { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | - public static function listInstalledPlugins () : array { |
|
64 | + public static function listInstalledPlugins() : array { |
|
65 | 65 | if (Cache::contains("plugins", "installed_plugins")) { |
66 | 66 | return Cache::get("plugins", "installed_plugins"); |
67 | 67 | } else { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - public static function listUninstalledPlugins () : array { |
|
90 | + public static function listUninstalledPlugins() : array { |
|
91 | 91 | $installed_plugin_names = self::listInstalledPluginNames(); |
92 | 92 | |
93 | 93 | //create new empty list |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return $list; |
126 | 126 | } |
127 | 127 | |
128 | - public static function clearCache () { |
|
128 | + public static function clearCache() { |
|
129 | 129 | Cache::clear("plugins"); |
130 | 130 | } |
131 | 131 |
@@ -27,17 +27,17 @@ |
||
27 | 27 | |
28 | 28 | abstract class PluginInstaller_Plugin { |
29 | 29 | |
30 | - public abstract function install (Plugin $plugin, array $install_json) : bool; |
|
30 | + public abstract function install(Plugin $plugin, array $install_json) : bool; |
|
31 | 31 | |
32 | - public abstract function uninstall (Plugin $plugin, array $install_json) : bool; |
|
32 | + public abstract function uninstall(Plugin $plugin, array $install_json) : bool; |
|
33 | 33 | |
34 | - public abstract function upgrade (Plugin $plugin, array $install_json) : bool; |
|
34 | + public abstract function upgrade(Plugin $plugin, array $install_json) : bool; |
|
35 | 35 | |
36 | - public function getPriority () : int { |
|
36 | + public function getPriority() : int { |
|
37 | 37 | return 10; |
38 | 38 | } |
39 | 39 | |
40 | - public static function cast (PluginInstaller_Plugin $plugin) : PluginInstaller_Plugin { |
|
40 | + public static function cast(PluginInstaller_Plugin $plugin) : PluginInstaller_Plugin { |
|
41 | 41 | return $plugin; |
42 | 42 | } |
43 | 43 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | return $this->addEvents($plugin, $install_json); |
46 | 46 | } |
47 | 47 | |
48 | - protected function addEvents (Plugin $plugin, array $install_json) : bool { |
|
48 | + protected function addEvents(Plugin $plugin, array $install_json) : bool { |
|
49 | 49 | //check, if events are specified |
50 | 50 | if (isset($install_json['events']) && is_array($install_json['events'])) { |
51 | 51 | //create events |