Procházet zdrojové kódy

#53 - system classes cleanup

Alex Trofimov před 12 roky
rodič
revize
70a6287015
76 změnil soubory, kde provedl 712 přidání a 672 odebrání
  1. 4 1
      inc/classes/BxDol.php
  2. 1 1
      inc/classes/BxDolAclQuery.php
  3. 134 110
      inc/classes/BxDolDb.php
  4. 4 4
      inc/classes/BxDolFile.php
  5. 17 21
      inc/classes/BxDolForm.php
  6. 9 7
      inc/classes/BxDolFormNested.php
  7. 17 14
      inc/classes/BxDolFtp.php
  8. 1 3
      inc/classes/BxDolGridConnections.php
  9. 17 15
      inc/classes/BxDolGzip.php
  10. 10 10
      inc/classes/BxDolImageResize.php
  11. 2 2
      inc/classes/BxDolImageTranscoder.php
  12. 9 7
      inc/classes/BxDolImageTranscoderQuery.php
  13. 1 1
      inc/classes/BxDolLanguages.php
  14. 1 1
      inc/classes/BxDolLanguagesQuery.php
  15. 6 9
      inc/classes/BxDolModule.php
  16. 19 17
      inc/classes/BxDolModuleConfig.php
  17. 2 2
      inc/classes/BxDolModuleQuery.php
  18. 11 9
      inc/classes/BxDolModuleTemplate.php
  19. 7 11
      inc/classes/BxDolObject.php
  20. 9 7
      inc/classes/BxDolPaginate.php
  21. 6 6
      inc/classes/BxDolParams.php
  22. 7 7
      inc/classes/BxDolPermalinks.php
  23. 9 3
      inc/classes/BxDolPrivacy.php
  24. 6 1
      inc/classes/BxDolPrivacyQuery.php
  25. 2 2
      inc/classes/BxDolProfile.php
  26. 11 10
      inc/classes/BxDolRequest.php
  27. 8 13
      inc/classes/BxDolRssFactory.php
  28. 8 2
      inc/classes/BxDolSearch.php
  29. 35 10
      inc/classes/BxDolService.php
  30. 6 6
      inc/classes/BxDolSession.php
  31. 11 8
      inc/classes/BxDolSessionQuery.php
  32. 8 8
      inc/classes/BxDolStorage.php
  33. 10 7
      inc/classes/BxDolStorageLocal.php
  34. 10 7
      inc/classes/BxDolStorageQuery.php
  35. 10 7
      inc/classes/BxDolStorageS3.php
  36. 30 31
      inc/classes/BxDolTemplate.php
  37. 6 0
      inc/classes/BxDolUploader.php
  38. 7 1
      inc/classes/BxDolView.php
  39. 9 6
      inc/classes/BxDolViewQuery.php
  40. 1 1
      inc/classes/BxDolVoteQuery.php
  41. 2 2
      inc/classes/BxDolXmlParser.php
  42. 3 3
      modules/boonex/developer/classes/BxDevConfig.php
  43. 1 1
      modules/boonex/developer/classes/BxDevDb.php
  44. 3 3
      modules/boonex/developer/classes/BxDevModule.php
  45. 3 3
      modules/boonex/developer/classes/BxDevTemplate.php
  46. 1 1
      modules/boonex/timeline/classes/BxTimelineCmts.php
  47. 1 1
      modules/boonex/timeline/classes/BxTimelineConfig.php
  48. 1 1
      modules/boonex/timeline/classes/BxTimelineModule.php
  49. 1 1
      modules/boonex/timeline/classes/BxTimelineTemplate.php
  50. 4 3
      modules/boonex/timeline/classes/BxTimelineUploaderSimple.php
  51. 3 3
      modules/boonex/uni/data/template/studio/scripts/BxTemplStudioFormView.php
  52. 9 7
      modules/boonex/uni/data/template/system/scripts/BxTemplFormView.php
  53. 7 5
      modules/boonex/uni/data/template/system/scripts/BxTemplName.php
  54. 12 9
      modules/boonex/uni/data/template/system/scripts/BxTemplPaginate.php
  55. 0 16
      modules/boonex/uni/data/template/system/scripts/BxTemplSearchResultText.php
  56. 6 5
      modules/boonex/uni/data/template/system/scripts/BxTemplView.php
  57. 4 4
      splash.php
  58. 1 1
      studio/classes/BxDolStudioBuilderPageQuery.php
  59. 3 3
      studio/classes/BxDolStudioDesignerQuery.php
  60. 3 3
      studio/classes/BxDolStudioDesignsQuery.php
  61. 2 2
      studio/classes/BxDolStudioForm.php
  62. 3 3
      studio/classes/BxDolStudioModulesQuery.php
  63. 3 3
      studio/classes/BxDolStudioPageQuery.php
  64. 3 3
      studio/classes/BxDolStudioSettingsQuery.php
  65. 3 3
      studio/classes/BxDolStudioStoreQuery.php
  66. 2 2
      studio/classes/BxDolStudioWidgetsQuery.php
  67. 3 3
      studio/template/scripts/BxBaseStudioFormView.php
  68. 21 35
      template/scripts/BxBaseFormView.php
  69. 12 9
      template/scripts/BxBasePaginate.php
  70. 1 1
      template/scripts/BxBaseUploaderHTML5.php
  71. 1 1
      template/scripts/BxBaseUploaderSimple.php
  72. 6 5
      template/scripts/BxBaseView.php
  73. 9 23
      upgrade/classes/BxDolUpgradeController.php
  74. 74 82
      upgrade/classes/BxDolUpgradeDb.php
  75. 10 23
      upgrade/classes/BxDolUpgradeUtil.php
  76. 10 11
      upgrade/index.php

+ 4 - 1
inc/classes/BxDol.php

@@ -7,12 +7,15 @@
  * @{
  */
 
-
 /** 
  * @page objects Objects
  * Classes which represents high level programming constructions to generate ready functionality, like Comments, Votings, Forms. 
  */
 
+/**
+ * Classes instances are stored here
+ */
+$GLOBALS['bxDolClasses'] = array();
 
 /**
  * Base class for all Dolphin classes

+ 1 - 1
inc/classes/BxDolAclQuery.php

@@ -18,7 +18,7 @@ class BxDolAclQuery extends BxDolDb implements iBxDolSingleton {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDolDb();
+        parent::__construct();
     }
 
     /**

+ 134 - 110
inc/classes/BxDolDb.php

@@ -7,57 +7,58 @@
  * @{
  */
 
-class BxDolDb extends BxDol implements iBxDolSingleton {
+class BxDolDb extends BxDol implements iBxDolSingleton 
+{
+    protected $_bErrorChecking = true;
+    protected $_sErrorMessage;
+    protected $_sHost, $_sPort, $_sSocket, $_sDbname, $_sUser, $_sPassword;
+    protected $_rLink, $_rCurrentRes, $_iCurrentResType;
 
-    var $error_checking = true;
-    var $error_message;
-    var $host, $port, $socket, $dbname, $user, $password, $link;
-    var $current_res, $current_arr_type;
-
-    var $oDbCacheObject = null;
+    protected $_oDbCacheObject = null;
 
     /**
      * set database parameters and connect to it
      */
-    protected function BxDolDb($aDbConf = false) {
-
+    protected function __construct($aDbConf = false) 
+    {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
 
         if (false === $aDbConf) {
-            $this->host = BX_DATABASE_HOST;
-            $this->port = BX_DATABASE_PORT;
-            $this->socket = BX_DATABASE_SOCK;
-            $this->dbname = BX_DATABASE_NAME;
-            $this->user = BX_DATABASE_USER;
-            $this->password = BX_DATABASE_PASS;
+            $this->_sHost = BX_DATABASE_HOST;
+            $this->_sPort = BX_DATABASE_PORT;
+            $this->_sSocket = BX_DATABASE_SOCK;
+            $this->_sDbname = BX_DATABASE_NAME;
+            $this->_sUser = BX_DATABASE_USER;
+            $this->_sPassword = BX_DATABASE_PASS;
         } else {
-            $this->host = $aDbConf['host'];
-            $this->port = $aDbConf['port'];
-            $this->socket = $aDbConf['sock'];
-            $this->dbname = $aDbConf['name'];
-            $this->user = $aDbConf['user'];
-            $this->password = $aDbConf['pwd'];
-            $this->error_checking = isset($aDbConf['error_checking']) ? $aDbConf['error_checking'] : true;
+            $this->_sHost = $aDbConf['host'];
+            $this->_sPort = $aDbConf['port'];
+            $this->_sSocket = $aDbConf['sock'];
+            $this->_sDbname = $aDbConf['name'];
+            $this->_sUser = $aDbConf['user'];
+            $this->_sPassword = $aDbConf['pwd'];
+            $this->_bErrorChecking = isset($aDbConf['error_checking']) ? $aDbConf['error_checking'] : true;
         }
 
-        $this->current_arr_type = MYSQL_ASSOC;
+        $this->_iCurrentResType = MYSQL_ASSOC;
 
         // connect to db automatically
-        if (empty($GLOBALS['bx_db_link'])) {
+        if (empty($GLOBALS['bx_db__rLink'])) {
             $this->connect();
             $GLOBALS['gl_db_cache'] = array();
         } else {
-            $this->link = $GLOBALS['bx_db_link'];
+            $this->_rLink = $GLOBALS['bx_db__rLink'];
         }
     }
 
     /**
      * Prevent cloning the instance
      */
-    public function __clone() {
+    public function __clone() 
+    {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
     }
@@ -85,7 +86,8 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
     /**
      * Get singleton instance of the class
      */
-    public static function getInstance($aDbConf = false, &$sError = null) {
+    public static function getInstance($aDbConf = false, &$sError = null) 
+    {
         if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
             $o = new BxDolDb($aDbConf);
             $sErrorMessage = $o->connect();
@@ -106,28 +108,28 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
      */
     function connect()
     {
-        $full_host = $this->host;
-        $full_host .= $this->port ? ':'.$this->port : '';
-        $full_host .= $this->socket ? ':'.$this->socket : '';
+        $full_host = $this->_sHost;
+        $full_host .= $this->_sPort ? ':'.$this->_sPort : '';
+        $full_host .= $this->_sSocket ? ':'.$this->_sSocket : '';
 
-        $this->link = @mysql_pconnect($full_host, $this->user, $this->password);
-        if (!$this->link)
+        $this->_rLink = @mysql_pconnect($full_host, $this->_sUser, $this->_sPassword);
+        if (!$this->_rLink)
             return 'Database connect failed';
 
         if (!$this->select_db())
             return 'Database select failed';
 
-        mysql_query("SET NAMES 'utf8'", $this->link);
-        mysql_query("SET sql_mode = ''", $this->link);
+        mysql_query("SET NAMES 'utf8'", $this->_rLink);
+        mysql_query("SET sql_mode = ''", $this->_rLink);
 
-        $GLOBALS['bx_db_link'] = $this->link;
+        $GLOBALS['bx_db__rLink'] = $this->_rLink;
 
         return '';
     }
 
     function select_db()
     {
-        return @mysql_select_db($this->dbname, $this->link);
+        return @mysql_select_db($this->_sDbname, $this->_rLink);
     }
 
     /**
@@ -135,7 +137,7 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
      */
     function close()
     {
-        mysql_close($this->link);
+        mysql_close($this->_rLink);
     }
 
     /**
@@ -143,7 +145,7 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
      */
     function getServerInfo()
     {
-        return mysql_get_server_info($this->link);
+        return mysql_get_server_info($this->_rLink);
     }
 
     /**
@@ -172,10 +174,12 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
         }
         return $arr_res;
     }
+
     /**
      * execute sql query and return a column as result
      */
-    function getColumn($sQuery) {
+    function getColumn($sQuery) 
+    {
         if(!$sQuery)
             return array();
 
@@ -216,13 +220,13 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
         if(!$query)
             return array();
         if($arr_type != MYSQL_ASSOC && $arr_type != MYSQL_NUM)
-            $this->current_arr_type = MYSQL_ASSOC;
+            $this->_iCurrentResType = MYSQL_ASSOC;
         else
-            $this->current_arr_type = $arr_type;
-        $this->current_res = $this->res ($query);
+            $this->_iCurrentResType = $arr_type;
+        $this->_rCurrentRes = $this->res ($query);
         $arr_res = array();
-        if($this->current_res && mysql_num_rows($this->current_res))
-            $arr_res = mysql_fetch_array($this->current_res, $this->current_arr_type);
+        if($this->_rCurrentRes && mysql_num_rows($this->_rCurrentRes))
+            $arr_res = mysql_fetch_array($this->_rCurrentRes, $this->_iCurrentResType);
         return $arr_res;
     }
 
@@ -231,13 +235,13 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
      */
     function getNextRow()
     {
-        $arr_res = mysql_fetch_array($this->current_res, $this->current_arr_type);
+        $arr_res = mysql_fetch_array($this->_rCurrentRes, $this->_iCurrentResType);
         if($arr_res)
             return $arr_res;
         else
         {
-            mysql_free_result($this->current_res);
-            $this->current_arr_type = MYSQL_ASSOC;
+            mysql_free_result($this->_rCurrentRes);
+            $this->_iCurrentResType = MYSQL_ASSOC;
             return array();
         }
     }
@@ -249,8 +253,8 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
     {
         if ($res)
             return (int)@mysql_num_rows($res);
-        elseif (!$this->current_res)
-            return (int)@mysql_num_rows($this->current_res);
+        elseif (!$this->_rCurrentRes)
+            return (int)@mysql_num_rows($this->_rCurrentRes);
         else
             return 0;
     }
@@ -260,7 +264,7 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
      */
     function getAffectedRows()
     {
-        return mysql_affected_rows($this->link);
+        return mysql_affected_rows($this->_rLink);
     }
 
     /**
@@ -270,38 +274,38 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
     {
         $res = $this->res($query);
         if ($res)
-            return mysql_affected_rows($this->link);
+            return mysql_affected_rows($this->_rLink);
         return false;
     }
 
     /**
      * execute any query
      */
-    function res($query, $error_checking = true)
+    function res($query, $bErrorChecking = true)
     {
         if(!$query)
             return false;
 
         if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginQuery($query);
 
-        $res = @mysql_query($query, $this->link);
+        $res = @mysql_query($query, $this->_rLink);
 
         if (false === $res)
-            $this->error_message = @mysql_error($this->link); // we need to remeber last error message since mysql_ping will reset it on the next line !
+            $this->_sErrorMessage = @mysql_error($this->_rLink); // we need to remeber last error message since mysql_ping will reset it on the next line !
         else
-            $this->error_message = '';
+            $this->_sErrorMessage = '';
 
-        if (!$res && !@mysql_ping($this->link)) { // if mysql connection is lost - reconnect and try again
-            @mysql_close($this->link);
+        if (!$res && !@mysql_ping($this->_rLink)) { // if mysql connection is lost - reconnect and try again
+            @mysql_close($this->_rLink);
             $sErrorMessage = $this->connect();
             if ($sErrorMessage)
                 $this->error($sErrorMessage, true);
-            $res = mysql_query($query, $this->link);
+            $res = mysql_query($query, $this->_rLink);
         }
 
         if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endQuery($res);
 
-        if (!$res && $error_checking)
+        if (!$res && $bErrorChecking)
             $this->error('Database query error', false, $query);
         return $res;
     }
@@ -391,50 +395,55 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
 
     function lastId()
     {
-        return mysql_insert_id($this->link);
+        return mysql_insert_id($this->_rLink);
     }
 
     function getErrorMessage () 
     {
-        $s = mysql_error($this->link);
+        $s = mysql_error($this->_rLink);
         if ($s)
             return $s;
         else
-            return $this->error_message;
+            return $this->_sErrorMessage;
     }
 
     function error($text, $isForceErrorChecking = false, $sSqlQuery = '')
     {
-        if ($this->error_checking || $isForceErrorChecking)
+        if ($this->_bErrorChecking || $isForceErrorChecking)
             $this->genMySQLErr ($text, $sSqlQuery);
         else
             $this->log($text . ': ' . $this->getErrorMessage());
     }
 
-    function isParam($sName, $bCache = true) {
+    function isParam($sName, $bCache = true) 
+    {
         return $this->oParams->exists($sName, $bCache);
     }
 
-    function addParam($sName, $sValue, $iKateg, $sDesc, $sType) {
+    function addParam($sName, $sValue, $iKateg, $sDesc, $sType) 
+    {
         return $this->oParams->add($sName, $sValue, $iKateg, $sDesc, $sType);
     }
 
-    function getParam($sName, $bCache = true) {
+    function getParam($sName, $bCache = true) 
+    {
         return $this->oParams->get($sName, $bCache);
     }
 
-    function setParam($sName, $sValue ) {
+    function setParam($sName, $sValue ) 
+    {
         $this->oParams->set($sName, $sValue);
         return true;
     }
 
-    function listTables() {
-        return mysql_list_tables($GLOBALS['db']['db'], $this->link);
-        //return mysql_list_tables($GLOBALS['db']['db'], $this->link) or $this->error('Database get encoding error');
+    function listTables() 
+    {
+        return mysql_list_tables($GLOBALS['db']['db'], $this->_rLink);
     }
 
-    function getFields($sTable) {
-        $rFields = mysql_list_fields($this->dbname, $sTable, $this->link);
+    function getFields($sTable) 
+    {
+        $rFields = mysql_list_fields($this->_sDbname, $sTable, $this->_rLink);
         $iFields = mysql_num_fields($rFields);
 
         $aResult = array('original' => array(), 'uppercase' => array());
@@ -447,16 +456,19 @@ class BxDolDb extends BxDol implements iBxDolSingleton {
         return $aResult;
     }
 
-    function isFieldExists($sTable, $sFieldName) {
+    function isFieldExists($sTable, $sFieldName) 
+    {
         $aFields = $this->getFields($sTable);
         return in_array(strtoupper($sFieldName), $aFields['uppercase']);
     }
 
-    function getEncoding() {
-        return  mysql_client_encoding($this->link) or $this->error('Database get encoding error');
+    function getEncoding()  
+    {
+        return  mysql_client_encoding($this->_rLink) or $this->error('Database get encoding error');
     }
 
-    function genMySQLErr( $out, $query ='' ) {
+    function genMySQLErr( $out, $query ='' ) 
+    {
         $sParamsOutput = false;
         $sFoundError = '';
 
@@ -515,7 +527,7 @@ EOJ;
                 if( strlen( $query ) )
                     echo "<div><b>Query:</b><br />{$query}</div>";
 
-                if ($this->link)
+                if ($this->_rLink)
                     echo '<div><b>Mysql error:</b><br />' . $this->getErrorMessage() . '</div>';
 
                 echo '<div style="overflow:scroll;height:300px;border:1px solid gray;">';
@@ -553,7 +565,7 @@ EOJ;
             if( strlen( $query ) )
                 $sMailBody .= "Query:  <pre>" . htmlspecialchars_adv($query) . "</pre> ";
 
-            if ($this->link)
+            if ($this->_rLink)
                 $sMailBody .= "Mysql error: " . $this->getErrorMessage() . "<br /><br /> ";
 
             $sMailBody .= $sFoundError. '<br /> ';
@@ -576,28 +588,31 @@ EOJ;
         exit;
     }
 
-    function setErrorChecking ($b) {
-        $this->error_checking = $b;
+    function setErrorChecking ($b) 
+    {
+        $this->_bErrorChecking = $b;
     }
 
-    function getDbCacheObject () {
-        if ($this->oDbCacheObject != null) {
-            return $this->oDbCacheObject;
+    function getDbCacheObject () 
+    {
+        if ($this->_oDbCacheObject != null) {
+            return $this->_oDbCacheObject;
         } else {
             $sEngine = getParam('sys_db_cache_engine');
-            $this->oDbCacheObject = bx_instance ('BxDolCache'.$sEngine);
-            if (!$this->oDbCacheObject->isAvailable())
-                $this->oDbCacheObject = bx_instance ('BxDolCacheFile');
-            return $this->oDbCacheObject;
+            $this->_oDbCacheObject = bx_instance ('BxDolCache'.$sEngine);
+            if (!$this->_oDbCacheObject->isAvailable())
+                $this->_oDbCacheObject = bx_instance ('BxDolCacheFile');
+            return $this->_oDbCacheObject;
         }
     }
 
-    function genDbCacheKey ($sName) {
+    function genDbCacheKey ($sName) 
+    {
         return 'db_' . $sName . '_' . bx_site_hash() . '.php';
     }
 
-    function fromCache ($sName, $sFunc) {
-
+    function fromCache ($sName, $sFunc) 
+    {
         $aArgs = func_get_args();
         array_shift ($aArgs); // shift $sName
         array_shift ($aArgs); // shift $sFunc
@@ -625,8 +640,8 @@ EOJ;
         return $mixedRet;
     }
 
-    function cleanCache ($sName) {
-
+    function cleanCache ($sName) 
+    {
         if (!getParam('sys_db_cache_enable'))
             return true;
 
@@ -637,7 +652,8 @@ EOJ;
         return $oCache->delData($sKey);
     }
 
-    function & fromMemory ($sName, $sFunc) {
+    function & fromMemory ($sName, $sFunc) 
+    {
         if (array_key_exists($sName, $GLOBALS['gl_db_cache'])) {
             return $GLOBALS['gl_db_cache'][$sName];
 
@@ -651,7 +667,8 @@ EOJ;
         }
     }
 
-    function cleanMemory ($sName) {
+    function cleanMemory ($sName) 
+    {
         if (isset($GLOBALS['gl_db_cache'][$sName])) {
             unset($GLOBALS['gl_db_cache'][$sName]);
             return true;
@@ -667,8 +684,9 @@ EOJ;
      * @param string $s string to escape
      * @return escaped string whcich is ready to pass to SQL query.
      */
-    function escape ($s) {
-        return mysql_real_escape_string($s, $this->link);
+    function escape ($s) 
+    {
+        return mysql_real_escape_string($s, $this->_rLink);
     }
 
     /**
@@ -683,23 +701,25 @@ EOJ;
      * @param $mixed array or parameters or just one paramter
      * @return string which is ready to pass to IN(...) SQL construction
      */
-    function implode_escape ($mixed) {
+    function implode_escape ($mixed) 
+    {
         if (is_array($mixed)) {
             $s = '';
             foreach ($mixed as $v)
-                $s .= (is_numeric($v) ? $v : "'" . mysql_real_escape_string($v, $this->link) . "'") . ',';
+                $s .= (is_numeric($v) ? $v : "'" . mysql_real_escape_string($v, $this->_rLink) . "'") . ',';
             if ($s)
                 return substr($s, 0, -1);
             else
                 return 'NULL';
         }
-        return is_numeric($mixed) ? $mixed : ($mixed ? "'" . mysql_real_escape_string($mixed, $this->link) . "'" : 'NULL');
+        return is_numeric($mixed) ? $mixed : ($mixed ? "'" . mysql_real_escape_string($mixed, $this->_rLink) . "'" : 'NULL');
     }
 
     /**
      * @deprecated
      */
-    function unescape ($mixed) {
+    function unescape ($mixed) 
+    {
         if (is_array($mixed)) {
             foreach ($mixed as $k => $v)
                 $mixed[$k] = $this->getOne("SELECT '$v'");
@@ -724,7 +744,8 @@ EOJ;
      * @param mixed $mixed any number if parameters to replace, number of parameters whould match number of ? symbols in SQL query
      * @return string with SQL query ready for execution
      */
-    function prepare ($sQuery) {
+    function prepare ($sQuery) 
+    {
         $aArgs = func_get_args();
         $sQuery = array_shift($aArgs);
         $iPos = 0;
@@ -743,12 +764,13 @@ EOJ;
         return $sQuery;
     }
 
-    function log ($s) {
+    function log ($s) 
+    {
         return file_put_contents(BX_DIRECTORY_PATH_ROOT . 'tmp/db.err.log', date('Y-m-d H:i:s') . "\t" . $s . "\n", FILE_APPEND);
     }
 
-    function executeSQL($sPath, $aReplace = array (), $isBreakOnError = true) {
-
+    function executeSQL($sPath, $aReplace = array (), $isBreakOnError = true) 
+    {
         if(!file_exists($sPath) || !($rHandler = fopen($sPath, "r")))
             return array(array ('query' => "fopen($sPath, 'r')", 'error' => 'file not found or permission denied'));
 
@@ -793,13 +815,15 @@ EOJ;
     }
 }
 
-function getParam( $param_name, $use_cache = true ) {
-    return BxDolDb::getInstance()->getParam($param_name, $use_cache);
+function getParam($sParamName, $bUseCache = true) 
+{
+    return BxDolDb::getInstance()->getParam($sParamName, $bUseCache);
 }
 
-function setParam( $param_name, $param_val ) {
-    return BxDolDb::getInstance()->setParam($param_name, $param_val);
+function setParam($sParamName, $sParamVal) 
+{
+    return BxDolDb::getInstance()->setParam($sParamName, $sParamVal);
 }
 
-
 /** @} */
+

+ 4 - 4
inc/classes/BxDolFile.php

@@ -8,11 +8,11 @@
  */
 
 class BxDolFile extends BxDol implements iBxDolSingleton {
-    var $_sPathFrom;
-    var $_sPathTo;
+    protected $_sPathFrom;
+    protected $_sPathTo;
 
-    function BxDolFile() {
-        parent::BxDol();
+    function __construct() {
+        parent::__construct();
 
         $this->_sPathFrom = BX_DIRECTORY_PATH_ROOT;
         $this->_sPathTo = BX_DIRECTORY_PATH_ROOT;

+ 17 - 21
inc/classes/BxDolForm.php

@@ -607,7 +607,7 @@ define('BX_DATA_VALUES_ADDITIONAL', 'LKey2'); ///< Use additional values for dat
  *      
  *      class BxSampleFormCheckerHelper extends BxDolFormCheckerHelper {
  *          
- *          var $_sDiv = ',';
+ *          protected $_sDiv = ',';
  *          
  *          // prepare RBG values to save to the DB
  *          function passRgb ($s) {
@@ -716,28 +716,25 @@ define('BX_DATA_VALUES_ADDITIONAL', 'LKey2'); ///< Use additional values for dat
  */
 class BxDolForm extends BxDol implements iBxDolReplaceable
 {
-
     static $TYPES_CHECKBOX = array('checkbox' => 1, 'switcher' => 1);
     static $TYPES_TEXT = array('text' => 1, 'textarea' => 1);
     static $TYPES_FILE = array('file' => 1);
 
     protected $_aMarkers = array ();
 
-    var $oTemplate;
+    protected $oTemplate;
 
-    var $_isValid = true;
-    var $_sCheckerHelper;
-    var $_aSpecificValues;
+    protected $_isValid = true;
+    protected $_sCheckerHelper;
+    protected $_aSpecificValues;
   
-    var $aFormAttrs;
-    var $aTableAttrs;
-    var $aInputs;
-    var $aParams;
-
-    var $id; ///< Form element id    
+    public $aFormAttrs; ///< form html element attributes
+    public $aInputs; ///< form inputs
+    public $aParams; ///< additional form parameters 
+    public $id; ///< Form element id
 
-    function BxDolForm ($aInfo, $oTemplate) {
-        parent::BxDol();
+    function __construct ($aInfo, $oTemplate) {
+        parent::__construct();
 
         if ($oTemplate)
             $this->oTemplate = $oTemplate;
@@ -745,7 +742,6 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
             $this->oTemplate = BxDolTemplate::getInstance();
 
         $this->aFormAttrs    = isset($aInfo['form_attrs'])   ? $aInfo['form_attrs']  : array();
-        $this->aTableAttrs   = isset($aInfo['table_attrs'])  ? $aInfo['table_attrs'] : array();
         $this->aInputs       = isset($aInfo['inputs'])       ? $aInfo['inputs']      : array();
         $this->aParams       = isset($aInfo['params'])       ? $aInfo['params']      : array();
 
@@ -1066,12 +1062,12 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
 }
 
 class BxDolFormChecker {
-    var $_oChecker;
-    var $_sFormMethod;
-    var $_bFormCsrfChecking;
-    var $_aSpecificValues;
+    protected $_oChecker;
+    protected $_sFormMethod;
+    protected $_bFormCsrfChecking;
+    protected $_aSpecificValues;
 
-    function BxDolFormChecker ($sHelper = '') {
+    function __construct ($sHelper = '') {
         $this->_sFormMethod = BX_DOL_FORM_METHOD_GET;
         $this->_bFormCsrfChecking = true;
 
@@ -1490,4 +1486,4 @@ class BxDolFormCheckerHelper {
     }
 }
 
-/** @} */ 
+/** @} */

+ 9 - 7
inc/classes/BxDolFormNested.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxTemplFormView');
 
@@ -22,7 +23,7 @@ class BxDolFormNested extends BxTemplFormView {
      * @param $sSubmitName main form submit_name; field name of submit form input to determine if form is submitted or not.
      * @param $oTemplate optional template object
      */
-    function BxDolFormNested($sName, $aForm, $sSubmitName = false, $oTemplate = false) {
+    function __construct($sName, $aForm, $sSubmitName = false, $oTemplate = false) {
 
         if (!isset($aForm['params']['nested_form_template']) || !$aForm['params']['nested_form_template'])
             $aForm['params']['nested_form_template'] = 'uploader_nested_form_wrapper.html';
@@ -41,7 +42,7 @@ class BxDolFormNested extends BxTemplFormView {
             );
         }
 
-        parent::BxTemplFormView($aForm, $oTemplate);
+        parent::__construct($aForm, $oTemplate);
     }
 
     function genForm() {
@@ -53,3 +54,4 @@ class BxDolFormNested extends BxTemplFormView {
     }
 }
 
+/** @} */

+ 17 - 14
inc/classes/BxDolFtp.php

@@ -1,22 +1,23 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolFile');
 
 class BxDolFtp extends BxDolFile {
-    var $_sHost;
-    var $_sLogin;
-    var $_sPassword;
-    var $_sPathTo;
-    var $_rStream;
-
-    function BxDolFtp($sHost, $sLogin, $sPassword, $sPath = '/') {
-        parent::BxDolFile();
+    protected $_sHost;
+    protected $_sLogin;
+    protected $_sPassword;
+    protected $_sPathTo;
+    protected $_rStream;
+
+    function __construct($sHost, $sLogin, $sPassword, $sPath = '/') {
+        parent::__construct();
         $this->_sHost = $sHost;
         $this->_sLogin = $sLogin;
         $this->_sPassword = $sPassword;
@@ -144,4 +145,6 @@ class BxDolFtp extends BxDolFile {
         ftp_chdir($this->_rStream, $sPwd);
         return true;
     }
-}
+}
+
+/** @} */

+ 1 - 3
inc/classes/BxDolGridConnections.php

@@ -3,9 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
- * @defgroup    Messages Messages
- * @ingroup     DolphinModules
- *
+ * @defgroup    DolphinCore Dolphin Core
  * @{
  */
 

+ 17 - 15
inc/classes/BxDolGzip.php

@@ -1,25 +1,26 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 class BxDolGzip extends BxDol {
-    var $_sType;
-    var $_bGzip;
-    var $_sEncoding;
-    var $_iExpirationOffset;
+    protected $_sType;
+    protected $_bGzip;
+    protected $_sEncoding;
+    protected $_iExpirationOffset;
 
-    var $_sInFile;
+    protected $_sInFile;
 
-    var $_sOutFile;
-    var $_sOutContent;
-    var $_sOutContentZipped;
+    protected $_sOutFile;
+    protected $_sOutContent;
+    protected $_sOutContentZipped;
 
-    function BxDolGzip($sFile) {
-        parent::BxDol();
+    function __construct($sFile) {
+        parent::__construct();
 
         $this->_iExpirationOffset = 3600 * 24 * 10;
 
@@ -129,3 +130,4 @@ class BxDolGzip extends BxDol {
     }
 }
 
+/** @} */

+ 10 - 10
inc/classes/BxDolImageResize.php

@@ -32,21 +32,21 @@ define( 'IMAGE_TYPE_PNG',         3 );
 
 class BxDolImageResize extends BxDol implements iBxDolSingleton {
 
-    var $w = 64, $h = 64; ///< size of destination image
-    var $_isCrop = false;
-    var $_isAutoCrop = false;
-    var $_cropX, $_cropY, $_cropW, $_cropH;
-    var $_iForceOutputType = false; ///< force IMAGE_TYPE_PNG, IMAGE_TYPE_PNG, IMAGE_TYPE_GIF or false to keep the original format // TODO: check if this setting works when ImageMagick is used
-    var $_iJpegQuality = 90; ///< jpeg quality
-    var $_isSquareResize = false; ///< use smart resize, destination image will be exact Width x Height size
-    var $_isUseGD; ///< use GD library or command line ImagMagic utilites
+    protected $w = 64, $h = 64; ///< size of destination image
+    protected $_isCrop = false;
+    protected $_isAutoCrop = false;
+    protected $_cropX, $_cropY, $_cropW, $_cropH;
+    protected $_iForceOutputType = false; ///< force IMAGE_TYPE_PNG, IMAGE_TYPE_PNG, IMAGE_TYPE_GIF or false to keep the original format // TODO: check if this setting works when ImageMagick is used
+    protected $_iJpegQuality = 90; ///< jpeg quality
+    protected $_isSquareResize = false; ///< use smart resize, destination image will be exact Width x Height size
+    protected $_isUseGD; ///< use GD library or command line ImagMagic utilites
 
-    function BxDolImageResize() {
+    function __construct() {
 
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
 
         $this->_isUseGD = getParam('enable_gd') == 'on' && extension_loaded('gd') ? true : false;
     }

+ 2 - 2
inc/classes/BxDolImageTranscoder.php

@@ -91,8 +91,8 @@ class BxDolImageTranscoder extends BxDol implements iBxDolFactoryObject
     /**
      * constructor
      */
-    protected function BxDolImageTranscoder($aObject, $oStorage) {
-        parent::BxDol();
+    protected function __construct($aObject, $oStorage) {
+        parent::__construct();
         $this->_aObject = $aObject;
         $this->_oStorage = $oStorage;        
         $this->_oDb = new BxDolImageTranscoderQuery($aObject);

+ 9 - 7
inc/classes/BxDolImageTranscoderQuery.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
@@ -14,8 +15,8 @@ bx_import('BxDolDb');
 class BxDolImageTranscoderQuery extends BxDolDb {
     protected $_aObject;
 
-    public function BxDolImageTranscoderQuery($aObject) {
-        parent::BxDolDb();
+    public function __construct($aObject) {
+        parent::__construct();
         $this->_aObject = $aObject;
     }
 
@@ -152,3 +153,4 @@ class BxDolImageTranscoderQuery extends BxDolDb {
     }
 }
 
+/** @} */

+ 1 - 1
inc/classes/BxDolLanguages.php

@@ -21,7 +21,7 @@ class BxDolLanguages extends BxDol implements iBxDolSingleton {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
 
         $this->oDb = BxDolLanguagesQuery::getInstance();
     }

+ 1 - 1
inc/classes/BxDolLanguagesQuery.php

@@ -15,7 +15,7 @@ class BxDolLanguagesQuery extends BxDolDb implements iBxDolSingleton {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDolDb();
+        parent::__construct();
     }
 
     /**

+ 6 - 9
inc/classes/BxDolModule.php

@@ -40,19 +40,16 @@
  *
  */
 class BxDolModule extends BxDol {
-    var $_aModule;
-
-    var $_oDb;
-
-    var $_oTemplate;
-
-    var $_oConfig;
+    public $_aModule;
+    public $_oDb;
+    public $_oTemplate;
+    public $_oConfig;
 
     /**
      * constructor
      */
-    function BxDolModule($aModule) {
-        parent::BxDol();
+    function __construct($aModule) {
+        parent::__construct();
 
         $this->_aModule = $aModule;
 

+ 19 - 17
inc/classes/BxDolModuleConfig.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 /**
  * Base class for Config classes in modules engine.
@@ -27,31 +28,31 @@ defined('BX_DOL') or die('hack attempt');
 
 class BxDolModuleConfig extends BxDol {
 
-    var $_iId;
+    protected $_iId;
 
-    var $_sName;
+    protected $_sName;
 
-    var $_sVendor;
+    protected $_sVendor;
 
-    var $_sClassPrefix;
+    protected $_sClassPrefix;
 
-    var $_sDbPrefix;
+    protected $_sDbPrefix;
 
-    var $_sDirectory;
+    protected $_sDirectory;
 
-    var $_sUri;
+    protected $_sUri;
 
-    var $_sHomePath;
+    protected $_sHomePath;
 
-    var $_sClassPath;
+    protected $_sClassPath;
 
-    var $_sHomeUrl;
+    protected $_sHomeUrl;
 
     /**
      * constructor
      */
-    function BxDolModuleConfig($aModule) {
-        parent::BxDol();
+    function __construct($aModule) {
+        parent::__construct();
 
         $this->_iId = empty($aModule['id']) ? 0 : (int)$aModule['id'];
         $this->_sName = isset($aModule['name']) ? $aModule['name'] : '';
@@ -115,3 +116,4 @@ class BxDolModuleConfig extends BxDol {
     }
 }
 
+/** @} */

+ 2 - 2
inc/classes/BxDolModuleQuery.php

@@ -10,11 +10,11 @@
 bx_import('BxDolDb');
 
 class BxDolModuleQuery extends BxDolDb implements iBxDolSingleton {
-    function BxDolModuleQuery() {
+    function __construct() {
     	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDolDb();
+        parent::__construct();
     }
     /**
      * Prevent cloning the instance

+ 11 - 9
inc/classes/BxDolModuleTemplate.php

@@ -1,22 +1,23 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolTemplate');
 
 class BxDolModuleTemplate extends BxDolTemplate {
-    var $_oDb;
-    var $_oConfig;
-    var $_bObStarted = 0;
+    protected $_oDb;
+    protected $_oConfig;
+    protected $_bObStarted = 0;
 
     /*
      * Constructor.
      */
-    function BxDolModuleTemplate(&$oConfig, &$oDb, $sRootPath = BX_DIRECTORY_PATH_ROOT, $sRootUrl = BX_DOL_URL_ROOT) {
+    function __construct(&$oConfig, &$oDb, $sRootPath = BX_DIRECTORY_PATH_ROOT, $sRootUrl = BX_DOL_URL_ROOT) {
         parent::__construct($sRootPath, $sRootUrl);
 
         $this->_oDb = &$oDb;
@@ -93,3 +94,4 @@ class BxDolModuleTemplate extends BxDolTemplate {
     } 
 }
 
+/** @} */

+ 7 - 11
inc/classes/BxDolObject.php

@@ -7,25 +7,19 @@
  * @{
  */
 
-
-/** 
- * @page objects Objects
- * Classes which represents high level programming constructions to generate ready functionality, like Comments, Votings, Forms. 
- */
-
-
 /**
- * Base class for all Dolphin Object classes
+ * Base class for all Dolphin Object classes.
+ * Child classes usually represents high level programming constructions to generate ready 'objects' functionality, like Comments, Votings, Forms. 
  */
 class BxDolObject extends BxDol {
-	protected $_iId = 0;    ///< item id the action to be performed with
+	protected $_iId = 0; ///< item id the action to be performed with
     protected $_sSystem = ''; ///< current system name
     protected $_aSystem = array(); ///< current system array
 
     protected $_oQuery = null;
 
     public function __construct($sSystem, $iId, $iInit = 1) {
-    	parent::BxDol();
+    	parent::__construct();
 
     	$this->_aSystems = $this->getSystems();
         if(!isset($this->_aSystems[$sSystem]))
@@ -84,4 +78,6 @@ class BxDolObject extends BxDol {
     {
         return $this->_aSystem && (int)$this->_aSystem['is_on'] == 1;
     }
-}
+}
+
+/** @} */

+ 9 - 7
inc/classes/BxDolPaginate.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 // TODO: get rid of PerPage changer / count all and maybe other advanced features
 
@@ -86,8 +87,8 @@ abstract class BxDolPaginate extends BxDol {
     /**
      * Constructor
      */
-    public function BxDolPaginate($aParams, $oTemplate = null) {
-        parent::BxDol();
+    public function __construct($aParams, $oTemplate = null) {
+        parent::__construct();
 
         if ($oTemplate)
             $this->_oTemplate = $oTemplate;
@@ -338,3 +339,4 @@ abstract class BxDolPaginate extends BxDol {
 
 }
 
+/** @} */

+ 6 - 6
inc/classes/BxDolParams.php

@@ -10,19 +10,19 @@
 bx_import('BxDolCacheFile');
 
 class BxDolParams extends BxDol {
-    var $_oDb;
-    var $_oCache;
-    var $_sCacheFile;
-    var $_aParams;
+    protected $_oDb;
+    protected $_oCache;
+    protected $_sCacheFile;
+    protected $_aParams;
 
     /**
      * constructor
      */
-    function BxDolParams($oDb) {
+    function __construct($oDb) {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
 
         $this->_oDb = $oDb;
         $this->_oCache = new BxDolCacheFile(); // feel free to change to another cache system if you are sure that it is available

+ 7 - 7
inc/classes/BxDolPermalinks.php

@@ -54,17 +54,17 @@ bx_import('BxDolDb');
  *
  */
 class BxDolPermalinks extends BxDolDb implements iBxDolSingleton {
-    var $sCacheFile;
-    var $aLinksStandard;
-    var $aLinksPermalink;
-    var $aPrefixesStandard;
-    var $aPrefixesPermalink;
+    protected $sCacheFile;
+    protected $aLinksStandard;
+    protected $aLinksPermalink;
+    protected $aPrefixesStandard;
+    protected $aPrefixesPermalink;
 
-    function BxDolPermalinks() {
+    function __construct() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDolDb();
+        parent::__construct();
 
         // TODO: allow to disable cache completely
         $oCache = $this->getDbCacheObject();

+ 9 - 3
inc/classes/BxDolPrivacy.php

@@ -14,11 +14,15 @@ define('BX_DOL_PG_MEONLY', '2');
 define('BX_DOL_PG_ALL', '3');
 define('BX_DOL_PG_MEMBERS', '4');
 define('BX_DOL_PG_FRIENDS', '5');
-//define('BX_DOL_PG_FAVES', '6');
-//define('BX_DOL_PG_CONTACTS', '7');
 
 define('BX_DOL_PG_DEFAULT', BX_DOL_PG_ALL);
 
+/** 
+ * @page objects 
+ * @section privacy Privacy
+ * @ref BxDolPrivacy
+ */
+
 /**
  * Privacy settings for any content.
  *
@@ -67,7 +71,7 @@ class BxDolPrivacy extends BxDol implements iBxDolFactoryObject
      */
     function __construct($aObject)
     {
-        parent::BxDol();
+        parent::__construct();
 
         $this->_aObject = $aObject;
         $this->_sObject = $aObject['object'];
@@ -297,3 +301,5 @@ class BxDolPrivacy extends BxDol implements iBxDolFactoryObject
         return false;
     }
 }
+
+/** @} */

+ 6 - 1
inc/classes/BxDolPrivacyQuery.php

@@ -1,7 +1,10 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
 
 bx_import('BxDolDb');
@@ -179,3 +182,5 @@ class BxDolPrivacyQuery extends BxDolDb
         return $this->fromCache($sCacheKey, 'getRow', $sQuery);
     }
 }
+
+/** @} */

+ 2 - 2
inc/classes/BxDolProfile.php

@@ -15,8 +15,8 @@ define('BX_PROFILE_ACTION_ROBOT', 2); ///< action peformed by some robot based o
 
 class BxDolProfile extends BxDol implements iBxDolProfile {
 
-    var $_iProfileID;
-    var $_oQuery;
+    protected $_iProfileID;
+    protected $_oQuery;
 
     /**
      * Constructor

+ 11 - 10
inc/classes/BxDolRequest.php

@@ -1,19 +1,18 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 define('BX_DOL_REQUEST_ERROR_MODULE_NOT_FOUND', 1);
 define('BX_DOL_REQUEST_ERROR_PAGE_NOT_FOUND', 2);
 
-$GLOBALS['bxDolClasses'] = array();
-
 class BxDolRequest extends BxDol {
-    function BxDolRequest() {
-        parent::BxDol();
+    function __construct() {
+        parent::__construct();
     }
     public static function processAsFile($aModule, &$aRequest) {
         if(empty($aRequest) || ($sFileName = array_shift($aRequest)) == "")
@@ -137,9 +136,11 @@ class BxDolRequest extends BxDol {
         $oTemplate = BxDolTemplate::getInstance();
         $oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
         $oTemplate->setPageHeader(_t("_sys_request_" . $sType . "_not_found_cpt"));
-        $oTemplate->setPageContent('page_main_code', DesignBoxContent('123', MsgBox(_t("_sys_request_" . $sType . "_not_found_cnt", bx_process_output($sParam1), bx_process_output($sParam2))), BX_DB_PADDING_NO_CAPTION));
+        $oTemplate->setPageContent('page_main_code', DesignBoxContent('', MsgBox(_t("_sys_request_" . $sType . "_not_found_cnt", bx_process_output($sParam1), bx_process_output($sParam2))), BX_DB_PADDING_NO_CAPTION));
         $oTemplate->getPageCode();
         exit;
     }
 }
 
+/** @} */
+

+ 8 - 13
inc/classes/BxDolRssFactory.php

@@ -1,20 +1,14 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 class BxDolRssFactory extends BxDol {
 
-    /**
-     * default constructor of factory pattern
-     */
-    function BxDolRssFactory() {
-        parent::BxDol();
-    }
-
     /**
      * @param array $aRssData, fields:
      *    UnitID
@@ -36,7 +30,6 @@ class BxDolRssFactory extends BxDol {
         ));
     }
 
-
     /**
      * Generate rss feed using any custom data fields
      * but you need to describe fields in $aFields array.
@@ -97,3 +90,5 @@ class BxDolRssFactory extends BxDol {
 
 }
 
+/** @} */
+

+ 8 - 2
inc/classes/BxDolSearch.php

@@ -10,6 +10,12 @@
 define('BX_DOL_SEARCH_RESULTS_PER_PAGE_DEFAULT', 10);
 define('BX_DOL_SEARCH_KEYWORD_PAGE', 'site-search-page');
 
+/** 
+ * @page objects 
+ * @section search Search
+ * @ref BxDolSearch
+ */
+
 /**
  * Search class for different content.
  *
@@ -201,10 +207,10 @@ class BxDolSearch extends BxDol
  *  );
  *
  *  // array of fields renamings
- *  var $aPseud - filling in costructor by function _getPseud
+ *  $aPseud - filling in costructor by function _getPseud
  *
  *  // unique identificator from `sys_objects_search` table
- *  var $id;
+ *  $id;
  *
  * @endcode
  *

+ 35 - 10
inc/classes/BxDolService.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolRequest');
 
@@ -31,11 +32,14 @@ bx_import('BxDolRequest');
  */
 class BxDolService extends BxDol 
 {
-    function BxDolService () 
-    {
-        parent::BxDol();
-    }
-
+    /**
+     * Perform serice call
+     * @param $mixed module name or module id
+     * @param $sMethod service method name in format 'method_name', corresponding class metod is serviceMethodName
+     * @param $aParams params to pass to service method
+     * @param $sClass class to search for service method, by default it is main module class 
+     * @return service call result
+     */
     public static function call($mixed, $sMethod, $aParams = array(), $sClass = 'Module') 
     {
         bx_import('BxDolModuleQuery');
@@ -50,6 +54,22 @@ class BxDolService extends BxDol
         return empty($aModule) ? '' : BxDolRequest::processAsService($aModule, $sMethod, $aParams, $sClass);
     }
 
+    /**
+     * Perform serice call by accepting serialized array of service call parameters:
+     * @code
+     *     array (
+     *         'module' => 'system', // module name
+     *         'method' => 'test', // service method name
+     *         'params' => array(), // array of parameters to pass to service method
+     *         'class' => 'Module', // class to search service method in
+     *     )
+     * @endcode
+     *
+     * @param $s serialized array of serice call
+     * @param $aMarkers service method name in format 'method_name', corresponding class metod is serviceMethodName
+     * @param $sReplaceIn params to pass to service method
+     * @return service call result
+     */
     public static function callSerialized($s, $aMarkers = array(), $sReplaceIn = 'params') 
     {
         $a = @unserialize($s);
@@ -62,9 +82,14 @@ class BxDolService extends BxDol
         return self::call($a['module'], $a['method'], isset($a['params']) ? $a['params'] : array(), isset($a['class']) ? $a['class'] : 'Module');
     }
 
+    /**
+     * Check if string is serialized array
+     */
     public static function isSerializedService($s) 
     {
         return preg_match('/^a:[\d+]:\{/', $s);
     }
 }
 
+/** @} */
+

+ 6 - 6
inc/classes/BxDolSession.php

@@ -13,17 +13,17 @@ define('BX_DOL_SESSION_LIFETIME', 3600);
 define('BX_DOL_SESSION_COOKIE', 'memberSession');
 
 class BxDolSession extends BxDol implements iBxDolSingleton {
-    var $oDb;
-    var $sId;
-    var $iUserId;
-    var $aData;
+    protected $oDb;
+    protected $sId;
+    protected $iUserId;
+    protected $aData;
 
-    private function BxDolSession() {
+    private function __construct() {
 
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
 
         $this->oDb = new BxDolSessionQuery();
         $this->sId = '';

+ 11 - 8
inc/classes/BxDolSessionQuery.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
@@ -12,10 +13,10 @@ bx_import('BxDolDb');
  * @see BxDolSession
  */
 class BxDolSessionQuery extends BxDolDb {
-    var $sTable;
+    protected $sTable;
 
-    function BxDolSessionQuery() {
-        parent::BxDolDb();
+    function __construct() {
+        parent::__construct();
 
         $this->sTable = 'sys_sessions';
     }
@@ -47,3 +48,5 @@ class BxDolSessionQuery extends BxDolDb {
     }
 }
 
+/** @} */
+

+ 8 - 8
inc/classes/BxDolStorage.php

@@ -205,8 +205,8 @@ abstract class BxDolStorage extends BxDol implements iBxDolFactoryObject {
     /**
      * constructor
      */
-    protected function BxDolStorage($aObject) {
-        parent::BxDol();
+    protected function __construct($aObject) {
+        parent::__construct();
         $this->_aObject = $aObject;
         $this->_iCacheControl = $aObject['cache_control'];
         $this->_aParams = $aObject['params'] ? unserialize($aObject['params']) : '';
@@ -998,7 +998,7 @@ abstract class BxDolStorage extends BxDol implements iBxDolFactoryObject {
  */
 class BxDolStorageHelperXhr {
 
-    var $sName;
+    protected $sName;
 
     function BxDolStorageHelperXhr ($aParams) {
         $this->sName = $aParams['name'];
@@ -1043,7 +1043,7 @@ class BxDolStorageHelperXhr {
  */
 class BxDolStorageHelperForm {  
 
-    var $aFile;
+    protected $aFile;
 
     function BxDolStorageHelperForm ($aParams) {
         $this->aFile = $aParams['file'];
@@ -1081,7 +1081,7 @@ class BxDolStorageHelperForm {
  */
 class BxDolStorageHelperPath { 
 
-    var $sPath;
+    protected $sPath;
 
     function BxDolStorageHelperPath ($aParams) {
         $this->sPath = $aParams['path'];
@@ -1116,9 +1116,9 @@ class BxDolStorageHelperPath {
  */
 class BxDolStorageHelperStorage {
 
-    var $iFileId;
-    var $oStorage;
-    var $aFile;
+    protected $iFileId;
+    protected $oStorage;
+    protected $aFile;
 
     function BxDolStorageHelperStorage ($aParams) {
         $this->iFileId = $aParams['id'];

+ 10 - 7
inc/classes/BxDolStorageLocal.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 define ('BX_DOL_STORAGE_DIR_RIGHTS', 0777);
 define ('BX_DOL_STORAGE_FILE_RIGHTS', 0666);
@@ -20,8 +21,8 @@ class BxDolStorageLocal extends BxDolStorage {
     /**
      * constructor
      */
-    public function BxDolStorageLocal($aObject) {
-        parent::BxDolStorage($aObject);
+    public function __construct($aObject) {
+        parent::__construct($aObject);
     }
 
     /**
@@ -147,3 +148,5 @@ class BxDolStorageLocal extends BxDolStorage {
     }
 }
 
+/** @} */
+

+ 10 - 7
inc/classes/BxDolStorageQuery.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
@@ -16,8 +17,8 @@ class BxDolStorageQuery extends BxDolDb {
     protected $_aObject;
     protected $_sTableFiles;
 
-    public function BxDolStorageQuery($aObject) {
-        parent::BxDolDb();
+    public function __construct($aObject) {
+        parent::__construct();
         $this->_aObject = $aObject;
         $this->_sTableFiles = '`' . $aObject['table_files'] . '`';
     }
@@ -262,3 +263,5 @@ class BxDolStorageQuery extends BxDolDb {
     }
 }
 
+/** @} */
+

+ 10 - 7
inc/classes/BxDolStorageS3.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 define ('BX_DOL_STORAGE_PUBLIC', 'public');
 define ('BX_DOL_STORAGE_PRIVATE', 'private');
@@ -31,8 +32,8 @@ class BxDolStorageS3 extends BxDolStorage {
     /**
      * constructor
      */
-    public function BxDolStorageS3($aObject) {
-        parent::BxDolStorage($aObject);
+    public function __construct($aObject) {
+        parent::__construct($aObject);
 
         $sAccessKey = getParam('sys_storage_s3_access_key');
         $sSecretKey = getParam('sys_storage_s3_secret_key');
@@ -195,3 +196,5 @@ class BxDolStorageS3 extends BxDolStorage {
     }
 }
 
+/** @} */
+

+ 30 - 31
inc/classes/BxDolTemplate.php

@@ -11,7 +11,6 @@ ini_set('pcre.backtrack_limit', 1000000);
 
 define('BX_DOL_TEMPLATE_DEFAULT_CODE', 'uni');
 define('BX_DOL_TEMPLATE_FOLDER_ROOT', 'template');
-//define('BX_DOL_TEMPLATE_FOLDER_BASE', 'base');
 
 define('BX_DOL_TEMPLATE_INJECTIONS_CACHE', 'sys_injections.inc');
 
@@ -126,43 +125,43 @@ class BxDolTemplate extends BxDol implements iBxDolSingleton {
     /**
      * Main fields
      */
-    var $_sPrefix;
-    var $_sRootPath;
-    var $_sRootUrl;
-    var $_sSubPath;
-    var $_sInjectionsTable;
-    var $_sInjectionsCache;
-    var $_sCode;
-    var $_sCodeKey;
-    var $_sKeyWrapperHtml;
-    var $_sFolderHtml;
-    var $_sFolderCss;
-    var $_sFolderImages;
-    var $_sFolderIcons;
-    var $_aTemplates;
-
-    var $_aLocations;
-    var $_aLocationsJs;
+    protected $_sPrefix;
+    protected $_sRootPath;
+    protected $_sRootUrl;
+    protected $_sSubPath;
+    protected $_sInjectionsTable;
+    protected $_sInjectionsCache;
+    protected $_sCode;
+    protected $_sCodeKey;
+    protected $_sKeyWrapperHtml;
+    protected $_sFolderHtml;
+    protected $_sFolderCss;
+    protected $_sFolderImages;
+    protected $_sFolderIcons;
+    protected $_aTemplates;
+
+    protected $_aLocations;
+    protected $_aLocationsJs;
 
     /**
      * Cache related fields
      */
-    var $_bCacheEnable;
-    var $_sCacheFolderUrl;
-    var $_sCachePublicFolderUrl;
-    var $_sCachePublicFolderPath;
-    var $_sCacheFilePrefix;
+    protected $_bCacheEnable;
+    protected $_sCacheFolderUrl;
+    protected $_sCachePublicFolderUrl;
+    protected $_sCachePublicFolderPath;
+    protected $_sCacheFilePrefix;
 
-    var $_bImagesInline;
-    var $_iImagesMaxSize;
+    protected $_bImagesInline;
+    protected $_iImagesMaxSize;
 
-    var $_bCssCache;
-    var $_bCssArchive;
-    var $_sCssCachePrefix;
+    protected $_bCssCache;
+    protected $_bCssArchive;
+    protected $_sCssCachePrefix;
 
-    var $_bJsCache;
-    var $_bJsArchive;
-    var $_sJsCachePrefix;
+    protected $_bJsCache;
+    protected $_bJsArchive;
+    protected $_sJsCachePrefix;
 
     /**
      * Less related fields

+ 6 - 0
inc/classes/BxDolUploader.php

@@ -9,6 +9,12 @@
 
 bx_import('BxDolUploaderQuery');
 
+/** 
+ * @page objects 
+ * @section uploader Uploader
+ * @ref BxDolUploader
+ */
+
 /**
  * Uploaders are disigned to work as form field in forms. @see BxDolForm.
  * 

+ 7 - 1
inc/classes/BxDolView.php

@@ -12,6 +12,12 @@ bx_import('BxDolViewQuery');
 
 define ('BX_DOL_VIEW_OLD_VIEWS', 3 * 86400); ///< views older than this number of seconds will be deleted automatically
 
+/** 
+ * @page objects 
+ * @section views Views
+ * @ref BxDolView
+ */
+
 /**
  * Track any object views automatically
  *
@@ -52,7 +58,7 @@ class BxDolView extends BxDolObject
     /**
      * Constructor
      */
-    function BxDolView($sSystem, $iId, $iInit = true)
+    function __construct($sSystem, $iId, $iInit = true)
     {
     	parent::__construct($sSystem, $iId, $iInit);
 		if(empty($this->_sSystem))

+ 9 - 6
inc/classes/BxDolViewQuery.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
@@ -24,7 +25,7 @@ class BxDolViewQuery extends BxDolDb
 
     public function __construct(&$oModule)
     {
-        parent::BxDolDb();
+        parent::__construct();
 
         $this->_oModule = $oModule;
 
@@ -74,3 +75,5 @@ class BxDolViewQuery extends BxDolDb
         return (int)$this->query($sQuery) > 0;
     }
 }
+
+/** @} */

+ 1 - 1
inc/classes/BxDolVoteQuery.php

@@ -28,7 +28,7 @@ class BxDolVoteQuery extends BxDolDb
 
     public function __construct(&$oModule)
     {
-        parent::BxDolDb();
+        parent::__construct();
 
         $this->_oModule = $oModule;
 

+ 2 - 2
inc/classes/BxDolXmlParser.php

@@ -12,11 +12,11 @@ bx_import('BxDol');
 class BxDolXmlParser extends BxDol implements iBxDolSingleton {
     protected $rParser;
 
-    function BxDolXmlParser() {
+    function __construct() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDol();
+        parent::__construct();
     }
 
     /**

+ 3 - 3
modules/boonex/developer/classes/BxDevConfig.php

@@ -18,9 +18,9 @@ class BxDevConfig extends BxDolModuleConfig
 	protected $sAnimationEffect;
     protected $iAnimationSpeed;
 
-    function BxDevConfig($aModule)
+    function __construct($aModule)
     {
-        parent::BxDolModuleConfig($aModule);
+        parent::__construct($aModule);
 
         $this->aJsClasses = array('polyglot' => 'BxDevPolyglot');
         $this->aJsObjects = array('polyglot' => 'oBxDevPolyglot');
@@ -55,4 +55,4 @@ class BxDevConfig extends BxDolModuleConfig
     }
 }
 
-/** @} */
+/** @} */

+ 1 - 1
modules/boonex/developer/classes/BxDevDb.php

@@ -12,7 +12,7 @@
 bx_import('BxDolModuleDb');
 
 class BxDevDb extends BxDolModuleDb {
-    function BxDevDb(&$oConfig) {
+    function __construct(&$oConfig) {
         parent::__construct($oConfig);
     }
 

+ 3 - 3
modules/boonex/developer/classes/BxDevModule.php

@@ -28,8 +28,8 @@ define('BX_DEV_TOOLS_PERMISSIONS', 'permissions');
 class BxDevModule extends BxDolModule {
     public $aTools;
 
-    function BxDevModule($aModule) {
-        parent::BxDolModule($aModule);
+    function __construct($aModule) {
+        parent::__construct($aModule);
 
         $this->aTools = array(
             array('name' => BX_DEV_TOOLS_GENERAL, 'title' => ''),
@@ -45,4 +45,4 @@ class BxDevModule extends BxDolModule {
         return $this->aTools;
     }
 }
-/** @} */
+/** @} */

+ 3 - 3
modules/boonex/developer/classes/BxDevTemplate.php

@@ -12,8 +12,8 @@
 bx_import('BxDolModuleTemplate');
 
 class BxDevTemplate extends BxDolModuleTemplate {
-    function BxDevTemplate(&$oConfig, &$oDb) {
-        parent::BxDolModuleTemplate($oConfig, $oDb);
+    function __construct(&$oConfig, &$oDb) {
+        parent::__construct($oConfig, $oDb);
 
         $this->addStudioCss(array('main.css'));       
     }
@@ -37,4 +37,4 @@ class BxDevTemplate extends BxDolModuleTemplate {
     } 
 }
 
-/** @} */
+/** @} */

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineCmts.php

@@ -15,7 +15,7 @@ class BxTimelineCmts extends BxTemplCmts
 {
     function __construct($sSystem, $iId, $iInit = 1)
     {
-        parent::BxTemplCmts($sSystem, $iId, $iInit);
+        parent::__construct($sSystem, $iId, $iInit);
     }
 
     public function isAttachImageEnabled()

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -60,7 +60,7 @@ class BxTimelineConfig extends BxDolModuleConfig
      */
     public function __construct($aModule)
     {
-        parent::BxDolModuleConfig($aModule);
+        parent::__construct($aModule);
 
         $this->_sAlertSystemName = $this->_sName;
         $this->_sCommentSystemName = $this->_sName;

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -54,7 +54,7 @@ class BxTimelineModule extends BxDolModule
      */
     function __construct($aModule)
     {
-        parent::BxDolModule($aModule);
+        parent::__construct($aModule);
         $this->_oConfig->init($this->_oDb);
         $this->_oTemplate->init();
         $this->_iOwnerId = 0;

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -15,7 +15,7 @@ class BxTimelineTemplate extends BxDolModuleTemplate
 {
     function __construct(&$oConfig, &$oDb)
     {
-        parent::BxDolModuleTemplate($oConfig, $oDb);
+        parent::__construct($oConfig, $oDb);
     }
 
     protected function getModule()

+ 4 - 3
modules/boonex/timeline/classes/BxTimelineUploaderSimple.php

@@ -10,6 +10,7 @@
  */
 
 bx_import ('BxTemplUploaderSimple');
+bx_import('BxDolModule');
 
 /**
  * Upload files using standard HTML forms.
@@ -18,8 +19,7 @@ bx_import ('BxTemplUploaderSimple');
 class BxTimelineUploaderSimple extends BxTemplUploaderSimple {
     public function __construct ($aObject, $sStorageObject, $sUniqId) {
         parent::__construct($aObject, $sStorageObject, $sUniqId);
-
-        bx_import('BxDolModule');
+        
         $oModule = BxDolModule::getInstance('bx_timeline');
 
         $this->_oTemplate = $oModule->_oTemplate;
@@ -29,8 +29,9 @@ class BxTimelineUploaderSimple extends BxTemplUploaderSimple {
     public function getUploaderButton($mixedGhostTemplate, $isMultiple = true, $aParams = array()) {
     	$sResult = parent::getUploaderButton($mixedGhostTemplate, $isMultiple, $aParams);
 
+        $oModule = BxDolModule::getInstance('bx_timeline');
     	return $this->_oTemplate->parseHtmlByContent($sResult, array(
-			'js_object' => $this->_oTemplate->_oConfig->getJsObject('post'),
+			'js_object' => $oModule->_oConfig->getJsObject('post'),
     	));
     }
 }

+ 3 - 3
modules/boonex/uni/data/template/studio/scripts/BxTemplStudioFormView.php

@@ -12,8 +12,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxBaseStudioFormView');
 
 class BxTemplStudioFormView extends BxBaseStudioFormView { 
-    function BxTemplStudioFormView($aInfo, $oTemplate = false) {
-        parent::BxBaseStudioFormView($aInfo, $oTemplate);
+    function __construct($aInfo, $oTemplate = false) {
+        parent::__construct($aInfo, $oTemplate);
     }
 }
-/** @} */
+/** @} */

+ 9 - 7
modules/boonex/uni/data/template/system/scripts/BxTemplFormView.php

@@ -1,17 +1,19 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxBaseFormView');
 
 class BxTemplFormView extends BxBaseFormView {
 
-    function BxTemplFormView($aInfo, $oTemplate = false) {
-        parent::BxBaseFormView($aInfo, $oTemplate);
+    function __construct($aInfo, $oTemplate = false) {
+        parent::__construct($aInfo, $oTemplate);
     }
 }
 
+/** @} */

+ 7 - 5
modules/boonex/uni/data/template/system/scripts/BxTemplName.php

@@ -1,10 +1,12 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 $sTemplName = 'UNI';
 
+/** @} */

+ 12 - 9
modules/boonex/uni/data/template/system/scripts/BxTemplPaginate.php

@@ -1,20 +1,23 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import("BxBasePaginate");
 
 /**
  * @see BxDolPaginate
  */
-class BxTemplPaginate extends BxBasePaginate {
-
-    function BxTemplPaginate($aParams, $oTemplate = false) {
-        parent::BxBasePaginate($aParams, $oTemplate);
+class BxTemplPaginate extends BxBasePaginate 
+{
+    function __construct($aParams, $oTemplate = false) 
+    {
+        parent::__construct($aParams, $oTemplate);
     }
 }
 
+/** @} */

+ 0 - 16
modules/boonex/uni/data/template/system/scripts/BxTemplSearchResultText.php

@@ -1,16 +0,0 @@
-<?php
-/**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
- */
-defined('BX_DOL') or die('hack attempt');
-
-bx_import('BxBaseSearchResultText');
-
-class BxTemplSearchResultText extends BxBaseSearchResultText {
-    function BxTemplSearchResultText() {
-        parent::BxBaseSearchResultText();
-    }
-}
-

+ 6 - 5
modules/boonex/uni/data/template/system/scripts/BxTemplView.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxBaseView');
 

+ 4 - 4
splash.php

@@ -18,9 +18,9 @@ bx_import('BxTemplFormView');
 
 class BxDolSplashMenuTop extends BxTemplStudioMenuTop implements iBxDolSingleton
 {
-	function BxDolSplashMenuTop()
+	function __construct()
 	{
-		parent::BxTemplStudioMenuTop();
+		parent::__construct();
 
 		$oTemplate = BxDolStudioTemplate::getInstance();
 
@@ -48,7 +48,7 @@ class BxDolSplashMenuTop extends BxTemplStudioMenuTop implements iBxDolSingleton
 
 class BxDolSplashForm extends BxTemplFormView
 {
-	function BxDolSplashForm($oTemplate = false)
+	function __construct($oTemplate = false)
 	{
 		$aInfo = array(
             'form_attrs' => array(
@@ -80,7 +80,7 @@ class BxDolSplashForm extends BxTemplFormView
                 ),
             )
         );
-		parent::BxTemplFormView($aInfo, $oTemplate);
+		parent::__construct($aInfo, $oTemplate);
 	}
 
 	function isSubmittedAndNotValid ()

+ 1 - 1
studio/classes/BxDolStudioBuilderPageQuery.php

@@ -12,7 +12,7 @@ bx_import('BxDolStudioPageQuery');
 
 class BxDolStudioBuilderPageQuery extends BxDolStudioPageQuery { 
     function __construct() {
-        parent::BxDolStudioPageQuery();
+        parent::__construct();
     }
 
     function getPages($aParams, &$aItems, $bReturnCount = true) {

+ 3 - 3
studio/classes/BxDolStudioDesignerQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioPageQuery');
 
 class BxDolStudioDesignerQuery extends BxDolStudioPageQuery {
-    function BxDolStudioDesignerQuery() {
-        parent::BxDolStudioPageQuery();
+    function __construct() {
+        parent::__construct();
     }
 }
-/** @} */
+/** @} */

+ 3 - 3
studio/classes/BxDolStudioDesignsQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioPageQuery');
 
 class BxDolStudioDesignsQuery extends BxDolStudioPageQuery {
-    function BxDolStudioDesignsQuery() {
-        parent::BxDolStudioPageQuery();
+    function __construct() {
+        parent::__construct();
     }
 
     function getTemplatesBy($aParams, &$aItems, $bReturnCount = true) {
@@ -66,4 +66,4 @@ class BxDolStudioDesignsQuery extends BxDolStudioPageQuery {
         return (int)$this->getOne("SELECT FOUND_ROWS()");
     }
 }
-/** @} */
+/** @} */

+ 2 - 2
studio/classes/BxDolStudioForm.php

@@ -14,8 +14,8 @@ bx_import('BxDolStudioTemplate');
 define('BX_DOL_STUDIO_METHOD_DEFAULT', 'post');
 
 class BxDolStudioForm extends BxBaseFormView {
-    function BxDolStudioForm($aInfo, $oTemplate) {
-        parent::BxBaseFormView($aInfo, $oTemplate !== false ? $oTemplate : BxDolStudioTemplate::getInstance());
+    function __construct($aInfo, $oTemplate) {
+        parent::__construct($aInfo, $oTemplate !== false ? $oTemplate : BxDolStudioTemplate::getInstance());
 
         $this->_sCheckerHelper = isset($this->aParams['checker_helper']) ? $this->aParams['checker_helper'] : 'BxDolStudioFormCheckerHelper';
     }

+ 3 - 3
studio/classes/BxDolStudioModulesQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolModuleQuery');
 
 class BxDolStudioModulesQuery extends BxDolModuleQuery {
-    function BxDolStudioModulesQuery() {
-        parent::BxDolModuleQuery();
+    function __construct() {
+        parent::__construct();
     }
 }
-/** @} */
+/** @} */

+ 3 - 3
studio/classes/BxDolStudioPageQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolDb');
 
 class BxDolStudioPageQuery extends BxDolDb {
-    function BxDolStudioPageQuery() {
-        parent::BxDolDb();
+    function __construct() {
+        parent::__construct();
     }
 
     function getPages($aParams, &$aItems, $bReturnCount = true) {
@@ -102,4 +102,4 @@ class BxDolStudioPageQuery extends BxDolDb {
         return $bResult;
     }
 }
-/** @} */
+/** @} */

+ 3 - 3
studio/classes/BxDolStudioSettingsQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioPageQuery');
 
 class BxDolStudioSettingsQuery extends BxDolStudioPageQuery {
-    function BxDolStudioSettingsQuery() {
-        parent::BxDolStudioPageQuery();
+    function __construct() {
+        parent::__construct();
     }
 
     function getTypes($aParams, &$aItems, $bReturnCount = true) {
@@ -156,4 +156,4 @@ class BxDolStudioSettingsQuery extends BxDolStudioPageQuery {
         return (int)$this->getOne("SELECT FOUND_ROWS()");
     }
 }
-/** @} */
+/** @} */

+ 3 - 3
studio/classes/BxDolStudioStoreQuery.php

@@ -11,8 +11,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioModulesQuery');
 
 class BxDolStudioStoreQuery extends BxDolStudioModulesQuery {
-    function BxDolStudioStoreQuery() {
-        parent::BxDolStudioModulesQuery();
+    function __construct() {
+        parent::__construct();
     }
 }
-/** @} */
+/** @} */

+ 2 - 2
studio/classes/BxDolStudioWidgetsQuery.php

@@ -11,11 +11,11 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioPageQuery');
 
 class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery implements iBxDolSingleton {
-    function BxDolStudioWidgetsQuery() {
+    function __construct() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
-        parent::BxDolStudioPageQuery();
+        parent::__construct();
     }
 
 	/**

+ 3 - 3
studio/template/scripts/BxBaseStudioFormView.php

@@ -12,8 +12,8 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioForm');
 
 class BxBaseStudioFormView extends BxDolStudioForm {
-    function BxBaseStudioFormView($aInfo, $oTemplate) {
-        parent::BxDolStudioForm($aInfo, $oTemplate);
+    function __construct($aInfo, $oTemplate) {
+        parent::__construct($aInfo, $oTemplate);
     }
 
     function addCssJs() {
@@ -194,4 +194,4 @@ class BxBaseStudioFormView extends BxDolStudioForm {
         return $sInput . $sControl;
     }
 }
-/** @} */
+/** @} */

+ 21 - 35
template/scripts/BxBaseFormView.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolForm');
 
@@ -15,67 +16,52 @@ class BxBaseFormView extends BxDolForm {
     protected static $_isCssJsAdded = false;
     protected static $_isCssJsAddedViewMode = false;
 
-    var $bEnableErrorIcon = true;
+    /**
+     * Enable or disable error message displaying
+     */
+    protected $bEnableErrorIcon = true;
 
     /**
      * HTML Code of this form
-     *
-     * @var string
      */
-    var $sCode;
+    protected $sCode;
 
     /**
      * Code which will be added to the beginning of the form.
      * For example, hidden inputs.
      * For internal use only
-     *
-     * @var string
      */
-    var $_sCodeAdd = '';
+    protected $_sCodeAdd = '';
 
     /**
      * for internal use only
-     *
-     * @var boolean
-     */
-    var $_isSectionOpened = false;
-
-    /**
-     *
-     *
-     * @var boolean
      */
-    var $_bHtmlEditorAdded = false;
+    protected $_isSectionOpened = false;
 
     /**
      * Default divider for several inputs
-     * @var string
      */
-    var $_sDivider = '<span class="bx-def-margin-left"></span>';
+    protected $_sDivider = '<span class="bx-def-margin-left"></span>';
 
     /**
      * Alternative divider for several inputs
-     * @var string
      */
-    var $_sDividerAlt = '<br />';
+    protected $_sDividerAlt = '<br />';
 
     /**
      * Form is added dynamically.
-     * @var boolean
      */
-    var $_bDynamicMode = false;
+    protected $_bDynamicMode = false;
 
     /**
      * Function name for generation close form section HTML.
-     * @var string
      */
-    var $_sSectionClose = 'getCloseSection';
+    protected $_sSectionClose = 'getCloseSection';
 
     /**
      * Function name for generation open form section HTML.
-     * @var string
      */
-    var $_sSectionOpen = 'getOpenSection';
+    protected $_sSectionOpen = 'getOpenSection';
 
     /**
      * Constructor
@@ -88,8 +74,8 @@ class BxBaseFormView extends BxDolForm {
      *
      * @return BxBaseFormView
      */
-    function BxBaseFormView($aInfo, $oTemplate) {
-        parent::BxDolForm($aInfo, $oTemplate);
+    function __construct($aInfo, $oTemplate) {
+        parent::__construct($aInfo, $oTemplate);
 
         if (isset($this->aParams['view_mode']) && $this->aParams['view_mode']) {
             $this->_sSectionClose = 'getCloseSectionViewMode';
@@ -117,7 +103,6 @@ class BxBaseFormView extends BxDolForm {
     function genForm() {
 
         $this->_sCodeAdd = '';
-        $this->_bHtmlEditorAdded = false;
 
         $sTable = $this->genRows();
 
@@ -1224,3 +1209,4 @@ BLAH;
     }
 }
 
+/** @} */

+ 12 - 9
template/scripts/BxBasePaginate.php

@@ -1,20 +1,23 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import("BxDolPaginate");
 
 /**
  * @see BxDolPaginate
  */
-class BxBasePaginate extends BxDolPaginate {
-
-    function BxBasePaginate($aParams, $oTemplate) {
-        parent::BxDolPaginate($aParams, $oTemplate);
+class BxBasePaginate extends BxDolPaginate 
+{
+    function __construct($aParams, $oTemplate) 
+    {
+        parent::__construct($aParams, $oTemplate);
     }
 }
 
+/** @} */

+ 1 - 1
template/scripts/BxBaseUploaderHTML5.php

@@ -16,7 +16,7 @@ bx_import ('BxDolUploader');
  */
 class BxBaseUploaderHTML5 extends BxDolUploader {    
 
-    var $_sDivId; ///< div id where upload button will be placed
+    protected $_sDivId; ///< div id where upload button will be placed
 
     function __construct ($aObject, $sStorageObject, $sUniqId) {
         parent::__construct($aObject, $sStorageObject, $sUniqId);

+ 1 - 1
template/scripts/BxBaseUploaderSimple.php

@@ -15,7 +15,7 @@ bx_import ('BxDolUploader');
  */
 class BxBaseUploaderSimple extends BxDolUploader {    
 
-    var $_sIframeId;
+    protected $_sIframeId;
 
     function __construct ($aObject, $sStorageObject, $sUniqId) {
         parent::__construct($aObject, $sStorageObject, $sUniqId);

+ 6 - 5
template/scripts/BxBaseView.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolView');
 

+ 9 - 23
upgrade/classes/BxDolUpgradeController.php

@@ -1,25 +1,11 @@
-<?
-
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin 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 2 of the
-* License, or  any later version.
-*
-* Dolphin 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 Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinUpgrade Dolphin Upgrade Script
+ * @{
+ */
 
 class BxDolUpgradeController {
 
@@ -248,4 +234,4 @@ class BxDolUpgradeController {
 
 }
 
-?>
+/** @} */

+ 74 - 82
upgrade/classes/BxDolUpgradeDb.php

@@ -1,48 +1,33 @@
-<?
-
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin 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 2 of the
-* License, or  any later version.
-*
-* Dolphin 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 Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-define( 'BX_UPGRADE_DB_FULL_VISUAL_PROCESSING', true );
-define( 'BX_UPGRADE_DB_FULL_DEBUG_MODE', true );
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinUpgrade Dolphin Upgrade Script
+ * @{
+ */
+
+define('BX_UPGRADE_DB_FULL_VISUAL_PROCESSING', true);
+define('BX_UPGRADE_DB_FULL_DEBUG_MODE', true);
 
 class BxDolUpgradeDb
 {
-    var $error_checking = true;
-    var $host, $port, $socket, $dbname, $user, $password, $link;
-    var $current_res, $current_arr_type;
+    protected $_bErrorChecking = true;
+    protected $_sHost, $_sPort, $_sSocket, $_sDbname, $_sUser, $_sPassword;
+    protected $_rLink, $_rCurrentRes, $_iCurrentResType;
 
-    var $oParams;
-
-    /*
-    *set database parameters and connect to it
-    */
-    function BxDolUpgradeDb(){
-
-        $this->host = DATABASE_HOST;
-        $this->port = DATABASE_PORT;
-        $this->socket = DATABASE_SOCK;
-        $this->dbname = DATABASE_NAME;
-        $this->user = DATABASE_USER;
-        $this->password = DATABASE_PASS;
-        $this->current_arr_type = MYSQL_ASSOC;
+    /**
+     * set database parameters and connect to it
+     */
+    function __construct()
+    {
+        $this->_sHost = DATABASE_HOST;
+        $this->_sPort = DATABASE_PORT;
+        $this->_sSocket = DATABASE_SOCK;
+        $this->_sDbname = DATABASE_NAME;
+        $this->_sUser = DATABASE_USER;
+        $this->_sPassword = DATABASE_PASS;
+        $this->_iCurrentResType = MYSQL_ASSOC;
 
         $this->connect();
     }
@@ -52,12 +37,12 @@ class BxDolUpgradeDb
      */
     function connect()
     {
-        $full_host = $this->host;
-        $full_host .= $this->port ? ':'.$this->port : '';
-        $full_host .= $this->socket ? ':'.$this->socket : '';
+        $full_host = $this->_sHost;
+        $full_host .= $this->_sPort ? ':'.$this->_sPort : '';
+        $full_host .= $this->_sSocket ? ':'.$this->_sSocket : '';
 
-        $this->link = @mysql_pconnect($full_host, $this->user, $this->password);
-        if (!$this->link)
+        $this->_rLink = @mysql_pconnect($full_host, $this->_sUser, $this->_sPassword);
+        if (!$this->_rLink)
             $this->error('Database connect failed', true);
 
         if (!$this->select_db())
@@ -69,7 +54,7 @@ class BxDolUpgradeDb
 
     function select_db()
     {
-        return @mysql_select_db($this->dbname, $this->link) or $this->error('Cannot complete query (select_db)');
+        return @mysql_select_db($this->_sDbname, $this->_rLink) or $this->error('Cannot complete query (select_db)');
     }
 
     /**
@@ -77,10 +62,9 @@ class BxDolUpgradeDb
      */
     function close()
     {
-        mysql_close($this->link);
+        mysql_close($this->_rLink);
     }
 
-
     /**
      * execute sql query and return one row result
      */
@@ -99,10 +83,12 @@ class BxDolUpgradeDb
         }
         return $arr_res;
     }
+
     /**
      * execute sql query and return a column as result
      */
-    function getColumn($sQuery) {
+    function getColumn($sQuery) 
+    {
         if(!$sQuery)
             return array();
 
@@ -143,13 +129,13 @@ class BxDolUpgradeDb
         if(!$query)
             return array();
         if($arr_type != MYSQL_ASSOC && $arr_type != MYSQL_NUM)
-            $this->current_arr_type = MYSQL_ASSOC;
+            $this->_iCurrentResType = MYSQL_ASSOC;
         else
-            $this->current_arr_type = $arr_type;
-        $this->current_res = $this->res ($query);
+            $this->_iCurrentResType = $arr_type;
+        $this->_rCurrentRes = $this->res ($query);
         $arr_res = array();
-        if($this->current_res && mysql_num_rows($this->current_res))
-            $arr_res = mysql_fetch_array($this->current_res, $this->current_arr_type);
+        if($this->_rCurrentRes && mysql_num_rows($this->_rCurrentRes))
+            $arr_res = mysql_fetch_array($this->_rCurrentRes, $this->_iCurrentResType);
         return $arr_res;
     }
 
@@ -158,13 +144,13 @@ class BxDolUpgradeDb
      */
     function getNextRow()
     {
-        $arr_res = mysql_fetch_array($this->current_res, $this->current_arr_type);
+        $arr_res = mysql_fetch_array($this->_rCurrentRes, $this->_iCurrentResType);
         if($arr_res)
             return $arr_res;
         else
         {
-            mysql_free_result($this->current_res);
-            $this->current_arr_type = MYSQL_ASSOC;
+            mysql_free_result($this->_rCurrentRes);
+            $this->_iCurrentResType = MYSQL_ASSOC;
             return array();
         }
     }
@@ -176,8 +162,8 @@ class BxDolUpgradeDb
     {
         if ($res)
             return (int)@mysql_num_rows($res);
-        elseif (!$this->current_res)
-            return (int)@mysql_num_rows($this->current_res);
+        elseif (!$this->_rCurrentRes)
+            return (int)@mysql_num_rows($this->_rCurrentRes);
         else
             return 0;
     }
@@ -187,7 +173,7 @@ class BxDolUpgradeDb
      */
     function getAffectedRows()
     {
-        return mysql_affected_rows($this->link);
+        return mysql_affected_rows($this->_rLink);
     }
 
     /**
@@ -197,21 +183,21 @@ class BxDolUpgradeDb
     {
         $res = $this->res($query);
         if($res)
-            return mysql_affected_rows($this->link);
+            return mysql_affected_rows($this->_rLink);
         return false;
     }
 
     /**
      * execute any query
      */
-    function res($query, $error_checking = true)
+    function res($query, $bErrorChecking = true)
     {
         if(!$query)
             return false;
         if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginQuery($query);
-        $res = mysql_query($query, $this->link);
+        $res = mysql_query($query, $this->_rLink);
         if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endQuery($res);
-        if (!$res && $error_checking)
+        if (!$res && $bErrorChecking)
             $this->error('Database query error', false, $query);
         return $res;
     }
@@ -301,27 +287,29 @@ class BxDolUpgradeDb
 
     function lastId()
     {
-        return mysql_insert_id($this->link);
+        return mysql_insert_id($this->_rLink);
     }
 
     function error($text, $isForceErrorChecking = false, $sSqlQuery = '')
     {
-        if ($this->error_checking || $isForceErrorChecking)
+        if ($this->_bErrorChecking || $isForceErrorChecking)
             $this->genMySQLErr ($text, $sSqlQuery);
         else
-            $this->log($text.': '.mysql_error($this->link));
+            $this->log($text.': '.mysql_error($this->_rLink));
     }
 
-    function listTables() {
-        return mysql_list_tables($GLOBALS['db']['db'], $this->link);
-        //return mysql_list_tables($GLOBALS['db']['db'], $this->link) or $this->error('Database get encoding error');
+    function listTables() 
+    {
+        return mysql_list_tables($GLOBALS['db']['db'], $this->_rLink);
     }
 
-    function getEncoding() {
-        return  mysql_client_encoding($this->link) or $this->error('Database get encoding error');
+    function getEncoding() 
+    {
+        return  mysql_client_encoding($this->_rLink) or $this->error('Database get encoding error');
     }
 
-    function genMySQLErr( $out, $query ='' ) {
+    function genMySQLErr( $out, $query ='' ) 
+    {
         $aBackTrace = debug_backtrace();
         unset( $aBackTrace[0] );
 
@@ -367,7 +355,7 @@ EOJ;
                 if( strlen( $query ) )
                     echo "<div><b>Query:</b><br />{$query}</div>";
 
-                echo '<div><b>Mysql error:</b><br />'.mysql_error($this->link).'</div>';
+                echo '<div><b>Mysql error:</b><br />'.mysql_error($this->_rLink).'</div>';
                 echo '<div style="overflow:scroll;height:300px;border:1px solid gray;">';
                     echo $sFoundError;
                     echo "<b>Debug backtrace:</b><br />";
@@ -388,16 +376,18 @@ EOJ;
         exit;
     }
 
-    function setErrorChecking ($b) {
-        $this->error_checking = $b;
+    function setErrorChecking ($b) 
+    {
+        $this->_bErrorChecking = $b;
     }
 
-    function escape ($s) {
+    function escape ($s) 
+    {
         return mysql_real_escape_string($s);
     }
 
-    function executeSQL($sPath, $aReplace = array (), $isBreakOnError = true) {
-
+    function executeSQL($sPath, $aReplace = array (), $isBreakOnError = true) 
+    {
         if(!file_exists($sPath) || !($rHandler = fopen($sPath, "r")))
             return array ('query' => "fopen($sPath, 'r')", 'error' => 'file not found or permission denied');
 
@@ -429,7 +419,7 @@ EOJ;
                 $sQuery = str_replace($sDelimiter, "", $sQuery);
             $rResult = $this->res(trim($sQuery), false);
             if(!$rResult) {
-                $aResult[] = array('query' => $sQuery, 'error' => mysql_error($this->link));
+                $aResult[] = array('query' => $sQuery, 'error' => mysql_error($this->_rLink));
                 if ($isBreakOnError)
                     break;
             }
@@ -441,4 +431,6 @@ EOJ;
         return empty($aResult) ? true : $aResult;
     }
 }
-?>
+
+/** @} */
+

+ 10 - 23
upgrade/classes/BxDolUpgradeUtil.php

@@ -1,25 +1,11 @@
-<?
-
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin 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 2 of the
-* License, or  any later version.
-*
-* Dolphin 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 Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinUpgrade Dolphin Upgrade Script
+ * @{
+ */
 
 class BxDolUpgradeUtil {
 
@@ -257,4 +243,5 @@ class BxDolUpgradeUtil {
     }
 }
 
-?>
+/** @} */
+

+ 10 - 11
upgrade/index.php

@@ -1,13 +1,11 @@
-<?php
-
-/*
-
-    $aConf['iVersion'] = '7.0';
-    $aConf['iPatch'] = '0'; // RC2
-
-    sys_version
-*/
-
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinUpgrade Dolphin Upgrade Script
+ * @{
+ */
 
 require_once('./../inc/header.inc.php');
 require_once(BX_DIRECTORY_PATH_ROOT . 'upgrade/classes/BxDolUpgradeController.php');
@@ -31,4 +29,5 @@ else
 
 include (BX_UPGRADE_DIR_TEMPLATES . '_footer.php');
 
-?>
+/** @} */
+