@@ -126,6 +126,9 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | + /** |
|
| 130 | + * @param string $f |
|
| 131 | + */ |
|
| 129 | 132 | function deleteUploadDirectory($f) |
| 130 | 133 | {
|
| 131 | 134 | if ( is_dir( $f ) ){
|
@@ -234,6 +237,7 @@ discard block |
||
| 234 | 237 | |
| 235 | 238 | /** |
| 236 | 239 | * splits a mysql export into separate |
| 240 | + * @param string $sql |
|
| 237 | 241 | */ |
| 238 | 242 | static function splitSql($sql) |
| 239 | 243 | {
|
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function dropDatabase() |
| 28 | 28 | {
|
| 29 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
|
|
| 29 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
|
|
| 30 | 30 | if (PEAR::isError($result)) {
|
| 31 | 31 | throw new Exception($result->getUserInfo()); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
|
| 35 | - $drop = $this->db->exec('DROP TABLE ' . $line['tables_in_' . DB_NAME]);
|
|
| 35 | + $drop = $this->db->exec('DROP TABLE '.$line['tables_in_'.DB_NAME]);
|
|
| 36 | 36 | if (PEAR::IsError($drop)) {
|
| 37 | 37 | throw new Exception($drop->getUserInfo()); |
| 38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | function createDatabaseSchema() |
| 44 | 44 | {
|
| 45 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql'); |
|
| 45 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-structure.sql'); |
|
| 46 | 46 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
| 47 | 47 | |
| 48 | 48 | foreach ($sql_arr as $sql) {
|
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql'); |
|
| 56 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-update.sql'); |
|
| 57 | 57 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
| 58 | 58 | |
| 59 | 59 | foreach ($sql_arr as $sql) {
|
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | function emptyDatabase() |
| 70 | 70 | {
|
| 71 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME);
|
|
| 71 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME);
|
|
| 72 | 72 | if (PEAR::isError($result)) {
|
| 73 | 73 | throw new Exception($result->getUserInfo()); |
| 74 | 74 | } |
| 75 | 75 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
|
| 76 | - $truncate = $this->db->exec('TRUNCATE TABLE ' . $line['Tables_in_'.DB_NAME]);
|
|
| 76 | + $truncate = $this->db->exec('TRUNCATE TABLE '.$line['Tables_in_'.DB_NAME]);
|
|
| 77 | 77 | if (PEAR::IsError($truncate)) {
|
| 78 | 78 | throw new Exception($truncate->getUserInfo()); |
| 79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | function createStartingValues() |
| 86 | 86 | {
|
| 87 | - $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql'); |
|
| 87 | + $sql_values = file_get_contents(dirname(__FILE__).'/database-values.sql'); |
|
| 88 | 88 | $sql_arr = Intraface_Install::splitSql($sql_values); |
| 89 | 89 | |
| 90 | 90 | foreach ($sql_arr as $sql) {
|
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | function deleteUploadDirectory($f) |
| 130 | 130 | {
|
| 131 | - if ( is_dir( $f ) ){
|
|
| 132 | - foreach ( scandir( $f ) as $item ){
|
|
| 133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
| 131 | + if (is_dir($f)) {
|
|
| 132 | + foreach (scandir($f) as $item) {
|
|
| 133 | + if (!strcmp($item, '.') || !strcmp($item, '..')) |
|
| 134 | 134 | continue; |
| 135 | - $this->deleteUploadDirectory( $f . "/" . $item ); |
|
| 135 | + $this->deleteUploadDirectory($f."/".$item); |
|
| 136 | 136 | } |
| 137 | - rmdir( $f ); |
|
| 138 | - } else{
|
|
| 139 | - @unlink( $f ); |
|
| 137 | + rmdir($f); |
|
| 138 | + } else {
|
|
| 139 | + @unlink($f); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $object_method[0] = str_replace('/', '', $object_method[0]);
|
| 216 | 216 | $object_method[0] = str_replace('\\', '', $object_method[0]);
|
| 217 | 217 | |
| 218 | - require_once dirname(__FILE__) . '/Helper/'.$object_method[0].'.php'; |
|
| 218 | + require_once dirname(__FILE__).'/Helper/'.$object_method[0].'.php'; |
|
| 219 | 219 | $object_name = 'Install_Helper_'.$object_method[0]; |
| 220 | 220 | $object = new $object_name($kernel, $this->db); |
| 221 | 221 | $object->$object_method[1](); |
@@ -130,8 +130,9 @@ |
||
| 130 | 130 | {
|
| 131 | 131 | if ( is_dir( $f ) ){
|
| 132 | 132 | foreach ( scandir( $f ) as $item ){
|
| 133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
| 134 | - continue; |
|
| 133 | + if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) { |
|
| 134 | + continue; |
|
| 135 | + } |
|
| 135 | 136 | $this->deleteUploadDirectory( $f . "/" . $item ); |
| 136 | 137 | } |
| 137 | 138 | rmdir( $f ); |
@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | $this->db->setOption('portability', MDB2_PORTABILITY_NONE); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $SQL |
|
| 31 | + */ |
|
| 29 | 32 | function query($SQL) |
| 30 | 33 | { |
| 31 | 34 | $this->result = $this->db->query($SQL); |
@@ -101,6 +104,9 @@ discard block |
||
| 101 | 104 | return mysql_escape_string($value); |
| 102 | 105 | } |
| 103 | 106 | |
| 107 | + /** |
|
| 108 | + * @param string $type |
|
| 109 | + */ |
|
| 104 | 110 | function quote($value, $type) |
| 105 | 111 | { |
| 106 | 112 | return $this->db->quote($value, $type); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param string $belong_to What the address belongs to, corresponding to the ones in Address::getBelongToTypes() |
| 84 | 84 | * @param integer $belong_to_id From belong_to. NB not id on the address |
| 85 | 85 | * |
| 86 | - * @return object Address |
|
| 86 | + * @return Intraface_Address Address |
|
| 87 | 87 | */ |
| 88 | 88 | function factory($belong_to, $belong_to_id) |
| 89 | 89 | { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * Returns possible belong to types |
| 96 | 96 | * |
| 97 | - * @return array |
|
| 97 | + * @return string[] |
|
| 98 | 98 | */ |
| 99 | 99 | public static function getBelongToTypes() |
| 100 | 100 | { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @param array $array_var et array med felter med adressen. Se felterne i init funktionen: $this->fields |
| 222 | 222 | * |
| 223 | - * @return bolean true or false |
|
| 223 | + * @return boolean true or false |
|
| 224 | 224 | */ |
| 225 | 225 | function save($array_var) |
| 226 | 226 | { |
@@ -99,11 +99,11 @@ |
||
| 99 | 99 | public static function getBelongToTypes() |
| 100 | 100 | { |
| 101 | 101 | return array(1 => 'intranet', |
| 102 | - 2 => 'user', |
|
| 103 | - 3 => 'contact', |
|
| 104 | - 4 => 'contact_delivery', |
|
| 105 | - 5 => 'contact_invoice', |
|
| 106 | - 6 => 'contactperson'); |
|
| 102 | + 2 => 'user', |
|
| 103 | + 3 => 'contact', |
|
| 104 | + 4 => 'contact_delivery', |
|
| 105 | + 5 => 'contact_invoice', |
|
| 106 | + 6 => 'contactperson'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @param string $belong_to What the address belongs to, corresponding to the ones in Address::getBelongToTypes() |
| 15 | 15 | * @param integer $belong_to_id From belong_to. NB not id on the address |
| 16 | 16 | * |
| 17 | - * @return object Address |
|
| 17 | + * @return Intraface_Address Address |
|
| 18 | 18 | */ |
| 19 | 19 | public function findByBelongToAndId($belong_to, $belong_to_id) |
| 20 | 20 | { |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Public: henter beløbet efter konvertering |
| 52 | - * @return beløb |
|
| 52 | + * @return double |
|
| 53 | 53 | */ |
| 54 | 54 | function get() |
| 55 | 55 | {
|
@@ -23,6 +23,9 @@ discard block |
||
| 23 | 23 | $this->session_id = $session_id; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param Intraface_Auth_User $adapter |
|
| 28 | + */ |
|
| 26 | 29 | public function authenticate($adapter) |
| 27 | 30 | {
|
| 28 | 31 | if (is_callable(array($adapter, 'getIdentification'))) {
|
@@ -43,7 +46,7 @@ discard block |
||
| 43 | 46 | /** |
| 44 | 47 | * hasIdentity() |
| 45 | 48 | * |
| 46 | - * @return mixed user id or false |
|
| 49 | + * @return boolean user id or false |
|
| 47 | 50 | */ |
| 48 | 51 | public function hasIdentity() |
| 49 | 52 | {
|
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if ($object = $adapter->auth()) {
|
| 35 | - $this->notifyObservers('login', $identification . ' logged in');
|
|
| 35 | + $this->notifyObservers('login', $identification.' logged in');
|
|
| 36 | 36 | } else {
|
| 37 | - $this->notifyObservers('login', $identification . ' could not login');
|
|
| 37 | + $this->notifyObservers('login', $identification.' could not login');
|
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return $object; |
@@ -58,6 +58,7 @@ |
||
| 58 | 58 | /** |
| 59 | 59 | * This function is dynamically redefinable. |
| 60 | 60 | * @see $GLOBALS['_global_function_callback_email'] |
| 61 | + * @param string $args |
|
| 61 | 62 | */ |
| 62 | 63 | function autoop($args) {
|
| 63 | 64 | $args = func_get_args(); |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | return $data; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if (is_array($data)){
|
|
| 140 | - return array_map('safeToDb',$data);
|
|
| 139 | + if (is_array($data)) {
|
|
| 140 | + return array_map('safeToDb', $data);
|
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if (get_magic_quotes_gpc()) {
|
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | function intrafaceBackendErrorhandler($errno, $errstr, $errfile, $errline, $errcontext) |
| 195 | 195 | {
|
| 196 | 196 | if (!defined('ERROR_LOG')) {
|
| 197 | - define('ERROR_LOG', dirname(__FILE__) . '/../log/error.log');
|
|
| 197 | + define('ERROR_LOG', dirname(__FILE__).'/../log/error.log');
|
|
| 198 | 198 | } |
| 199 | 199 | $errorhandler = new ErrorHandler; |
| 200 | 200 | if (!defined('ERROR_LEVEL_CONTINUE_SCRIPT')) {
|
@@ -36,8 +36,6 @@ discard block |
||
| 36 | 36 | /** |
| 37 | 37 | * Constructor |
| 38 | 38 | * |
| 39 | - * @param integer $intranet_id The id of the intranet |
|
| 40 | - * |
|
| 41 | 39 | * @return void |
| 42 | 40 | */ |
| 43 | 41 | function __construct($id) |
@@ -59,7 +57,7 @@ discard block |
||
| 59 | 57 | /** |
| 60 | 58 | * loads |
| 61 | 59 | * |
| 62 | - * @return void |
|
| 60 | + * @return integer|null |
|
| 63 | 61 | */ |
| 64 | 62 | function load() |
| 65 | 63 | {
|
@@ -103,9 +101,9 @@ discard block |
||
| 103 | 101 | * @todo might be smarter to throw in an actual module object |
| 104 | 102 | * that would make us sure that it is actually valid |
| 105 | 103 | * |
| 106 | - * @param mixed $module The id or name of the module |
|
| 104 | + * @param string $module The id or name of the module |
|
| 107 | 105 | * |
| 108 | - * @return void |
|
| 106 | + * @return boolean |
|
| 109 | 107 | */ |
| 110 | 108 | function hasModuleAccess($module) |
| 111 | 109 | {
|
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | |
| 95 | 95 | public function getAddress() |
| 96 | 96 | {
|
| 97 | - return ($this->address = Intraface_Address::factory('intranet', $this->id));
|
|
| 97 | + return ($this->address = Intraface_Address::factory('intranet', $this->id));
|
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | */ |
| 110 | 110 | function hasModuleAccess($module) |
| 111 | 111 | {
|
| 112 | - $filename = PATH_INCLUDE_MODULE . $module . '/Main' . ucfirst($module) . '.php'; |
|
| 112 | + $filename = PATH_INCLUDE_MODULE.$module.'/Main'.ucfirst($module).'.php'; |
|
| 113 | 113 | if (file_exists($filename)) {
|
| 114 | 114 | require_once $filename; |
| 115 | 115 | $module_class = 'Main'.ucfirst($module); |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | * |
| 168 | 168 | * @param $count (integer) how many characters to return? |
| 169 | 169 | * |
| 170 | - * @return random key (string) only letters |
|
| 170 | + * @return string key (string) only letters |
|
| 171 | 171 | */ |
| 172 | 172 | function randomKey($length = 1) |
| 173 | 173 | { |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | function getModuleHandler() |
| 59 | 59 | { |
| 60 | 60 | if (!empty($this->modulehandler)) { |
| 61 | - return $this->modulehandler; |
|
| 61 | + return $this->modulehandler; |
|
| 62 | 62 | } |
| 63 | - return ($this->modulehandler = new Intraface_ModuleHandler($this->intranet, $this->user)); |
|
| 63 | + return ($this->modulehandler = new Intraface_ModuleHandler($this->intranet, $this->user)); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | function getIntranet() |
| 179 | 179 | { |
| 180 | - return $this->intranet; |
|
| 180 | + return $this->intranet; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | function getSetting() |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | $this->db = MDB2:: singleton(DB_DSN); |
| 43 | 43 | if (PEAR::isError($this->db)) { |
| 44 | - throw new Exception($this->db->getMessage() . $this->db->getUserInfo()); |
|
| 44 | + throw new Exception($this->db->getMessage().$this->db->getUserInfo()); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |