Re: Casing function names: Conclusion#2

From: Date: Wed, 23 May 2001 11:00:37 +0000
Subject: Re: Casing function names: Conclusion#2
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969335521@lists.php.net to get a copy of this message
He, this helps... (threatening to just do it after the thread goes into trips to germany etc...) It was a no indeed :) Okay, now a better try: 1. The stylesheet should be modified to be case-insensitive. 2. Function that are readable in lowercase, *should always be written lowercase* (like header, setcookie, etc.) This might look like a huge manual job, but it isn't. Generate a list of all <function> tags, and per function, choose a preferred casing. Then apply it to the whole doc. This way, you also won't get anymore that one and the same function is written in ten different ways. See also below. 3. A big function-renaming should eventually take place (not the phpdoc's business) 4. All functionnames should be lowercase. Note: location in the sentence etc should NOT have any influence on the casing. Greetz, Jeroen PS: I wrote the script (based on Torben's) #!C:/pf/internet/apache/php/php.exe -q <?php /* -*- mode: c++; minor-mode: font -*- */ error_reporting(0); if ($argc < 2) { die('Usage: ' . basename($argv[0]) . ' <xml_files>'); } while (isset($argv[++$i]) ) { $source = implode('', file($argv[$i])); while(true) { list($trash,$source) = split( "<function[ \n]*>" , $source , 2 ); if (!$source) break; list($funcname,$source) = split( "</function[ \n]*>", $source , 2); if (strtolower($funcname) != $funcname // && strtolower($funcname{0}) . substr($funcname,1) != strtolower($funcname) ) echo "$funcname\n"; } } ?> And the output shows that most mixed-case function names just have the first letter uppercase, and nothing more. The argument of readability is not valid for these functions, so IMO these CAN be renamed. When filtering these out, (by uncommenting the commented line) the following list remains: (sorted, double lines removed) [ Someone should check those 'functions' out like "COM::COM" and "Parallel searching using YAZ" ] COM::COM GetImageSize ImageAlphaBlending ImageArc ImageChar ImageCharUp ImageColorAllocate ImageColorDeAllocate ImageColorTransparent ImageCopy ImageCopyMerge ImageCopyMergeGray ImageCopyResampled ImageCopyResized ImageCreate ImageCreateFromGif ImagecreateFromJPEG ImageCreateFromJPEG ImageCreateFromPNG ImageCreateFromString ImageCreateFromWBMP ImageCreateTrueColor ImageDashedLine ImageDestroy ImageEllipse ImageFill ImageFilledArc ImageFilledEllipse ImageFilledPolygon ImageFilledRectangle ImageFillToBorder ImageFontHeight ImageFontWidth ImageGammaCorrect ImageGIF ImageInterlace ImageJPEG ImageLine ImageLoadFont ImagePNG ImagePolygon ImagePSFreeFont ImagePSLoadFont ImageRectangle ImageSetBrush ImageSetPixel ImageSetThickness ImageSetTile ImageString ImageStringUp ImageSX ImageSY ImageTrueColorToPalette ImageTTFBBox ImageTTFText ImageTypes imageWBMP ImageWBMP OciBindByName OCIBindByName OCIColumnIsNULL OCIColumnName OCIColumnSize OCIColumnType OCICommit OCIDefineByName OCIError OCIExecute OCIFetch OCIFetchInto OCIFetchStatement OCIFreeCursor OCIFreeDesc OCIFreeStatement OCIInternalDebug OCILogOff OCILogon OCINewCursor OCINewDescriptor OCINLogon OCINumCols OCIParse OCIPLogon OCIResult OCIRollback OCIRowCount OCIServerVersion OCIStatementType Ora_ColumnName Ora_ColumnSize Ora_ColumnType Ora_Error Ora_ErrorCode OrbitEnum OrbitObject OrbitStruct Parallel searching using YAZ PassThru PDF_add_bookmark PDF_add_launchlink PDF_add_locallink PDF_add_note PDF_add_outline PDF_add_pdflink PDF_add_thumbnail PDF_add_weblink PDF_arc PDF_attach_file PDF_begin_page PDF_begin_pattern PDF_begin_template PDF_circle PDF_clip PDF_close PDF_close_image PDF_close_pdi PDF_close_pdi_page PDF_closepath PDF_closepath_fill_stroke PDF_closepath_stroke PDF_concat PDF_continue_text PDF_curveto PDF_delete PDF_end_page PDF_end_pattern PDF_end_template PDF_execute_image PDF_fill_stroke PDF_findfont PDF_get_annotation PDF_get_bookmark PDF_get_buffer PDF_get_font PDF_get_fontname PDF_get_fontsize PDF_get_image_height PDF_get_image_width PDF_get_parameter PDF_get_pdi_parameter PDF_get_pdi_value PDF_get_value PDF_initgraphics PDF_lineto PDF_makespotcolor PDF_moveto PDF_new PDF_open PDF_open_file PDF_open_gif PDF_open_image PDF_open_image*() PDF_open_image_file PDF_open_jpeg PDF_open_memory_image PDF_open_pd_pagei PDF_open_pdi PDF_open_png PDF_open_tiff PDF_place_image PDF_place_pdi_page PDF_put_image PDF_rect PDF_restore PDF_rotate PDF_save PDF_scale PDF_set_border_color PDF_set_border_dash PDF_set_border_style PDF_set_char_spacing PDF_set_duration PDF_set_font PDF_set_horiz_scaling PDF_set_info PDF_set_info_author PDF_set_info_creator PDF_set_info_keywords PDF_set_info_subject PDF_set_info_title PDF_set_leading PDF_set_parameter PDF_set_paramter PDF_set_text_matrix PDF_set_text_pos PDF_set_text_rendering PDF_set_text_rise PDF_set_transition PDF_set_value PDF_set_word_spacing PDF_setcolor PDF_setdash PDF_setflat PDF_setfont PDF_setgray PDF_setgray_fill PDF_setgray_stroke PDF_setlinecap PDF_setlinejoin PDF_setlinewidth PDF_setmatrix PDF_setmiterlimit PDF_setpolydash PDF_setrgbcolor PDF_setrgbcolor_fill PDF_setrgbcolor_stroke PDF_show PDF_show_boxed PDF_show_xy PDF_skew PDF_stringwidth PDF_stroke PDF_translate pg_Connect pg_ErrorMessage pg_Exec SetCookie swf_actionGetUrl swf_actionGotoFrame swf_actionGotoLabel swf_actionSetTarget swf_actionWaitForFrame swf_endButton swf_onCondition swf_shapeArc swf_shapeFillOff swf_shapeFillSolid swf_shapeLineSolid swf_shapeLineTo swf_shapeMoveTo SWFAction SWFDisplayItem SWFShape->addJpegFill SWFText SWFText->setFont SWFTextField->setFont VARIANT::VARIANT

« previous php.doc (#969335521) next »