ClientInterface.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /*
  3. * This file is part of the php-phantomjs.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace JonnyW\PhantomJs;
  9. use JonnyW\PhantomJs\Message\RequestInterface;
  10. use JonnyW\PhantomJs\Message\ResponseInterface;
  11. /**
  12. * PHP PhantomJs
  13. *
  14. * @author Jon Wenmoth <contact@jonnyw.me>
  15. */
  16. interface ClientInterface
  17. {
  18. /**
  19. * Get singleton instance
  20. *
  21. * @access public
  22. * @return \JonnyW\PhantomJs\ClientInterface
  23. */
  24. public static function getInstance();
  25. /**
  26. * Get message factory instance
  27. *
  28. * @access public
  29. * @return \JonnyW\PhantomJs\Message\FactoryInterface
  30. */
  31. public function getMessageFactory();
  32. /**
  33. * Send request
  34. *
  35. * @access public
  36. * @param \JonnyW\PhantomJs\Message\RequestInterface $request
  37. * @param \JonnyW\PhantomJs\Message\ResponseInterface $response
  38. */
  39. public function send(RequestInterface $request, ResponseInterface $response);
  40. /**
  41. * Set new PhantomJs executable path.
  42. *
  43. * @access public
  44. * @param string $path
  45. */
  46. public function setPhantomJs($path);
  47. /**
  48. * Get PhantomJs executable path.
  49. *
  50. * @access public
  51. * @return string
  52. */
  53. public function getPhantomJs();
  54. /**
  55. * Set PhantomJs loader executable path.
  56. *
  57. * @access public
  58. * @param string $path
  59. */
  60. public function setPhantomLoader($path);
  61. /**
  62. * Get PhantomJs loader executable path.
  63. *
  64. * @access public
  65. * @return string
  66. */
  67. public function getPhantomLoader();
  68. /**
  69. * Set PhantomJs run options.
  70. *
  71. * @access public
  72. * @param array $options
  73. */
  74. public function setOptions(array $options);
  75. /**
  76. * Get PhantomJs run options.
  77. *
  78. * @access public
  79. * @return array
  80. */
  81. public function getOptions();
  82. /**
  83. * Add single PhantomJs run option.
  84. *
  85. * @access public
  86. * @param string $option
  87. */
  88. public function addOption($option);
  89. /**
  90. * Debug.
  91. *
  92. * @access public
  93. * @param boolean $doDebug
  94. */
  95. public function debug($doDebug);
  96. /**
  97. * Set log info.
  98. *
  99. * @access public
  100. * @param string $info
  101. */
  102. public function setLog($info);
  103. /**
  104. * Get log info.
  105. *
  106. * @access public
  107. * @return string
  108. */
  109. public function getLog();
  110. /**
  111. * Clear log info.
  112. *
  113. * @access public
  114. */
  115. public function clearLog();
  116. }