Bug #14402 » tsconfig_help.diff
tsconfig_help.new/ext_emconf.php 2007-02-06 17:21:16.000000000 +0100 | ||
---|---|---|
########################################################################
|
||
# Extension Manager/Repository config file for ext: "tsconfig_help"
|
||
#
|
||
# Auto generated 06-02-2007 17:25
|
||
# Auto generated 05-02-2007 08:55
|
||
#
|
||
# Manual updates:
|
||
# Only the data in the array - anything else is removed by next write.
|
||
... | ... | |
'constraints' => array(
|
||
'depends' => array(
|
||
'cms' => '',
|
||
'libunzipped' => '',
|
||
),
|
||
'conflicts' => array(
|
||
),
|
tsconfig_help.new/mod1/index.php 2007-02-06 17:28:04.000000000 +0100 | ||
---|---|---|
require_once('conf.php');
|
||
require_once($BACK_PATH.'init.php');
|
||
require_once($BACK_PATH.'template.php');
|
||
require_once($BACK_PATH.'mod/tools/em/class.em_unzip.php');
|
||
require_once(t3lib_extMgm::extPath('libunzipped').'class.tx_libunzipped.php');
|
||
$LANG->includeLLFile('EXT:tsconfig_help/mod1/locallang.xml');
|
||
... | ... | |
*/
|
||
function getZIPFileContents ($ZIPfile, $filename) {
|
||
if (@file_exists($ZIPfile)) {
|
||
// Unzipping SXW file, getting filelist:
|
||
$this->zipObj = t3lib_div::makeInstance('tx_libunzipped');
|
||
$files = $this->zipObj->init($ZIPfile);
|
||
if ($files === false) {
|
||
return false;
|
||
} elseif (count($files)) {
|
||
// Extract and parse the meta information of the document
|
||
$filedetails=$this->zipObj->getFileFromXML($filename);
|
||
return $filedetails['content'];
|
||
}
|
||
$tempPath = PATH_site.'typo3temp/zip_temp/';
|
||
t3lib_div::mkdir ($tempPath);
|
||
$this->unzip($ZIPfile, $tempPath);
|
||
$output = t3lib_div::getURL($tempPath.$filename);
|
||
$cmd = 'rm -r "'.$tempPath.'"';
|
||
exec($cmd);
|
||
return $output;
|
||
}
|
||
}
|
||
/**
|
||
* Unzips a zip file in the given path.
|
||
*
|
||
* Uses unzip binary if available, otherwise a pure PHP unzip is used.
|
||
*
|
||
* @param string $file Full path to zip file
|
||
* @param string $path Path to change to before extracting
|
||
* @return boolean True on success, false in failure
|
||
*/
|
||
function unzip($file, $path) {
|
||
// we use a pure PHP unzip
|
||
$unzip = new em_unzip($file);
|
||
$ret = $unzip->extract(array('add_path'=>$path));
|
||
return (is_array($ret));
|
||
}
|
||
/**
|
||
* Parses the whole XML file in order to understand the Styles structure. This function is mostly looking at the styles
|