TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,910
  • Total Topics: 21,307
  • Online today: 872
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 566
  • Total: 566

SCARY problem on installation

Started by urbanscrawl, July 17, 2006, 09:17:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

G6Cad

can you zip it up and make a link the the whole file so i can download it?
eg www.yourdomain.com/temp/load.zip

urbanscrawl

   Here's the last bit:



// The simple yet efficient memcached.
   if (isset($modSettings['cache_memcached']) && trim($modSettings['cache_memcached']) != '')
   {
      // Grab the memcached server.
      if (!is_resource($memcached))
         get_memcached_server();
      if (!$memcached)
         return;

      // !!! It almost might be best to write null to as many as possible....
      if (!fwrite($memcached, 'set ' . $key . ' 0 ' . $ttl . ' ' . strlen($value) . "\r\n" . $value . "\r\n"))
      {
         $memcached = fclose($memcached);
         return;
      }

      fread($memcached, 128);
   }
   // eAccelerator...
   elseif (function_exists('eaccelerator_put'))
   {
      if (rand(0, 10) == 1)
         eaccelerator_gc();

      if ($value === null)
         @eaccelerator_rm($key);
      else
         eaccelerator_put($key, $value, $ttl);
   }
   // Turck MMCache?
   elseif (function_exists('mmcache_put'))
   {
      if (rand(0, 10) == 1)
         mmcache_gc();

      if ($value === null)
         @mmcache_rm($key);
      else
         mmcache_put($key, $value, $ttl);
   }
   // Alternative PHP Cache, ahoy!
   elseif (function_exists('apc_store'))
   {
      if ($value === null)
         apc_delete($key);
      else
         apc_store($key, $value, $ttl);
   }
   // Zend Platform/ZPS/etc.
   elseif (function_exists('output_cache_put'))
      output_cache_put($key, $value);

   if (isset($GLOBALS['db_show_debug']) && $GLOBALS['db_show_debug'] === true)
      $cache_hits[$cache_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
}

function cache_get_data($key, $ttl = 120)
{
   global $boardurl, $sourcedir, $modSettings, $memcached;
   global $cache_hits, $cache_count;

   if (empty($modSettings['cache_enable']) && !empty($modSettings))
      return;

   $cache_count = isset($cache_count) ? $cache_count + 1 : 1;
   if (isset($GLOBALS['db_show_debug']) && $GLOBALS['db_show_debug'] === true)
   {
      $cache_hits[$cache_count] = array('k' => $key, 'd' => 'get');
      $st = microtime();
   }

   $key = md5($boardurl . filemtime($sourcedir . '/Load.php')) . '-SMF-' . $key;

   // Okay, let's go for it memcached!
   if (isset($modSettings['cache_memcached']) && trim($modSettings['cache_memcached']) != '')
   {
      // Grab the memcached server.
      if (!is_resource($memcached) && $memcached !== '0')
         get_memcached_server();
      if (!$memcached)
      {
         // '0' means ignore me for the rest of this page view.
         $memcached = '0';
         return null;
      }

      if (!fwrite($memcached, 'get ' . $key . "\r\n"))
      {
         $memcached = fclose($memcached);
         return null;
      }

      $response = fgets($memcached);
      if (substr($response, 0, 3) != 'END' && substr($response, 0, 5) != 'VALUE')
      {
         // Bad response, junk time.
         $memcached = fclose($memcached);
         return null;
      }

      if (substr($response, 0, 5) == 'VALUE' && preg_match('~(\d+)$~', trim($response), $match) != 0)
         $value = substr(fread($memcached, $match[1] + 2), 0, -2);

      fread($memcached, 5);
   }
   // Again, eAccelerator.
   elseif (function_exists('eaccelerator_get'))
      $value = eaccelerator_get($key);
   // The older, but ever-stable, Turck MMCache...
   elseif (function_exists('mmcache_get'))
      $value = mmcache_get($key);
   // This is the free APC from PECL.
   elseif (function_exists('apc_fetch'))
      $value = apc_fetch($key);
   // Zend's pricey stuff.
   elseif (function_exists('output_cache_get'))
      $value = output_cache_get($key, $ttl);

   if (isset($GLOBALS['db_show_debug']) && $GLOBALS['db_show_debug'] === true)
   {
      $cache_hits[$cache_count]['t'] = array_sum(explode(' ', microtime())) - array_sum(explode(' ', $st));
      $cache_hits[$cache_count]['s'] = isset($value) ? strlen($value) : 0;
   }

   if (empty($value))
      return null;
   // If it's broke, it's broke... so give up on it.
   else
      return @unserialize($value);
}

function get_memcached_server($level = 3)
{
   global $modSettings, $memcached, $db_persist;

   $servers = explode(',', $modSettings['cache_memcached']);
   $server = explode(':', trim($servers[array_rand($servers)]));

   // Don't try more times than we have servers!
   $level = min(count($servers), $level);

   // Don't wait too long: yes, we want the server, but we might be able to run the query faster!
   if (empty($db_persist))
      $memcached = @fsockopen($server[0], empty($server[1]) ? 11211 : $server[1], $err, $err, 0.15);
   else
      $memcached = @pfsockopen($server[0], empty($server[1]

G6Cad

Very hard for us to help with out the actual numbers of the lines the error are reported from.
Please try to attach the file of make a zip and link to it so we can download it.

urbanscrawl

I have just noticed that there appear to be two load.php files, one that was created a few days ago and one load.php- that was created today possibly when I tried to install the program - in fact there appear to be quite a few doubled up...

so do you want the first or the second or both?

G6Cad

I want the one in use with out any renaming after the file like a - or ~ the file used is simply called load.php


urbanscrawl

I'm not sure why that's not linking I can see it in the file I have created...  :-\

Hmmm, how else can I let you see it?


urbanscrawl

damn - you get the same prob - ah - were you saying that I had to zip it?  ;)

I am not sure I have winzip - one second I'll check...

G6Cad

You have to download it to your local machine and ZIP it before you link to the file
or when you have downloaded it, attache it here to your post directly as is

This website is proudly hosted on Crocweb Cloud Website Hosting.