PHP Classes

How to Use a PHP Debian Package Parser to Deb Parser: Parse Debian files to extract package information

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-08-11 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 11 All time: 11,402 This week: 41Up
Version License PHP version Categories
deb-parser 1.0The PHP License5PHP 5, System information, Files and ..., U..., C..., P..., G...
Description 

Author

This script can parse Debian files to extract package information.

It extracts Debian Linux program package installation files into the current directory.

The script opens the package control file to parse it and extract details of the program to install like the package, name, dependencies, author, section, and version.

Innovation Award
PHP Programming Innovation award nominee
August 2024
Number 3
Debian is a well-known Linux distribution that is also a base for other distributions like Ubuntu.

Debian uses a file format to store packages of files for each program that can be installed using Debian.

This package provides a simple script to extract program information from a Debian installation package file.

Manuel Lemos
Picture of Parsa Yazdani
  Performance   Level  
Name: Parsa Yazdani <contact>
Classes: 3 packages by
Country: Australia Australia
Age: ???
All time rank: 436952 in Australia Australia
Week rank: 170 Up3 in Australia Australia Up
Innovation award
Innovation award
Nominee: 2x

Documentation

Deb Parser

Parse deb files using php

Requirements

PHP 8

If you are on PHP 7 or lower, replace this:

if(str_starts_with($line, 'Package: '))
    $bundleid = substr($line, 9);

with this:

if(substr($line, 0, 9) === "Package: ")
    $bundleid = substr($line, 9);

How to use

  1. Put file.deb in the same directory as index.php
  2. Run index.php
  3. Done ## Variables Set - $bundleid - $packagename - $depends - $description - $author - $section - $version

  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file index.php Aux. Configuration script
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:11
This week:0
All time:11,402
This week:41Up