芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/minscoop.com/system/ThirdParty/Kint/Zval/Representation/SourceRepresentation.php
filename = $filename; $this->line = $line; $start_line = \max($line - $padding, 1); $length = $line + $padding + 1 - $start_line; $this->source = self::getSource($filename, $start_line, $length); if (null !== $this->source) { $this->contents = \implode("\n", $this->source); } } /** * Gets section of source code. * * @param string $filename Full path to file * @param int $start_line The first line to display (1 based) * @param null|int $length Amount of lines to show */ public static function getSource(string $filename, int $start_line = 1, ?int $length = null): ?array { if (!$filename || !\file_exists($filename) || !\is_readable($filename)) { return null; } $source = \preg_split("/\r\n|\n|\r/", \file_get_contents($filename)); $source = \array_combine(\range(1, \count($source)), $source); $source = \array_slice($source, $start_line - 1, $length, true); return $source; } }