ClientInterface.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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\Http\RequestInterface;
  10. use JonnyW\PhantomJs\Http\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\Http\MessageFactoryInterface
  30. */
  31. public function getMessageFactory();
  32. /**
  33. * Send request
  34. *
  35. * @access public
  36. * @param \JonnyW\PhantomJs\Http\RequestInterface $request
  37. * @param \JonnyW\PhantomJs\Http\ResponseInterface $response
  38. */
  39. public function send(RequestInterface $request, ResponseInterface $response);
  40. /**
  41. * Get PhantomJs run command with
  42. * loader and run options.
  43. *
  44. * @access public
  45. * @return string
  46. */
  47. public function getCommand();
  48. /**
  49. * Set new PhantomJs executable path.
  50. *
  51. * @access public
  52. * @param string $path
  53. */
  54. public function setPhantomJs($path);
  55. /**
  56. * Get PhantomJs executable path.
  57. *
  58. * @access public
  59. * @return string
  60. */
  61. public function getPhantomJs();
  62. /**
  63. * Set PhantomJs run options.
  64. *
  65. * @access public
  66. * @param array $options
  67. */
  68. public function setOptions(array $options);
  69. /**
  70. * Get PhantomJs run options.
  71. *
  72. * @access public
  73. * @return array
  74. */
  75. public function getOptions();
  76. /**
  77. * Add single PhantomJs run option.
  78. *
  79. * @access public
  80. * @param string $option
  81. */
  82. public function addOption($option);
  83. /**
  84. * Debug.
  85. *
  86. * @access public
  87. * @param boolean $doDebug
  88. */
  89. public function debug($doDebug);
  90. /**
  91. * Log info.
  92. *
  93. * @access public
  94. * @param string $info
  95. * @return \JonnyW\PhantomJs\Client
  96. */
  97. public function log($info);
  98. /**
  99. * Get log info.
  100. *
  101. * @access public
  102. * @return string
  103. */
  104. public function getLog();
  105. /**
  106. * Clear log info.
  107. *
  108. * @access public
  109. * @return \JonnyW\PhantomJs\Client
  110. */
  111. public function clearLog();
  112. }