Code reformatting
authorNicole Cordes <cordes@cps-it.de>
Tue, 30 Apr 2013 23:18:39 +0000 (01:18 +0200)
committerNicole Cordes <cordes@cps-it.de>
Tue, 30 Apr 2013 23:18:39 +0000 (01:18 +0200)
ChangeLog
Classes/Hook/DocHeaderButtonsHook.php
Classes/Service/CommunicationService.php
Classes/Service/ExtensionSettingService.php
Classes/Service/LoggingService.php
Classes/Service/TsConfigService.php
ext_autoload.php
ext_emconf.php
ext_localconf.php
ext_tables.php

index 2f0c043..f772f65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Set current backend language as frontend language
        * Initialise a new content object in simulated frontend
+       * Code reformatting
 
 2013-02-18 Nicole Cordes <cordes@cps-it.de>
 
index 09de6b8..fe9ecc6 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-       /***************************************************************
+/***************************************************************
  *  Copyright notice
  *
  *  (c) 2012 Nicole Cordes <cordes@cps-it.de>
@@ -37,9 +37,9 @@ class tx_vcc_hook_docHeaderButtonsHook {
        var $communicationService = NULL;
 
        /**
-        * @var tx_vcc_service_tsConfigService|NULL
+        * @var template|NULL
         */
-       var $tsConfigService = NULL;
+       var $pObj = NULL;
 
        /**
         * @var array
@@ -47,14 +47,14 @@ class tx_vcc_hook_docHeaderButtonsHook {
        var $params = array();
 
        /**
-        * @var template|NULL
+        * @var string
         */
-       var $pObj = NULL;
+       var $permsClause = '';
 
        /**
-        * @var string
+        * @var tx_vcc_service_tsConfigService|NULL
         */
