forked from uup-dump/api
fetchupd.php: Adjust for the new fileinfo database
This commit is contained in:
parent
16b3bc786d
commit
9e3c1c574b
@ -18,6 +18,7 @@ limitations under the License.
|
|||||||
require_once dirname(__FILE__).'/shared/main.php';
|
require_once dirname(__FILE__).'/shared/main.php';
|
||||||
require_once dirname(__FILE__).'/shared/requests.php';
|
require_once dirname(__FILE__).'/shared/requests.php';
|
||||||
require_once dirname(__FILE__).'/shared/cache.php';
|
require_once dirname(__FILE__).'/shared/cache.php';
|
||||||
|
require_once dirname(__FILE__).'/shared/fileinfo.php';
|
||||||
require_once dirname(__FILE__).'/listid.php';
|
require_once dirname(__FILE__).'/listid.php';
|
||||||
|
|
||||||
function uupFetchUpd(
|
function uupFetchUpd(
|
||||||
@ -288,10 +289,9 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fileWrite = 'NO_SAVE';
|
$fileWrite = 'NO_SAVE';
|
||||||
if(!file_exists('fileinfo/'.$updateString.'.json')) {
|
if(!uupApiFileInfoExists($updateId)) {
|
||||||
consoleLogger('WARNING: This build is NOT in the database. It will be saved now.');
|
consoleLogger('WARNING: This build is NOT in the database. It will be saved now.');
|
||||||
consoleLogger('Parsing information to write...');
|
consoleLogger('Parsing information to write...');
|
||||||
if(!file_exists('fileinfo')) mkdir('fileinfo');
|
|
||||||
|
|
||||||
$fileList = preg_replace('/<Files>|<\/Files>/', '', $fileList[0]);
|
$fileList = preg_replace('/<Files>|<\/Files>/', '', $fileList[0]);
|
||||||
preg_match_all('/<File.*?<\/File>/', $fileList, $fileList);
|
preg_match_all('/<File.*?<\/File>/', $fileList, $fileList);
|
||||||
@ -349,7 +349,7 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
|
|||||||
consoleLogger('Successfully parsed the information.');
|
consoleLogger('Successfully parsed the information.');
|
||||||
consoleLogger('Writing new build information to the disk...');
|
consoleLogger('Writing new build information to the disk...');
|
||||||
|
|
||||||
$success = file_put_contents('fileinfo/'.$updateString.'.json', json_encode($temp)."\n");
|
$success = uupApiWriteFileinfo($updateString, $temp);
|
||||||
if($success) {
|
if($success) {
|
||||||
consoleLogger('Successfully written build information to the disk.');
|
consoleLogger('Successfully written build information to the disk.');
|
||||||
$fileWrite = 'INFO_WRITTEN';
|
$fileWrite = 'INFO_WRITTEN';
|
||||||
|
Loading…
Reference in New Issue
Block a user