[Easymod-cvs] easymod/docs method_guidelines,NONE,1.1 parser_guidelines,NONE,1.1
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2005-12-04 03:12:39
|
Update of /cvsroot/easymod/easymod/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29556/docs Added Files: method_guidelines parser_guidelines Log Message: First commit to SourceForge. Enjoy! --- NEW FILE: parser_guidelines --- //-----------------------// // Parser Guidelines // //-----------------------// - Every parser must have these functions/methods, that return the indicated array of information: ~~~~~~~~~~~~~~~~ ~ parse_header ~ ~~~~~~~~~~~~~~~~ array( - 'name' : MOD Name - 'authors' : array( array( - 'username' : Author Username - 'email' : Author Email - 'name' : Author Email - 'website' : Author Website ) ... ) - 'desc' : MOD Description (OPTIONAL) - 'version' : MOD Version - 'file_edit': Files to be edited (OPTIONAL) - 'file_inc': Files included (OPTIONAL) - 'notes' : Authors notes (OPTIONAL) - 'license' : License for MOD (OPTIONAL) - 'history' : (OPTIONAL) array( array( - 'date' : Date of entry - 'version' : Version on entry - 'note' : Note about entry ) ... ) ) ~~~~~~~~~~~~~ ~ parse_sql ~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ ~ parse_actions ~ ~~~~~~~~~~~~~~~~~ array( array( - 'type' : OPEN/COPY/FIND etc... - 'command' : The contents of the action, I.e. the FIND string, or the filename to copy ) ... ) - The parser must also have a verify() function, that returns true or false on wetyher the parsed file is a MOD install file - The file should include a test for if the class already exists - The file should end with the class being instinated into $mod_parser - Each parse function should use the io class object (testing and creating if nesscecary) --- NEW FILE: method_guidelines --- //---------------------------------------// // Read/Write/Move Method Guidelines // //---------------------------------------// - Each method needs to have the following at the top if ( isset($set_methods) ) { $method = 'lang_variable'; return; } This is used by easymod so that it knows the method is there. EasyMOD will look for 'lang_variable' in the $lang variables. If it doesn't exist, it will use that string but with underscores (_) replaced with spaces. @TODO Need to think of the way to test if the function is usable or not. I want only those methods that will work to be displayed to the user. - Every method must have the following functions - open_file($file = '') - write_file($file = '', $contents = '') - make_dir($dir) - copy_file($from_file, $to_file) - clean() - test() - Each function needs to return true if successfully and false if not successfull - Each method needs a clean function which will be used to close any connections like with the FTP method. This function can be left empty. - Functions that start with _ are private and are only used by that class itself. An exception to this is if the class needs to log in so it has an constructor function. An example of this would be the function to change the directory in the ftp method - The file should include a test for if the class already exists - The file should end with the class being instinated into $mod_io |