Get all of the events on the schedule that are due.

@param  \Nova\Foundation\Application  $app
@return array
174231
public function dueEvents(Application $app)
    {
        return array_filter($this->events, function ($event) use ($app)
        {
            return $event->isDue($app);
        });
    }
612025
public function bootstrap(Application $app)
    {
        $items = [];

        // First we will see if we have a cache configuration file. If we do, we'll load
        // the configuration items from that file so that it is very quick. Otherwise
        // we will need to spin through every configuration file and load them all.
        if (file_exists($cached = $app->getCachedConfigPath())) {
            $items = require $cached;

            $loadedFromCache = true;
        }

        // Next we will spin through all of the configuration files in the configuration
        // directory and load each one into the repository. This will make all of the
        // options available to the developer for use in various parts of this app.
        $app->instance('config', $config = new Repository($items));

        if (! isset($loadedFromCache)) {
            $this->loadConfigurationFiles($app, $config);
        }

        // Finally, we will set the application's environment based on the configuration
        // values that were loaded. We will pass a callback which will be used to get
        // the environment in a web context where an "--env" switch is not present.
        $app->detectEnvironment(function () use ($config) {
            return $config->get('app.env', 'production');
        });

        date_default_timezone_set($config->get('app.timezone', 'UTC'));

        mb_internal_encoding('UTF-8');
    }
648181
public static function getEventManager($app)
    {
        if (self::$_eventManager) {
            return self::$_eventManager;
        }
        foreach ($app->components as $name => $config) {
            $class = is_string($config) ? $config : @$config['class'];
            if($class == str_replace('Bootstrap', 'Manager', get_called_class())){
                return self::$_eventManager = $app->$name;
            }
        }
        $eventFile = \Yii::getAlias('@app/config/_events.php');
        $app->setComponents([
            'eventManager' => [
                'class'  => 'bariew\eventManager\EventManager',
                'events' => file_exists($eventFile) && is_file($eventFile)
                    ? include $eventFile 
                    : []
            ],
        ]);
        return self::$_eventManager = $app->eventManager;
    }
199903
protected function getConfigurationFiles(ApplicationContract $app): array
    {
        $files = [];

        $configPath = $app->configPath();

        $configFiles = Finder::create()
            ->files()
            ->name('*.php')
            ->in($configPath);

        foreach ($configFiles as $file) {
            $directory = $this->getNestedDirectory($file, $configPath);
            $files[$directory.basename($file->getPathname(), '.php')] = $file->getPathname();
        }

        ksort($files, SORT_NATURAL);

        return $files;
    }
728741
public function connect(Application $app)
    {
        $controllers = $app['controllers_factory'];

        $handler = function ($resource) use ($app) {
            if ($app['logger']) {
                $app['logger']->debug(sprintf('Appending a trailing slash for the request to `/%s`.', $resource));
            }

            $currentRequest = $app['request_stack']->getCurrentRequest();
            $request = Request::create(
                '/' . $resource . '/',
                $currentRequest->getMethod(),
                [],
                $currentRequest->cookies->all(),
                $currentRequest->files->all(),
                $currentRequest->server->all(),
                $currentRequest->getContent()
            );
            $request = $request->duplicate(
                $currentRequest->query->all(),
                $currentRequest->request->all()
            );
            $request->headers->replace($currentRequest->headers->all());

            // Make an internal sub-request based off the request that would have 404'd.
            // http://silex.sensiolabs.org/doc/usage.html#forwards
            return $app->handle($request, HttpKernelInterface::SUB_REQUEST);
        };

        /**
         * Register the catch-all route.
         *
         * Use a look behind assertion to ensure we only match routes
         * with no trailing slash.
         *
         * @link https://stackoverflow.com/questions/16398471/regex-not-ending-with
         */
        $controllers->match('/{resource}', $handler)
                    ->assert('resource', '.*(?<!\/)$')
                    ->bind('no_trailing_slash_handler');

        return $controllers;
    }
599518
protected function defineControllers(Application $app)
    {
        $this->createController('/payone', 'payone-index', 'Payone', 'index', 'index')->method('POST');
        $this->createController('/payone/getfile', 'payone-getfile', 'payone', 'index', 'getFile')->method('GET|POST');
        $this->createController('/payone/regular-redirect-payment-cancellation', 'payone-cancel-redirect', 'Payone', 'index', 'cancelRedirect')->method('GET');
        $this->createController('/payone/getinvoice', 'payone-getinvoice', 'Payone', 'index', 'getInvoice')->method('GET');
        $this->createController(
            static::EXPRESS_CHECKOUT_BUTTON_PATH,
            static::EXPRESS_CHECKOUT_BUTTON,
            'payone',
            'expressCheckout',
            'checkoutWithPaypalButton'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_INIT_PATH,
            static::EXPRESS_CHECKOUT_INIT,
            'payone',
            'expressCheckout',
            'initPaypalExpressCheckout'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_LOAD_DETAILS_PATH,
            static::EXPRESS_CHECKOUT_LOAD_DETAILS,
            'payone',
            'expressCheckout',
            'loadPaypalExpressCheckoutDetails'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_FAILURE_PATH,
            static::EXPRESS_CHECKOUT_FAILURE,
            'payone',
            'expressCheckout',
            'failure'
        )->method('GET');

        $this->createController(
            static::EXPRESS_CHECKOUT_BACK_PATH,
            static::EXPRESS_CHECKOUT_BACK,
            'payone',
            'expressCheckout',
            'back'
        )->method('GET');
    }
