Пример #1
0
 /**
  * Get all custom endpoints
  * @return array - list of endpoint files loaded
  * @throws \Exception
  */
 public static function getCustomEndpoints()
 {
     self::requireConstants('APPLICATION_PATH', __FUNCTION__);
     $endpointsDirectory = APPLICATION_PATH . '/customs/endpoints';
     if (!file_exists($endpointsDirectory)) {
         return [];
     }
     return find_php_files($endpointsDirectory, true);
 }
Пример #2
0
 public function testFindFiles()
 {
     $this->createTempFiles();
     $path = $this->path;
     $filesFound = find_files($path, 0, '*');
     $this->assertSame(7, count($filesFound));
     $jsFilesFound = find_js_files($path);
     $this->assertSame(2, count($jsFilesFound));
     $htmlFilesFound = find_html_files($path);
     $this->assertSame(2, count($htmlFilesFound));
     $phpFilesFound = find_php_files($path);
     $this->assertSame(2, count($phpFilesFound));
     // Including subdirectories
     $filesFound = find_files($path, 0, '*', true);
     $this->assertSame(10, count($filesFound));
     $jsFilesFound = find_js_files($path, true);
     $this->assertSame(3, count($jsFilesFound));
     $htmlFilesFound = find_html_files($path, true);
     $this->assertSame(3, count($htmlFilesFound));
     $phpFilesFound = find_php_files($path, true);
     $this->assertSame(3, count($phpFilesFound));
     $this->assertInternalType('array', find_templates());
     $this->removeTempFiles();
 }