btc : bc1q9n0v6l3ch2pjfhld4rj9y23m9wl9xpmznlx
Broadworks API와의 상호 작용을 위해 HTTPS 또는 TCP 스트림 (기본값)을 통해 SOAP 중에서 선택할 수 있습니다. 기본 벤치 마크는 TCP 스트림의 경우 SOAP가있는 15/요청/2 초/요청/초를 제안합니다. userGetRequest17Sp4가 벤치 마크에 사용되었습니다.
세션을 클라이언트로 내보내고 Cronjob과 같은 방법에 의해 트리거 된 Broadworks OCI-P 스크립트가 외부 세션 데이터를 사용하여 실행할 수 있도록 추가되었습니다. 포팅 세션은 비밀번호가 저장되지 않았기 때문에 요청한 사용자로서 명령을 실행하는 안전한 방법입니다. 쿠키/세션 ID는 인증에 사용됩니다.
프레임 워크의 모든 요소는 IDE 자동 완성을 염두에두고 구축되었으므로 데이터 유형의 세부 사항을 기억할 필요가 없습니다. 아래는 그룹 내 모든 사용자를위한 CallforwardingAlways를 비활성화하는 예입니다.
상호 작용 CLI가 구축되어 프로그래밍 지식이 제로가 필요합니다. 사용자는 Linux 파일 시스템의 디렉토리 및 파일과 같은 방식으로 스키마를 탐색합니다. CLI에서 명령을 실행하여 결과를 화면에 인쇄 할 수 있습니다. Tab Autocompletion Works- (최신 릴리스에서 깨진)
객체는 직렬화를 지원하여 메시지를 일반 텍스트 형식으로 저장할 수 있도록하는 데이터 유형으로 다시 비교할 수있는 프레임 워크가 이해할 수있는 데이터 유형으로 다시 넓은 작업으로 재생할 수 있습니다.
$ composer require lukebeer/broadworks-ocip
$ composer require lukebeer/broadworks-ocip:development
<?php
require_once ' vendor/autoload.php ' ;
// Use the ComplexType required for this example.
use Broadworks_OCIP api Rel_17_sp4_1_197_OCISchemaAS OCISchemaUser UserServiceGetAssignmentListRequest ;
// Create a Client and login. CoreFactory also has getSOAPClient()
$ client = BroadworksOCIP Factory:: getTCPClient ( ' ocip.example.com ' );
$ client -> login ( ' user ' , ' pass ' );
// Generate a request, send and assign the response to $response
$ request = new UserServiceGetAssignmentListRequest ( ' [email protected] ' );
$ response = $ request -> get ( $ client );
// This response type returns a TableType object, getValue() renders a table.
echo $ response -> getServicePacksAssignmentTable ()-> getValue ();
?>
/* Spits out:
+--------------------------------------------------+----------+
| Service Name | Assigned |
+--------------------------------------------------+----------+
| Anonymous Call Rejection | true |
| Authentication | true |
| Call Forwarding Always | true |
| Call Forwarding Busy | true |
| Call Forwarding No Answer | true |
| Call Notify | false |
| Calling Line ID Delivery Blocking | true |
| CommPilot Express | true |
| CommPilot Call Manager | true |
| Do Not Disturb | true |
| Intercept User | true |
| Last Number Redial | true |
| Sequential Ring | true |
+--------------------------------------------------+----------+
*/userGetRequest17Sp4와 같은 복합 유형은 복합 유형을 포함한 요소 유형의 혼합물을 포함 할 수있는 유형입니다. 그들을 중첩 된 아이들과 XML로 생각하십시오.
설정해야 할 요소 중 하나가 복잡한 유형이라면 복합체 유형은 부모 객체에 설정되기 전에 생성이 필요합니다. 예를 들어 StreetAddress는 복잡한 유형입니다.
<?php
$ address = new StreetAddress ();
$ address -> setAddressLine1 ( ' 1337 Street ' );
$ address -> setCountry ( ' England ' );
$ request = new UserAddRequest17sp4 ();
$ request -> setStreetAddress ( $ address ); Broadworks_OCIPapiRel_17_sp4_1_197_OCISchemaASOCISchemaDataTypesStreetAddress Object
(
[elementName] => StreetAddress
[addressLine1:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 80
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] => 1337 Street
[elementName:protected] => addressLine1
)
[addressLine2:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 80
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] =>
[elementName:protected] => addressLine2
)
[city:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 50
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] =>
[elementName:protected] => city
)
[stateOrProvince:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 50
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] =>
[elementName:protected] => stateOrProvince
)
[stateOrProvinceDisplayName:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 50
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] =>
[elementName:protected] => stateOrProvinceDisplayName
)
[zipOrPostalCode:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 50
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] =>
[elementName:protected] => zipOrPostalCode
)
[country:protected] => Broadworks_OCIPcoreBuilderTypesSimpleContent Object
(
[annontation:protected] =>
[attributes:protected] =>
[restrictions:protected] => Array
(
[0] => Broadworks_OCIPcoreBuilderRestrictionsMinLength Object
(
[value:protected] => 1
[detail:protected] =>
)
[1] => Broadworks_OCIPcoreBuilderRestrictionsMaxLength Object
(
[value:protected] => 50
[detail:protected] =>
)
)
[errors:protected] =>
[elementValue:protected] => Enngland
[elementName:protected] => country
)
[elements:protected] => Array
(
)
[responseType:protected] =>
[errors:protected] =>
[params:protected] => Array
(
)
[args:protected] =>
[elementValue:protected] =>
)
탁상 유형은 Ocitable 데이터를 처리하는 데 사용됩니다. 열 제목을 위해 단일 치수 배열이 전달되며 단일 또는 다중 차원 배열이있는 Addrow 또는 Addrow를 사용하여 데이터를 설정합니다.
데이터와 함께 echo $table->getValue() 로 예쁜 ASCII 테이블을 렌더링하고 $table->findRow('something') 로 검색 할 수 있습니다.
단일 열만 필요한 경우 메소드 $table->getColumn($id) 은 데이터 세트의 모든 행에서 특정 데이터 열을 반환합니다. 키에는 하나의 값을 사용할 수 있고 다른 값은 값에 사용할 수 있습니다.
<?php
$ data = $ table -> getColummn ( 0 , 3 );
$ newTable = new TableType ([ ' User Id ' , ' Phone Number ' );
$ newTable -> addRows ( $ data );
echo $ newTable -> getValue ();보고:
+------------------------+---------------+
| User Id | Phone Number |
+------------------------+---------------+
| [email protected] | 01234123456 |
| [email protected] | 01234123456 |
| [email protected] | 01234123456 |
| [email protected] | 01234123456 |
| [email protected] | 01234123456 |
| [email protected] | 01234123456 |
+------------------------+---------------+
문제 추적기를 사용하여 버그 또는 파일 기능 요청을보고하십시오.
PR을 환영합니다. 개발을 시작하려면 다음을 수행하십시오.
$ curl -X POST -u " GITHUB_USERNAME:GITHUB_PASSWORD " https://api.github.com/repos/lukebeer/broadworks-ocip/forks && history -c
$ git clone github:GITHUB_USERNAME/broadworks-ocip &&
$ cd broadworks-ocip Builder
Builder.php # Takes a ComplexType and converts to XML or XML string then wraps it in an envelope ready for shipping.
Restrictions
Enumeration.php # Defines a list of acceptable values.
Length.php # Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero.
MaxExclusive.php # Specifies the upper bounds for numeric values (the value must be less than this value).
MaxInclusive.php # Specifies the upper bounds for numeric values (the value must be less than or equal to this value).
MaxLength.php # Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero.
MinExclusive.php # Specifies the lower bounds for numeric values (the value must be greater than this value).
MinInclusive.php # Specifies the lower bounds for numeric values (the value must be greater than or equal to this value).
MinLength.php # Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero.
Pattern.php # Defines the exact sequence of characters that are acceptable.
Restriction.php # Abstract base class all restrictions must extend.
RestrictionInterface.php # Interface all Restrictins must implement.
Types
ComplexInterface.php # Interface all ComplexTypes must implement.
ComplexType.php # Defines a complex type element.
PrimitiveType.php # Primitive type such as bool/int/string.
SimpleContent.php # Contains extensions or restrictions on a text-only complex type or on a simple type as content and contains no elements.
SimpleInterface.php # Interface all SimpleTypes must implement.
SimpleType.php # Defines a simple type and specifies the constraints and information about the values of attributes or text-only elements.
TableType.php # Used for OCITable responses only, never in requests.
TypeCheck.php # Not implemented yet.
TypeMap.php # Converts xs types to PHP types.
TypeTrait.php # Common trait all types have.
Client
Client.php # Main controller for the whole framework exposing methods for requests and responses.
Transport
SOAPTransport.php # Communicates with Broadworks via http(s), this is the slowest but most robust transport type.
TCPTransport.php # Communicates with Broadworks via a TCPStream on port 2208, this is the fastest transport type.
TransportInterface.php # Interface all Transport types must implement.
Console
Console.php # Generates an array of commands for the interactive console.
Logging
ErrorControl.php # Crappy logging object, needs nuking and starting again.
Output
ConsoleOutput.php # Output type for the interactive console.
JSONOutput.php # Generates and echos JSON.
OutputInterface.php # Output interface all Outputs must implement.
Response
Response.php # Takes XML input and returns response object specified or false if error.
ResponseOutput.php # Convenience class for selecting response output format.
Serializer
SerializerInterface.php # Interface all Serializers must implement.
XMLSerializer.php # Converts XML into the requested object type automatically, very much the brain of this.
Session
Session.php # Portable Session object used to store details of the current authenticated session.