656210
private function callAppEvent(AbstractApp $app, string $event)
    {
        if (method_exists($app, $event)) {
            return call_user_func([
                $app,
                $event
            ]);
        }
    }
784505
public function all($app = NULL) : Array
    {
        if( ! is_string($app) )
        {
            if( $app === NULL )
            {
                $MLFiles = $this->getMLFiles();
            }
            elseif( is_array($app) )
            {
                $MLFiles = $app;
            }
            else
            {
                return false;
            }

            $allMLFiles = [];

            if( ! empty($MLFiles) ) foreach( $MLFiles as $file )
            {
                $removeExtension = $this->removeExtension($file);
                $allMLFiles[$removeExtension] = $this->all($removeExtension);
            }

            return $allMLFiles;
        }
        else
        {
            if( is_file($createFile = $this->_langFile($app)) )
            {
                $read = file_get_contents($createFile);

                return json_decode($read, true);
            }   

            return [];
        }
    }
643865
protected function getEvents() {
        if (!$this->_events) {
            $this->_events = new EventList($this->version, $this->solution['sid']);
        }

        return $this->_events;
    }
1282272
public function retrieveCalendarEvents(){
        
        $select = $this->tableGateway->getSql()->select();
        // preparing columns for calendar ui
        // as defined column name for calendar ui
        $select->columns(
            array(
                new \Zend\Db\Sql\Expression('cal_id AS id'),
                new \Zend\Db\Sql\Expression('CONCAT(cal_id," : ",cal_event_title) AS title'),
                new \Zend\Db\Sql\Expression('cal_date_start AS start'),
                new \Zend\Db\Sql\Expression('cal_date_end AS end'),
            ));
        $dataCalendar = $this->tableGateway->selectWith($select);
        
        return $dataCalendar;
    }
345592
public function getSchedule()
    {
        $list = [];

        foreach ($this->schedule as $time => $jobs) {
            foreach ($jobs as $job) {
                $list[$time][] = $job->getId();
            }
        }

        return $list;
    }
712603
public function run(Application $app)
    {
        $this->trigger(self::EVENT_BEFORE_RUN);
        if (count($this->_afterCallbacks) > 0) {
            $this->runCommandInForeground($app);
        } else {
            $this->runCommandInBackground($app);
        }
        $this->trigger(self::EVENT_AFTER_RUN);
    }
1216844
public function getAvailableApps()
    {
        $em = $this->getServiceManager()->get('playgroundfacebook_doctrine_em');

        $query = $em->createQuery('SELECT f FROM PlaygroundFacebook\Entity\App f WHERE f.isAvailable = true ORDER BY f.updatedAt DESC');
        $apps = $query->getResult();

        return $apps;
    }
332772
public function findApplicableRoles()
    {
        $widget = $this->widget;
        $array = [];
        foreach ($this->availableRoles as $role) {
            if ($widget->isApplicable($role)) {
                $array[] = $role;
            }
        }
        return $array;
    }
66124
protected function getEvents()
    {
        $events = [];

        foreach ($this->laravel->getProviders(EventServiceProvider::class) as $provider) {
            $providerEvents = array_merge($provider->discoverEvents(), $provider->listens());

            $events = array_merge_recursive($events, $providerEvents);
        }

        return $events;
    }
633131
protected function filtersPass(Application $app)
	{
		if (($this->filter && ! $app->call($this->filter)) ||
			 $this->reject && $app->call($this->reject))
		{
			return false;
		}

		return true;
	}
205513
public function connect(Application $app)
    {
        /** @var ControllerCollection $controllers */
        $controllers = $app['controllers_factory'];
        $controllers->get('/', 'oauth.controller::signinRedirect');
        $controllers->get('/signin', 'oauth.controller::signinGet');
        $controllers->post('/signin', 'oauth.controller::signinPost');
        $controllers->post('/authorize', 'oauth.controller::authorize');
        $controllers->get('/access_token', 'oauth.controller::accessToken');
        $controllers->post('/access_token', 'oauth.controller::accessToken');
        $controllers->get('/token', 'oauth.controller::tokenInfo');

        return $controllers;
    }