Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

where is "tep_is_writable" defined in 2.3.3?


BGTFICA

Recommended Posts

Posted

I was getting fatal errors when I try to log in to admin telling me of undefined fun. tep_get_ip_address. So, i copied the definition from

catalog/includes/functions/general.php

to

catalog/admin/includes/functions/general.php

Now I can login, but the dashboard i incomplete and I cannot access the "categories/products" page.

Both of these have fatal errors telling me of undefined function: tep_is_writable.

I do not know where this is defined.

 

Please note, this trouble comes as I try to set up USPS Rate V4 Intl Rate V2 - 01-27-13 Update.

 

I am very novice :-)

 

thx very much in advance,

Isaiah

Rom. 10:13

 

Posted

It's supposed to be at the very end of /admin/include/functions/general.php

 

But it's not defined in the catalog version of that file.

 

Sounds like you inadvertantly uploaded your catalog version to the admin side.

 

As you already have learned - They aren't interchangable.

 

////
// Wrapper function for is_writable() for Windows compatibility
function tep_is_writable($file) {
if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
 if (file_exists($file)) {
 $file = realpath($file);
 if (is_dir($file)) {
	 $result = @tempnam($file, 'osc');
	 if (is_string($result) && file_exists($result)) {
	 unlink($result);
	 return (strpos($result, $file) === 0) ? true : false;
	 }
 } else {
	 $handle = @fopen($file, 'r+');
	 if (is_resource($handle)) {
	 fclose($handle);
	 return true;
	 }
 }
 } else{
 $dir = dirname($file);
 if (file_exists($dir) && is_dir($dir) && tep_is_writable($dir)) {
	 return true;
 }
 }
 return false;
} else {
 return is_writable($file);
}
}

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...