Update:Archive/1.0/Developers: Difference between revisions

Line 523: Line 523:
* [49] Header sent before contents are determined
* [49] Header sent before contents are determined
* [59+] Functions defined during script - this should be separated; the logic behind the script is hard to determine because function definitions interrupt it
* [59+] Functions defined during script - this should be separated; the logic behind the script is hard to determine because function definitions interrupt it
* [127-132] This seemingly arbitrary variable renaming makes it hard to follow where data originates.
* [179-208]
* [179-208]
** use $_SERVER['HTTP_USER_AGENT'] instead of calling getenv multiple times
** use $_SERVER['HTTP_USER_AGENT'] instead of calling getenv multiple times
Line 529: Line 530:
** Code comments indicate 1-6, checks provide IDs 0,2,3,4,5,6
** Code comments indicate 1-6, checks provide IDs 0,2,3,4,5,6
** Use logic to create short-circuit; right now it's all if's so the checks will happen even after a match is found and $osid is set -- logically, it's possible for $osid to be set twice
** Use logic to create short-circuit; right now it's all if's so the checks will happen even after a match is found and $osid is set -- logically, it's possible for $osid to be set twice
* [234] Query in a loop.  Remove this.  This should be replaced with an IN(explode(','$reqItemGuid)) for $reqItemGuid[$i] in the query, reducing the number of queries from count($reqItemGuid) to 1 since $osid and $reqTargetAppGuid are the same.
* [253] Is there any way to avoid this OR ?
3,035

edits