concrete/src/Job/Job.php
public static function getAvailableList($includeConcreteDirJobs = 1)
    {
        $jobObjs = array();

        //get existing jobs
        $existingJobHandles = array();
        $existingJobs = static::getList();
        foreach ($existingJobs as $j) {
            $existingJobHandles[] = $j->getJobHandle();
        }

        if (!$includeConcreteDirJobs) {
            $jobClassLocations = array(DIR_FILES_JOBS);
        } else {
            $jobClassLocations = static::jobClassLocations();
        }

        foreach ($jobClassLocations as $jobClassLocation) {
            // Open a known directory, and proceed to read its contents
            if (is_dir($jobClassLocation)) {
                if ($dh = opendir($jobClassLocation)) {
                    while (($file = readdir($dh)) !== false) {
                        if (substr($file, strlen($file) - 4) != '.php') {
                            continue;
                        }

                        $alreadyInstalled = 0;
                        foreach ($existingJobHandles as $existingJobHandle) {
                            if (substr($file, 0, strlen($file) - 4) == $existingJobHandle) {
                                $alreadyInstalled = 1;
                                break;
                            }
                        }
                        if ($alreadyInstalled) {
                            continue;
                        }

                        $jHandle = substr($file, 0, strlen($file) - 4);
                        $className = static::getClassName($jHandle);
                        $jobObjs[$jHandle] = Core::make($className);
                        $jobObjs[$jHandle]->jHandle = $jHandle;
                    }
                    closedir($dh);
                }
            }
        }

        return $jobObjs;
    }
public static function getAvailableList($includeConcreteDirJobs = 1)
    {
        $jobObjs = array();

        //get existing jobs
        $existingJobHandles = array();
        $existingJobs = static::getList();
        foreach ($existingJobs as $j) {
            $existingJobHandles[] = $j->getJobHandle();
        }

        if (!$includeConcreteDirJobs) {
            $jobClassLocations = array(DIR_FILES_JOBS);
        } else {
            $jobClassLocations = static::jobClassLocations();
        }

        foreach ($jobClassLocations as $jobClassLocation) {
            // Open a known directory, and proceed to read its contents
            if (is_dir($jobClassLocation)) {
                if ($dh = opendir($jobClassLocation)) {
                    while (($file = readdir($dh)) !== false) {
                        if (substr($file, strlen($file) - 4) != '.php') {
                            continue;
                        }

                        $alreadyInstalled = 0;
                        foreach ($existingJobHandles as $existingJobHandle) {
                            if (substr($file, 0, strlen($file) - 4) == $existingJobHandle) {
                                $alreadyInstalled = 1;
                                break;
                            }
                        }
                        if ($alreadyInstalled) {
                            continue;
                        }

                        $jHandle = substr($file, 0, strlen($file) - 4);
                        $className = static::getClassName($jHandle);
                        $jobObjs[$jHandle] = Core::make($className);
                        $jobObjs[$jHandle]->jHandle = $jHandle;
                    }
                    closedir($dh);
                }
            }
        }

        return $jobObjs;
    }
public static function getAvailableList ( $ includeConcreteDirJobs = 1 ) { $ jobObjs = array ( ) ; //get existing jobs $ existingJobHandles = array ( ) ; $ existingJobs = static :: getList ( ) ; foreach ( $ existingJobs as $ j ) { $ existingJobHandles [ ] = $ j -> getJobHandle ( ) ; } if ( ! $ includeConcreteDirJobs ) { $ jobClassLocations = array ( DIR_FILES_JOBS ) ; } else { $ jobClassLocations = static :: jobClassLocations ( ) ; } foreach ( $ jobClassLocations as $ jobClassLocation ) { // Open a known directory, and proceed to read its contents if ( is_dir ( $ jobClassLocation ) ) { if ( $ dh = opendir ( $ jobClassLocation ) ) { while ( ( $ file = readdir ( $ dh ) ) !== false ) { if ( substr ( $ file , strlen ( $ file ) - 4 ) != '.php' ) { continue ; } $ alreadyInstalled = 0 ; foreach ( $ existingJobHandles as $ existingJobHandle ) { if ( substr ( $ file , 0 , strlen ( $ file ) - 4 ) == $ existingJobHandle ) { $ alreadyInstalled = 1 ; break ; } } if ( $ alreadyInstalled ) { continue ; } $ jHandle = substr ( $ file , 0 , strlen ( $ file ) - 4 ) ; $ className = static :: getClassName ( $ jHandle ) ; $ jobObjs [ $ jHandle ] = Core :: make ( $ className ) ; $ jobObjs [ $ jHandle ] -> jHandle = $ jHandle ; } closedir ( $ dh ) ; } } } return $ jobObjs ; }
Scan job directories for job classes
Scan job directories for job classes