[TYPO3-core] RFC: #16420: TYPO3 misses a Linkvalidator module

Christian Kuhn lolli at schwarzbu.ch
Wed Nov 17 01:32:27 CET 2010


Hey.

On 11/16/2010 05:58 PM, Patrick Gaumond wrote:
> Problem:
> TYPO3 Core doesn't provide any mechanism to help correct missing or
> broken links. It simply just don't render them silently if it's an
> internal page for example without anyone being aware.

First: I really like this extension, especially the scheduler task is 
great. From a functionality point of view the extension is pretty much 
complete and works for me. It's great to see this extension in the core, 
I'm sure many people will love it.

 From core point of view, this extension is _not_ yet ready: There are a 
lot of things to do, especially remove redundancies, improve general 
code quality like nesting levels and naming things, refactorings to 
smaller methods and cleaner code base in general.

I talked with Steffen Kamper about this and the general goal is to add 
the extension to core as it is now, and give your team the chance to 
improve the code until beta3.
So: Here is my general +1 on reading and testing, but we will have to 
discard the extension again if it doesn't improve significantly until 
beta3 (development will be done in forge, we'll merge back to core trunk).

If you want me to give you a helping hand, please drop me a line. I'll 
do my best to help out as far as my time allows this.

Attached patch does some basic things I stumbled upon. It's a git diff 
file, it should apply with -p1:
- Add info extension as dependency to ext_emconf
- Fix a warning in scheduler task
- Fix a deprecated by-reference-call warning in modfunc1 module
- Some base cleanups in several files

Here is a (incomplete) list of what I think what should be done. 
Warning: It's a long and unsorted list, mixing bugs and tasks, but many 
things are really simple. Don't be afraid of it ;)

* The scheduler task code and other classes need refactoring (more and 
smaller methods).
* Manual needs proof reading
* Changelog file should probably be deleted later on, changes will go to 
core Changelog
* The list in the BE module should be sorted by record (currently two 
findings in one records are not necessarily next to each other)
* Fix naming scheme. example: 
tx_linkvalidator_scheduler_linkadditionalfieldprovider -> 
tx_linkvalidator_Tasks_LinkAdditionalFieldProvider
* Add missing classes to ext_autoload
* lowercase all filenames
* Add TCA for the table and show records on pid 0, or maybe even on the 
pages where the check was done? Requires a pid field, probably together 
with a key on it for quick query within module?
* Fix dos line endings in ext_tables.php
* Currently the linkchecker does not show internal links to hidden (only 
deleted) pages as broken. From a frontend point of view those links 
_are_ broken. Imho those links should be listed as well.
* Use the new mail API for the scheduler mail? Do we _really_ need to 
send html mails? Use locallang labels in the template?
* PageTSconfig: showUpdateButton = true -> showUpdateButton = 1 (this is 
TS, not php)
* Remove clear.gif in modfunc1/
* Reduce locallang files to default labels only (no "de", no orig_hash, ..)
* Change whitespaces to tabs (eg. in mod_template.html), check for 
pending whitespaces
* Check accessibility of methods (eg. initialize in modfunc1 could be 
protected)
* Check for duplicate code and refactor (eg. big parts of scheduler task 
and modfunc module are pretty much identical)
* Remove "// End of method by comments". If methods are short enough 
it's obvious what they close
* Avoid abbreviations, example: labels.depth_infi -> labels.depth_infinite
* Refacor business code in if conditions, example in modfunc: if (($res 
= $GLOBALS['TYPO3_DB']->exec_SELECTquery( ...
* Remove global $LANG calls, refactor (eg. in modfunc startTable())
* Avoid foreach($something as $key => $value): give $key and $value 
better names
* Add @package and @subpackage annotations to lib/ classes, check 
visibility of methods
* Rename tx_linkvalidator_checkbase to 
tx_linkvalidator_LinkTypes_Abstract or something like that, rename other 
classes accordingly
* Move all classes to classes/ folder, move task to classes/tasks 
subfolder, maybe create another subfolder for the linktype things
* Create an interface for the linktype classes, let the different types 
implement it
* Create unit tests at least for the link type classes, they do not have 
big dependencies and should be easily testable
* Refactor at least class tx_linkvalidator_processing: The main method 
getLinkStatistics() is far too complicated and nested, reminds me of 
typolink() ;)


Thanks
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16420-01.diff
Type: text/x-patch
Size: 18142 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101117/ea45567f/attachment-0001.bin>


More information about the TYPO3-team-core mailing list