How not to hard code paths
How not to hard code paths
You may have heard the term "hard coding" a few times before. Here's a quote from Wikipedia.org. Quote:
Example of a hard coded path PHP Code:
PHP Code:
Other info values for getting directory paths Note: All are followed by an example. Use only the first part of each one! Quote:
|
Re: How not to hard code paths
You can also use get_localinfo() to find the above dir. This is really just a more complicated method. I thought I would just post for reference.
|
Re: How not to hard code paths
Code:
|
Re: How not to hard code paths
Yes, it would.
|
Re: How not to hard code paths
Just some FYI, get_localinfo() will get you any of the paths defined in the core.ini, here is an example of a stock core.ini
Code:
; Configuration file for AMX Mod X |
Re: How not to hard code paths
Thanks, guys! I'll update it now :)
|
Re: How not to hard code paths
Thanks for the info! Way better then what I did. >_<
|
Re: How not to hard code paths
Also, shouldn't it be
PHP Code:
PHP Code:
|
Re: How not to hard code paths
your eyes are sharp, just a typo and I think everyone will notice that when they use it. and I don't think the author is here lately.
|
Re: How not to hard code paths
OK, thank you. :) Just checking.
|
All times are GMT -4. The time now is 15:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.