PHP code example of snapshotpl / zf-snap-hip-chat

1. Go to this page and download the library: Download snapshotpl/zf-snap-hip-chat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

snapshotpl / zf-snap-hip-chat example snippets


return array(
  'zf_snap_hip_chat' => array(
    'api' => array(
      'auth_token' => 'yourauthtoken',
    ),
  ),
);

$hipChat = $this->getServiceLocator()->get('hipchat');

return array(
  'zf_snap_hip_chat' => array(
    'logger' => array(
      'room_id' => array(100001, 'log room'),
    ),
  ),
);

$logger = new Zend\Log\Logger();
$hipChat = $this->getServiceLocator()->get('hipchat_log_writer');
$logger->addWriter($hipChat);
$logger->debug('HipChat debug message!');

$logger = $this->getServiceLocator()->get('hipchat_logger');
$logger->debug('HipChat debug message!');

return array(
  'zf_snap_hip_chat' => array(
    'api' => array(
      'auth_token' => null, // Required auth token
      'api_target' => HipChat::DEFAULT_TARGET, // Url address to HipChat API
      'api_version' => HipChat::VERSION_1, // Api version
    ),
    'logger' => array(
      'room_id' => null, // string, int or array with IDs, 

php public/index.php

HipChat API
  index.php hipchat message send <message> [--room=] [--from=] [--notify] [--color=(yellow|red|gray|green|purple|random)] [--format=(html|text)]    Sends message
  index.php hipchat room list    Lists rooms
  index.php hipchat room history <room> [--date=]    Room's history                           
  index.php hipchat room set topic <room> <topic> [--from=]    Sets room topic