Callback used ezcBaseFile

@param string $ezpAutoloadFileFindContext
@param string $sourceDir
@param string $fileName
@param string $fileInfo
@return void
489681
public static function findRecursiveCallback( ezpAutoloadFileFindContext $context, $sourceDir, $fileName, $fileInfo )
    {
        if ( $fileInfo['mode'] & 0x4000 )
        {
            return;
        }

        // update the statistics
        $context->elements[] = $sourceDir . DIRECTORY_SEPARATOR . $fileName;
        $context->count++;

        $context->generator->updateProgressOutput( eZAutoloadGenerator::OUTPUT_PROGRESS_PHASE1 );
    }
1085816
public function _savePageSource($filename)
    {
        if (!isset($this->webDriver)) {
            $this->debug('WebDriver::_savePageSource method has been called when webDriver is not set');
            return;
        }
        try {
            file_put_contents($filename, $this->webDriver->getPageSource());
        } catch (\Exception $e) {
            $this->debug('Unable to retrieve source page from Selenium : ' . $e->getMessage());
        }
    }
27610
static function copy( $sourceFilename, $destinationFilename )
    {
        if ( is_dir( $sourceFilename ) )
        {
            eZDebug::writeError( "Unable to copy directory $sourceFilename, use eZDir::copy instead", __METHOD__ );
            return false;
        }
        $sourceFD = @fopen( $sourceFilename, 'rb' );
        if ( !$sourceFD )
        {
            eZDebug::writeError( "Unable to open source file $sourceFilename in read mode", __METHOD__ );
            return false;
        }
        if ( is_dir( $destinationFilename ) )
        {
            $dirPosition = strrpos( $sourceFilename, '/' );
            $filePosition = 0;
            if ( $dirPosition !== false )
                $filePosition = $dirPosition + 1;
            if ( strlen( $destinationFilename ) > 0 and
                 $destinationFilename[strlen( $destinationFilename ) - 1] == '/' )
                $destinationFilename .= substr( $sourceFilename, $filePosition );
            else
                $destinationFilename .= '/' . substr( $sourceFilename, $filePosition );
        }

        // If source and destination are the same files we just return true
        if ( $sourceFilename == $destinationFilename )
        {
            @fclose( $sourceFD );
            return true;
        }

        $destinationFD = fopen( $destinationFilename, 'wb' );
        chmod( $destinationFilename, octdec( eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' ) ) );
        if ( !$destinationFD )
        {
            @fclose( $sourceFD );
            eZDebug::writeError( "Unable to open destination file $destinationFilename in write mode", __METHOD__ );
            return false;
        }
        $bytesCopied = 0;
        do
        {
            $data = fread( $sourceFD, 4096 );
            if ( strlen( $data ) == 0 )
                break;
            fwrite( $destinationFD, $data );
            $bytesCopied += strlen( $data );
        } while( true );

        @fclose( $sourceFD );
        @fclose( $destinationFD );
        return true;
    }
922620
protected function initializeFileLoader(FileLoader $fileLoader = null)
    {
        if (!isset($this->fileLoader)) {
            $this->setFileLoader(($fileLoader) ? $fileLoader : new FileLoader());
        }
    }
1170208
public static function GetXmlReaderInstanceForSourceFile($filePath, $fileName = null) {
        if (!isset($fileName)) {
            $fileName = substr($filePath, strrpos($filePath, "/") + 1);
        }
        $xmlFilesLoaded = apc_fetch(\Puzzlout\Framework\Enums\CacheKeys::XmlFilesLoaded);
        if (array_key_exists($fileName, $xmlFilesLoaded)) {
            $this->xmlReader = $xmlFilesLoaded[$fileName];
        } else {
            $this->xmlReader = isset($fileName) ?
                    new \Puzzlout\Framework\Core\XmlReader(null, $configFileName) :
                    new \Puzzlout\Framework\Core\XmlReader($filePath);
            $xmlFilesLoaded[$configFileName] = $this->xmlReader;
            apc_add(\Puzzlout\Framework\Enums\CacheKeys::XmlFilesLoaded, $xmlFilesLoaded);
        }
    }
829259
private function findSourceFilesFromList(array $filenames): void
  {
    foreach ($filenames as $filename)
    {
      if (!file_exists($filename))
      {
        $this->io->error(sprintf("File not exists: '%s'", $filename));
        $this->errorFilenames[] = $filename;
      }
      else
      {
        $routineName     = pathinfo($filename, PATHINFO_FILENAME);
        $this->sources[] = ['path_name'    => $filename,
                            'routine_name' => $routineName,
                            'method_name'  => $this->methodName($routineName)];
      }
    }
  }
140011
protected function buildResourceWatcher($sourceDir, $destinationDir)
    {
        $fs = new Filesystem();
        $relativeDestination = rtrim($fs->makePathRelative($destinationDir, $sourceDir), '/');

        $finder = new Finder();
        $finder->files()
            ->name('*.*')
            ->in($sourceDir);

        if (false === strpos($relativeDestination, '..')) {
            $finder->exclude($relativeDestination);
        }

        $rc = new ResourceCacheMemory();
        $rw = new ResourceWatcher($rc);
        $rw->setFinder($finder);

        return $rw;
    }
103919
public function file_exists($contextid, $component, $filearea, $itemid, $filepath, $filename) {
        $filepath = clean_param($filepath, PARAM_PATH);
        $filename = clean_param($filename, PARAM_FILE);

        if ($filename === '') {
            $filename = '.';
        }

        $pathnamehash = $this->get_pathname_hash($contextid, $component, $filearea, $itemid, $filepath, $filename);
        return $this->file_exists_by_hash($pathnamehash);
    }
1230120
public function addSource($filename, $source, $fileData)
    {
        $this->_sources[substr($filename, strlen($this->_phpdoctor->sourcePath()) + 1)] = array(
            $source, $fileData
        );
    }
142660
private void processFileSet(FileSet fileSet, RuleSet ruleSet, ExecutorService pool) {
        DirectoryScanner dirScanner = fileSet.getDirectoryScanner(project);
        File baseDir = fileSet.getDir(project);
        String[] includedFiles = dirScanner.getIncludedFiles();

        if (includedFiles == null || includedFiles.length == 0) {
            LOG.info("No matching files found for FileSet with basedir [" + baseDir + "]");
            return;
        }

        for (String filePath : includedFiles) {
            Runnable task = buildTask(baseDir, filePath, ruleSet);
            pool.submit(task);
        }
    }
15060
public function uploadFile(string $name, string $filename): void
    {
        $sourceFile = FilePath::parse($filename);
        if (!file_exists($sourceFile->__toString())) {
            throw new InvalidUploadedFileException('File "' . $sourceFile . '" does not exist.');
        }

        $destinationFile = tempnam(sys_get_temp_dir(), 'php');
        copy($sourceFile->__toString(), $destinationFile);

        $this->setUploadedFile(
            $name,
            new UploadedFile(
                FilePath::parse($destinationFile),
                $sourceFile->__toString(),
                filesize($destinationFile)
            )
        );
    }
858049
public function validateFile(File $file, $sourceFilePath = null)
	{
		$result = $this->checkList($file->getExtension());
		
		if( ! $result) {
			$message = 'File extension "'.$file->getExtension().'" is not allowed';
			
			throw new Exception\UploadFilterException(self::EXCEPTION_MESSAGE_KEY, $message);
		}
	}
846764
function _addFileOrContinueBrowsing (item, fileList) {
  !fs.statSync(item).isDirectory() ? fileList.push(item) : _browseDir(item, fileList)
}
411571
function fileStoreContents( $filePath, $contents, $scope = false, $datatype = false )
    {
        eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileStoreContents( '$filePath' )", __METHOD__ );

        eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );

        eZFile::create( basename( $filePath ), dirname( $filePath ), $contents, true );

        $perm = eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' );
        chmod( $filePath, octdec( $perm ) );

        eZDebug::accumulatorStop( 'dbfile' );
    }
463590
public function renderTwigFile($template, $target, array $parameters, $sourceDir)
    {
        if (!is_dir(dirname($target))) {
            mkdir(dirname($target), 0777, true);
        }

        return file_put_contents($target, $this->renderTwig($template, $parameters, $sourceDir));
    }
1340823
public function parseFile($filename, $config = NULL, $encoding = NULL, $use_include_path = false, $filename, $config = NULL, $encoding = NULL, $use_include_path = false)
    {
    }
200322
public function validate(FileAbstraction $entity, $typeName, $sourceFilePath = null)
	{
		$siblings = $entity->getSiblings();
		$creatingFilename = $entity->getFileName();

		foreach ($siblings as $record) {
			/* @var $record File */
			
			if ( ! $record->equals($entity)) {
				$recordName = $record->getFileName();
				
				$creatingFilename = mb_strtolower($creatingFilename);
				$recordName = mb_strtolower($recordName);

				if ($creatingFilename == $recordName) {
					$message = $typeName . ' with this name already exists.';
					
					throw new Exception\DuplicateFileNameException(self::EXCEPTION_MESSAGE_KEY, $message);
				}
			}
		}
	}