-       var $permsClause = '';
+       var $tsConfigService = NULL;
 
        /**
         * Initialize the object
@@ -108,7 +108,7 @@ class tx_vcc_hook_docHeaderButtonsHook {
                $record = array();
                $table = '';
 
-                       // For web -> page view or web -> list view
+               // For web -> page view or web -> list view
                if ($this->pObj->scriptID === 'ext/cms/layout/db_layout.php' || $this->pObj->scriptID === 'ext/recordlist/mod1/index.php') {
                        $id = t3lib_div::_GP('id');
                        if (is_object($GLOBALS['SOBE']) && $GLOBALS['SOBE']->current_sys_language) {
@@ -124,7 +124,7 @@ class tx_vcc_hook_docHeaderButtonsHook {
                                        'pid' => $id
                                );
                        }
-               } elseif ($this->pObj->scriptID === 'typo3/alt_doc.php') {      // For record edit
+               } elseif ($this->pObj->scriptID === 'typo3/alt_doc.php') { // For record edit
                        $editConf = t3lib_div::_GP('edit');
                        if (is_array($editConf) && !empty($editConf)) {
                                // Finding the current table
@@ -146,17 +146,17 @@ class tx_vcc_hook_docHeaderButtonsHook {
 
                if (isset($record['pid']) && $record['pid'] > 0) {
                        if ($this->isModuleAccessible($record['pid'], $table)) {
-                                       // Process last request
+                               // Process last request
                                $button = $this->process($table, $record['uid']);
 
-                                       // Generate button with form for list view
+                               // Generate button with form for list view
                                if ($this->pObj->scriptID === 'ext/recordlist/mod1/index.php') {
                                        $button .= $this->generateButton(TRUE);
-                               } else {        // Generate plain input button
+                               } else { // Generate plain input button
                                        $button .= $this->generateButton();
                                }
 
-                                       // Add button to button list and extend layout
+                               // Add button to button list and extend layout
                                $this->params['buttons']['vcc'] = $button;
                                $buttonWrap = t3lib_parsehtml::getSubpart($pObj->moduleTemplate, '###BUTTON_GROUP_WRAP###');
                                $this->params['markers']['BUTTONLIST_LEFT'] .= t3lib_parsehtml::substituteMarker($buttonWrap, '###BUTTONS###', trim($button));
@@ -175,7 +175,7 @@ class tx_vcc_hook_docHeaderButtonsHook {
                $html = '<input type="image" class="c-inputButton" name="_clearvarnishcache" src="clear.gif" title="Clear Varnish cache" />';
 
                if ($wrapWithForm) {
-                       $html = '<form action="'. t3lib_div::getindpenv('REQUEST_URI') . '" method="post">' . $html . '</form>';
+                       $html = '<form action="' . t3lib_div::getindpenv('REQUEST_URI') . '" method="post">' . $html . '</form>';
                }
 
                return t3lib_iconWorks::getSpriteIcon(
@@ -197,10 +197,10 @@ class tx_vcc_hook_docHeaderButtonsHook {
        protected function isModuleAccessible($pageId, $table) {
                $access = FALSE;
 
-                       // Check edit rights for page as cache can be flushed then only
+               // Check edit rights for page as cache can be flushed then only
                $pageinfo = t3lib_BEfunc::readPageAccess($pageId, $this->permsClause);
                if ($pageinfo !== FALSE) {
-                               // Get TSconfig for extension
+                       // Get TSconfig for extension
                        $tsConfig = $this->tsConfigService->getConfiguration($pageId);
                        if (isset($tsConfig[$table]) && !empty($tsConfig[$table])) {
                                $access = TRUE;
@@ -229,7 +229,7 @@ class tx_vcc_hook_docHeaderButtonsHook {
        }
 }
 
-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Hook/DocHeaderButtonsHook.php'])  {
+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Hook/DocHeaderButtonsHook.php']) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Hooks/DocHeaderButtonsHook.php']);
 }
 
index cc58a8c..e73b213 100644 (file)
@@ -37,19 +37,14 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
        var $contentObject = NULL;
 
        /**
-        * @var tx_vcc_service_extensionSettingService|NULL
-        */
-       var $extensionSettingService = NULL;
-
-       /**
-        * @var tx_vcc_service_loggingService|NULL
+        * @var boolean
         */
-       var $loggingService = NULL;
+       var $enableIndexScript = FALSE;
 
        /**
-        * @var tx_vcc_service_tsConfigService|NULL
+        * @var tx_vcc_service_extensionSettingService|NULL
         */
-       var $tsConfigService = NULL;
+       var $extensionSettingService = NULL;
 
        /**
         * @var array
@@ -67,19 +62,24 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
        var $httpProtocol = '';
 
        /**
-        * @var boolean
+        * @var tx_vcc_service_loggingService|NULL
         */
-       var $stripSlash = FALSE;
+       var $loggingService = NULL;
+
+       /**
+        * @var array
+        */
+       var $serverArray = array();
 
        /**
         * @var boolean
         */
-       var $enableIndexScript = FALSE;
+       var $stripSlash = FALSE;
 
        /**
-        * @var array
+        * @var tx_vcc_service_tsConfigService|NULL
         */
