HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/public_html/wp-content/plugins/depicter/app/src/Editor/Migrations/JobsQueue.php
<?php
namespace Depicter\Editor\Migrations;


class JobsQueue
{

	public function migrate(){
		$jobsList = \Depicter::storage()->filesystem()->scan(__DIR__);

		$latestExecutedJob = \Depicter::options()->get('last_document_migration', 0 );
		if ( $jobsList ) {
			foreach( $jobsList as $key => $job ) {
				if ( $job['name'] == 'JobsQueue.php' ) {
					continue;
				}
	
				$jobName = basename( $job['name'], '.php');
				$jobVersion = str_replace( 'Version', '', $jobName );
				if ( $jobVersion > $latestExecutedJob ) {
					$jobClassName = "Depicter\Editor\Migrations\\" . $jobName;
					( new $jobClassName() )->up();
					\Depicter::options()->set( 'last_document_migration', $jobVersion );
				}
			}
		}
	}
}