Devogera uma lista com os arquivos php
contidos no diretório especificado.

@param  string $destiny
@return array
490170
protected function makeIndex(string $path) : array
    {
        $index = [];

        $list = scandir($path);
        foreach ($list as $item) {

            if (in_array($item, ['.', '..']) ) {
                continue;
            }

            $iterator_index_item = $path . DIRECTORY_SEPARATOR . $item;

            if (is_link($iterator_index_item)) {
                // LINKS
                // são ignorados neste ponto
                continue;

            } elseif (is_file($iterator_index_item) == true) {

                if ($this->isPhpFilename($iterator_index_item) == true) {
                    $index[] = $iterator_index_item;
                } else {
                    // Arquivos não-PHP
                    // são ignorados neste ponto
                    continue;
                }

            } elseif (is_dir($iterator_index_item) ) {
                // DIRETÓRIOS
                $list = $this->makeIndex($iterator_index_item);
                foreach ($list as $file) {
                    $index[] = $file;
                }
            }
        }

        return $index;
    }
542136
public function getList()
    {
        $pageType = $this->params('pageType', PageTypes::NORMAL);
        $pageId = $this->params('pageId', null);

        /** @var \Rcm\Validator\Page $validator */
        $validator = clone($this->getServiceLocator()->get(\Rcm\Validator\Page::class));
        $validator->setPageType($pageType);

        $return = [
            'valid' => true
        ];

        if (!$validator->isValid($pageId)) {
            $return['valid'] = false;
            $return['error'] = $validator->getMessages();

            /** @var \Zend\Http\Response $response */
            $response = $this->response;

            $errorCodes = array_keys($return['error']);

            foreach ($errorCodes as &$errorCode) {
                if ($errorCode == $validator::PAGE_EXISTS) {
                    $response->setStatusCode(409);
                    break;
                } elseif ($errorCode == $validator::PAGE_NAME) {
                    $response->setStatusCode(417);
                }
            }
        }

        return new JsonModel($return);
    }
489751
public function listDeployments(string $sha = null, string $ref = null, string $task = null,
                                    string $environment = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
            http_build_query(['sha' => $sha, 'ref' => $ref, 'task' => $task, 'environment' => $environment])));
    }
885121
public function getScopes(SessionEntity $session)
    {
        // TODO: Check this before pushing
        $result = $this->getConnection()->table('oauth_session_scopes')
                  ->select('oauth_scopes.*')
                  ->join('oauth_scopes', 'oauth_session_scopes.scope_id', '=', 'oauth_scopes.id')
                  ->where('oauth_session_scopes.session_id', $session->getId())
                  ->get();

        $scopes = [];

        foreach ($result as $scope) {
            $scopes[] = (new ScopeEntity($this->getServer()))->hydrate([
                'id' => $scope->id,
                'description' => $scope->description,
            ]);
        }

        return $scopes;
    }
4540
public function getDirectives()
    {
        return [
            'lang' => [$this, 'translate'],
            'translate' => [$this, 'translate'],
            'sprintf' => [$this, 'sprintf'],
            'plural' => [$this, 'plural'],
            'choice' => [$this, 'plural'],
            'messages' => [$this, 'messages'],
            'widget' => [$this, 'widget'],
            'route' => [$this, 'route'],
            'formToken' => [$this, 'formToken'],

            // Authorisation
            'auth' => [$this, 'auth'],
            'can' => [$this, 'auth'],
            'cannot' => [$this, 'cannot'],
            'endcan' => [$this, 'endauth'],
            'endcannot' => [$this, 'endauth'],
            'endauth' => [$this, 'endauth'],

            // Asset
            'css' => [$this, 'css'],
            'js' => [$this, 'js'],
            'assetTemplate' => [$this, 'assetTemplate'],
            'endTemplate' => [$this, 'endTemplate'],
            'attr' => [$this, 'attr'],

            // Debug
            'shown' => [$this, 'shown'],
            'dd' => [$this, 'dd'],
            'ds' => [$this, 'ds'],
            'die' => [$this, 'dead'],
            'debug' => [$this, 'debug'],
            'enddebug' => [$this, 'endauth'],
        ];
    }
604284
public function getIndexAliases($index)
    {
        $responseData = $this->db->get([$index, '_alias', '*']);
        if (empty($responseData)) {
            return [];
        }

        return $responseData[$index]['aliases'];
    }
870454
public function getMenuEntries($location = null)
    {
        $runtimeManager = $this->framework->getRuntimeManager();

        // Give the modules the opportunity to add additional menu entries
        $runtimeManager->executeEvent('\\Zepi\\Web\\General\\Event\\MenuManager\\RegisterAdditionalMenuEntries');
        
        if ($location === null) {
            return $this->menuEntries;
        }
        
        // If this location does not exists, return an empty array
        if (!isset($this->menuEntries[$location])) {
            return array();
        }
        
        // Execute the event
        $menuEntries = $runtimeManager->executeFilter('\\Zepi\\Web\\General\\Filter\\MenuManager\\FilterMenuEntries', $this->menuEntries[$location]);
        
        return $menuEntries;
    }
