My own CMS. Here's the function signature of the heart of it, which depending on circumstance may call itself recursively.<p><pre><code> function a_nodes_list_trees(
$site_url,
$base_url,
$mode,
$site_id,
$max_subtree_depth,
$nlevels,
$node_id = 0,
$tree_id = 0,
$nleft = 0,
$nright = 0,
$nlevel = 0,
$current_subtree_depth = 0,
$flags = 0,
$order = 'tree',
$inline = false, /* needed when loading stuff via ajax*/
$skipped_types = [],
$items_per_page = 10,
$min_tag_count = 2,
$min_author_count = 2,
$is_site_root = false,
$skip_pagination = false,
$ignore_404 = false,
$skip_display_options_and_batch_ops = false,
$display_bottom_pagination = true)
</code></pre>
As you can tell from the default values, it started out having 6 arguments. And it has things like this in it:<p><pre><code> $mysql_the_rest = 'FROM
'.DBTP.'node n
LEFT JOIN
'.DBTP.'node n2
ON
n.tree_id = n2.id
AND
n2.perm_view & ' . A_PERMS . '
'.$mysql_join.'
WHERE
'.$mysql_where2.'
'.$mysql_where.'
n.perm_view & ' . A_PERMS . '
AND
n.site_id = ' . $site_id . '
';
$total_count = $A->db->fetch_one_column('c', ' SELECT COUNT(*) c '.$mysql_the_rest);
</code></pre>
.. you know? The whole CMS is 20k lines of PHP, with HTML, PHP, and MySQL all happily living together in the same files (it's not that I don't have templates, I just have plenty HTML in the PHP, too)<p>Yet, it works like a charm, PHP updates made it faster even, and I can use it for everything I needed so far, and use its output in a variety of ways. I still want to rewrite it, but it seems a lot of work to just shave off a few ms and have nicer code, with the same result for the visitor, and also having to write something that migrates the content. I suspect with enough content, it will slow down, and then I'll think about the next iteration. But it's still a mixture of pride, plain being happy to have it, and groaning whenever I fix a bug or add a feature.