2017 © Pedro Peláez
 

library mime-stub

This script can be used to generate -self-executing- .php Files.

image

frdl/mime-stub

This script can be used to generate -self-executing- .php Files.

  • Wednesday, October 11, 2017
  • by webfan
  • Repository
  • 2 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

README

webfan\MimeStubAPC

<?php 

   $vm = \webfan\MimeStubAPC::vm();

 // echo print_r($vm, true);

 $newFile = __DIR__. DIRECTORY_SEPARATOR . 'TestMimeStubAPC.php';


 $a = <<<PHPE

 echo ' TEST-modified.';

 PHPE;


 $stub = $vm->get_file($vm->document, '$HOME/index.php', 'stub index.php')
 // ->clear()
   ->append($a)
 ;

  $vm->to('hello@wor.ld');
  $vm->from('me@localhost');
  $stub->from('hello@wor.ld');  

  $vm->location = $newFile;
 require $newFile;
 $run($newFile);

Riverline\MultiPartParser

Homepage, (*1)

Build Status, (*2)

What is Riverline\MultiPartParser

Riverline\MultiPartParse is a one class lib to parse multipart document ( multipart email, multipart form, etc ...) and manage each part encoding and charset to extract their content., (*3)

Requirements

  • PHP 5.3 or HHVM

Installation

Riverline\MultiPartParse is compatible with composer and any prs-0 autoloader., (*4)

composer require riverline/multipart-parser

Usage

<?php

use Riverline\MultiPartParser\Part;

$content = <<<EOL
User-Agent: curl/7.21.2 (x86_64-apple-darwin)
Host: localhost:8080
Accept: */*
Content-Type: multipart/form-data; boundary=----------------------------83ff53821b7c

------------------------------83ff53821b7c
Content-Disposition: form-data; name="foo"

bar
------------------------------83ff53821b7c
Content-Transfer-Encoding: base64

YmFzZTY0
------------------------------83ff53821b7c
Content-Disposition: form-data; name="upload"; filename="text.txt"
Content-Type: text/plain

File content
------------------------------83ff53821b7c--
EOL;

$document = new Part($content);

if ($document->isMultiPart()) {
    $parts = $document->getParts();
    echo $parts[0]->getBody(); // Output bar
    // It decode encoded content
    echo $parts[1]->getBody(); // Output base64

    // You can also filter by part name
    $parts = $document->getPartsByName('foo');
    echo $parts[0]->getName(); // Output foo

    // You can extract the headers
    $contentDisposition = $parts[0]->getHeader('Content-Disposition');
    echo $contentDisposition; // Output Content-Disposition: form-data; name="foo"
    // Helpers
    echo Part::getHeaderValue($contentDisposition); // Output form-data
    echo Part::getHeaderOption($contentDisposition, 'name'); // Output foo

    // File helper
    if ($parts[2]->isFile()) {
        echo $parts[2]->getFileName(); // Output text.txt
        echo $parts[2]->getMimeType(); // Output text/plain
    }
}

The Versions

11/10 2017

dev-master

9999999-dev

This script can be used to generate -self-executing- .php Files.

  Sources   Download

MIT BSD-4-Clause BSD-3-Clause 1.3.6.1.4.1.37553.8.1.8.4.5

The Requires

  • php >=5.3

 

by Romain Cambien

stub parser multipart self-executing

17/12 2015

1.1.8

1.1.8.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

17/12 2015

1.1.7

1.1.7.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

07/12 2015

1.1.6

1.1.6.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

04/12 2015

1.1.5

1.1.5.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

10/11 2015

1.1.4

1.1.4.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

09/11 2015

1.1.3

1.1.3.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

09/11 2015

1.1.2

1.1.2.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

06/11 2015

1.1.1

1.1.1.0

One class library to parse multipart content with encoding and charset support.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

05/11 2015

1.1.0

1.1.0.0

Library to parse multipart requests

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Romain Cambien

parser http multipart

05/11 2015

1.0.0

1.0.0.0

Library to parse multipart requests

  Sources   Download

MIT

The Requires

  • php >=5.1

 

by Romain Cambien

parser http multipart

05/11 2015

0.0.1

0.0.1.0

Library to parse multipart requests

  Sources   Download

MIT

The Requires

  • php >=5.1

 

by Romain Cambien

parser http multipart