Enter description here ...
@param MWebfile $webfile
@return string
552042
public function resolveTableNameFromWebfile(MWebfile $webfile)
    {

        $classname = $webfile::$m__sClassName;

        if (strpos($classname, "\\") != -1) { // check if classname is given with namespace

            $lastBackslashOccurrence = strrpos($classname, "\\");
            $classname = substr($classname, $lastBackslashOccurrence + 1);
        }

        $tableName = $this->databaseConnection->getTablePrefix() . $classname;
        return $tableName;
    }
665913
protected function getCssClass( $file ) {
		$file_extension = substr( strrchr( $file, '.' ), 1 );
		switch ( $file_extension ) {
			case 'epub':
				$pre_suffix = strstr( $file, '._3.epub' );
				break;
			case 'pdf':
				$pre_suffix = strstr( $file, '._print.pdf' );
				break;
			case 'html':
				$pre_suffix = strstr( $file, '.-htmlbook.html' );
				break;
			case 'xml':
				$pre_suffix = strstr( $file, '._vanilla.xml' );
				break;
			default:
				$pre_suffix = false;
		}
		if ( 'html' === $file_extension && '.-htmlbook.html' === $pre_suffix ) {
			$file_class = 'htmlbook';
		} elseif ( 'html' === $file_extension && false === $pre_suffix ) {
			$file_class = 'xhtml';
		} elseif ( 'xml' === $file_extension && '._vanilla.xml' === $pre_suffix ) {
			$file_class = 'vanillawxr';
		} elseif ( 'xml' === $file_extension && false === $pre_suffix ) {
			$file_class = 'wxr';
		} elseif ( 'epub' === $file_extension && '._3.epub' === $pre_suffix ) {
			$file_class = 'epub3';
		} elseif ( 'pdf' === $file_extension && '._print.pdf' === $pre_suffix ) {
			$file_class = 'print-pdf';
		} else {
			/**
			 * Map custom export format file extensions to their CSS class.
			 *
			 * For example, here's how one might set the CSS class for a .docx file:
			 *
			 * add_filter( 'pb_get_export_file_class', function ( $file_extension ) {
			 *    if ( 'docx' == $file_extension ) {
			 *        return 'word';
			 *    }
			 *    return $file_extension;
			 * } );
			 *
			 * @since 3.9.8
			 *
			 * @param string $file_extension
			 */
			$file_class = apply_filters( 'pb_get_export_file_class', $file_extension );
		}
		return $file_class;
	}
1281427
public function parse($inputFile)
    {
        $DCNamespace = 'http://purl.org/rss/1.0/modules/content/';
        $WPNamespace = 'http://wordpress.org/export/1.2/';
        $reader = new \XMLReader();
        $dom = new \DOMDocument('1.0', 'UTF-8');
        $reader->open($inputFile);

        while ($reader->read() && $reader->name !== 'item');

        while($reader->name == 'item') {
            $xml = simplexml_import_dom($dom->importNode($reader->expand(), true));
            $wpItems = $xml->children($WPNamespace);
            $content = $xml->children($DCNamespace)->encoded;

            $categories = [];
            $tags = [];

            foreach($xml->category as $category) {
                if('category' == $category->attributes()->domain) {
                    $categories[] = (string)$category;
                }

                if('post_tag' == $category->attributes()->domain) {
                    $tags[] = (string)$category;
                }
            }

            if($wpItems) {
                $post_type = (string)$wpItems->post_type;
                $data = [
                    'type' => $post_type,
                    'post_date' => new \DateTime((string)$wpItems->post_date),
                    'title' => (string)$xml->title,
                    'content' => (string)$content,
                    'tags' => $tags,
                    'categories' => $categories,
                ];
                yield $data;
            }

            $reader->next('item');
        }
    }
207198
public function getBinary(\SplFileInfo $file): string
    {
        if (!($file instanceof \SplFileObject)) {
            $file = $file->openFile();
        } else {
            $file->rewind();
        }
        if ($file instanceof \SplTempFileObject) {
            $binary = '';
            while ($file->valid()) {
                $binary .= $file->fread(self::READ_LENGTH);
            }
        } else {
            if (!($file instanceof \SplFileObject)) {
                $file = $file->openFile();
            }
            $binary = $file->fread($file->getSize());
        }
        return $binary;
    }
92385
public function sendingbackupinfo($backupfile) {
        $sizeinfo = new stdClass();
        $sizeinfo->total = number_format($backupfile->get_filesize() / 1000000, 2);
        $html = html_writer::tag('div', get_string('sendingsize', 'hub', $sizeinfo),
            array('class' => 'courseuploadtextinfo'));
        return $html;
    }
