如何在php中创建代码快捷方式(php触发器)

i just want to know
how i must create code shortcut in php
i see phpfox script its just use:

//for get user id
Phpfox::getUserId();
//when user most be logged in 
Phpfox::isUser(true);
//or user must be admin for do this action
Phpfox::isAdmin(true);
//or this for insert query
Phpfox::getLib('database')->query("")
//so i can get user id easy with this simple code
$userid = Phpfox::getUserId();

so these are shortcut yes?
for run some codes and return something just like call function
so how can i create something like this? for call it for get something...

If i understand your question correctly, you should read about Database Abstraction Layer..

http://pear.php.net/package/DB

I guess you are talking talking about static class methods or functions or class constants..