720228
public function streamsFollowed($token = null)
    {
        $token = $this->getToken($token);

        $streams = $this->client->get('https://api.twitch.tv/kraken/streams/followed?oauth_token=' . $token);

        return $streams->json();
    }
847059
public function menu($trans = true)
    {
        $menu = [];

        foreach ($this->items as $date => $log) {
            /** @var \Arcanedev\LogViewer\Entities\Log $log */
            $menu[$date] = $log->menu($trans);
        }

        return $menu;
    }
128252
public function getCatalogs($locale = null, $domain = null) {
		$cache = $this->getCacheFrontend();
		
		if (is_array($locale)) {
			$catalogs = $cache->getMany($locale);
			
			return empty($catalogs) ? null : $catalogs;
		}
		
		$catalogs = $cache->get($locale);
		
		if ($catalogs === null) {
			return;
		}
		
		return [$locale => $catalogs];
	}
1301122
public function getList()
    {
        $service = $this->getDomainService();
        $appId = $this->getEvent()
            ->getRouteMatch()
            ->getParam('appId');
        
        $origin = parse_url($this->getRequest()->getHeader('Referer'));
        $uri = $this->getRequest()->getUri();
        $domainId = $uri->getHost();
        if (isset($origin['query'])) {
            parse_str($origin['query'], $query);
            $domainId = $query['xdm_e'];
        }
        
        $domain = $service->getDomainMapper()->findOneBy(array(
            'domain' => $domainId
        ));
        
        $stories = array();
        
        if ($domain) {
            $storymappings = $domain->getStoryMappings();
            foreach ($storymappings as $sm) {
                $conditions = array();
                $events = array(
                    'before' => array(),
                    'after' => array()
                );
                $objects = array();
                
                $i = 0;
                foreach ($sm->getObjects() as $objectMapping) {
                    $objects[$i]['id'] = $objectMapping->getObject()->getCode();
                    $attributes = array();
                    foreach ($objectMapping->getAttributes() as $attributeMapping) {
                        $attributes[] = array(
                            'name' => $attributeMapping->getAttribute()->getCode(),
                            'xpath' => $attributeMapping->getXpath()
                        );
                    }
                    $objects[$i]['properties'] = $attributes;
                    ++ $i;
                }
                
                if ($sm->getConditionsUrl() != '') {
                    $conditions['url'] = $sm->getConditionsUrl();
                }
                
                if ($sm->getConditionsXpath() != '') {
                    $conditions['xpath'] = $sm->getConditionsXpath();
                }
                
                if ($sm->getEventBeforeUrl() != '') {
                    $events['before']['url'] = $sm->getEventBeforeUrl();
                }
                
                if ($sm->getEventBeforeXpath() != '') {
                    $events['before']['xpath'] = $sm->getEventBeforeXpath();
                }
                
                if ($sm->getEventAfterUrl() != '') {
                    $events['after']['url'] = $sm->getEventAfterUrl();
                }
                
                if ($sm->getEventAfterXpath() != '') {
                    $events['after']['xpath'] = $sm->getEventAfterXpath();
                }
                
                $stories[$sm->getStory()->getCode()] = array(
                    'story_mapping_id' => $sm->getId(),
                    'events' => $events,
                    'conditions' => $conditions,
                    'objects' => $objects
                );
            }
        }
        
        $response = $this->getResponse();
        $contentType = 'application/json';
        $adapter = '\Zend\Serializer\Adapter\Json';
        $response->getHeaders()->addHeaderLine('Content-Type', $contentType);
        $adapter = new $adapter();
        
        $content = array(
            'library' => array(
                'config' => array(
                    'broadcast' => false
                ),
                'stories' => $stories
            )
        );
        
        $response->setContent($adapter->serialize($content));
        
        return $response;
    }
985243
public function listExtensions($type)
    {
        $results = [];

        if ($this->items === null) {
            $this->loadExtensions();
        }

        if (isset($this->items[$type]) && is_array($this->items[$type])) {
            $results = $this->items[$type];
        }

        if ($this->transactionItems !== null && isset($this->transactionItems[$type])) {
            $results = array_merge($results, $this->transactionItems[$type]);
        }

        return $results;
    }
632153
public function getAllDeliveryIds()
    {
        $returnValue = array();
        $sql = 'SELECT ' . self::RESULTS_TABLE_ID . ', ' . self::DELIVERY_COLUMN . ' FROM ' . self::RESULTS_TABLENAME;
        $results = $this->getPersistence()->query($sql);
        foreach ($results as $value) {
            $returnValue[] = array(
                "deliveryResultIdentifier" => $value[self::RESULTS_TABLE_ID],
                "deliveryIdentifier" => $value[self::DELIVERY_COLUMN]
            );
        }
        return $returnValue;
    }
