manishjaingit / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

Move $ALLOWED_SITES from global variable to class variable #421

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
using global to access $ALLOWED_SITES is not good. Instead of that i suggest to 
send it like parameter to start() function and than bring it to class variable 
from where it can be used in more OO way.

What version of the product are you using? On what operating system?
2.8.11, win7

Please provide any additional information below.
When I try to use this great script i get in problem with $ALLOWED_SITES array, 
it wasn't visible in constructor. When i check how its implemented i notice 
that its used with 'global' that is not good way to pass around variables, 
specially if u already use classes. I suggest to send $ALLOWED_SITES to static 
start() function and than to __contruct() where it will be assigned to class 
variable from where it can be accessed in more natural way for OOP and class. I 
attach modified version of file to this issue.

Anyway thanks for this great script...
Best regards,
Milan

Original issue reported on code.google.com by zivkovic...@gmail.com on 7 Jan 2013 at 12:09

Attachments: