[TYPO3-dev] Obsolete parts of pibase (WAS: classes location, get data from query...)

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Sun Feb 4 00:26:11 CET 2007


Am Sat, 03 Feb 2007 17:36:44 -0500 schrieb Andrew Davis:

> hi
> 
> i cant seem to find the php for the pi base classes
> ( pi_exec_query() , etc. ).
> 
> I am making an extension using the kicksarter, which is great, but i 
> want to make my own class in the pi_ class, instead of using listview() 
> since it wraps the result in <table> since it thinks it wil be a table 
> (duh).
> 
> so i can do
> 
> $res = $this->pi_exec_query('tx_avgffeatcontent_items');
> 
> but $res only conains a string "Resource id #128"... i am wondering how 
> to directly access the query result that should be $res?
> 
> 
> 
> 
> i am planning on looking at that listview() in the pi_classes but i cant 
> find that php file...
> 
> any assistance much appreciated.
> Andrew Davis

Hi Andrew,

before programming extensions I suggest to read at least the docs

"Core APIs" and "Coding Guidlens"

http://typo3.org/documentation/document-library/core-documentation/

They will also answer your question.

Personally I regard all pi_classes as obsolete and will not use
tslib_pibase any longer. The API of the function only produces headaches
(link functions and query functions). The handling of caching is a medium
sized disaster. The kickstarter doesn't produce the very best example code. 

I suggested a path of simplification for the handling of caching within
pi_base to the responsible people (core team). They were in majority
completely uninterested or over-challenged to discuss it. 

Dmitry on the other hand is sticky to strict bug for bug backward
compatibilty that he prefers to keep to the over complectated API, even
where matters could be improved for a comparingly low price. Well that's
not the worst strategy. Keeping the old API for old extensions, don't
build new extension upon tslib_base if you can avoid it. Or only use it
for translation handling.



>From experience I suggest the following strategy, if you want to use
pibase.

1.) Translations: 

pibase is still good in this. Use the pi_base API for this.


2.) Links: 

Not worth to study the many limited and complicated functions of pi_base
API. Try to understand the use of typolink directly, less work, full
flexibility.

See: 

http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/5/8/
http://svn.t3.digitaldistrict.de/cgi-bin/trac.cgi/browser/typo3xdev/tx_lib/trunk/class.tx_lib_link.php


3.) Queries: 

The same. Forget pi_base API. Use new DBAL directly. 

http://typo3.org/documentation/document-library/core-documentation/doc_core_cgl/4.0.0/view/1/4/


Regards

Elmar





































More information about the TYPO3-dev mailing list