| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- class updater {
-
-
- static function dbconnect() {
- global $config;
- $conn = mysql_pconnect($config['db_host'],$config['db_username'],$config['db_password']);
- mysql_select_db($config['db_name'],$conn);
- return true;
- }
-
- static function check() {
- $xml = '<?xml version="1.0" encoding="UTF-8"?>';
-
- $res = mysql_query("select * from kreatin_updates where update_status='0';");
- if (mysql_num_rows($res)>0) {
- while ($row = mysql_fetch_array($res)) {
- $xml.= '<file>'
- . '<path>'.$row['update_file'].'</path>'
- . '<version>'.$row['update_version'].'</version>'
- . '</file>';
- }
-
- $fname = 'kreatin_core_updates_'.time().".xml";
- file_put_contents($fname,$xml);
-
- return 'http://kreatin.kreatio.hu/'.$fname;
- }
- else {
- return 'no updates';
- }
- }
-
-
- static function generateUpdateXML() {
-
- }
-
-
- static function sendXML() {
-
- }
-
-
- static function serverFiles() {
-
- }
-
-
- }
|