php - Order include file depending on inherit -


Hello there guys and best wishes from Sweden!

I have a very difficult problem, I will try to show what I mean exactly.

I am creating a modular CMS, and some modules get from a parent module. My problem is that the parents' modules need to be included before "children".

I get module enfo from an XML file and store it in an array like this:

  array ([blogg] => array ([module_id] = & Gt; Blog [module_name] = & gt; blog [module_dcc] = & gt; description [module_arimal] => http://www.url.se [author] = & gt; god name [author_url] = & Gt; http://url.se [version] = & gt; 1.0 [heir] => core | Twitter [path] => / path / to / file [dependon] => Array ([0] = & gt; Core [1] => Twitter))  

I have exploded the heir and co-found it in "Dependent" As you see above, the problem is that I can sort the sequence to include the files. Every module comes out of the core, but if the Danone array has another module, then the "child" mod < / P>

Tobas

Look at "topological sort".


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -