BTC: BC1Q9N0V6L3CH2PJFHLD4RJ9Y2EPH3M9WL9XPMZNLX
أصبح من الممكن الآن الاختيار بين SOAP عبر HTTPS أو دفق TCP (افتراضي) للتفاعل مع API Broadworks. تقترح المعايير الأساسية 15/طلب/ثانية مع الصابون و 150/طلب/ثانية لدفق TCP. تم استخدام userGetRegeRquest17SP4 للمعيار.
يمكن تصدير الجلسات من العميل وإلى العميل ، تمت إضافة ذلك للسماح برامج نصية Broadworks OCI-P الناتجة عن طرق مثل cronjobs للتنفيذ باستخدام بيانات الجلسة الخارجية. تعد جلسات النقل طريقة آمنة لتنفيذ الأوامر حيث أن المستخدم الذي طلبها نظرًا لعدم تخزين كلمة المرور ، يتم استخدام ملفات تعريف الارتباط/SessionID للمصادقة.
تم بناء جميع عناصر الإطار مع وضع الإكمال التلقائي IDE في الاعتبار ، لذلك لا توجد حاجة لتذكر تفاصيل نوع البيانات ، فيما يلي مثال على تعطيل Callforwardingalways لجميع المستخدمين داخل المجموعة.
تم تصميم CLI المتفاعل في المعرفة الصفرية برمجة. يتنقل المستخدم عبر المخطط بنفس الطريقة التي تقوم بها بالدولة والملفات على نظام ملفات Linux. يمكن تنفيذ الأوامر في CLI مع النتائج المطبوعة على الشاشة. Tab Works Upletion Works - (مكسور في أحدث إصدار)
تدعم الكائنات التسلسل للسماح بتوفير الرسائل بتنسيق نص عادي يمكن أن يعود مرة أخرى إلى أنواع البيانات التي يمكن أن يفهمها الإطار بعد ذلك مرة أخرى إلى Broadworks على سبيل المثال
$ 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 مع الأطفال المتداخلين.
إذا كان أحد العناصر التي سيتم تعيينها هو complextype ، فإن ComplexType يحتاج إلى إنشاء قبل تعيينه في الكائن الأصل. على سبيل المثال ، 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] =>
)
يتم استخدام TableTspes للتعامل مع بيانات ocable. يتم تمرير مجموعة أبعاد واحدة في عناوين الأعمدة ويتم تعيين البيانات باستخدام AddRow أو AddRows مع صفائف واحدة أو متعددة الأبعاد.
من الممكن تقديم جدول ASCII جميل مع echo $table->getValue() مع البيانات وأيضًا البحث باستخدام $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 |
+------------------------+---------------+
يرجى استخدام تعقب المشكلات للإبلاغ عن أي أخطاء أو طلبات ميزة الملف.
PRS موضع ترحيب. للبدء في التطور ، افعل هذا:
$ 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.