Set_Up_Automator::get_integrations_autoload_directories()

Sets all trigger, actions, and closure classes directories


Source Source

File: src/core/classes/class-set-up-automator.php

	public function get_integrations_autoload_directories() {
		//$integrations = get_transient( 'automator_get_all_integrations' );
		$integrations = array();
		$directory    = UA_ABSPATH . 'src' . DIRECTORY_SEPARATOR . 'integrations';
		if ( empty( $integrations ) ) {
			try {
				$integrations = self::read_directory( $directory );
			} catch ( Exception $e ) {
				throw new Automator_Exception( $e->getTraceAsString() );
			}
			$integrations           = apply_filters_deprecated( 'uncanny_automator_integrations', array( $integrations ), '3.0', 'automator_integrations_setup' );
			self::$all_integrations = apply_filters( 'automator_integrations_setup', $integrations );
			set_transient( 'automator_get_all_integrations', self::$all_integrations, 5 * MINUTE_IN_SECONDS );
		} else {
			self::$all_integrations = apply_filters( 'automator_integrations_setup', $integrations );
		}

		return self::extract_integration_folders( self::$all_integrations, $directory );
	}