function cloud_schema() { $pars = _cloud_build_params(); $pars['method'] = 'application.schema'; $dat = cloud_request('http://v2.addons.we7.cc/gateway.php', $pars); $file = IA_ROOT . '/data/application.schema'; $ret = _cloud_shipping_parse($dat, $file); if (!is_error($ret)) { $schemas = array(); if (!empty($ret['schemas'])) { load()->func('db'); foreach ($ret['schemas'] as $remote) { $name = substr($remote['tablename'], 4); $local = db_table_schema(pdo(), $name); unset($remote['increment']); unset($local['increment']); if (empty($local)) { $schemas[] = $remote; } else { $diffs = db_schema_compare($local, $remote); if (!empty($diffs)) { $schemas[] = $remote; } } } } $ret['schemas'] = $schemas; } return $ret; }
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details. */ load()->func('file'); load()->model('cloud'); load()->func('communication'); if ($do == 'check') { $filetree = file_tree(IA_ROOT); $modify = array(); $unknown = array(); $lose = array(); $pars = _cloud_build_params(); $pars['method'] = 'application.build'; $pars['extra'] = cloud_extra_data(); $dat = cloud_request('http://v2.addons.we7.cc/gateway.php', $pars); $file = IA_ROOT . '/data/application.build'; $ret = _cloud_shipping_parse($dat, $file); foreach ($ret['files'] as $value) { $clouds[$value['path']]['path'] = $value['path']; $clouds[$value['path']]['checksum'] = $value['checksum']; } foreach ($filetree as $filename) { $file = str_replace(IA_ROOT, '', $filename); $ignore_list = array(strpos($file, '/data/tpl/') === 0, substr($file, -8) == 'map.json', strpos($file, '/data/logs') === 0, strpos($file, '/attachment') === 0, $file == '/data/config.php', strpos($file, '/data') === 0 && substr($file, -4) == 'lock', strpos($file, '/app/themes/default') === 0, $file == '/framework/version.inc.php'); if (in_array(true, $ignore_list)) { continue; } if (preg_match('/\\/addons\\/([a-zA-Z_0-9\\-]+)\\/.*/', $file, $match)) { $module = IA_ROOT . '/addons/' . $match[1]; if (file_exists($module . '/map.json')) { $maps = file_get_contents($module . '/map.json'); $maps = json_decode($maps, true);