OSDN Git Service

PDO対応
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / libs / backup.php
index b788d3f..4884da0 100755 (executable)
@@ -73,7 +73,7 @@ class Backup
                // catch all output generated by plugins\r
                ob_start();\r
                $res = sql_query('SELECT pfile FROM '.sql_table('plugin'));\r
-               while ($plugName = mysql_fetch_object($res)) {\r
+               while ($plugName = sql_fetch_object($res)) {\r
                        $plug =& $manager->getPlugin($plugName->pfile);\r
                        if ($plug) $tables = array_merge($tables, (array) $plug->getTableList());\r
                }\r
@@ -160,7 +160,7 @@ class Backup
                // add command to drop table on restore\r
                echo "DROP TABLE IF EXISTS $tablename;\n";\r
                $result = sql_query("SHOW CREATE TABLE $tablename");\r
-               $create = mysql_fetch_assoc($result);\r
+               $create = sql_fetch_assoc($result);\r
                echo $create['Create Table'];\r
                echo ";\n\n";\r
        }\r
@@ -255,7 +255,7 @@ class Backup
        \r
                        $fields = array();\r
                        for ($j = 0; $j < $num_fields; $j++) {\r
-                               $fields[] = mysql_field_name($result, $j);\r
+                               $fields[] = sql_field_name($result, $j);\r
                        }\r
        \r
        /*      }*/\r
@@ -270,12 +270,12 @@ class Backup
                //\r
                // Grab the data from the table.\r
                //\r
-               $result = mysql_query("SELECT * FROM $tablename");\r
+               $result = sql_query("SELECT * FROM $tablename");\r
        \r
-               if(mysql_num_rows($result) > 0)\r
+               if(sql_num_rows($result) > 0)\r
                        echo "\n#\n# " . sprintf(_BACKUP_BACKUPFILE_TABLEDATAFOR, $tablename) . "\n#\n";\r
                        \r
-               $num_fields = mysql_num_fields($result);\r
+               $num_fields = sql_num_fields($result);\r
                \r
                //\r
                // Compose fieldname list\r
@@ -285,7 +285,7 @@ class Backup
                //\r
                // Loop through the resulting rows and build the sql statement.\r
                //\r
-               while ($row = mysql_fetch_array($result))\r
+               while ($row = sql_fetch_array($result))\r
                {\r
                        // Start building the SQL statement.\r
        \r
@@ -404,8 +404,8 @@ class Backup
                                // DEBUG\r
        //                      debug("Executing: " . htmlspecialchars($sql) . "\n");\r
        \r
-                               $result = mysql_query($sql);\r
-                               if (!$result) debug(_BACKUP_RESTOR_SQL_ERROR . mysql_error());\r
+                               $result = sql_query($sql);\r
+                               if (!$result) debug(_BACKUP_RESTOR_SQL_ERROR . sql_error());\r
        \r
                        }\r
                }\r