SwissCenter is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

Commit 1574

User picture
  • Author: Pernod
  • 2011-05-10 21:12 (almost 3 years ago)

Added a System Test to verify location of Wget.
Added an External File Locations section to manually specify location of Wget.
Updated the Windows Wget.exe from 1.10.2 to 1.11.4.

Ref #259

Files Affected

 
15731574
733
 * @return string
733
 * @return string
734
 */
734
 */
735
 
735
 
736
function wget_location()
736
function wget_location($system_setting = true)
737
{
737
{
738
  if (is_windows())
738
  if ( $system_setting )
739
    return os_path(SC_LOCATION.'ext/wget/wget.exe');
739
    return get_sys_pref('WGET_PATH', wget_location(false));
740
  elseif (is_synology())
 
 
741
    return trim(exec("which wget | grep '^/' | head -1"));
 
 
742
  else
740
  else
743
    return trim(shell_exec("which wget | grep '^/' | head -1"));
741
  {
 
 
742
    if (is_windows())
 
 
743
      return os_path(SC_LOCATION.'ext/wget/wget.exe');
 
 
744
    elseif (is_synology())
 
 
745
      return trim(exec("which wget | grep '^/' | head -1"));
 
 
746
    else
 
 
747
      return trim(shell_exec("which wget | grep '^/' | head -1"));
 
 
748
  }
744
}
749
}
745
 
750
 
746
/**
751
/**
 
 
752
 * Returns the version of the WGET command
 
 
753
 *
 
 
754
 * @return string
 
 
755
 */
 
 
756
 
 
 
757
function wget_version()
 
 
758
{
 
 
759
  if ( file_exists(wget_location()) )
 
 
760
  {
 
 
761
    $cmd = wget_location().' --version';
 
 
762
    ob_start();
 
 
763
    passthru($cmd);
 
 
764
    $output = ob_get_contents();
 
 
765
    ob_end_clean();
 
 
766
    return preg_get('/Wget ([0-9.]+)/i', $output);
 
 
767
  }
 
 
768
  else
 
 
769
    return '';
 
 
770
}
 
 
771
 
 
 
