V 3.5 RC 1

This commit is contained in:
Romain Neutron
2011-12-05 00:23:28 +01:00
parent 6f1ee368aa
commit 4c5b7eb658
5563 changed files with 466984 additions and 985416 deletions

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package binaryAdapter
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class binaryAdapter_flash_toimage extends binaryAdapter_adapterAbstract
{
/**
*
* @var array
*/
protected $processors = array(
'binaryAdapter_flash_toimage_swfextract',
'binaryAdapter_flash_toimage_swfrender'
);
public function get_name()
{
return 'Binary adapter flash to image';
}
}

View File

@@ -0,0 +1,82 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package binaryAdapter
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class binaryAdapter_flash_toimage_swfextract extends binaryAdapter_processorAbstract
{
/**
*
* @var array
*/
protected $options = array();
/**
*
* @var string
*/
protected $binary_name = 'GV_swf_extract';
/**
*
* @param system_file $origine
* @param string $dest
* @return binaryAdapter_flash_toimage_swfextract
*/
protected function process(system_file $origine, $dest)
{
$cmd = sprintf('%s %s'
, $this->binary
, $this->escapeshellargs($origine->getPathname())
);
$stdout = $this->shell_cmd($cmd);
$id = false;
foreach ($stdout as $l)
{
if (substr(trim($l), 0, 4) == '[-j]')
{
$id = ' -j '
. array_pop(explode('-', array_pop(explode(' ', trim($l)))));
$ext = '.jpg';
break;
}
if (substr(trim($l), 0, 4) == '[-p]')
{
$id = ' -p '
. array_pop(explode('-', array_pop(explode(' ', trim($l)))));
$ext = '.png';
break;
}
}
if ($id)
{
$cmd = sprintf('%s %s %s -o %s'
, $this->binary
, $id
, $this->escapeshellargs($origine->getPathname())
, $this->escapeshellargs($dest)
);
$this->shell_cmd($cmd);
}
return $this;
}
}

View File

@@ -0,0 +1,52 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package binaryAdapter
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class binaryAdapter_flash_toimage_swfrender extends binaryAdapter_processorAbstract
{
/**
*
* @var array
*/
protected $options = array();
/**
*
* @var string
*/
protected $binary_name = 'GV_swf_render';
/**
*
* @param system_file $origine
* @param string $dest
* @return binaryAdapter_flash_toimage_swfrender
*/
protected function process(system_file $origine, $dest)
{
$cmd = sprintf('%s -l %s -o %s'
, $this->binary
, $this->escapeshellargs($origine->getPathname())
, $this->escapeshellargs($dest)
);
$this->shell_cmd($cmd);
return $this;
}
}