251903
public static function getEntityNotAllow(): array
    {
        $file = [];
        if (file_exists(PATH_HOME . "public/entity/-entity.json"))
            $file = json_decode(file_get_contents(PATH_HOME . "public/entity/-entity.json"), true);

        foreach (Helper::listFolder(PATH_HOME . VENDOR) as $lib) {
            if (file_exists(PATH_HOME . VENDOR . "{$lib}/public/entity/-entity.json")) {
                $json = json_decode(file_get_contents(PATH_HOME . VENDOR . "{$lib}/public/entity/-entity.json"), true);
                foreach ($json as $setor => $info) {
                    foreach ($info as $entity) {
                        if (file_exists(PATH_HOME . VENDOR . "{$lib}/public/entity/cache/{$entity}.json")) {
                            if ($setor === "*") {
                                for ($e = 0; $e < 20; $e++) {
                                    //Adiciona entidade ao setor
                                    if (!isset($file[$e]) || !in_array($entity, $file[$e]))
                                        $file[$e][] = $entity;
                                }
                            } else {
                                //Adiciona entidade ao setor
                                if (!in_array($entity, $file[$setor]))
                                    $file[$setor][] = $entity;
                            }
                        }
                    }
                }
            }
        }

        return $file;
    }
307992
public function getSiteAccessesByMandatorId($mandatorId = null)
    {
        if ($mandatorId === null) {
            return array($this->siteAccess->name);
        }

        $siteAccesses = array();

        foreach ($this->siteAccessConfig as $siteAccessName => $config) {
            if (!isset($config['yoochoose']['customer_id']) || (int)$config['yoochoose']['customer_id'] !== $mandatorId) {
                continue;
            }

            $siteAccesses[$siteAccessName] = $siteAccessName;

            if ($this->isDefaultSiteAccessChanged()
                && $this->isSiteAccessSameAsSystemDefault($siteAccessName)
                && $this->isMandatorIdConfigured($mandatorId)
            ) {
                // default siteAccess name is changed and configuration should be adjusted
                $siteAccesses[$this->defaultSiteAccessName] = $this->defaultSiteAccessName;
            }
        }

        if (empty($siteAccesses)) {
            throw new NotFoundException('configuration for eZ Recommendation', "mandatorId: {$mandatorId}");
        }

        return array_values($siteAccesses);
    }
87702
public static function getServicesList()
    {
        $map = [
          'GET' => 'get',
          'POST' => 'create',
          'PUT' => 'update',
          'DELETE' => 'delete',
        ];
        
        $table = new \Console_Table();
        $table->setHeaders(['Method', 'Type', 'Description', 'Parameters']);
        foreach (self::getServices() as $key => $service) {
            if ($service['type'] == 'entity') {
                foreach ($service['actions'] as $action) {
                    $table->addRow([
                        sprintf('xAC::%s()->%s()'
                            , $service['endpoint']
                            , $action['endpoint'] == 'default' ? $map[$action['method']] : $action['endpoint']
                            ), 
                        'entity/' . $action['type'], 
                        $action['description']
                    ]);
                }
            } else {
                $table->addRow(['xAC::' . $service['endpoint'] . '()->get()', $service['type'], $service['description']]);
            }
        }
        
        echo $table->getTable();
    }
1125998
protected function getSiteResources(Site $site)
    {
        $primaryDomain = $site->getDomain();

        if (empty($primaryDomain)) {
            // no resources if domain missing
            return array();
        }

        $primaryDomainName = $primaryDomain->getDomainName();
        $siteId = $site->getSiteId();

        $sitesResourceId = $this->resourceName->get(self::RESOURCE_SITES);
        $siteResourceId = $this->resourceName->get(self::RESOURCE_SITES, $siteId);

        $return[$siteResourceId] = [
            'resourceId' => $siteResourceId,
            'parentResourceId' => $sitesResourceId,
            'name' => $primaryDomainName,
            'description' => "Resource for site '{$primaryDomainName}'"
        ];

        $return[$siteResourceId] = array_merge(
            $this->resources[$sitesResourceId],
            $return[$siteResourceId]
        );

        $pagesResourceId = $this->resourceName->get(self::RESOURCE_SITES, $siteId, self::RESOURCE_PAGES);

        $return[$pagesResourceId] = [
            'resourceId' => $pagesResourceId,
            'parentResourceId' => $siteResourceId,
            'name' => $primaryDomainName . ' - pages',
            'description' => "Resource for pages on site '{$primaryDomainName}'"
        ];

        $return[$pagesResourceId] = array_merge(
            $this->resources[self::RESOURCE_PAGES],
            $return[$pagesResourceId]
        );

        $pages = $site->getPages();

        /** @var \Rcm\Entity\Page $page */
        foreach ($pages as &$page) {
            $pageResources = $this->getPageResources($page, $site);
            $return = array_merge($pageResources, $return);
        }

        return $return;
    }