772
/**
747
 * Returns the windows directory (otherwise known as the systemroot).
773
 * Returns the windows directory (otherwise known as the systemroot).
748
 *
774
 *
749
 * @return string
775
 * @return string
15731574
182
  $core_tests->add_test( $server, check_server_scheduler(), str("PASS_SERVER_SCHED"), str("FAIL_SERVER_SCHED"));
182
  $core_tests->add_test( $server, check_server_scheduler(), str("PASS_SERVER_SCHED"), str("FAIL_SERVER_SCHED"));
183
 
183
 
184
  # ----------------------
184
  # ----------------------
 
 
185
  # Wget
 
 
186
  # ----------------------
 
 
187
 
 
 
188
  $wget = $component_tests->add_section("Wget ".wget_version(),1);
 
 
189
 
 
 
190
  $component_tests->add_test( $wget, file_exists(wget_location()), str('PASS_WGET_TEST'),str('FAIL_WGET_TEST','<a
href="'.server_address().'config/index.php?section=EXT_FILES&action=DISPLAY">'.str('EXTERNAL_FILES').'</a>&
#x27;).'<p>'.str('WGET_DESC'),FALSE);
 
 
191
 
 
 
192
  # ----------------------
185
  # Music IP
193
  # Music IP
186
  # ----------------------
194
  # ----------------------
187
 
195
 
188
  $musicip = $component_tests->add_section("MusicIP ".musicip_version(),1);
196
  $musicip = $component_tests->add_section("MusicIP ".musicip_version(),2);
189
 
197
 
190
  $component_tests->add_test( $musicip, musicip_available(TRUE),
str('PASS_MUSICIP_TEST'),str('FAIL_MUSICIP_TEST').'<p>'.str('MIP_DESC','<a
href="http://www.musicip.com">www.musicip.com</a>'),FALSE);
198
  $component_tests->add_test( $musicip, musicip_available(TRUE),
str('PASS_MUSICIP_TEST'),str('FAIL_MUSICIP_TEST').'<p>'.str('MIP_DESC','<a
href="http://www.musicip.com">www.musicip.com</a>'),FALSE);
191
 
199
 
...
 
...
 
198
 
206
 
199
  if (is_windows())
207
  if (is_windows())
200
  {
208
  {
201
    $monitor = $component_tests->add_section("SwissMonitor",4);
209
    $monitor = $component_tests->add_section("SwissMonitor",3);
202
    $installed = win_service_installed("SwissMonitorService");
210
    $installed = win_service_installed("SwissMonitorService");
203
    $component_tests->add_test( $monitor, $installed ,
str('PASS_SWISSMONITOR_INSTALLED'),str('FAIL_SWISSMONITOR_INSTALLED').'<p>'.str('SWISSMONITOR_DESCRIPTION'));
211
    $component_tests->add_test( $monitor, $installed ,
str('PASS_SWISSMONITOR_INSTALLED'),str('FAIL_SWISSMONITOR_INSTALLED').'<p>'.str('SWISSMONITOR_DESCRIPTION'));
204
 
212
 
Show contents
15731574
119
      $menu->add_menu(str('ADDITIONAL_COMPONENTS'));
119
      $menu->add_menu(str('ADDITIONAL_COMPONENTS'));
120
      $menu->add_item(str('CONFIG_MUSICIP')         ,'section=MUSICIP&action=DISPLAY');
120
      $menu->add_item(str('CONFIG_MUSICIP')         ,'section=MUSICIP&action=DISPLAY');
121
      if (is_windows())
121
      if (is_windows())
122
        $menu->add_item(str('CONFIG_SWISSMONITOR')    ,'section=SWISSMONITOR&action=DISPLAY');
122
        $menu->add_item(str('CONFIG_SWISSMONITOR')  ,'section=SWISSMONITOR&action=DISPLAY');
 
 
123
      $menu->add_item(str('EXTERNAL_FILES')         ,'section=EXT_FILES&action=DISPLAY');
123
 
124
 
124
      $menu->add_menu(str('EXPERT_OPTIONS'));
125
      $menu->add_menu(str('EXPERT_OPTIONS'));
125
      $menu->add_item(str('LANG_EDITOR')            ,'section=LANGUAGE&action=DISPLAY');
126
      $menu->add_item(str('LANG_EDITOR')            ,'section=LANGUAGE&action=DISPLAY');
15731574
1128
        <version>1.22</version>
1128
        <version>1.22</version>
1129
      </string>
1129
      </string>
1130
      <string>
1130
      <string>
 
 
1131
        <id>EXTERNAL_FILES</id>
 
 
1132
        <text>External File Locations</text>
 
 
1133
        <version>1.23.1</version>
 
 
1134
      </string>
 
 
1135
      <string>
1131
        <id>EXTRAS_TEST_TITLE</id>
1136
        <id>EXTRAS_TEST_TITLE</id>
1132
        <text>Additional Components</text>
1137
        <text>Additional Components</text>
1133
        <version>1.19</version>
1138
        <version>1.19</version>
...
 
...
 
1313
        <version>1.20.1</version>
1318
        <version>1.20.1</version>
1314
      </string>
1319
      </string>
1315
      <string>
1320
      <string>
 
 
1321
        <id>FAIL_WGET_TEST</id>
 
 
1322
        <text>Unable to locate Wget. The media search will fail to run. Please specify the correct location in the %s section.</text>
 
 
1323
        <version>1.23.1</version>
 
 
1324
      </string>
 
 
1325
      <string>
1316
        <id>FANART</id>
1326
        <id>FANART</id>
1317
        <text>Fanart</text>
1327
        <text>Fanart</text>
1318
        <version>1.22</version>
1328
        <version>1.22</version>
...
 
...
 
3532
        <version>1.19</version>
3542
        <version>1.19</version>
3533
      </string>
3543
      </string>
3534
      <string>
3544
      <string>
 
 
3545
        <id>PASS_WGET_TEST</id>
 
 
3546
        <text>Wget has been located.</text>
 
 
3547
        <version>1.23.1</version>
 
 
3548
      </string>
 
 
3549
      <string>
3535
        <id>PC_LINK_BACK</id>
3550
        <id>PC_LINK_BACK</id>
3536
        <text>Back</text>
3551
        <text>Back</text>
3537
        <version>1.19</version>
3552
        <version>1.19</version>
...
 
...
 
6099
        <version>1.22</version>
6114
        <version>1.22</version>
6100
      </string>
6115
      </string>
6101
      <string>
6116
      <string>
 
 
6117
        <id>WGET_DESC</id>
 
 
6118
        <text>GNU Wget is a network utility to retrieve files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It works
non-interactively, so it can work in the background.</text>
 
 
6119
        <version>1.23.1</version>
 
 
6120
      </string>
 
 
6121
      <string>
 
 
6122
        <id>WGET_PATH</id>
 
 
6123
        <text>Wget path</text>
 
 
6124
        <version>1.23.1</version>
 
 
6125
      </string>
 
 
6126
      <string>
 
 
6127
        <id>WGET_PATH_NOT_FOUND</id>
 
 
6128
        <text>Wget was not found at the specified location</text>
 
 
6129
        <version>1.23.1</version>
 
 
6130
      </string>
 
 
6131
      <string>
 
 
6132
        <id>WGET_PATH_PROMPT</id>
 
 
6133
        <text>Please specify the full path of the Wget executable. This is usually detected correctly but on some Linux based systems you may have to
manually enter this.</text>
 
 
6134
        <version>1.23.1</version>
 
 
6135
      </string>
 
 
6136
      <string>
6102
        <id>WIKI_LOOKUP</id>
6137
        <id>WIKI_LOOKUP</id>
6103
        <text>Wikipedia Lookups</text>
6138
        <text>Wikipedia Lookups</text>
6104
        <version>1.19</version>
6139
        <version>1.19</version>