I get these notices on cron runs (drush cron --debug):

Undefined index: SERVER_NAME openoutreach.profile:121
Undefined index: SERVER_ADDR openoutreach.profile:122

I grepped for the server_ip index and don't see anywhere it's used. But that leaves the server_name index, which I believe is needed but this is Apps thing all new territory for me.

Comments

nedjo’s picture

Thx for noting this. It's in code I cribbed from openpublish_apps_servers_info() and haven't looked closely at. Likely just a test for isset() in each case will help here--but what to set the values to if not set I don't know.

Robin Millette’s picture

I opened #1719808: $_SERVER use in openpublish.profile and drush use hoping to get answers there about hook_apps_servers_info() and the use of those 2 server indexes.

Robin Millette’s picture

I'm using this for now in openoutreach_apps_servers_info() which got rid of the notices when running drush cron or drush cc. Nothing exploded :-)

  $ret = array(
    'debut' => array(
      'title' => 'debut',
      'description' => t('Debut apps'),
      'manifest' => 'http://appserver.openoutreach.org/app/query',
      'profile' => $profile,
      'profile_version' => isset($info['version']) ? $info['version'] : '7.x-1.x',
    ),
  );

  if (isset($_SERVER['SERVER_NAME'])) {
    $ret['debut']['server_name'] = $_SERVER['SERVER_NAME'];
  }
  
  if (isset($_SERVER['SERVER_ADDR'])) {
    $ret['debut']['server_ip'] = $_SERVER['SERVER_ADDR'];
  }

  return $ret;
nedjo’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.