Cleanup: AgaviToolkit?
- Proposal for Agavi 2.0
- Authors
AgaviToolkit? has always bothered me somewhat. It doesn't seem appropriate that a framework have a 'toolkit' class with whatever miscellany didn't fit in anywhere else.
Here's an analysis of the current methods and some proposals. For ideas I'm not sure about, I placed a (?) after the suggestion.
- isPathAbsolute($path): move to Feature/Filesystem? (?)
- normalizePath($path): move to Feature/Filesystem? (?)
- mkdir($path): move to Feature/Filesystem? (?)
- stringBase($baseString, $compString, &$equalAmount = 0): only used once in AgaviWebRouting?, move to routing or remove, as it is not particularly useful
- clearCache($path = ''): remove per Feature/Caching
- overloadHelper(array $definitions, array $parameters): haven't got the slightest clue what this is for, but seems to be used exclusively by date stuff, so move it over there
- expandVariables($string, array $arguments = array()): remove per Cleanup/Configuration#Directives
- literalize($value): remove per Cleanup/Configuration#Directives
- expandDirectives($value): remove per Cleanup/Configuration#Directives
- floorDivide($numerator, $denominator, &$remainder): again, seems to be used exclusivly by date stuff, so move it that way (this isn't the kind of thing that should be exposed by a framework anyway)
- isPortNecessary($scheme, $port): although this is used both in AgaviWebRouting? and in AgaviWebRequest?, I think it associates more closely with AgaviWebRouting?, as it is used to both parse input URLs and generate URLs (?)
- getValueByKeyList(array $array, array $keys, $default = null): move to translation, as it's the only place it's used and is seemingly useful at all; again, this isn't the sort of thing a framework should expose
- isNotArray($value): remove entirely; it's really not that difficult to type !is_array(...)
Since I'm sure some Agavi projects make use of this class now, this proposal is marked as for Agavi 2.0.
I know some of these suggestions will be pretty controversial, so I'm definitely open to comments/criticism/slaps to the face.