-       var $serverArray = array();
+       var $tsConfigService = NULL;
 
        /**
         * Initialize the object
@@ -109,7 +109,7 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
 
                $this->contentObject = t3lib_div::makeInstance('tslib_cObj');
 
-                       // Initialize hook objects
+               // Initialize hook objects
                $this->initializeHookObjects();
        }
 
@@ -146,33 +146,12 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                $this->tsConfigService = $tsConfigService;
        }
 
-       protected function createTSFE() {
-               if (!is_object($GLOBALS['TT'])) {
-                       $GLOBALS['TT'] = t3lib_div::makeInstance('t3lib_TimeTrackNull');
-               }
-
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 1, '');
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->initFEuser();
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               if (TYPO3_MODE == 'BE') {
-                               // Set current backend language
-                       $GLOBALS['TSFE']->getPageRenderer()->setLanguage($GLOBALS['LANG']->lang);
-               }
-               $GLOBALS['TSFE']->newcObj();
-
-               TSpagegen::pagegenInit();
-       }
-
        protected function initializeHookObjects() {
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vcc']['hooks']['communicationService'])) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vcc']['hooks']['communicationService'] as $classReference) {
                                $hookObject = t3lib_div::getUserObj($classReference);
 
-                                       // Hook objects have to implement interface
+                               // Hook objects have to implement interface
                                if ($hookObject instanceof tx_vcc_hook_communicationServiceHookInterface) {
                                        $this->hookObjects[] = $hookObject;
                                }
@@ -182,6 +161,92 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
        }
 
        /**
+        * Generates the flash messages for the requests
+        *
+        * @param array $resultArray
+        *
+        * @return string
+        */
+       public function generateBackendMessage(array $resultArray) {
+               $content = '';
+
+               if (is_array($resultArray)) {
+                       foreach ($resultArray as $result) {
+                               switch ($result['status']) {
+                                       case t3lib_FlashMessage::OK:
+                                               // Extend button marker with messages
+                                               $content .= '<script type="text/javascript">
+                                                       parent.TYPO3.Flashmessage.display(
+                                                               TYPO3.Severity.ok,
+                                                               "Server: ' . $result['server'] . ' // Host: ' . $result['host'] . '",
+                                                               "Request: ' . $result['request'] . '<br />Message: ' . $result['message'][0] . '",
+                                                               5
+                                                       );
+                                               </script>';
+                                               break;
+
+                                       default:
+                                               // Extend button marker with messages
+                                               $content .= '<script type="text/javascript">
+                                                       parent.TYPO3.Flashmessage.display(
+                                                               TYPO3.Severity.error,
+                                                               "Server: ' . $result['server'] . ' // Host: ' . $result['host'] . '",
+                                                               "Request: ' . $result['request'] . '<br />Message: ' . implode('<br />', $result['message']) . '<br />Sent:<br />' . implode('<br />', $result['requestHeader']) . '",
+                                                               10
+                                                       );
+                                               </script>';
+                                               break;
+                               }
+                       }
+                       unset($result);
+               }
+
+               return $content;
+       }
+
+       /**
+        * Send clear cache commands for pages to defined server
+        *
+        * @param string $fileName
+        * @param string $host
+        *
+        * @return array
+        */
+       public function sendClearCacheCommandForFiles($fileName, $host = '') {
+               // Log debug information
+               $logData = array(
+                       'fileName' => $fileName,
+                       'host' => $host
+               );
+               $this->loggingService->debug('CommunicationService::sendClearCacheCommandForFiles arguments', $logData);
+
+               // If no host was given get all
+               if ($host === '') {
+                       $hostArray = array();
+
+                       // Get all domain records and check page access
+                       $domainArray = t3lib_BEfunc::getRecordsByField('sys_domain', 'redirectTo', '', ' AND hidden=0');
+                       if (is_array($domainArray) && !empty($domainArray)) {
+                               $permsClause = $GLOBALS['BE_USER']->getPagePermsClause(2);
+                               foreach ($domainArray as $domain) {
+                                       $pageinfo = t3lib_BEfunc::readPageAccess($domain['pid'], $permsClause);
+                                       if ($pageinfo !== FALSE) {
+                                               $hostArray[] = $domain['domainName'];
+                                       }
+                               }
+                               unset($domain);
+                       }
+                       $host = implode(',', $hostArray);
+
+                       // Log debug information
+                       $logData['host'] = $host;
+                       $this->loggingService->debug('CommunicationService::sendClearCacheCommandForFiles built host', $logData);
+               }
+
+               return $this->processClearCacheCommand($fileName, 0, $host);
+       }
+
+       /**
         * Send clear cache commands for pages to defined server
         *
         * @param string $table
@@ -191,17 +256,17 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
         * @return array
         */
        public function sendClearCacheCommandForTables($table, $uid, $host = '') {
-                       // Get current record to process
+               // Get current record to process
                $record = t3lib_BEfunc::getRecord($table, $uid);
 
-                       // Build request
+               // Build request
                if ($table === 'pages') {
                        $pid = $record['uid'];
                } else {
                        $pid = $record['pid'];
                }
 
-                       // Log debug information
+               // Log debug information
                $logData = array(
                        'table' => $table,
                        'uid' => $uid,
@@ -217,28 +282,28 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                $url = $this->contentObject->typoLink_URL($typolink);
                $LD = $this->contentObject->lastTypoLinkLD;
 
-                       // Check for root site
+               // Check for root site
                if ($url === '' && $table === 'pages') {
                        $rootline = t3lib_BEfunc::BEgetRootLine($uid);
                        if (is_array($rootline) && count($rootline) > 1) {
-                                       // If uid equals the site root we have to process
+                               // If uid equals the site root we have to process
                                if ($uid == $rootline[1]['uid']) {
                                        $url = '/';
                                }
                        }
                }
 
-                       // Log debug information
+               // Log debug information
                $logData['url'] = $url;
                $this->loggingService->debug('CommunicationService::sendClearCacheCommandForTables built url', $logData, $pid);
 
-                       // Process only for valid URLs
+               // Process only for valid URLs
                if ($url !== '') {
 
                        $url = $this->removeHost($url);
                        $responseArray = $this->processClearCacheCommand($url, $pid, $host);
 
-                               // Check support of index.php script
+                       // Check support of index.php script
                        if ($this->enableIndexScript) {
                                $url = $LD['url'] . $LD['linkVars'];
                                $url = $this->removeHost($url);
@@ -259,62 +324,25 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                );
        }
 
-       /**
-        * Send clear cache commands for pages to defined server
-        *
-        * @param string $fileName
-        * @param string $host
-        *
-        * @return array
-        */
-       public function sendClearCacheCommandForFiles($fileName, $host = '') {
-                       // Log debug information
-               $logData = array(
-                       'fileName' => $fileName,
-                       'host' => $host
-               );
-               $this->loggingService->debug('CommunicationService::sendClearCacheCommandForFiles arguments', $logData);
-
-                       // If no host was given get all
-               if ($host === '') {
-                       $hostArray = array();
-
-                               // Get all domain records and check page access
-                       $domainArray = t3lib_BEfunc::getRecordsByField('sys_domain', 'redirectTo', '', ' AND hidden=0');
-                       if (is_array($domainArray) && !empty($domainArray)) {
-                               $permsClause = $GLOBALS['BE_USER']->getPagePermsClause(2);
-                               foreach ($domainArray as $domain) {
-                                       $pageinfo = t3lib_BEfunc::readPageAccess($domain['pid'], $permsClause);
-                                       if ($pageinfo !== FALSE) {
-                                               $hostArray[] = $domain['domainName'];
-                                       }
-                               }
-                               unset($domain);
-                       }
-                       $host = implode(',', $hostArray);
-
-                               // Log debug information
-                       $logData['host'] = $host;
-                       $this->loggingService->debug('CommunicationService::sendClearCacheCommandForFiles built host', $logData);
+       protected function createTSFE() {
+               if (!is_object($GLOBALS['TT'])) {
+                       $GLOBALS['TT'] = t3lib_div::makeInstance('t3lib_TimeTrackNull');
                }
 
-               return $this->processClearCacheCommand($fileName, 0, $host);
-       }
-
-       /**
-        * Remove any host from an url
-        *
-        * @param string $url
-        *
-        * @return string
-        */
-       protected function removeHost($url) {
-               if (strpos($url, '://') !== FALSE) {
-                       $urlArray = parse_url($url);
-                       $url = substr($url, strlen($urlArray['scheme'] . '://' . $urlArray['host']));
+               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 1, '');
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->initFEuser();
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               if (TYPO3_MODE == 'BE') {
+                       // Set current backend language
+                       $GLOBALS['TSFE']->getPageRenderer()->setLanguage($GLOBALS['LANG']->lang);
                }
+               $GLOBALS['TSFE']->newcObj();
 
-               return $url;
+               TSpagegen::pagegenInit();
        }
 
        /**
@@ -334,25 +362,25 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                                'server' => $server
                        );
 
-                               // Build request
+                       // Build request
                        if ($this->stripSlash) {
                                $url = rtrim($url, '/');
                        }
                        $request = $server . '/' . ltrim($url, '/');
                        $response['request'] = $request;
 
-                               // Check for curl functions
+                       // Check for curl functions
                        if (!function_exists('curl_init')) {
-                                       // TODO: Implement fallback to file_get_contents()
+                               // TODO: Implement fallback to file_get_contents()
                                $response['status'] = t3lib_FlashMessage::ERROR;
                                $response['message'] = 'No curl_init available';
                        } else {
-                                       // If no host was given we need to loop over all
+                               // If no host was given we need to loop over all
                                $hostArray = array();
                                if ($host !== '') {
                                        $hostArray = t3lib_div::trimExplode(',', $host, 1);
                                } else {
-                                               // Get all (non-redirecting) domains from root
+                                       // Get all (non-redirecting) domains from root
                                        $rootLine = t3lib_BEfunc::BEgetRootLine($pid);
                                        foreach ($rootLine as $row) {
                                                $domainArray = t3lib_BEfunc::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo="" AND hidden=0');
@@ -366,35 +394,35 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                                        unset($row);
                                }
 
-                                       // Fallback to current server
+                               // Fallback to current server
                                if (empty($hostArray)) {
                                        $domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/');
                                        $hostArray[] = substr($domain, strpos($domain, '://') + 3);
                                }
 
-                                       // Loop over hosts
+                               // Loop over hosts
                                foreach ($hostArray as $xHost) {
                                        $response['host'] = $xHost;
 
-                                               // Curl initialization
+                                       // Curl initialization
                                        $ch = curl_init();
 
-                                               // Disable direct output
+                                       // Disable direct output
                                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
-                                               // Only get header response
+                                       // Only get header response
                                        curl_setopt($ch, CURLOPT_HEADER, 1);
                                        curl_setopt($ch, CURLOPT_NOBODY, 1);
 
-                                               // Set url
+                                       // Set url
                                        curl_setopt($ch, CURLOPT_URL, $request);
 
-                                               // Set method and protocol
+                                       // Set method and protocol
                                        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpMethod);
                                        curl_setopt($ch, CURLOPT_HTTP_VERSION, ($this->httpProtocol === 'http_10') ? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1);
 
-                                               // Set X-Host and X-Url header
-                                               // Set X-Host-Quoted and X-Url-Quoted with added slashes for regular expression in vcl
+                                       // Set X-Host and X-Url header
+                                       // Set X-Host-Quoted and X-Url-Quoted with added slashes for regular expression in vcl
                                        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                                                'X-Host: ' . $xHost,
                                                'X-Host-Quoted: ' . preg_quote($xHost),
@@ -402,12 +430,12 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                                                'X-Url-Quoted: ' . preg_quote($url)
                                        ));
 
-                                               // Store outgoing header
+                                       // Store outgoing header
                                        curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
 
-                                               // Include preProcess hook (e.g. to set some alternative curl options
+                                       // Include preProcess hook (e.g. to set some alternative curl options
                                        foreach ($this->hookObjects as $hookObject) {
-                                                       /** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
+                                               /** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
                                                $hookObject->preProcess($ch, $request, $response, $this);
                                        }
                                        unset($hookObject);
@@ -422,16 +450,16 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
                                        }
                                        $response['requestHeader'] = preg_split('/(\r|\n)+/m', trim(curl_getinfo($ch, CURLINFO_HEADER_OUT)));
 
-                                               // Include postProcess hook (e.g. to start some other jobs)
+                                       // Include postProcess hook (e.g. to start some other jobs)
                                        foreach ($this->hookObjects as $hookObject) {
-                                                       /** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
+                                               /** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
                                                $hookObject->postProcess($ch, $request, $response, $this);
                                        }
                                        unset($hookObject);
 
                                        curl_close($ch);
 
-                                               // Log debug information
+                                       // Log debug information
                                        $logData = array(
                                                'url' => $url,
                                                'pid' => $pid,
@@ -452,51 +480,23 @@ class tx_vcc_service_communicationService implements t3lib_Singleton {
        }
 
        /**
-        * Generates the flash messages for the requests
+        * Remove any host from an url
         *
-        * @param array $resultArray
+        * @param string $url
         *
         * @return string
         */
-       public function generateBackendMessage(array $resultArray) {
-               $content = '';
-
-               if (is_array($resultArray)) {
-                       foreach ($resultArray as $result) {
-                               switch ($result['status']) {
-                                       case t3lib_FlashMessage::OK:
-                                                       // Extend button marker with messages
-                                               $content .= '<script type="text/javascript">
-                                                       parent.TYPO3.Flashmessage.display(
-                                                               TYPO3.Severity.ok,
-                                                               "Server: ' . $result['server'] . ' // Host: ' . $result['host'] . '",
-                                                               "Request: ' . $result['request'] . '<br />Message: ' . $result['message'][0] . '",
-                                                               5
-                                                       );
-                                               </script>';
-                                               break;
-
-                                       default:
-                                                       // Extend button marker with messages
-                                               $content .= '<script type="text/javascript">
-                                                       parent.TYPO3.Flashmessage.display(
-                                                               TYPO3.Severity.error,
-                                                               "Server: ' . $result['server'] . ' // Host: ' . $result['host'] . '",
-                                                               "Request: ' . $result['request'] . '<br />Message: ' . implode('<br />', $result['message']) . '<br />Sent:<br />' . implode('<br />', $result['requestHeader']) . '",
-                                                               10
-                                                       );
-                                               </script>';
-                                               break;
-                               }
-                       }
-                       unset($result);
+       protected function removeHost($url) {
+               if (strpos($url, '://') !== FALSE) {
+                       $urlArray = parse_url($url);
+                       $url = substr($url, strlen($urlArray['scheme'] . '://' . $urlArray['host']));
                }
 
-               return $content;
+               return $url;
        }
 }
 
-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/CommunicationService.php'])  {
+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/CommunicationService.php']) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/CommunicationService.php']);
 }
 
index 4470bb1..00c0517 100644 (file)
@@ -68,7 +68,7 @@ class tx_vcc_service_extensionSettingService implements t3lib_Singleton {
        }
 }
 
-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/ExtensionSettingService.php'])  {
+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/ExtensionSettingService.php']) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/ExtensionSettingService.php']);
 }
 
