Commit 6e86939f authored by robert's avatar robert

Committed the most recent version of ter_fe (1.0.4) which is currently in use on typo3.org.

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/trunk@12014 735d13b6-9817-0410-8766-e36946ffe9aa
parent ab3ba5fc
Version 1.0.4 20.03.2007 Robert Lemke <robert@typo3.org>
+ Improved the caching of extension files for the ter_fe details view: Files are now only unpacked again if the md5 sum of the T3X file (not the extensions.xml.gz) changed.
+ Changed the tx_terfe / contentcache file structure: now the files of each extension reside in their own subdirectory.
Version 1.0.3 16.12.2006 Robert Lemke <robert@typo3.org>
# Fixed bug 0004086: extension rating shows 0 (zero) instead of "-" or nothing
# If no title was defined for an extension, links in ter_fe will now have the label "Untitled"
+ Added a little feature (#0004053): You can now link to the single view of the most current version of an extension by omitting the "version" get parameter or setting version to "current".
Version 1.0.2 15.12.2006 Robert Lemke <robert@typo3.org>
+ Added feature "Render Problems" link which explains why documents were not rendered. (See extension ter_doc_renderproblems)
......
......@@ -162,8 +162,10 @@ class tx_terfe_common {
if (is_array ($extensionRecord)) {
foreach ($extensionRecord as $key => $value) {
switch ($key) {
case 'extensionkey':
case 'title':
$extensionRecord[$key] = strlen($value) > 0 ? $value : $this->pObj->pi_getLL('extensioninfo_general_untitled','',1);
break;
case 'extensionkey':
case 'description':
case 'authorname':
case 'authoremail':
......@@ -317,27 +319,46 @@ class tx_terfe_common {
protected function db_getAndUpdateExtensionDetails ($extensionKey, $version) {
global $TYPO3_DB, $TSFE;
$baseDir = $this->baseDirT3XContentCache;
$firstLetter = strtolower (substr ($extensionKey, 0, 1));
$secondLetter = strtolower (substr ($extensionKey, 1, 1));
$t3xFileHash = $this->getT3XFileHash ($extensionKey, $version);
$table = 'tx_terfe_extensiondetails';
$res = $TYPO3_DB->exec_SELECTquery(
'extensionkey,version,files,t3xfilemd5',
$table,
'extensionkey=' . $TYPO3_DB->fullQuoteStr ($extensionKey, $table) . ' AND version=' . $TYPO3_DB->fullQuoteStr($version, $table)
);
if ($res && $TYPO3_DB->sql_num_rows($res) > 0) {
$detailsRow = $TYPO3_DB->sql_fetch_assoc($res);
if ($detailsRow['t3xfilemd5'] == $t3xFileHash) {
$filesT3xFileHash = file_get_contents($baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey.'/'.$extensionKey.'-'.$version.'.t3xmd5');
if ($filesT3xFileHash == $t3xFileHash) {
$detailsRow['files'] = unserialize($detailsRow['files']);
return $detailsRow;
}
}
}
$t3xArr = $this->getUnpackedT3XFile ($extensionKey, $version);
if (!is_array ($t3xArr)) return FALSE;
$filesArr = array ();
if (is_array ($t3xArr['FILES'])) {
$baseDir = $this->baseDirT3XContentCache;
$firstLetter = strtolower (substr ($extensionKey, 0, 1));
$secondLetter = strtolower (substr ($extensionKey, 1, 1));
// Create directories if neccessary and delete possible old data from this extension version:
@mkdir ($baseDir.$firstLetter);
@mkdir ($baseDir.$firstLetter.'/'.$secondLetter);
@mkdir ($baseDir.$firstLetter,0770);
@mkdir ($baseDir.$firstLetter.'/'.$secondLetter,0770);
@mkdir ($baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey,0770);
foreach (glob($baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey.'-'.$version.'*') as $fileName) {
foreach (glob($baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey.'/'.$extensionKey.'-'.$version.'*') as $fileName) {
@unlink ($fileName);
}
// Now write the files to the temporary directory:
foreach ($t3xArr['FILES'] as $fileName => $fileInfoArr) {
$cleanFileName = $extensionKey.'-'.$version.'-'.preg_replace ('/[^\w]/', '__', $fileName);
$tempFileName = $baseDir.$firstLetter.'/'.$secondLetter.'/'.$cleanFileName;
$tempFileName = $baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey.'/'.$cleanFileName;
t3lib_div::writeFile ($tempFileName, $fileInfoArr['content']);
......@@ -347,13 +368,15 @@ class tx_terfe_common {
'tempfilename' => $cleanFileName
);
}
file_put_contents($baseDir.$firstLetter.'/'.$secondLetter.'/'.$extensionKey.'/'.$extensionKey.'-'.$version.'.t3xmd5', $t3xFileHash);
}
$detailsRow = array (
'extensionkey' => $extensionKey,
'version' => $version,
'files' => serialize ($filesArr),
't3xfilemd5' => @md5_file ($this->getExtensionVersionPathAndBaseName($extensionKey, $version).'.t3x')
't3xfilemd5' => $t3xFileHash
);
// Update db record:
......@@ -590,7 +613,7 @@ class tx_terfe_common {
$firstLetter = strtolower (substr ($extensionDetailsArr['extensionkey'], 0, 1));
$secondLetter = strtolower (substr ($extensionDetailsArr['extensionkey'], 1, 1));
$tempDir = substr ($this->baseDirT3XContentCache, strlen(PATH_site)).$firstLetter.'/'.$secondLetter.'/';
$tempDir = substr ($this->baseDirT3XContentCache, strlen(PATH_site)).$firstLetter.'/'.$secondLetter.'/'.$extensionDetailsArr['extensionkey'].'/';
if (is_array ($filesArr)) {
$tableRows = array ();
......@@ -753,6 +776,18 @@ class tx_terfe_common {
return unserialize ($dataUncompressed);
}
/**
* Returns the MD5 hash of the T3X file for the specified extension key and version
*
* @param string $extensionKey: Extension key
* @param string $version: Version number
* @return mixed The result of md5_file
* @access protected
*/
protected function getT3XFileHash ($extensionKey, $version) {
return @md5_file ($this->getExtensionVersionPathAndBaseName($extensionKey, $version).'.t3x');
}
/**
* Transfers a file to the client browser.
* NOTE: This function must be called *before* any HTTP headers have been sent!
......@@ -774,6 +809,8 @@ class tx_terfe_common {
header('Content-Transfer-Encoding: binary');
header('Content-length:'.filesize($fullPath).'');
readfile($fullPath);
ob_flush();
die();
return TRUE;
}
......
......@@ -3,7 +3,7 @@
########################################################################
# Extension Manager/Repository config file for ext: "ter_fe"
#
# Auto generated 17-05-2006 11:44
# Auto generated 20-03-2007 15:17
#
# Manual updates:
# Only the data in the array - anything else is removed by next write.
......@@ -29,8 +29,8 @@ $EM_CONF[$_EXTKEY] = array(
'clearCacheOnLoad' => 0,
'lockType' => '',
'author_company' => 'The TYPO3 Association',
'version' => '1.0.2',
'_md5_values_when_last_written' => 'a:79:{s:8:".project";s:4:"e45a";s:9:"ChangeLog";s:4:"3a0d";s:25:"class.tx_terfe_common.php";s:4:"6bc5";s:21:"ext_conf_template.txt";s:4:"0902";s:12:"ext_icon.gif";s:4:"1cd6";s:17:"ext_localconf.php";s:4:"1725";s:14:"ext_tables.php";s:4:"4414";s:14:"ext_tables.sql";s:4:"7a35";s:24:"ext_typoscript_setup.txt";s:4:"35fc";s:30:"flexform_ds_pluginmode_pi1.xml";s:4:"ec1e";s:30:"flexform_ds_pluginmode_pi2.xml";s:4:"79a4";s:13:"locallang.xml";s:4:"01d3";s:20:"locallang_common.xml";s:4:"e7e8";s:16:"locallang_db.xml";s:4:"1438";s:11:"CVS/Entries";s:4:"c5d0";s:15:"CVS/Entries.Log";s:4:"f7d3";s:14:"CVS/Repository";s:4:"02e7";s:8:"CVS/Root";s:4:"f73b";s:14:"doc/manual.sxw";s:4:"fe2d";s:15:"doc/CVS/Entries";s:4:"cc9e";s:18:"doc/CVS/Repository";s:4:"ebcc";s:12:"doc/CVS/Root";s:4:"f73b";s:14:"pi1/ce_wiz.gif";s:4:"02b6";s:26:"pi1/class.tx_terfe_pi1.php";s:4:"7570";s:34:"pi1/class.tx_terfe_pi1_wizicon.php";s:4:"458c";s:30:"pi1/class.tx_terfe_ratings.php";s:4:"d86f";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"4062";s:15:"pi1/CVS/Entries";s:4:"3b95";s:18:"pi1/CVS/Repository";s:4:"2ab0";s:12:"pi1/CVS/Root";s:4:"f73b";s:14:"pi2/ce_wiz.gif";s:4:"02b6";s:26:"pi2/class.tx_terfe_pi2.php";s:4:"359c";s:34:"pi2/class.tx_terfe_pi2_wizicon.php";s:4:"b97e";s:13:"pi2/clear.gif";s:4:"cc11";s:17:"pi2/locallang.xml";s:4:"1f65";s:15:"pi2/CVS/Entries";s:4:"5ff9";s:18:"pi2/CVS/Repository";s:4:"f18b";s:12:"pi2/CVS/Root";s:4:"f73b";s:14:"pi3/ce_wiz.gif";s:4:"02b6";s:26:"pi3/class.tx_terfe_pi3.php";s:4:"acc3";s:34:"pi3/class.tx_terfe_pi3_wizicon.php";s:4:"bf4f";s:13:"pi3/clear.gif";s:4:"cc11";s:17:"pi3/locallang.xml";s:4:"9a33";s:15:"pi3/CVS/Entries";s:4:"4e28";s:18:"pi3/CVS/Repository";s:4:"81c9";s:12:"pi3/CVS/Root";s:4:"f73b";s:22:"res/changepassword.gif";s:4:"8be0";s:20:"res/comparefiles.gif";s:4:"4e40";s:14:"res/delete.gif";s:4:"46fc";s:13:"res/error.gif";s:4:"2611";s:16:"res/greenled.gif";s:4:"48a7";s:15:"res/greyled.gif";s:4:"3bd8";s:12:"res/info.gif";s:4:"d67e";s:14:"res/redled.gif";s:4:"c9cc";s:19:"res/state_alpha.gif";s:4:"f971";s:18:"res/state_beta.gif";s:4:"81f5";s:26:"res/state_experimental.gif";s:4:"1698";s:16:"res/state_na.gif";s:4:"fb15";s:22:"res/state_obsolete.gif";s:4:"6cd7";s:20:"res/state_stable.gif";s:4:"59f7";s:18:"res/state_test.gif";s:4:"f92e";s:14:"res/ter_fe.css";s:4:"c972";s:19:"res/transferkey.gif";s:4:"ba35";s:15:"res/warning.gif";s:4:"3330";s:17:"res/yellowled.gif";s:4:"d927";s:15:"res/CVS/Entries";s:4:"383f";s:19:"res/CVS/Entries.Log";s:4:"130b";s:18:"res/CVS/Repository";s:4:"8e57";s:12:"res/CVS/Root";s:4:"f73b";s:25:"res/icons/state_alpha.gif";s:4:"f971";s:24:"res/icons/state_beta.gif";s:4:"81f5";s:33:"res/icons/state_beta_reviewed.gif";s:4:"1ead";s:32:"res/icons/state_experimental.gif";s:4:"1698";s:26:"res/icons/state_stable.gif";s:4:"59f7";s:35:"res/icons/state_stable_reviewed.gif";s:4:"8fea";s:21:"res/icons/CVS/Entries";s:4:"e662";s:24:"res/icons/CVS/Repository";s:4:"c367";s:18:"res/icons/CVS/Root";s:4:"f73b";}',
'version' => '1.0.4',
'_md5_values_when_last_written' => 'a:64:{s:9:"ChangeLog";s:4:"ff92";s:25:"class.tx_terfe_common.php";s:4:"8463";s:21:"ext_conf_template.txt";s:4:"af1c";s:12:"ext_icon.gif";s:4:"1cd6";s:17:"ext_localconf.php";s:4:"fb1c";s:14:"ext_tables.php";s:4:"f1b0";s:14:"ext_tables.sql";s:4:"7a35";s:24:"ext_typoscript_setup.txt";s:4:"2069";s:30:"flexform_ds_pluginmode_pi1.xml";s:4:"29b0";s:30:"flexform_ds_pluginmode_pi2.xml";s:4:"d6fc";s:13:"locallang.xml";s:4:"0eec";s:20:"locallang_common.xml";s:4:"14da";s:16:"locallang_db.xml";s:4:"4f57";s:14:"pi2/ce_wiz.gif";s:4:"02b6";s:26:"pi2/class.tx_terfe_pi2.php";s:4:"feda";s:34:"pi2/class.tx_terfe_pi2_wizicon.php";s:4:"67db";s:13:"pi2/clear.gif";s:4:"cc11";s:17:"pi2/locallang.xml";s:4:"23c1";s:22:"res/changepassword.gif";s:4:"8be0";s:20:"res/comparefiles.gif";s:4:"4e40";s:14:"res/delete.gif";s:4:"46fc";s:13:"res/error.gif";s:4:"2611";s:16:"res/greenled.gif";s:4:"48a7";s:15:"res/greyled.gif";s:4:"3bd8";s:12:"res/info.gif";s:4:"d67e";s:14:"res/redled.gif";s:4:"c9cc";s:19:"res/state_alpha.gif";s:4:"f971";s:18:"res/state_beta.gif";s:4:"81f5";s:26:"res/state_experimental.gif";s:4:"1698";s:16:"res/state_na.gif";s:4:"fb15";s:22:"res/state_obsolete.gif";s:4:"6cd7";s:20:"res/state_stable.gif";s:4:"59f7";s:18:"res/state_test.gif";s:4:"f92e";s:13:"res/terfe.css";s:4:"b589";s:19:"res/transferkey.gif";s:4:"ba35";s:15:"res/warning.gif";s:4:"3330";s:17:"res/yellowled.gif";s:4:"d927";s:25:"res/icons/state_alpha.gif";s:4:"f971";s:24:"res/icons/state_beta.gif";s:4:"81f5";s:33:"res/icons/state_beta_reviewed.gif";s:4:"1ead";s:32:"res/icons/state_experimental.gif";s:4:"1698";s:26:"res/icons/state_stable.gif";s:4:"59f7";s:35:"res/icons/state_stable_reviewed.gif";s:4:"8fea";s:23:"res/icons/stars/1.5.png";s:4:"fca8";s:21:"res/icons/stars/1.png";s:4:"188d";s:23:"res/icons/stars/2.5.png";s:4:"d606";s:21:"res/icons/stars/2.png";s:4:"a921";s:23:"res/icons/stars/3.5.png";s:4:"b460";s:21:"res/icons/stars/3.png";s:4:"5db0";s:23:"res/icons/stars/4.5.png";s:4:"6fac";s:21:"res/icons/stars/4.png";s:4:"51b6";s:21:"res/icons/stars/5.png";s:4:"9ea4";s:14:"pi1/ce_wiz.gif";s:4:"02b6";s:26:"pi1/class.tx_terfe_pi1.php";s:4:"7fa5";s:34:"pi1/class.tx_terfe_pi1_wizicon.php";s:4:"9ac3";s:30:"pi1/class.tx_terfe_ratings.php";s:4:"e767";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"5928";s:14:"pi3/ce_wiz.gif";s:4:"02b6";s:26:"pi3/class.tx_terfe_pi3.php";s:4:"da0c";s:34:"pi3/class.tx_terfe_pi3_wizicon.php";s:4:"d4b9";s:13:"pi3/clear.gif";s:4:"cc11";s:17:"pi3/locallang.xml";s:4:"dcd7";s:14:"doc/manual.sxw";s:4:"fe2d";}',
'constraints' => 'Array',
'suggests' => array(
),
......
......@@ -82,7 +82,7 @@ class tx_terfe_pi1 extends tslib_pibase {
protected $viewMode = ''; // View mode, one of the following: LATEST, CATEGORIES, FULLLIST
protected $feedbackMailsCCAddress = ''; // Email address(es) which also receive the feedback emails
protected $standardSelectionClause = 'state <> "obsolete" AND category <> "doc" '; // Standard selection criteria for listing of extensions
protected $standardSelectionClause = 'state <> "obsolete" '; // Standard selection criteria for listing of extensions
protected $tooFewReviewsMode = TRUE; // If set, by default unreviewed extensions appear in all modes but "unsupported". This is for the time when we yet don't have enough reviews
/**
......@@ -124,7 +124,7 @@ class tx_terfe_pi1 extends tslib_pibase {
} else {
if (!$this->piVars['view']) $this->piVars['view'] = 'new';
switch ($this->piVars['view']) {
case 'new': $subContent = $this->renderListView_new(); break;
case 'new': $subContent = $this->renderListView_new(); break;
case 'categories': $subContent = $this->renderListView_categories(); break;
case 'popular': $subContent = $this->renderListView_popular(); break;
case 'fulllist': $subContent = $this->renderListView_compactList('full'); break;
......@@ -449,7 +449,7 @@ class tx_terfe_pi1 extends tslib_pibase {
protected function renderSingleView_extension ($extensionKey, $version) {
global $TYPO3_DB, $TSFE;
if (!strlen($version)) $version = $this->commonObj->db_getLatestVersionNumberOfExtension ($extensionKey);
if (!strlen($version) || $version == 'current') $version = $this->commonObj->db_getLatestVersionNumberOfExtension ($extensionKey, $this->tooFewReviewsMode);
// Fetch the extension record:
$res = $TYPO3_DB->exec_SELECTquery (
......
This diff is collapsed.
......@@ -88,6 +88,7 @@
<label index="extensioninfo_feedback_emailsent_details">The feedback was sent to %s.</label>
<label index="extensioninfo_feedback_invalidemailaddress">ERROR: You did not enter a valid email address (%s)</label>
<label index="extensioninfo_feedback_invalidcaptcha">ERROR: You did not enter the correct numbers / letters</label>
<label index="extensioninfo_general_untitled">Untitled</label>
<label index="extensioninfo_ratings_username">Username</label>
<label index="extensioninfo_ratings_version">Version</label>
<label index="extensioninfo_ratings_funcrating">Functionality</label>
......
......@@ -120,9 +120,7 @@
&lt;p&gt;&lt;strong&gt;Good keys&lt;/strong&gt; are those which reflect what the extension is about. Examples:&lt;/p&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A message board named &quot;Michaels Super Board&quot;. Example key: &quot;mc_superboard&quot;&lt;/li&gt;
&lt;li&gt;A booking system called &quot;Hotel Manager&quot; for hotels. Example key: &quot;hotelmgr&quot;&lt;/li&gt;
&lt;li&gt;A plugin (poll system) in a series of plugins made by you or your company which is named &quot;Direct People Technology&quot;. Example key: &quot;dpt_pollsystem&quot;&lt;/li&gt;
&lt;li&gt;A skin for TYPO3 with aliens in the background image, named &quot;Black is Back&quot;. Example key: &quot;skinb2b&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
......@@ -131,7 +129,9 @@
&lt;p&gt;&lt;strong&gt;Bad keys&lt;/strong&gt; are strings which convey no information. Examples:&lt;/p&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&quot;asdf&quot; - the typical default &quot;whatever&quot;-string. If you want to test the Extension Repository, please use at least a key like &quot;test_asdf&quot;...&lt;/li&gt;
&lt;li&gt;A message board named &quot;Michaels Super Board&quot;. Example key: &quot;mc_superboard&quot;&lt;/li&gt;
&lt;li&gt;A plugin (poll system) in a series of plugins made by you or your company which is named &quot;Direct People Technology&quot;. Example key: &quot;dpt_pollsystem&quot;&lt;/li&gt;
&lt;li&gt;&quot;asdf&quot; - the typical default &quot;whatever&quot;-string. If you want to test the Extension Repository, please use at least a key like &quot;test_asdf&quot;...&lt;/li&gt;
&lt;li&gt;&quot;d_d_o&quot; - is too much of an abbreviation to tells us anything.&lt;/li&gt;
&lt;li&gt;&quot;my_super_module_for_typo3&quot; - this begs the question how it can be anything near &quot;super&quot; when you couldn't come up with a good extension key...&lt;/li&gt;
&lt;li&gt;&quot;i_always_use_underscores&quot; - Is bad because it uses underscores (see notice above). For your own sake.&lt;/li&gt;
......
......@@ -133,7 +133,7 @@ class tx_terfe_pi3 extends tx_terfe_pi1 {
protected $reviewer = array(); // User name and password of the currently logged in reviewer
protected $notificationEmail_recipient = 'robert@typo3.org,hirdes@elios.de,rg@rupert-germann.de';
protected $notificationEmail_recipient = 'robert@typo3.org';
protected $notificationEmail_sender = 'noreply@typo3.org';
protected $notificationEmail_replyTo = 'typo3-project-security@lists.netfielders.de';
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment