Home
Name Modified Size InfoDownloads / Week
readme.txt 2010-01-15 2.7 kB
Totals: 1 Item   2.7 kB 0
                          << ROOT >>

[ABOUT]
It’s easy to use. 
It doesn’t like any other framework, like a black box, has a steep learning curve.
It's transparent. The whole project if presented in a tree structure. 
You only need to know couple things about how it can help you reuse your code or content.
no configurations needed.


It’s simple therefore reliable.
It has only one file, about 90 lines of code. 

It’s powerful.
The idea is that the world is built on a tree structure.
It turns the tree structure of the file system into a living app.
It forces you to find out the tree structure of the problem you are trying to solve.  
It forces you to organize your content correctly so to maximize code or content reuse. 

It’s automatic. 
If you put things in the right position(in a tree structure of this system), things will work out by themselves.

It's flexible and extensible
It doesn't impose any limitations on coding.

It's an idea.
It can be implemented in different language, run in different context.

[HOW IT WORKS]
1. It processes css, js, inc and html files in each directory of the path. To use the result, put <?php echo $css;//or $html or $js?> in html file. example.html is parsed into $example. 

2. It evaluates inc files from top to bottom( from root to leaf). 
Then it parses templates(dirname.html the backbone) from bottom to top.

3. Using alter() to change path(logic).


[Examples]
file system:
admin        /login        /password        /verify
admin.inc    login.html    password.inc     verify.inc
             login.inc
             login.js 

uri:http://localhost/root/g/admin/login
path:admin/login
return:'<html>....</html>';
script g does these:
1. evaluate php code in admin.inc
2. evaluate php code in login.inc
3. set $js = '<script type='text/javascript' src='/root/admin/login/login.js'></script>'
4. parse template login.html and insert values, <php? echo $js; ?>.






uri:http://localhost/root/g/admin/login/password/verify?username=guest&password
path:admin/login/password/verify
parameter:username=guest&password
return: json string:{success:true}
script g does these: 
1. evaluate php code in admin.inc
2. evaluate php code in login.inc
3. set $js = '<script type='text/javascript' src='/root/admin/login/login.js'></script>'
4. evaluate php code in password.inc
5. evaluate php code in verify.inc with 'exit()'.





[INSTALL]
1. setup web server and php in httpd.conf.
	
	<Directory documentRoot >
		...
		DefaultType application/x-httpd-php
        </Directory>

2. download and extract root.tar.gz.

3. try the example links:
     http://localhost/root/g/admin/login username:guest without password.
     http://localhost/root/g/images/flags

Source: readme.txt, updated 2010-01-15