get rid of style warnings
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 3 Jul 2010 11:04:41 +0000 (11:04 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Sat, 3 Jul 2010 11:04:41 +0000 (11:04 +0000)
git-svn-id: https://silmor.de/svn/softmagic/pack/trunk@513 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

phpbase/schema.php
woc/phpout.cpp

index fb368ba..0d40157 100644 (file)
@@ -11,41 +11,41 @@ class WobSchemaBase {
        }
        
        /**return the version of this scheme*/
-       public function version(){return $this->sversion;}
+       public function version(){return self::$sversion;}
        
        /**return the tables to be created in order*/
        public function tableNames()
        {
-               return array_keys($this->scheme);
+               return array_keys(self::$scheme);
        }
        
        /**returns whether a table exists in the schema*/
        public function hasTable($t)
        {
-               return in_array($t,array_keys($this->scheme));
+               return in_array($t,array_keys(self::$scheme));
        }
        
        /**return the tables that are included in the backup*/
        public function backupTables()
        {
-               return $this->backup;
+               return self::$backup;
        }
        
        /**return the full definition of a table, or false if it does not exist*/
        public function tableDefinition($tab)
        {
-               if(!isset($this->scheme[$tab]))
+               if(!isset(self::$scheme[$tab]))
                        return false;
-               return $this->scheme[$tab];
+               return self::$scheme[$tab];
        }
        
        /**return the names of all columns of a table, or false if the table does not exist*/
        public function tableColumns($tab)
        {
-               if(!isset($this->scheme[$tab]))
+               if(!isset(self::$scheme[$tab]))
                        return false;
                $r=array();
-               foreach(array_keys($this->scheme[$tab]) as $c)
+               foreach(array_keys(self::$scheme[$tab]) as $c)
                        if(substr($c,0,1)!=":")
                                $r[]=$c;
                return $r;
@@ -54,30 +54,30 @@ class WobSchemaBase {
        /**return whether the table has this column*/
        public function tableHasColumn($tab,$col)
        {
-               return isset($this->scheme[$tab][$col]);
+               return isset(self::$scheme[$tab][$col]);
        }
        
        /**return default lines of the table for the initialization; returns empty array if there are none*/
        public function tableDefaults($tab)
        {
-               if(isset($this->preset[$tab]))return $this->preset[$tab];
+               if(isset(self::$preset[$tab]))return self::$preset[$tab];
                else return array();
        }
        
        /**return the type of a column, or false if it does not exist*/
        public function columnType($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               return $this->scheme[$tab][$col][0];
+               return self::$scheme[$tab][$col][0];
        }
        
        /**return the flags of a column, empty array if no flags are set, or false if the column does not exist*/
        public function columnFlags($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               $tmp=$this->scheme[$tab][$col];
+               $tmp=self::$scheme[$tab][$col];
                unset($tmp[0]);
                return array_values($tmp);
        }
@@ -85,9 +85,9 @@ class WobSchemaBase {
        /**returns true if the given column is of an integer type*/
        public function isIntColumn($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               $tpa=explode(":",$this->scheme[$tab][$col][0]);
+               $tpa=explode(":",self::$scheme[$tab][$col][0]);
                switch($tpa[0]){
                        case "int32":case "seq32":case "int64":case "seq64":case "enum":case "enum32":case "enum64":
                                return true;
@@ -99,9 +99,9 @@ class WobSchemaBase {
        /**returns the sequence column name if the table has a sequence, false otherwise*/
        public function hasSequence($tab)
        {
-               if(!isset($this->scheme[$tab]))
+               if(!isset(self::$scheme[$tab]))
                        return false;
-               foreach($this->scheme[$tab] as $cl => $def){
+               foreach(self::$scheme[$tab] as $cl => $def){
                        if($def[0] == "seq32" || $def[0] == "seq64")
                                return $cl;
                }
@@ -111,9 +111,9 @@ class WobSchemaBase {
        /**returns true if the given column is of a string type*/
        public function isStringColumn($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               $tpa=explode(":",$this->scheme[$tab][$col][0]);
+               $tpa=explode(":",self::$scheme[$tab][$col][0]);
                switch($tpa[0]){
                        case "string":case "text":
                                return true;
@@ -125,9 +125,9 @@ class WobSchemaBase {
        /**returns true if the given column is of a blob type*/
        public function isBlobColumn($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               $tpa=explode(":",$this->scheme[$tab][$col][0]);
+               $tpa=explode(":",self::$scheme[$tab][$col][0]);
                switch($tpa[0]){
                        case "blob":
                                return true;
@@ -139,9 +139,9 @@ class WobSchemaBase {
        /**returns true if the given column is of a bool type*/
        public function isBoolColumn($tab,$col)
        {
-               if(!isset($this->scheme[$tab][$col]))
+               if(!isset(self::$scheme[$tab][$col]))
                        return false;
-               $tpa=explode(":",$this->scheme[$tab][$col][0]);
+               $tpa=explode(":",self::$scheme[$tab][$col][0]);
                switch($tpa[0]){
                        case "bool":
                        case "boolean":
@@ -156,12 +156,12 @@ class WobSchemaBase {
        {
                $r=array();
                //search for direct mark
-               foreach($this->scheme[$tab] as $col=>$def)
+               foreach(self::$scheme[$tab] as $col=>$def)
                        if(in_array("primarykey",$def))
                                $r[]=$col;
                //search for special mark
-               if(isset($this->scheme[$tab][":primarykey"]))
-                       foreach($this->scheme[$tab][":primarykey"] as $col)
+               if(isset(self::$scheme[$tab][":primarykey"]))
+                       foreach(self::$scheme[$tab][":primarykey"] as $col)
                                if(!in_array($col,$r))
                                        $r[]=$col;
                //return result
index 7350efd..fea93d0 100644 (file)
@@ -59,7 +59,7 @@ WocPHPServerOut::WocPHPServerOut(const QDomElement&el)
        }
        m_schema.write(PHPSTART);
        m_schema.write(SCHEMASTART);
-       m_schema.write(("\t$this->sversion=\""+WocProcessor::instance()->dbVersion()+"\";\n").toAscii());
+       m_schema.write(("\tself::$sversion=\""+WocProcessor::instance()->dbVersion()+"\";\n").toAscii());
        addLoad("WobSchema","schema");
        //create Transaction file
        m_transact.setFileName(m_basedir+"/"+m_subdir+"/transaction"+m_fileext);
@@ -255,7 +255,7 @@ void WocPHPServerOut::newTable(const WocTable&tbl)
        
        //extend schema file
        //column definitions
-       code="\t$this->scheme[\""+tbl.name()+"\"]=array(";
+       code="\tself::$scheme[\""+tbl.name()+"\"]=array(";
        for(int i=0;i<cols.size();i++){
                if(i)code+=",";
                code+="\n\t\t\""+cols[i]+"\"=>array(\"";
@@ -277,11 +277,11 @@ void WocPHPServerOut::newTable(const WocTable&tbl)
                code+=")";
        }
        code+="\n\t);\n";
-       if(tbl.inBackup())code+="\t$this->backup[]=\""+tbl.name()+"\";\n";
+       if(tbl.inBackup())code+="\tself::$backup[]=\""+tbl.name()+"\";\n";
        //write presets
        QList<QMap<QString,QString> >presets=tbl.presets();
        if(presets.size()>0){
-               code+="\t$this->preset[\""+tbl.name()+"\"]=array(";
+               code+="\tself::$preset[\""+tbl.name()+"\"]=array(";
                for(int i=0;i<presets.size();i++){
                        if(i)code+=",";
                        code+="\n\t\tarray(";