Forums / General Questions / custom mod needs to access files above public_html outside cart, is it possible?

custom mod needs to access files above public_html outside cart, is it possible?

Views: 951

Results 1 to 7 of 7
16 Dec 2012, 2:27 PM
#1
boxes avatar

boxes

New Zenner

Join Date:
Jul 2004
Posts:
37
Plugin Contributions:
0

custom mod needs to access files above public_html outside cart, is it possible?

we're having a mod created that needs to access files above public_html and outside cart in public_html:

/home/user/public_html/zencart/

/home/user/public_html/custom_dir/stuff.php

/home/user/custom_dir_1/stuff_1.php
/home/user/custom_dir_1/more_stuff_1.php
/home/user/custom_dir_1/etc_1.php

/home/user/custom_dir_2/stuff_2.php
/home/user/custom_dir_2/more_stuff_2.php
/home/user/custom_dir_2/etc_2.php

is this possible? how might we allow going to those specific outside locations to access stuff?

thanks

peace

16 Dec 2012, 5:14 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: custom mod needs to access files above public_html outside cart, is it possible?

You should be able to do so providing the correct link info
As outlined in this tutorial, where a default folder is moved
http://www.zen-cart.com/content.php?257

Zen-Venom Get Bitten

16 Dec 2012, 5:25 PM
#3
boxes avatar

boxes

New Zenner

Join Date:
Jul 2004
Posts:
37
Plugin Contributions:
0

Re: custom mod needs to access files above public_html outside cart, is it possible?

kobra:

You should be able to do so providing the correct link info
As outlined in this tutorial, where a default folder is moved
http://www.zen-cart.com/content.php?257

interesting, thanks

so, we could define the custom outside locations in:

  • /includes/configure.php
  • /admin/includes/configure.php

define('DIR_FS_DOWNLOAD', '/home/my_user_name/download/');
define('DIR_CUSTOM_DIR_1', '/home/my_user_name/custom1/');
define('DIR_CUSTOM_DIR_2', '/home/my_user_name/public_html/custom2/');

and then just refer to the new define names . DIR_CUSTOM_DIR_1 . in the code to snag stuff from those locations

does it sound like i got it?

thanks

peace

16 Dec 2012, 6:26 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: custom mod needs to access files above public_html outside cart, is it possible?

honestly, I wouldn't do it in the configure files. It feels best to leave them as they are. Mess them up and the whole site will stop playing.

So, I would do it elsewhere. Usually that would be in

includes/extra_datafiles
admin/includes/extra_datafiles

But you can do it anywhere where the files are auto-loaded. If you don't know which stuff that applies to then just use those two folders. The only complication - and it is a bit unlikely - is if your new module does stuff before those two files get loaded. This is not likely unless you are doing some fairly archane stuff.

Nick
iszent.com

16 Dec 2012, 6:43 PM
#5
boxes avatar

boxes

New Zenner

Join Date:
Jul 2004
Posts:
37
Plugin Contributions:
0

Re: custom mod needs to access files above public_html outside cart, is it possible?

do you mean that you can add defines in the extra_datafiles dir?

/extra_datafiles/outside_paths_here.php

define('DIR_FS_DOWNLOAD', '/home/my_user_name/download/');
define('DIR_CUSTOM_DIR_1', '/home/my_user_name/custom1/');
define('DIR_CUSTOM_DIR_2', '/home/my_user_name/public_html/custom2/');

thanks

peace

16 Dec 2012, 7:52 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: custom mod needs to access files above public_html outside cart, is it possible?

Yes, that is one of the purposes of those folders.

(You may be more familiar with defines being used for language-specific output text, and thus would belong in a language file, but this is not related to user language.)

16 Dec 2012, 8:21 PM
#7
boxes avatar

boxes

New Zenner

Join Date:
Jul 2004
Posts:
37
Plugin Contributions:
0

Re: custom mod needs to access files above public_html outside cart, is it possible?

most cool, thanks!!

peace