"`" . str_replace("`", "``", $col) . "`", array_keys($row)); $vals = array_map(fn($val) => isset($val) ? $db_link->quote($val) : 'NULL', array_values($row)); $output .= "INSERT INTO `$table` (" . implode(", ", $cols) . ") VALUES (" . implode(", ", $vals) . ");\n"; } if(!empty($output)){ $basics = new \basics; $basics->create_file2($backupdir.'products.sql-'.date('Y-m-d_His'),$output); } $output = ''; $table = 'customers'; $res = xtc_db_query("SHOW CREATE TABLE `$table`"); $row = xtc_db_fetch_array($res); $output .= "DROP TABLE IF EXISTS `$table`;\n"; $output .= $row['Create Table'] . ";\n\n"; $query = xtc_db_query("SELECT * FROM $table"); $num = xtc_db_num_rows($query); while($row = xtc_db_fetch_array($query)){ $cols = array_map(fn($col) => "`" . str_replace("`", "``", $col) . "`", array_keys($row)); $vals = array_map(fn($val) => isset($val) ? $db_link->quote($val) : 'NULL', array_values($row)); $output .= "INSERT INTO `$table` (" . implode(", ", $cols) . ") VALUES (" . implode(", ", $vals) . ");\n"; } if(!empty($output)){ $basics = new \basics; $basics->create_file2($backupdir.'customers.sql-'.date('Y-m-d_His'),$output); } exit; $query = xtc_db_query("SELECT * FROM wishlist_attributes"); echo xtc_db_num_rows($query)." wishlist_attributes Eintraege\n\n"; exit; // ------------------------------ // -- BOF EBAY NOTIFICATIONS BULK // ------------------------------ require_once('admin/includes/classes/class.ebay.php'); $EBAYAPI = new \ebayApi; $events_array = [ 'AskSellerQuestion', // frage an verkaeufer 'BestOffer','BestOfferDeclined','BestOfferPlaced', // bestoffer aktionen 'EndOfAuction', // eine Auktion gilt als beendet 'FeedbackReceived', 'ItemExtended', // Angebot wurde verlaengert 'ItemSuspended', // wenn ebay cancelt 'ItemClosed', // Angebot gilt als beendet (durch kauf oder durch ablauf des angebots) 'ItemUnsold', 'ItemSold' ]; $activate_events = ['ItemClosed','ItemSuspended','ItemUnsold','ItemSold','ItemExtended']; $ebay_user = yes_query("SELECT user FROM ebay_auth"); echo sizeOf($ebay_user)." Seller zum Verarbeiten\n"; $site_id = $EBAYAPI->get_site_id_from_name(constant('EBAY_SITE')); foreach($ebay_user as $eu){ $seller = $eu['user']; if(ebayApi::oauth2_refreshtoken_exists($seller)){ if(!ebayApi::oauth2_usertoken_exists($seller) or ebayApi::get_oauth2_usertoken_lifetime($seller) < 1){ try{ ebayApi::refresh_oauth2_usertoken($seller); }catch(Exception $e){ echo "\trefresh_oauth2_usertoken() for seller ".$seller." failed. ".$e->getMessage()."\n"; continue; } } }else{ echo "\t".$seller." has no refresh token saved\n\n"; continue; } $role = 'User'; $ebaycalls = new \YES4Trade\Model\ebaycalls(); $additional_xml_params = [ 'PreferenceLevel' => $role ]; $res = $ebaycalls->tradingQuery($seller, 'GetNotificationPreferences', $site_id, $additional_xml_params ); $uprefs = []; $activateds = []; if($res->UserDeliveryPreferenceArray === null){ foreach($activate_events as $ac){ $uprefs[] = [ 'EventEnable'=>'Enable', 'EventType'=>$ac ]; $activateds[] = $ac; } }else{ $udpa = $res->UserDeliveryPreferenceArray->NotificationEnable ?? []; if(!is_array($udpa)){ $udpa = [$udpa]; } foreach($udpa as $ne){ if(in_array($ne->EventType,$activate_events)){ $uprefs[] = [ 'EventEnable'=>'Enable', 'EventType'=>$ne->EventType ]; $activateds[] = $ne->EventType; }else{ $uprefs[] = [ 'EventEnable'=>'Disable', 'EventType'=>$ne->EventType ]; } } } $uprefs_missing = array_diff($activate_events,$activateds); foreach($uprefs_missing as $um){ $uprefs[] = [ 'EventEnable'=>'Enable', 'EventType'=>$um ]; } $server = 'https://yes-a177922.de'; $additional_parameters = [ 'UserDeliveryPreferenceArray'=>['NotificationEnable'=>$uprefs], 'ApplicationDeliveryPreferences'=>[ 'ApplicationURL'=>$server.'/soap.php', 'ApplicationEnable'=>'Enable', 'AlertEnable'=>'Enable' ] ]; $ebaycalls = new \YES4Trade\Model\ebaycalls(); $response = $ebaycalls->tradingQuery($seller, 'SetNotificationPreferences', $site_id, $additional_parameters ); if($response->Ack == 'Success'){ printf("\tSeller %s: Platform Notifications updated\n",$seller); }else{ printf("\tSeller %s: Platform Notifications update failed!\n\n%s",$seller,print_r($response,true)); } } echo "\nfertig\n"; // ------------------------------ // -- EOF EBAY NOTIFICATIONS BULK // ------------------------------ exit; // BOF - NEUE TEMPLATEFILES IN ALLE TEMPLATESETS SCHREIBEN $base = DIR_FS_CATALOG.'templates/'; $tpl_location = 'module/'; $tpl_sets = scandir($base); $copy_file2 = 'create_account.select_account_type.html'; $copy_file_baseurl = 'http://agri.abcde.biz/yes/templates/YES4trade-fl/module/'; $html2 = file_get_contents($copy_file_baseurl.$copy_file2); foreach($tpl_sets as $entry){ if(in_array($entry,['.','..']) or !is_dir($base.$entry)){ continue; } if(is_file($base.$entry.'/'.$tpl_location.$copy_file2)){ echo $entry." hat schon\n"; continue; } try { if(!is_writable($base.$entry.'/'.$tpl_location)){ throw new Exception("Kann nicht in ".$base.$entry.'/'.$tpl_location." schreiben\n"); } // Versuche, den Text in die Datei zu schreiben $ergebnis = file_put_contents($base.$entry.'/'.$tpl_location.$copy_file2, $html2); if ($ergebnis !== false) { echo $copy_file2." in ".$entry . " erzeugt\n"; } else { throw new Exception("Fehler beim Schreiben in die Datei ".$copy_file2); } } catch (Exception $e) { echo "Es gab einen Fehler: " . $e->getMessage(); } } // EOF - NEUE TEMPLATEFILES IN ALLE TEMPLATESETS SCHREIBEN exit; $path = DIR_FS_CATALOG.'admin/templates/'; function searchFilesInDirectory($directory, $searchString) { // Alle Dateien und Verzeichnisse im angegebenen Verzeichnis auflisten $files = scandir($directory); foreach ($files as $file) { // Ignoriere aktuelle und übergeordnete Verzeichnisse if ($file === '.' || $file === '..') { continue; } // Volle Pfade der Dateien und Verzeichnisse erstellen $filePath = $directory . DIRECTORY_SEPARATOR . $file; // Wenn es sich um ein Verzeichnis handelt, rekursiv aufrufen if (is_dir($filePath)) { searchFilesInDirectory($filePath, $searchString); } else { // Wenn es sich um eine Datei handelt, nach dem String suchen if (searchInFile($filePath, $searchString)) { echo "String gefunden in: " . $filePath . PHP_EOL; } } } } // Funktion zum Durchsuchen einer Datei nach dem String function searchInFile($filePath, $searchString) { // Den Inhalt der Datei lesen $fileContents = file_get_contents($filePath); // Wenn der String im Inhalt der Datei gefunden wird return strpos($fileContents, $searchString) !== false; } // Beispielaufruf $directory = $path; // Pfad zum Verzeichnis, das durchsucht werden soll $searchString = '{get_products_det'; // Der String, nach dem gesucht werden soll // Die Funktion aufrufen searchFilesInDirectory($directory, $searchString); exit; // BOF - AKTIVE USER MIT ANZAHL LAUFENDER AUKTIONEN $user = xtc_db_query( "SELECT user FROM ebay_auth WHERE environment='production'" ); $auctions = xtc_db_query( "SELECT id FROM ebay_auctions WHERE status='0'" ); die(xtc_db_num_rows($user).' User / '.xtc_db_num_rows($auctions).' Auktionen'); // EOF - AKTIVE USER MIT ANZAHL LAUFENDER AUKTIONEN exit; require_once('admin/includes/classes/class.ebay.php'); $EBAYAPI = new ebayApi; $user = xtc_db_query( "SELECT user FROM ebay_auth WHERE environment='production'" ); while($r = xtc_db_fetch_array($user)){ printf("\r\nUSER: %s\r\n",$r['user']); $res = $EBAYAPI->getNotificationPreferences($r['user']); echo $res->ApplicationDeliveryPreferences->ApplicationURL; echo "\r\n"; foreach($res->ApplicationDeliveryPreferences->DeliveryURLDetails as $D){ printf("\tDeliveryURL: %s (%s)\r\n",$D->DeliveryURL, $D->Status); } } exit; $q = xtc_db_query( "SELECT DISTINCT(ea.id) as ebay_auctions_id FROM ebay_auctions ea LEFT JOIN ebay_auctions_variations eav ON ea.id=eav.ebay_auctions_id LEFT JOIN products_collies pc ON eav.products_id=pc.products_id WHERE ea.products_id=0 AND ea.status=0 AND pc.products_id IS NOT NULL" ); echo xtc_db_num_rows($q). "Auktionen\r\n"; while($r = xtc_db_fetch_array($q)){ printf("%d\r\n",$r['ebay_auctions_id']); } exit; $q = xtc_db_query("ALTER TABLE ebay_multi_edit_price_revise ADD revise_status INT(1) NOT NULL COMMENT '1 wenn alter preis an ebay gesendet wurde' AFTER price;"); die('AKTUALISIERT'); exit; $q = xtc_db_query("SELECT COUNT(specials_id) as anz FROM specials WHERE status=0"); $r = xtc_db_fetch_array($q); printf("Anzahl Eintraege specials Status=0: %s\r\n",$r['anz']); $q = xtc_db_query("SELECT COUNT(specials_id) as anz FROM specials WHERE status=1"); $r = xtc_db_fetch_array($q); printf("Anzahl Eintraege specials Status=1: %s\r\n",$r['anz']); $q = xtc_db_query("SELECT COUNT(specials_id) as anz FROM specials WHERE sell_to_v1null=1"); $r = xtc_db_fetch_array($q); printf("Anzahl Eintraege specials sell_to_v1null=1: %s\r\n",$r['anz']); $q = xtc_db_query("SELECT COUNT(specials_id) as anz FROM specials WHERE ebay_price_revise=1 AND status=1"); $r = xtc_db_fetch_array($q); printf("Anzahl Eintraege specials ebay_price_revise=1 && status=1: %s\r\n",$r['anz']); $q = xtc_db_query("SELECT COUNT(specials_ebay_revise_id) as anz FROM specials_ebay_revise"); $r = xtc_db_fetch_array($q); printf("Anzahl Eintraege specials_ebay_revise: %s\r\n",$r['anz']); exit; /* UTF-8 KONVERTIERUNG - AUSGABE DER MYSQL BEFEHLE printf("mysqldump -u%s -p%s -h %s -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database -B %s > yes4trade_utf8.sql\r\n", DB_SERVER_USERNAME, str_replace('!',"\\!",DB_SERVER_PASSWORD), DB_SERVER, DB_DATABASE ); echo "\r\n"; printf("mysql -u%s -p%s -h %s --default-character-set=utf8 < yes4trade_utf8-fixed.sql\r\n", DB_SERVER_USERNAME, str_replace('!',"\\!",DB_SERVER_PASSWORD), DB_SERVER, DB_DATABASE, DB_DATABASE ); echo "\r\n"; exit; */ $q = xtc_db_query( "SELECT eapr.*,ea.status FROM ebay_auctions_price_revise eapr LEFT JOIN ebay_auctions ea ON ea.id=eapr.ebay_auctions_id WHERE eapr.ebay_id != ''" ); while($r = xtc_db_fetch_array($q)){ print_r($r); } $q = xtc_db_query( "SELECT eapra.*,ea.status,ea.ebay_id FROM ebay_auctions_price_revise_auctions eapra LEFT JOIN ebay_auctions ea ON ea.id=eapra.ebay_auctions_id" ); while($r = xtc_db_fetch_array($q)){ printf("Auktion #%s pID %s - vermutlich Sonderpreis gesetzt am %s\r\n", $r['ebay_id'], $r['products_id'], $r['date_added'] ); } exit; $str = "?>"; exec("grep '".$str."' ".DIR_FS_CATALOG.'includes/configure.php',$matches); if(sizeOf($matches)){ echo "\r\nshop config has php closing tag - fixed\r\n"; system("sed -i '/$str/d' ".DIR_FS_CATALOG."includes/configure.php"); echo "more ".DIR_FS_CATALOG."includes/configure.php\r\n"; exit; } exec("grep '".$str."' ".DIR_FS_CATALOG.'admin/includes/configure.php',$matches); if(sizeOf($matches)){ echo "\r\nadmin config has php closing tag - fixed\r\n"; system("sed -i '/$str/d' ".DIR_FS_CATALOG."admin/includes/configure.php"); echo "more ".DIR_FS_CATALOG."admin/includes/configure.php\r\n"; exit; } system("chmod 777 ".DIR_FS_CATALOG.'includes/configure.php'); system(sprintf("echo 'define(\"YES_SYSTEM_HOME_DIRECTORY\",\"%s\");' >> %s", $_SERVER['HOME'].DIRECTORY_SEPARATOR,DIR_FS_CATALOG.'includes/configure.php' )); system("chmod 444 ".DIR_FS_CATALOG.'includes/configure.php'); system("chmod 777 ".DIR_FS_CATALOG.'admin/includes/configure.php'); system(sprintf("echo 'define(\"YES_SYSTEM_HOME_DIRECTORY\",\"%s\");' >> %s", $_SERVER['HOME'].DIRECTORY_SEPARATOR,DIR_FS_CATALOG.'admin/includes/configure.php' )); system("chmod 444 ".DIR_FS_CATALOG.'admin/includes/configure.php'); $secure_path_parts = explode(DIRECTORY_SEPARATOR,DIR_FS_CATALOG); $last_part = ''; foreach($secure_path_parts as $p){ if(strlen($p) < 1) continue; $last_part = $p; } $secure_path = current(explode('/'.$last_part.'/',DIR_FS_CATALOG)).'/secure_files/'; if($secure_path == $_SERVER['HOME'].DIRECTORY_SEPARATOR.'secure_files/'){ echo "no need to change\r\n"; }else{ system(sprintf("mv %s %s/secure_files",$secure_path,$_SERVER['HOME'])); echo "Done, now updatecvs\r\n"; } exit; ## ## BOF - BASH RECURSION FILE CONTENT ## $file_content = "#!/bin/bash find . -type f |\ while IFS= read -r myfile do mystring=$(file -i ${myfile}) if [[ $mystring == *\"iso\"* ]]; then if [[ ${myfile} != *\"/CVS/\"* ]]; then if [[ ${myfile} != *\".#\"* ]]; then if [[ ${myfile} != *\"recursive.sh\"* ]]; then iconv -f ISO-8859-1 -t UTF-8//TRANSLIT ${myfile} -o ${myfile} fi fi fi fi done "; file_put_contents(realpath('./').'/RECURSIVE_ICONV.sh',$file_content); ## ## EOF - BASH RECURSION FILE CONTENT ## printf("mysqldump -u%s -p%s -h %s -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database --ignore-table=%s.ebay_email_bodys -B %s > yes4trade_utf8.sql\r\n", DB_SERVER_USERNAME, str_replace('!',"\\!",DB_SERVER_PASSWORD), DB_SERVER, DB_DATABASE, DB_DATABASE ); echo "\r\n cp yes4trade_utf8.sql yes4trade_utf8-fixed.sql ### SED VARIANTE ### sed -i 's/COLLATE latin1_german2_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_german1_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_swedish_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_general_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_german2_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_german2_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_german2_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/COLLATE latin1_german2_ci/ /g' ./yes4trade_utf8-fixed.sql sed -i 's/CHARACTER SET latin1_german1/CHARACTER SET utf8 COLLATE utf8_general/g' ./yes4trade_utf8-fixed.sql sed -i 's/CHARACTER SET latin1_german2/CHARACTER SET utf8 COLLATE utf8_general/g' ./yes4trade_utf8-fixed.sql sed -i 's/CHARACTER SET latin1_swedish/CHARACTER SET utf8 COLLATE utf8_general/g' ./yes4trade_utf8-fixed.sql sed -i 's/CHARACTER SET latin1_general/CHARACTER SET utf8 COLLATE utf8_general/g' ./yes4trade_utf8-fixed.sql sed -i 's/CHARACTER SET latin1/CHARACTER SET utf8 COLLATE utf8_general_ci/g' ./yes4trade_utf8-fixed.sql sed -i 's/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/g' ./yes4trade_utf8-fixed.sql \r\n\r\n"; printf("mysql -u%s -p%s < yes4trade_utf8-fixed.sql\r\n", DB_SERVER_USERNAME, DB_SERVER_PASSWORD ); echo "rm -f yes4trade_utf8-fixed.sql\r\n"; echo "# Konvertiere templates/ Dateien in UTF-8\r\n"; printf("cp -R %s %s\r\n", DIR_FS_CATALOG.DIRECTORY_SEPARATOR."templates/", DIR_FS_CATALOG.DIRECTORY_SEPARATOR."templates_utf8/" ); printf("cd %s\r\n",DIR_FS_CATALOG.DIRECTORY_SEPARATOR."templates_utf8/"); echo "find . -type f -exec sed -i 's/charset=iso-8859-1\"/charset=UTF-8\"/g' {} +\r\n"; echo "cp ~/RECURSIVE_ICONV.sh ./\r\n"; echo "./RECURSIVE_ICONV.sh\r\n"; echo "rm RECURSIVE_ICONV.sh\r\n"; echo "cd ..\r\n"; echo "#convert own_* Files in lang/\r\n"; echo "cd lang\r\n"; echo "find . -name \"own_*\" -exec iconv -f ISO-8859-1 -t UTF-8//TRANSLIT \"{}\" -o \"{}\" \\;\r\n"; exit; $query = xtc_db_query( "SELECT products_vpe_name FROM products_vpe" ); $total = xtc_db_num_rows($query); $known = 0; $unknown = array(); while($record = xtc_db_fetch_array($query)){ switch(strtolower($record['products_vpe_name'])){ case 'oz': case 'lb': case 'mg': case 'g': case 'kg': case 'floz': case 'pt': case 'qt': case 'gal': case 'ml': case 'cl': case 'l': case 'cbm': case 'in': case 'ft': case 'yd': case 'cm': case 'mm': case 'sqft': case 'sqm': case 'Stück': $known++; break; default: $unknown[] = $record['products_vpe_name']; break; } } printf("Insgesamt %s VPE Einheiten, davon %s google konform\r\n\r\n",$total,$known); if(sizeOf($unknown)){ echo "Einheiten die nicht den Google measure Vorgaben entsprechen:\r\n".implode(", ",$unknown)."\r\n\r\n------------------------------\r\n\r\n\r\n"; } exit; $db_export_file = 'yes4trade_utf8.sql'; function microtime_float(){ list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);} function human_filesize($bytes, $decimals = 2) { $sz = 'BKMGTP'; $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];} $time_start = microtime_float(); $cmd = sprintf("mysqldump -u%s -p%s -h%s -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database -B %s > %s", DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_SERVER, DB_DATABASE, $db_export_file ); system($cmd); $time_end = microtime_float(); $time = $time_end - $time_start; echo "In $time Sekunden DB exportiert (".human_filesize(filesize($db_export_file)).")\n"; exit; /** DB GROESSE $q = xtc_db_query('SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema'); $r = xtc_db_fetch_array($q); print_r($r); exit; **/ /** ZEIGE TABELLEN KOLLATIONEN $records = array(); $query = xtc_db_query("SHOW TABLE status like 'products_cha%'"); while($record = xtc_db_fetch_array($query)){ $records[] = $record; } foreach($records as $record){ $table = $record['Name']; $table_collation = $record['Collation']; $tab_info = sprintf("%s (%s): %s",$table,$record['Engine'],$record['Collation']); $errors = array(); $query = xtc_db_query(sprintf( "SHOW FULL COLUMNS FROM `%s`", $table )); while($record = xtc_db_fetch_array($query)){ if($record['Collation'] != '' and $table_collation != $record['Collation']){ $errors[] = sprintf("%s: %s",$record['Field'],$record['Collation']); } } if(sizeOf($errors)){ printf("%s\r\n\t%s\r\n",$tab_info,implode("\r\n\t",$errors)); } } die('WEITER NICHT!'); */ /** TABELLEN ADDRESS FELDER ERWEITERN $tables = array( 'address_book','orders','reclamations','retouren','shippings','customers','newsletter_recipients','reviews','whos_online' ); $filter = array( 'company','name','street','suburb','city' ); $nofilter = array('customers_status_name'); $null_values = array('suburb','company'); $target_size = 64; $target_size_company = 128; $matches = array(); foreach($tables as $table){ $q = xtc_db_query("SHOW COLUMNS FROM ".$table); while($record = xtc_db_fetch_array($q)){ foreach($filter as $f){ if(strstr($record['Field'],$f) and !in_array($record['Field'],$nofilter)){ preg_match('#\((.*?)\)#', $record['Type'], $match); $field_target_size = ($f == 'company') ? $target_size_company : $target_size; if((int)$match[1] >= (int)$field_target_size) continue; $null = in_array($f,$null_values) ? 'NULL' : 'NOT NULL'; //$matches[] = sprintf("#change field %s from %s to %s",$record['Field'],$match[1],$field_target_size); $matches[] = sprintf("ALTER TABLE %s CHANGE `%s` `%s` VARCHAR(%s) %s;",$table,$record['Field'],$record['Field'],$field_target_size,$null); } } } } $field_target_size = 64; $table = 'categories_description'; $null = 'NULL'; $q = xtc_db_query("SHOW COLUMNS FROM ".$table); while($record = xtc_db_fetch_array($q)){ if($record['Field'] == 'categories_name'){ preg_match('#\((.*?)\)#', $record['Type'], $match); if( (int)$match[1] < $field_target_size){ //$matches[] = sprintf("#change field %s from %s to %s",$record['Field'],$match[1],$field_target_size); $matches[] = sprintf("ALTER TABLE %s CHANGE `%s` `%s` VARCHAR(%s) %s;",$table,$record['Field'],$record['Field'],$field_target_size,$null); } } } foreach($matches as $sql){ xtc_db_query($sql); } printf("Es wurden %s SQL Queries abgesetzt\r\n",sizeOf($matches)); */ /** ** ------------------------------------------------------ ** ** BOF DB STATISTIKEN SAMMELN ** DIE STATISTIKDATEI BEFINDET SICH AM ENDE IN webseiten/DATAS/DB.csv ** ** ------------------------------------------------------ **/ $stat_server_url = 'https://agri.abcde.biz/DATAS/collect.php'; $file_name_with_full_path = DIR_FS_CATALOG.'admin/exportdata/DB.csv'; $stmt = xtc_db_query(sprintf('SELECT TABLE_NAME AS "Table", table_rows AS Quant_of_Rows, ROUND( (data_length + index_length) /1024, 2 ) AS Total_Size_Kb FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema = "%s" ORDER BY Total_Size_Kb DESC LIMIT 10', DB_DATABASE )); $SEPARATOR = "\t"; ob_start(); while($row = xtc_db_fetch_array($stmt)){ echo STORE_NAME.$SEPARATOR; echo implode($SEPARATOR,$row); echo "\r\n"; } $content = ob_get_contents(); ob_end_clean(); file_put_contents($file_name_with_full_path,$content); $post = array('extra_info' => STORE_NAME,'file_contents'=>'@'.$file_name_with_full_path); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$stat_server_url); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); unlink($file_name_with_full_path); echo $result; exit; /** ** ------------------------------------------------------ ** ** EOF DB STATISTIKEN SAMMELN ** ** ------------------------------------------------------ **/