public static function portion($path, $init = 0, $end = 1024, $lines = false)
    {
        self::fullpath($path);

        if ($lines !== true) {
            return file_get_contents($path, false, null, $init, $end);
        }

        $i = 1;
        $output = '';

        $handle = fopen($path, 'rb');

        while (false === feof($handle) && $i <= $end) {
            $data = fgets($handle);

            if ($i >= $init) {
                $output .= $data;
            }

            ++$i;
        }

        fclose($handle);

        return $output;
    }
public static function portion($path, $init = 0, $end = 1024, $lines = false)
    {
        self::fullpath($path);

        if ($lines !== true) {
            return file_get_contents($path, false, null, $init, $end);
        }

        $i = 1;
        $output = '';

        $handle = fopen($path, 'rb');

        while (false === feof($handle) && $i <= $end) {
            $data = fgets($handle);

            if ($i >= $init) {
                $output .= $data;
            }

            ++$i;
        }

        fclose($handle);

        return $output;
    }
public static function portion ( $ path , $ init = 0 , $ end = 1024 , $ lines = false ) { self :: fullpath ( $ path ) ; if ( $ lines !== true ) { return file_get_contents ( $ path , false , null , $ init , $ end ) ; } $ i = 1 ; $ output = '' ; $ handle = fopen ( $ path , 'rb' ) ; while ( false === feof ( $ handle ) && $ i <= $ end ) { $ data = fgets ( $ handle ) ; if ( $ i >= $ init ) { $ output .= $ data ; } ++ $ i ; } fclose ( $ handle ) ; return $ output ; }
Read a script excerpt

@param string $path
@param int    $init
@param int    $end
@param bool   $lines
@throws \Inphinit\Experimental\Exception
@return string
Read a script excerpt