index 8efbb40..c2b566f 100644 (file)
  */
 class tx_vcc_service_loggingService implements t3lib_Singleton {
 
-       const OK      = 0;
-       const NOTICE  = 1;
-       const INFO    = 2;
+       const DEBUG = 99;
+
+       const ERROR = 4;
+
+       const INFO = 2;
+
+       const NOTICE = 1;
+
+       const OK = 0;
+
        const WARNING = 3;
-       const ERROR   = 4;
-       const DEBUG   = 99;
 
        /**
-        * @var tx_vcc_service_extensionSettingService|NULL
+        * @var integer
         */
-       var $extensionSettingService = NULL;
+       var $debug = 0;
 
        /**
-        * @var integer
+        * @var tx_vcc_service_extensionSettingService|NULL
         */
-       var $debug = 0;
+       var $extensionSettingService = NULL;
 
        /**
         * @var string
@@ -82,8 +87,19 @@ class tx_vcc_service_loggingService implements t3lib_Singleton {
        /**
         * @return void
         */
+       public function debug($message, $logData = array(), $pid = 0, $callerDepth = 2, $caller = NULL) {
+               if ($this->debug) {
+                       // Adjust callerDepth due to debug function
+                       $callerDepth++;
+                       $this->log($message, $logData, self::DEBUG, $pid, $callerDepth, $caller);
+               }
+       }
+
+       /**
+        * @return void
+        */
        public function log($message, $logData = array(), $type = self::INFO, $pid = 0, $callerDepth = 2, $caller = NULL) {
-                       // Get caller if not already set
+               // Get caller if not already set
                if ($caller === NULL) {
                        $caller = $this->getCallerFromBugtrace($callerDepth);
                }
@@ -102,26 +118,15 @@ class tx_vcc_service_loggingService implements t3lib_Singleton {
        }
 
        /**
-        * @return void
-        */
-       public function debug($message, $logData = array(), $pid = 0, $callerDepth = 2, $caller = NULL) {
-               if ($this->debug) {
-                               // Adjust callerDepth due to debug function
-                       $callerDepth++;
-                       $this->log($message, $logData, self::DEBUG, $pid, $callerDepth, $caller);
-               }
-       }
-
-       /**
         * @param integer $callerDepth
         *
         * @return array
         */
        protected function getCallerFromBugtrace($callerDepth) {
-                       // Get trace array
+               // Get trace array
                $trace = debug_backtrace();
 
-                       // Adjust callerDepth due to separate function
+               // Adjust callerDepth due to separate function
                $callerDepth++;
                if (isset($trace[$callerDepth])) {
                        return $trace[$callerDepth];
@@ -131,7 +136,7 @@ class tx_vcc_service_loggingService implements t3lib_Singleton {
        }
 }
 
-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/LoggingService.php'])  {
+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/LoggingService.php']) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/LoggingService.php']);
 }
 
