|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Apr 29, 2003 3:53 pm Post subject: |
|
|
I see, I was confused when you said:
Quote: |
Why don't you "hardcode" C..Z as resource locators if the current OS is Windows?"
|
But what you really meant is, if the resource is C-Z and it isn't registered and it's Windows, then treat it as part of the filepath instead of throwing an error.
What about A-B? It's possible to get templates off a floppy yes? Especially those high traffic sites? And of course, lower case should be allowed as well.
Monte |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Tue Apr 29, 2003 4:01 pm Post subject: |
|
|
My code snippet once again
Code: |
if (!isset($this->_plugins['resource'][$resource_type]) && $current_os == "win" && (strtolower($resource_type) >= "a") && (strtolower($resource_type) <= "z") {
if(file_exists($resource_type.":".$resource_name) && is_readable($resource_type.":".$resource_name)) {
$readable = true;
$resource_name = $resource_type.":".$resource_name;
}
|
You see? If current OS is windows and the resource_type is "A".."Z" (upper or lower case) and wasn't registered manually then I re-add the $resource_type to the $resource_name to treat it as directory again.
I have written the above code in mind so there can be an error but I think this should work?! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Apr 29, 2003 4:09 pm Post subject: |
|
|
Yes I tried it and it has syntax errors and other problems. If you get it working clean and test it (I don't have windows handy) I'll put in the patch.
Monte |
|
Back to top |
|
Wom.bat Smarty Pro
Joined: 24 Apr 2003 Posts: 107 Location: Munich, Germany
|
Posted: Tue Apr 29, 2003 4:48 pm Post subject: |
|
|
I'd vote for minimum-two-character-resource-names |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|