Page 1 of 1
Tangra PHP framework
Posted: Tue Jul 27, 2010 1:32 pm
by VladSun
I've just found it - the Tangra PHP framework. I also found it's made by a Bulgarian team (I am proud because of it of course

). I took a quick look at it, but I can't say yet whether it's good or not. Anyone who has used it?
http://www.tangraframework.net/
Re: Tangra PHP framework
Posted: Tue Jul 27, 2010 6:35 pm
by josh
They call themselves both a CMS and a framework? Kinda of like Joomla?
Re: Tangra PHP framework
Posted: Wed Jul 28, 2010 4:16 am
by VladSun
I've never worked with Joomla or other CMSs, but from what I've seen in the manual it's a framework.
Re: Tangra PHP framework
Posted: Wed Jul 28, 2010 9:49 am
by alex.barylski
Never used it but I can tell you from looking at the code, that any similarity between Joomla/Drupal ends at a conceptual level, in their attempt to be 'modular'. Joomla is by far the best choice in terms of 'true' modularity and clarity of it's definitions.
Cheers,
Alex
Re: Tangra PHP framework
Posted: Thu Jul 29, 2010 3:04 pm
by josh
That's a qualitative statement. Really noone is more modular than anyone else, unless you agree on a way to measure that.
Re: Tangra PHP framework
Posted: Fri Jul 30, 2010 8:08 am
by alex.barylski
Suffice to say, joomla is more specific in it's definition(s) of 'modular' than Drupal, etc. A module in Drupal is not as obvious as one in Joomla. Extensions in Joomla are more context specific, for instance a plugin is different from a component which is different from a module, whereas in Drupal pretty much every custom is a 'module'; If memory serves me correct, Drupal may have two types of modules, page and block or something like that, but I believe the contexts are almost identical.
Cheers,
Alex
Re: Tangra PHP framework
Posted: Sat Jul 31, 2010 11:02 am
by josh
and the third result for "joomla forms api" is.... a page from the drupal documentation lol. Like I said "obviousness" isn't a measure of modularity. There really is no measure. They both achieve the same thing with a different implementation, for the most part. In drupal I can "push" fields into forms other modules created, where is Joomla's modularity there? As far as I know if you want to do that in Joomla you have to override that whole other module, there is no API for 'splicing' in a field ala Zend_Form. There may be a form class that resembles Zend_Form but how do you "get at" a form provided by a core module, for example?
Drupal is unit tested. So my opinion is the opposite of yours. For example here Drupal lists their perceived benefits to using unit tests.
http://drupal.org/node/58881 My measure of modularity must be different than yours, because the way I see it Joomla uses a lot of hard to understand, hard to test code. Hard to test code isn't modular, in my opinion.
SO your argument was that Drupal is missing certain module types. My rebuttal would be that it does in fact provide exactly what you think its lacking. They also admit to being a "platform" and don't call themselves a framework, so +1 point on honesty. I don't view its lack of OOP as a negative, just makes it "different". The code runs faster as a result, for example. That's a positive.
Re: Tangra PHP framework
Posted: Sat Jul 31, 2010 5:34 pm
by VladSun
With all my respect, I think you should request a "topic split" from the moderators...
Re: Tangra PHP framework
Posted: Sat Aug 07, 2010 12:44 am
by BDKR
From Tangra site wrote:
Tangra framework is not intended for use on high load sites. It is more suitable for intranet or extranet environments where reliability, feature richness and usability are more important than serving 50 000+ hits per hour.
Hmmmm..........
Is feature richness and usability not important in sites serving 50K hits per hour? Is that what they are trying to say about Twitter and Facebook? I don't think the two are mutually exclusive.
I really
THINK this is long hand for "The performance sucks so don't try to build a high load site with it".
Of course, I could be wrong. Testing will tell. Until then, I'll stick with CI and Drupal.
Re: Tangra PHP framework
Posted: Sun Aug 08, 2010 1:11 pm
by VladSun
http://www.tangraframework.net/tfmanual ... asses.html
Usage of addslashes() and stripslashes() functions. You have to escape strings before feeding them into DB and unescape them when getting from DB. Some people suggest that mysql_real_escape_string() is better alternative than addslashes() but we disagree. mysql_real_escape_string() is DB dependant function, provided by mysql PHP module which may not exist and further more a MySQL connection is required before using it.
I have to disagree with this - addslashes() and stripslashes() functions are not a way to sanitize DB input. One shoould use DB engine provided escape functions (it should be implemented by the DB "driver").
if ($id) {
$sql = "insert into users (id, ".
"username, ".
"password ".
") ".
"values ".
"($id,".
"'$username', ".
"'$password' ".
")";
$dbc->execute($sql);
Blah ... if one is going to use plain SQL (which is fine to me), one must use (at least) placeholders and values passed to ensure proper escaping.
While I'm not sure whether Tangra design is good or bad, I think its implementation sucks

Re: Tangra PHP framework
Posted: Mon Aug 09, 2010 11:12 am
by alex.barylski
IMO, the case for whether to use addslashes or mysql_escape_real_string was deliberated and determined a best practice in the following blog:
http://shiflett.org/blog/2006/jan/addsl ... ape-string
If you want to use addslashes() because of the flexibility if offers you in not having to worry about dependencies on specific RDBMS, then you should be using a DB abstraction library of some sorts anyways and using a generic quote() method or prepared statements.
Cheers,
Alex