index e9691f6..1c2b780 100644 (file)
 class tx_vcc_service_tsConfigService implements t3lib_Singleton {
 
        /**
-        * @var tx_vcc_service_loggingService|NULL
+        * @var array
         */
-       var $loggingService = NULL;
+       var $configurationArray = array();
 
        /**
-        * @var array
+        * @var tx_vcc_service_loggingService|NULL
         */
-       var $configurationArray = array();
+       var $loggingService = NULL;
 
        /**
         * Initialize the object
@@ -74,7 +74,7 @@ class tx_vcc_service_tsConfigService implements t3lib_Singleton {
                        $modTsConfig = t3lib_BEfunc::getModTSconfig($id, 'mod.vcc');
                        $this->configurationArray[$id] = $modTsConfig['properties'];
 
-                               // Log debug information
+                       // Log debug information
                        $logData = array(
                                'id' => $id,
                                'configuration' => $modTsConfig['properties']
@@ -86,7 +86,7 @@ class tx_vcc_service_tsConfigService implements t3lib_Singleton {
        }
 }
 
-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/TsConfigService.php'])  {
+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/TsConfigService.php']) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/vcc/Classes/Service/TsConfigService.php']);
 }
 
index 1d0152c..07adec0 100644 (file)
@@ -1,11 +1,11 @@
 <?php
-       $extensionPath = t3lib_extMgm::extPath('vcc') . 'Classes/';
+$extensionPath = t3lib_extMgm::extPath('vcc') . 'Classes/';
 
-       return array(
-               'tx_vcc_hook_communicationServiceHookInterface' => $extensionPath . 'Interface/CommunicationServiceHookInterface.php',
-               'tx_vcc_service_communicationservice' => $extensionPath . 'Service/CommunicationService.php',
-               'tx_vcc_service_extensionsettingservice' => $extensionPath . 'Service/ExtensionSettingService.php',
-               'tx_vcc_service_loggingservice' => $extensionPath . 'Service/LoggingService.php',
-               'tx_vcc_service_tsconfigservice' => $extensionPath . 'Service/TsConfigService.php',
-       );
+return array(
+       'tx_vcc_hook_communicationServiceHookInterface' => $extensionPath . 'Interface/CommunicationServiceHookInterface.php',
+       'tx_vcc_service_communicationservice' => $extensionPath . 'Service/CommunicationService.php',
+       'tx_vcc_service_extensionsettingservice' => $extensionPath . 'Service/ExtensionSettingService.php',
+       'tx_vcc_service_loggingservice' => $extensionPath . 'Service/LoggingService.php',
+       'tx_vcc_service_tsconfigservice' => $extensionPath . 'Service/TsConfigService.php',
+);
 ?>
\ No newline at end of file
index 2d0a220..fe9aa26 100644 (file)
@@ -23,10 +23,8 @@ $EM_CONF[$_EXTKEY] = array(
                        'php' => '5.2.0-0.0.0',
                        'typo3' => '4.5.0-4.7.99',
                ),
-               'conflicts' => array(
-               ),
-               'suggests' => array(
-               ),
+               'conflicts' => array(),
+               'suggests' => array(),
        ),
        'dependencies' => 'cms',
        'module' => '',
@@ -41,8 +39,7 @@ $EM_CONF[$_EXTKEY] = array(
        'shy' => '',
        'uploadfolder' => 0,
        '_md5_values_when_last_written' => 'a:13:{s:9:"ChangeLog";s:4:"5054";s:16:"ext_autoload.php";s:4:"aba1";s:21:"ext_conf_template.txt";s:4:"d78b";s:12:"ext_icon.gif";s:4:"7736";s:17:"ext_localconf.php";s:4:"e4a4";s:14:"ext_tables.php";s:4:"158b";s:14:"ext_tables.sql";s:4:"685c";s:37:"Classes/Hook/DocHeaderButtonsHook.php";s:4:"47a9";s:40:"Classes/Service/CommunicationService.php";s:4:"62cb";s:43:"Classes/Service/ExtensionSettingService.php";s:4:"bb3d";s:34:"Classes/Service/LoggingService.php";s:4:"2697";s:35:"Classes/Service/TsConfigService.php";s:4:"e1f2";s:38:"Resources/Public/Icons/CachePlugin.png";s:4:"4312";}',
-       'suggests' => array(
-       ),
+       'suggests' => array(),
        'conflicts' => '',
 );
 
index 13134fd..1b71746 100644 (file)
@@ -4,11 +4,11 @@ if (!defined('TYPO3_MODE')) {
 }
 
 if (TYPO3_MODE == 'BE') {
-               // Register hook to add the cache clear button to configured items in different views
+       // Register hook to add the cache clear button to configured items in different views
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook']['vcc'] =
                'EXT:vcc/Classes/Hook/DocHeaderButtonsHook.php:tx_vcc_hook_docHeaderButtonsHook->addButton';
 
-               // Initialize array for internal hooks
+       // Initialize array for internal hooks
        if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vcc']['hooks']['communicationService'])) {
                $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['vcc']['hooks']['communicationService'] = array();
        }
index ed52731..9e70e4f 100644 (file)
@@ -3,13 +3,13 @@ if (!defined('TYPO3_MODE')) {
        die ('Access denied.');
 }
 
-       // Register sprite icons
+// Register sprite icons
 $icons = array(
        'clearVarnishCache' => t3lib_extMgm::extRelPath('vcc') . 'Resources/Public/Icons/CachePlugin.png',
 );
 t3lib_SpriteManager::addSingleIcons($icons, 'vcc');
 
-       // Add default module settings
+// Add default module settings
 t3lib_extMgm::addPageTSConfig('
 mod.vcc {
        pages = 1