PageRenderTime 48ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/html/AppCode/expressionengine/libraries/EE_Xmlrpc.php

https://github.com/w3bg/www.hsifin.com
PHP | 139 lines | 78 code | 17 blank | 44 comment | 10 complexity | 57868d9ff8b2f2059e3be66ff6b3427d MD5 | raw file
Possible License(s): AGPL-3.0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /**
  3. * ExpressionEngine - by EllisLab
  4. *
  5. * @package ExpressionEngine
  6. * @author ExpressionEngine Dev Team
  7. * @copyright Copyright (c) 2003 - 2010, EllisLab, Inc.
  8. * @license http://expressionengine.com/user_guide/license.html
  9. * @link http://expressionengine.com
  10. * @since Version 2.0
  11. * @filesource
  12. */
  13. // ------------------------------------------------------------------------
  14. /**
  15. * ExpressionEngine Core XMLRPC Class
  16. *
  17. * @package ExpressionEngine
  18. * @subpackage Core
  19. * @category Core
  20. * @author ExpressionEngine Dev Team
  21. * @link http://expressionengine.com
  22. */
  23. class EE_Xmlrpc extends CI_Xmlrpc {
  24. /**
  25. * Constructor
  26. */
  27. function EE_Xmlrpc($init = TRUE)
  28. {
  29. parent::CI_Xmlrpc();
  30. if ($init != TRUE)
  31. {
  32. return;
  33. }
  34. // Make a local reference to the ExpressionEngine super object
  35. $this->EE =& get_instance();
  36. $this->EE_initialize();
  37. }
  38. // --------------------------------------------------------------------
  39. /**
  40. * Set config values
  41. *
  42. * @access private
  43. * @return void
  44. */
  45. function EE_initialize()
  46. {
  47. }
  48. // --------------------------------------------------------------------
  49. /**
  50. * Set the email message
  51. *
  52. * EE uses action ID's so we override the messsage() function
  53. *
  54. * @access public
  55. * @return void
  56. */
  57. function weblogs_com_ping($server, $port=80, $name, $blog_url, $rss_url = '')
  58. {
  59. if (stristr($server, 'ping.pmachine.com') !== FALSE)
  60. {
  61. $server = str_replace('ping.pmachine.com', 'ping.expressionengine.com', $server);
  62. }
  63. $this->server($server, $port);
  64. $this->timeout(5);
  65. if (stristr($server, 'ping.expressionengine.com') === FALSE)
  66. {
  67. if ($rss_url != '')
  68. {
  69. $this->method('weblogUpdates.extendedPing');
  70. $this->request(array(
  71. $name,
  72. $blog_url,
  73. $this->EE->config->item('site_index'),
  74. $rss_url
  75. ));
  76. if ( ! $this->EE->xmlrpc->send_request())
  77. {
  78. $this->method('weblogUpdates.ping');
  79. $this->request(array(
  80. $name,
  81. $blog_url
  82. ));
  83. }
  84. else
  85. {
  86. return TRUE;
  87. }
  88. }
  89. else
  90. {
  91. $this->method('weblogUpdates.ping');
  92. $this->request(array(
  93. $name,
  94. $blog_url
  95. ));
  96. }
  97. }
  98. else
  99. {
  100. if ( ! $license = $this->EE->config->item('license_number'))
  101. {
  102. $this->EE->lang->loadfile('xmlrpc');
  103. $this->error = $this->EE->lang->line('invalid_license');
  104. return $this->display_error();
  105. }
  106. $this->method('ExpressionEngine.ping');
  107. $this->request(array(
  108. $name,
  109. $blog_url,
  110. $license
  111. ));
  112. }
  113. if ( ! $this->send_request())
  114. {
  115. return $this->display_error();
  116. }
  117. return TRUE;
  118. }
  119. }
  120. // END CLASS
  121. /* End of file EE_Xmlrpc.php */
  122. /* Location: ./system/expressionengine/libraries/EE_Xmlrpc.php */