610603
private function _readTemplate($templateFile) {
		$filename = PHPCHECKSTYLE_HOME_DIR . "/html/template/" . $templateFile . ".tmpl";
		$handle = fopen($filename, "r");
		$contents = fread($handle, filesize($filename));
		fclose($handle);

		return $contents;
	}
1365712
public function emvcRenderHtml(string $latteFile, array $data): string
    {
        $latte = new Engine();
        $latte->setTempDirectory($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/tmp/latte');
        return $latte->renderToString($_SERVER['DOCUMENT_ROOT'] . BASE_URL . '/private/latte/' . $latteFile, $data);
    }
624171
public function getDumpCommand(string $dumpFile, string $temporaryCredentialsFile): string
    {
        $quote = $this->determineQuote();

        $command = [
            "{$quote}{$this->dumpBinaryPath}mysqldump{$quote}",
            "--defaults-extra-file=\"{$temporaryCredentialsFile}\"",
        ];

        if (! $this->createTables) {
            $command[] = '--no-create-info';
        }

        if ($this->skipComments) {
            $command[] = '--skip-comments';
        }

        $command[] = $this->useExtendedInserts ? '--extended-insert' : '--skip-extended-insert';

        if ($this->useSingleTransaction) {
            $command[] = '--single-transaction';
        }

        if ($this->skipLockTables) {
            $command[] = '--skip-lock-tables';
        }

        if ($this->useQuick) {
            $command[] = '--quick';
        }

        if ($this->socket !== '') {
            $command[] = "--socket={$this->socket}";
        }

        foreach ($this->excludeTables as $tableName) {
            $command[] = "--ignore-table={$this->dbName}.{$tableName}";
        }

        if (! empty($this->defaultCharacterSet)) {
            $command[] = '--default-character-set='.$this->defaultCharacterSet;
        }

        foreach ($this->extraOptions as $extraOption) {
            $command[] = $extraOption;
        }

        if ($this->setGtidPurged !== 'AUTO') {
            $command[] = '--set-gtid-purged='.$this->setGtidPurged;
        }

        if (! $this->dbNameWasSetAsExtraOption) {
            $command[] = $this->dbName;
        }

        if (! empty($this->includeTables)) {
            $includeTables = implode(' ', $this->includeTables);
            $command[] = "--tables {$includeTables}";
        }

        return $this->echoToFile(implode(' ', $command), $dumpFile);
    }
659801
public static function get(string $srcFile = ''): string
    {
        if (File::exists($srcFile) === false) {
            throw new RuntimeException('Source file does not exist: '.$srcFile);
        }

        $tmp = @\getimagesize($srcFile);
        if (empty($tmp)) {
            throw new RuntimeException('Invalid source file: '.$srcFile);
        }

        return \sprintf('%s:%s', $tmp[0], $tmp[1]);
    }
1192113
protected function describeFieldsPrepareLabel($sLabel)
    {
        $aPatterns = [
            //  Common words
            '/\bid\b/i'   => 'ID',
            '/\burl\b/i'  => 'URL',
            '/\bhtml\b/i' => 'HTML',
            //  Common file extensions
            '/\bpdf\b/i'  => 'PDF',
        ];

        $sLabel = ucwords(preg_replace('/[\-_]/', ' ', $sLabel));
        $sLabel = preg_replace(array_keys($aPatterns), array_values($aPatterns), $sLabel);

        return $sLabel;
    }
237454
protected function generateViewFile($sourceFile,$viewFile)
	{
		static $regexRules=array(
			'<%=?\s*(.*?)\s*%>',		// PHP statements or expressions
			'<\/?(com|cache|clip):([\w\.]+)\s*((?:\s*\w+\s*=\s*\'.*?(?<!\\\\)\'|\s*\w+\s*=\s*".*?(?<!\\\\)"|\s*\w+\s*=\s*\{.*?\})*)\s*\/?>', // component tags
			'<!---.*?--->',	// template comments
		);
		$this->_sourceFile=$sourceFile;
		$this->_input=file_get_contents($sourceFile);
		$n=preg_match_all('/'.implode('|',$regexRules).'/msS',$this->_input,$matches,PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
		$textStart=0;
		$this->_output="<?php /* source file: $sourceFile */ ?>\n";
		for($i=0;$i<$n;++$i)
		{
			$match=&$matches[$i];
			$str=$match[0][0];
			$matchStart=$match[0][1];
			$matchEnd=$matchStart+strlen($str)-1;

			if($matchStart>$textStart)
				$this->_output.=substr($this->_input,$textStart,$matchStart-$textStart);
			$textStart=$matchEnd+1;

			if(strpos($str,'<com:')===0)	// opening component tag
			{
				$type=$match[3][0];
				if($str[strlen($str)-2]!=='/')  // open tag
					$this->_output.=$this->processBeginWidget($type,$match[4][0],$match[2][1]);
				else
					$this->_output.=$this->processWidget($type,$match[4][0],$match[2][1]);
			}
			elseif(strpos($str,'</com:')===0)	// closing component tag
				$this->_output.=$this->processEndWidget($match[3][0],$match[2][1]);
			elseif(strpos($str,'<cache:')===0)	// opening cache tag
			{
				$id=$match[3][0];
				if($str[strlen($str)-2]!=='/')  // open tag
					$this->_output.=$this->processBeginCache($id,$match[4][0],$match[2][1]);
				else
					$this->_output.=$this->processCache($id,$match[4][0],$match[2][1]);
			}
			elseif(strpos($str,'</cache:')===0)	// closing cache tag
				$this->_output.=$this->processEndCache($match[3][0],$match[2][1]);
			elseif(strpos($str,'<clip:')===0)	// opening clip tag
			{
				$id=$match[3][0];
				if($str[strlen($str)-2]!=='/')  // open tag
					$this->_output.=$this->processBeginClip($id,$match[4][0],$match[2][1]);
				else
					$this->_output.=$this->processClip($id,$match[4][0],$match[2][1]);
			}
			elseif(strpos($str,'</clip:')===0)	// closing clip tag
				$this->_output.=$this->processEndClip($match[3][0],$match[2][1]);
			elseif(strpos($str,'<%=')===0)	// expression
				$this->_output.=$this->processExpression($match[1][0],$match[1][1]);
			elseif(strpos($str,'<%')===0)	// statement
				$this->_output.=$this->processStatement($match[1][0],$match[1][1]);
		}
		if($textStart<strlen($this->_input))
			$this->_output.=substr($this->_input,$textStart);

		file_put_contents($viewFile,$this->_output);
	}
701678
public function getBindingForFile( $file ) {
		$engine_key = $this->default;

		foreach ( $this->bindings as $suffix => $engine ) {
			if ( substr( $file, -strlen( $suffix ) ) === $suffix ) {
				$engine_key = $engine;
				break;
			}
		}

		return $engine_key;
	}
1048152
protected function _render(string $viewFile, array $data = []): string
    {
        if (empty($data)) {
            $data = $this->viewVars;
        }

        if (substr($viewFile, -3) === 'php') {
            $out = parent::_render($viewFile, $data);
        } else {
            $data = array_merge(
                $data,
                iterator_to_array($this->helpers()->getIterator()),
                [
                    '_view' => $this,
                ]
            );

            try {
                $out = $this->getTwig()->loadTemplate($viewFile)->render($data);
            } catch (Exception $e) {
                $previous = $e->getPrevious();

                if ($previous !== null && $previous instanceof Exception) {
                    throw $previous;
                } else {
                    throw $e;
                }
            }
        }

        return $out;
    }
445182
public static function getCompiledFile($inputFile)
    {
        $currentFile = self::fixPathForInput($inputFile);
        $pathInfo = pathinfo($currentFile);
        $parser = \KayStrobach\Dyncss\Configuration\BeRegistry::get()->getFileHandler($pathInfo['extension']);
        if ($parser !== null) {
            $parser->setOverrides(self::getOverrides());
            $outputFile = $parser->compileFile($currentFile);

            return self::fixPathForOutput($outputFile);
        } else {
            return $inputFile;
        }
    }
733408
public function preview(File $file)
    {
        $bbcode = $this->bbcode();

        return preg_replace_callback_array([
            '/\](?<find>.*)\[/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->base_name, $m[0]);
            },
            '/size=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->humanSize, $m[0]);
            },
            '/uuid=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->uuid, $m[0]);
            },
            '/url=(?<find>{.*?})/' => function ($m) use ($file) {
                return str_replace($m['find'], $file->url, $m[0]);
            },
        ], $bbcode);
    }
904509
protected function getUriSchemeForManagedFile(array $element) {
    if (isset($element['#uri_scheme'])) {
      return $element['#uri_scheme'];
    }
    $scheme_options = \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::getVisibleStreamWrappers();
    if (isset($scheme_options['private'])) {
      return 'private';
    }
    elseif (isset($scheme_options['public'])) {
      return 'public';
    }
    else {
      return 'private';
    }
  }
888552
public function getDescription($i = 0)
    {
        $files = $this->files;
        $files = $this->owner->$files;
        if(!isset($files[$i]))
           return "";
        $file = $files[$i];
        return isset($file->vars->description) ? $file->vars->description : "";
    }