예제 #1
0
 /**
  * Finds out if a site is using a version control system.
  * @return string ( '1' | '0' )
  **/
 public static function is_version_controlled()
 {
     _deprecated_function(__METHOD__, 'jetpack-4.2', 'Jetpack_Sync_Functions::is_version_controlled');
     return (string) (int) Jetpack_Sync_Functions::is_version_controlled();
 }
 function test_get_protocol_normalized_url_cleared_on_reset_data()
 {
     Jetpack_Sync_Functions::get_protocol_normalized_url('home_url', get_home_url());
     Jetpack_Sync_Functions::get_protocol_normalized_url('site_url', get_site_url());
     Jetpack_Sync_Functions::get_protocol_normalized_url('main_network_site_url', network_site_url());
     $url_callables = array('home_url', 'site_url', 'main_network_site_url');
     foreach ($url_callables as $callable) {
         $this->assertInternalType('array', get_option(Jetpack_Sync_Functions::HTTPS_CHECK_OPTION_PREFIX . $callable));
     }
     Jetpack_Sync_Sender::get_instance()->uninstall();
     foreach ($url_callables as $callable) {
         $this->assertFalse(get_option(Jetpack_Sync_Functions::HTTPS_CHECK_OPTION_PREFIX . $callable));
     }
 }
 protected function file_system_write_access()
 {
     return Jetpack_Sync_Functions::file_system_write_access();
 }
 function test_ignores_but_preserves_https_value()
 {
     $non_https_site_url = site_url();
     $this->assertTrue(!!preg_match('/^http:/', site_url()));
     $_SERVER['HTTPS'] = 'on';
     $this->assertTrue(!!preg_match('/^https:/', site_url()));
     $this->assertEquals($non_https_site_url, Jetpack_Sync_Functions::preserve_scheme('siteurl', 'site_url'));
     $this->assertEquals($_SERVER['HTTPS'], 'on');
     unset($_SERVER['HTTPS']);
 }