2017 © Pedro PelĂĄez
 

library transformist

File conversion library

image

v-technologies/transformist

File conversion library

  • Wednesday, April 23, 2014
  • by tophsic
  • Repository
  • 10 Watchers
  • 6 Stars
  • 6,548 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

Transformist

Transformist is a PHP file conversion library. It provides a high level API to convert files into different formats painlessly., (*1)

It is also designed to be easily extended, just by adding custom converters., (*2)

Example

Here is what you could do to convert every word documents to PDF files in a directory:, (*3)

setup(
    '/path/to/directory',
    'application/msword',
    'application/pdf'
);

if ( $Transformist->run( )) {
    // You're good to go !
}

?>

You can use the setup( ) method in different ways to convert multiple documents in one pass:, (*4)

setup(
    array( '/path/to/input/directory' => '/path/to/output/directory' ),
    'application/msword',
    'application/pdf'
);


// Conversion of a particular file

$Transformist->setup(
    '/path/to/directory',
    'file.doc',
    'application/pdf'
);


// All files matching a pattern

$Transformist->setup(
    '/path/to/directory',
    '*.doc',
    'application/pdf'
);


// Multiple conversions

$Transformist->setup(
    '/path/to/directory',
    array(
        '*.doc'     => 'application/pdf',
        'image/jpg' => 'image/png'
    )
);

?>

Available conversions

Before going any further, you may want to know about the conversions that Transformist can handle. There's a method for that:, (*5)

availableConversions( );

?>

This method returns an array of all possible conversions. Each of its key represents an input type, and points to an array of output types., (*6)

Typically, it looks like this:, (*7)

 array(
        'image/png'
    ),
    'image/png' => array(
        'image/tiff'
    )
);

?>

Here you can convert JPG images to PNG, and PNG images to TIFF., (*8)

Test

Transformist provides a way to check all converters for validity. Some could be runnable without further configuration, while others could rely on external librairies that must be installed for the converter to work., (*9)

testConverters( );

// Or statically:

$results = Transformist::testConverters( );

?>

$results now looks like this:, (*10)

 true,
    'Transformist_Converter_Office_Png' => 'An external library is missing!',
    'Transformist_Converter_Office_Tiff' => true
);

?>

You should run this function only once when configuring your system or troubleshooting errors, as some converters could do some heavy computation to test their environment., (*11)

The Versions

23/04 2014

dev-master

9999999-dev http://github.com/v-technologies/transformist

File conversion library

  Sources   Download

The Requires

  • php >=5.2.0

 

The Development Requires

  • php >=5.3.0
  • mikey179/vfsstream >=1.0.0

by Félix Girault, V-Technologies

file conversion

23/04 2014

1.0.0

1.0.0.0 http://github.com/v-technologies/transformist

File conversion library

  Sources   Download

The Requires

  • php >=5.2.0

 

The Development Requires

  • php >=5.3.0
  • mikey179/vfsstream >=1.0.0

by Félix Girault, V-Technologies

file conversion

22/04 2014

dev-feature-ffmpeg-converter

dev-feature-ffmpeg-converter http://github.com/v-technologies/transformist

File conversion library

  Sources   Download

The Requires

  • php >=5.2.0

 

The Development Requires

  • php >=5.3.0
  • mikey179/vfsstream >=1.0.0

by Félix Girault, V-Technologies

file conversion