Component for reading phar.io manifest information from a PHP Archive (PHAR)

Related tags

Laravel manifest
Overview

Manifest

Component for reading phar.io manifest information from a PHP Archive (PHAR).

Build Status Scrutinizer Code Quality SensioLabsInsight

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require phar-io/manifest

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev phar-io/manifest

Usage

use PharIo\Manifest\ManifestLoader;
use PharIo\Manifest\ManifestSerializer;

$manifest = ManifestLoader::fromFile('manifest.xml');

var_dump($manifest);

echo (new ManifestSerializer)->serializeToString($manifest);
Comments
  • Honor PHP temp directory config

    Honor PHP temp directory config

    Fixed /tmp directory can be outside open_basedir scope. This fixes it using PHP config which is expected to be correct (and sys_get_temp_dir will return /tmp by default if no config is set).

    opened by mvorisek 4
  • Suggestion for the README

    Suggestion for the README

    Reading the readme would make me want to use the project, one thing is missing: you put a line that does a var_dump, but why not also adding the output of the var_dump?

    opened by williamdes 3
  • Dead links found in README.md

    Dead links found in README.md

    As a contributor to Mega-Linter project, I used it as a QA tools that checks lot of things, including dead links in Markdown files.

    markdown-lint-check do the job and report that 2 dead links were found in README.md, about SensioLabsInsight button

          ERROR: 2 dead links found!
          [✖] https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7 → Status: 0
          [✖] https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png → Status: 0
    

    See https://github.com/phar-io/manifest/blame/master/README.md#L7

    opened by llaville 2
  • Feature: generate manifest from any composer.lock file

    Feature: generate manifest from any composer.lock file

    Following issue https://github.com/phar-io/version/issues/28 that is now fixed, I may propose a solution to parse any composer.lock file to generate a Manifest.

    Goal Write a manifest from any Github repositories, quickly without xml structure errors with the real components installed !

    To avoid rewrites too much code, I've reused lot of existing architecture as much as possible.

    That means:

    • Usage
    <?php
    use PharIo\Manifest\ManifestLoader;
    use PharIo\Manifest\ManifestSerializer;
    
    $manifest = ManifestLoader::fromComposer("/path/to/composer.lock");
    
    echo (new ManifestSerializer)->serializeToString($manifest);
    
    • Source Code

    New exception PharIo\Manifest\NotEncodableValueException is raised if composer.lock could not be decoded.

    All new elements are in new directory src/json to separate from other existing elements.

    Add a new example to demonstrate feature with a PHPUnit 5.6.5 composer.lock (generated today, with existing dependencies versions)

    • WARNINGs

    As composer.lock does not contains all necessary informations required to generate a fully real manifest, some entry are built with defaults:

    • contains tag
    • copyright tag

    Here is an example to build the manifest of PHPUnit 5.6.5 (compares with https://github.com/phar-io/manifest/blob/master/tests/_fixture/phpunit-5.6.5.xml)

    <?php
    // script examples/example-02.php
    use PharIo\Manifest\ManifestLoader;
    use PharIo\Manifest\ManifestSerializer;
    
    require __DIR__ . '/../vendor/autoload.php';
    
    $manifest = ManifestLoader::fromComposer(
        dirname(__DIR__) . '/tests/_fixture/phpunit-5.6.5_composer.lock'
    );
    
    echo (new ManifestSerializer)->serializeToString($manifest);
    

    That prints following manifest

    <?xml version="1.0" encoding="UTF-8"?>
    <phar xmlns="https://phar.io/xml/manifest/1.0">
        <contains name="vendor/package" version="0.0.0-dev" type="library"/>
        <copyright>
            <author name="John Doe" email="[email protected]"/>
            <license type="MIT" url="https://spdx.org/licenses/MIT.html"/>
        </copyright>
        <requires>
            <php version="^5.6 || ^7.0">
                <ext name="dom"/>
                <ext name="json"/>
                <ext name="mbstring"/>
                <ext name="xml"/>
                <ext name="libxml"/>
            </php>
        </requires>
        <bundles>
            <component name="doctrine/instantiator" version="1.0.5"/>
            <component name="myclabs/deep-copy" version="1.7.0"/>
            <component name="phpdocumentor/reflection-common" version="1.0.1"/>
            <component name="phpdocumentor/reflection-docblock" version="3.3.2"/>
            <component name="phpdocumentor/type-resolver" version="0.4.0"/>
            <component name="phpspec/prophecy" version="1.10.3"/>
            <component name="phpunit/php-code-coverage" version="4.0.8"/>
            <component name="phpunit/php-file-iterator" version="1.4.5"/>
            <component name="phpunit/php-text-template" version="1.2.1"/>
            <component name="phpunit/php-timer" version="1.0.9"/>
            <component name="phpunit/php-token-stream" version="1.4.12"/>
            <component name="phpunit/phpunit-mock-objects" version="3.4.4"/>
            <component name="sebastian/code-unit-reverse-lookup" version="1.0.2"/>
            <component name="sebastian/comparator" version="1.2.4"/>
            <component name="sebastian/diff" version="1.4.3"/>
            <component name="sebastian/environment" version="2.0.0"/>
            <component name="sebastian/exporter" version="2.0.0"/>
            <component name="sebastian/global-state" version="1.1.1"/>
            <component name="sebastian/object-enumerator" version="2.0.1"/>
            <component name="sebastian/recursion-context" version="2.0.0"/>
            <component name="sebastian/resource-operations" version="1.0.0"/>
            <component name="sebastian/version" version="2.0.1"/>
            <component name="symfony/polyfill-ctype" version="1.19.0"/>
            <component name="symfony/yaml" version="3.4.47"/>
            <component name="webmozart/assert" version="1.9.1"/>
        </bundles>
    </phar>
    
    opened by llaville 1
  • Add .gitattributes with export-ignore rules to exclude test/build files from dist

    Add .gitattributes with export-ignore rules to exclude test/build files from dist

    Similar to theseer/tokenizer#9, adding a .gitattributes file with export-ignore rules can greatly reduce the zip file size as it excludes tests, examples, and other build/test related files.

    Thank you.

    opened by Ayesh 1
  • Publish a new release to include PR #2

    Publish a new release to include PR #2

    The 1.0.1 release uses the deprecated \PHPUnit_Framework_TestCase class within its tests. This prevents me from installing PHPUnit since this package is required by phpunit/phpunit and the tests fail.

    opened by Nicolapps 1
  • Be able to create an `Author` without email

    Be able to create an `Author` without email

    Context Create a manifest from Composer data

    Consider reading the Composer schema. We will see that only the author's name of the package is required. Email is optional !

    Current behaviour Cannot create a valid PharIo\Manifest\Author object without a valid email address.

    Expected behaviour Be able to create a valid PharIo\Manifest\Author object without Email.

    Script to reproduce issue

    <?php
    
    use PharIo\Manifest\Author;
    use PharIo\Manifest\AuthorCollection;
    use PharIo\Manifest\Email;
    
    $authorsCollection = new AuthorCollection();
    foreach ($composerJson['authors'] as $author) {
        $authorsCollection->add(
            new Author($author['name'], new Email('[email protected]')),
        );
    }
    
    enhancement 
    opened by llaville 0
  • Fix PHP 8.1 deprecation notices

    Fix PHP 8.1 deprecation notices

    From https://github.com/sebastianbergmann/phpunit/runs/3112779264:

    Deprecated: Return type of PharIo\Manifest\ElementCollection::current() should either be compatible with
    Iterator::current(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress
    the notice in /home/runner/work/phpunit/phpunit/vendor/phar-io/manifest/src/xml/ElementCollection.php on line 27
    
    Deprecated: Return type of PharIo\Manifest\ElementCollection::key() should either be compatible with
    Iterator::key(): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress
    the notice in /home/runner/work/phpunit/phpunit/vendor/phar-io/manifest/src/xml/ElementCollection.php on line 33
    
    Deprecated: Return type of PharIo\Manifest\ElementCollection::valid() should either be compatible with
    Iterator::valid(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress
    the notice in /home/runner/work/phpunit/phpunit/vendor/phar-io/manifest/src/xml/ElementCollection.php on line 37
    
    opened by sebastianbergmann 0
  • Feature: Add ability to read .github/FUNDING.yml

    Feature: Add ability to read .github/FUNDING.yml

    Reference: https://github.com/phar-io/phar.io/issues/89

    Adding the ability to read the .github/FUNDING.yml beside the manifest.xml it would be possible to display funding information for the user. Since we are hiding the information if the end-user decides to use phive instead of directly installing using tools with composer.

    And using the already existing files the maintenance is near to zero for tools that already have the funding enabled.

    enhancement 
    opened by icanhazstring 0
Releases(2.0.3)
Laravel 5 package for reading and writing CSV files.

CSV Laravel 5 package for reading and writing CSV files. Warning The package has been updated to PHP 7. If you can't update to PHP 7 use version 0.6.x

Maciej Wilgucki 48 Nov 29, 2022
Add Server-Timing header information from within your Laravel apps.

Laravel Server Timings Add Server-Timing header information from within your Laravel apps. Installation You can install the package via composer: comp

Beyond Code 498 Dec 15, 2022
Get the thumbnail of youtube and vimeo videos from the url. The returned information is ID and URL of the thumbnail

Video Thumbnail URL Get the thumbnail of youtube and vimeo videos from the url. The returned information is ID and URL of the thumbnail Installation I

Fernando Valler 2 Jan 22, 2022
A Laravel package to scrub sensitive information that breaks operational security policies from being leaked on accident or not by developers.

A Laravel package to scrub sensitive information that breaks operational security policies from being leaked on accident or not by developers.

YorCreative 104 Jan 6, 2023
How to get cookies from users' browser and send the information to your email address and telegram bot

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

MAXWELL 3 Dec 3, 2022
symfony workflow component for laravel7 and 8 ,php 7 and 8

Laravel workflow Use the Symfony Workflow component in Laravel8,PHP7,PHP8 This repository based on @brexis,his project since 2019-09 No longer maintai

null 3 Jul 21, 2022
Laminas\Console is a component to design and implement console applications in PHP.

laminas-console This package is abandoned and will receive no further development! We recommend using laminas/laminas-cli. Laminas\Console is a compon

Laminas Project 10 Nov 27, 2021
Laravel Livewire full page component routing.

Laravel Livewire Routes Laravel Livewire full page component routing. This package allows you to specify routes directly inside your full page Livewir

null 22 Oct 6, 2022
Laravel Livewire form component with declarative Bootstrap 5 fields and buttons.

Laravel Livewire Forms Laravel Livewire form component with declarative Bootstrap 5 fields and buttons. Requirements Bootstrap 5 Installation composer

null 49 Oct 29, 2022
Laravel component to create gorgeous Charts.css charts.

Laravel component to create gorgeous Charts.css charts. This package will help you generate CSS only charts based on the Charts.css library. Installat

Maarten Paauw 105 Sep 26, 2022
Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

About LivewireUI Modal LivewireUI Modal is a Livewire component that provides you with a modal that supports multiple child modals while maintaining s

Livewire UI 806 Jan 6, 2023
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Livewire UI 792 Jan 3, 2023
Asset Component is a port of Laravel 3 Asset for Orchestra Platform.

Asset Component is a port of Laravel 3 Asset for Orchestra Platform. The component main functionality is to allow asset declaration to be handle dynamically and asset dependencies can be resolve directly from the container. It however is not intended to becoma an asset pipeline package for Laravel, for such purpose we would recommend to use Grunt or Gulp.

Orchestra Platform 54 Mar 31, 2022
A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards.

TALL multiselect cards A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards. Table of content

Frederic Habich 19 Dec 14, 2022
Laravel Composable View Composers Package - Compose View Composers from Component Composers

Laravel Virtuoso Laravel Composable View Composers Package Increase flexibility and reduce code duplication by easily composing complex View Composers

Yitzchok Willroth 68 Dec 29, 2021
Customizable Feedback Component for Laravel

Laravel Feedback Component allows you to easily implement a Customer Feedback component on your website. It is build with VueJS but can be implemented in any kind of Laravel Project. You just need to drop a few lines in your layout.

Clément Rigo 254 Dec 25, 2022
Laravel Livewire component to show Events in a good looking monthly calendar

Livewire Calendar This package allows you to build a Livewire monthly calendar grid to show events for each day. Events can be loaded from within the

Andrés Santibáñez 680 Jan 4, 2023
Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

About Wire Elements Modal Wire Elements Modal is a Livewire component that provides you with a modal that supports multiple child modals while maintai

Wire Elements 806 Jan 6, 2023
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Wire Elements 790 Dec 27, 2022