"https", "MONERIS_HOST" => "esqa.moneris.com", "MONERIS_PORT" => "443", "MONERIS_FILE" => "/gateway2/servlet/MpgRequest", "API_VERSION" => "MpgApi Version 2.03(php)", "CLIENT_TIMEOUT" => "60"); public function __construct($test_mode = \false) { } public function getGlobals() { } } class mpgHttpsPost { public $api_token = \NULL; public $store_id = \NULL; public $mpgRequest = \NULL; public $mpgResponse = \NULL; public function __construct($store_id, $api_token, $mpgRequestOBJ, $test_mode = \false) { } public function getMpgResponse() { } public function toXML() { } } class mpgResponse { public $responseData = \NULL; public $p = \NULL; public $currentTag = \NULL; public $purchaseHash = array(); public $refundHash = \NULL; public $correctionHash = array(); public $isBatchTotals = \NULL; public $term_id = \NULL; public $receiptHash = array(); public $ecrHash = array(); public $CardType = \NULL; public $currentTxnType = \NULL; public $ecrs = array(); public $cards = array(); public $cardHash = array(); public $ACSUrl = \NULL; public function __construct($xmlString) { } public function getMpgResponseData() { } public function getAvsResultCode() { } public function getCvdResultCode() { } public function getRecurSuccess() { } public function getCardType() { } public function getTransAmount() { } public function getTxnNumber() { } public function getReceiptId() { } public function getTransType() { } public function getReferenceNum() { } public function getResponseCode() { } public function getISO() { } public function getBankTotals() { } public function getMessage() { } public function getAuthCode() { } public function getComplete() { } public function getTransDate() { } public function getTransTime() { } public function getTicket() { } public function getTimedOut() { } public function getTerminalStatus($ecr_no) { } public function getPurchaseAmount($ecr_no, $card_type) { } public function getPurchaseCount($ecr_no, $card_type) { } public function getRefundAmount($ecr_no, $card_type) { } public function getRefundCount($ecr_no, $card_type) { } public function getCorrectionAmount($ecr_no, $card_type) { } public function getCorrectionCount($ecr_no, $card_type) { } public function getTerminalIDs() { } public function getCreditCardsAll() { } public function getCreditCards($ecr_no) { } public function characterHandler($parser, $data) { } public function startHandler($parser, $name, $attrs) { } public function endHandler($parser, $name) { } } class mpgRequest { public $txnTypes = array("purchase" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "refund" => array("order_id", "amount", "txn_number", "crypt_type"), "idebit_purchase" => array("order_id", "cust_id", "amount", "idebit_track2"), "idebit_refund" => array("order_id", "amount", "txn_number"), "ind_refund" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "preauth" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "completion" => array("order_id", "comp_amount", "txn_number", "crypt_type"), "purchasecorrection" => array("order_id", "txn_number", "crypt_type"), "opentotals" => array("ecr_number"), "batchclose" => array("ecr_number"), "cavv_purchase" => array("order_id", "cust_id", "amount", "pan", "expdate", "cavv"), "cavv_preauth" => array("order_id", "cust_id", "amount", "pan", "expdate", "cavv")); public $txnArray = \NULL; public function __construct($txn) { } public function toXML() { } } class mpgCustInfo { public $level3template = array("cust_info" => array("email", "instructions", "billing" => array("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost"), "shipping" => array("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost"), "item" => array("name", "quantity", "product_code", "extended_amount"))); public $level3data = \NULL; public $email = \NULL; public $instructions = \NULL; public function __construct($custinfo = 0, $billing = 0, $shipping = 0, $items = 0) { } public function setCustInfo($custinfo) { } public function setEmail($email) { } public function setInstructions($instructions) { } public function setShipping($shipping) { } public function setBilling($billing) { } public function setItems($items) { } public function toXML() { } public function toXML_low($template, $txnType) { } } class mpgRecur { public $params = \NULL; public $recurTemplate = array("recur_unit", "start_now", "start_date", "num_recurs", "period", "recur_amount"); public function __construct($params) { } public function toXML() { } } class mpgTransaction { public $txn = \NULL; public $custInfo = \NULL; public $avsInfo = \NULL; public $cvdInfo = \NULL; public $recur = \NULL; public function __construct($txn) { } public function getCustInfo() { } public function setCustInfo($custInfo) { } public function getCvdInfo() { } public function setCvdInfo($cvdInfo) { } public function getAvsInfo() { } public function setAvsInfo($avsInfo) { } public function getRecur() { } public function setRecur($recur) { } public function getTransaction() { } } class mpgAvsInfo { public $params = \NULL; public $avsTemplate = array("avs_street_number", "avs_street_name", "avs_zipcode"); public function __construct($params) { } public function toXML() { } } class mpgCvdInfo { public $params = \NULL; public $cvdTemplate = array("cvd_indicator", "cvd_value"); public function __construct($params) { } public function toXML() { } } } namespace WHMCS\Module\Gateway\Paypalcheckout { class PaypalJsClient { protected $params = array(); protected $elements = array(); protected $styleLabel = "checkout"; protected $debug = false; const PARTNER_ID = "WHMCS_ST"; const INTEGRATION_DATE = "2019-11-01"; public function addParam($key, $value) { } public function getParams() { } public function setStyleLabel($styleLabel) { } public function addCreateOrder($routeCreateOrder, $token, $forceOneTime = false) { } public function addCreateSubscription($routeCreateOrder, $token, $companyName, $firstName, $lastName, $email) { } public function addOnApprove($routeVerifyPayment, $token, $invoiceId, $waitMsg = "Processing payment. Please wait...") { } public function render($hidden = false) { } } class PaypalOnboarding { protected $sandbox = false; protected $featuredPage = false; protected $sellerNonce = ""; const LIVE_URL = "https://www.paypal.com/"; const SANDBOX_URL = "https://www.sandbox.paypal.com/"; const LIVE_API_URL = "https://api.paypal.com/"; const SANDBOX_API_URL = "https://api.sandbox.paypal.com/"; const LIVE_PARTNER_ID = "HA8JRU89P2JUL"; const SANDBOX_PARTNER_ID = "2XXGCC6WVS9A4"; public function __construct() { } public function enableSandbox() { } public function isFeaturedPage() { } public function getOnboardCompleteJsFunctionName() { } protected function getPartnerId() { } protected function getUrl() { } public function getLinkUri() { } protected function getApiUrl() { } protected function getSaveUrl() { } public function getJs() { } public function getOffboardJs() { } } class PaypalController { public function createOrder(\WHMCS\Http\Message\ServerRequest $request) { } public function createPlanId($cart, $clientId) { } public function validateOrder(\WHMCS\Http\Message\ServerRequest $request) { } public function verifyPayment(\WHMCS\Http\Message\ServerRequest $request) { } public function verifySubscriptionSetup(\WHMCS\Http\Message\ServerRequest $request) { } protected function decodeJsonBodyResponse($response) { } } class PayPalWebhookHandler { protected $actionMap = array("PAYMENT.CAPTURE.PENDING" => "paymentCapturePending", "BILLING.SUBSCRIPTION.CREATED" => "subscriptionCreated", "PAYMENT.SALE.COMPLETED" => "paymentCompleted", "BILLING.SUBSCRIPTION.SUSPENDED" => "subscriptionSuspended", "BILLING.SUBSCRIPTION.CANCELLED" => "subscriptionCancelled", "CUSTOMER.DISPUTE.RESOLVED" => "disputeResolved"); public function execute($data) { } protected function paymentCapturePending($data) { } protected function subscriptionCreated($data) { } protected function paymentCompleted($data) { } protected function subscriptionSuspended($data) { } protected function subscriptionCancelled($data) { } protected function disputeResolved($data) { } } class ApiClient { protected $useSandbox = false; protected $options = array(); protected $accessToken = NULL; protected $sendPartnerId = false; protected $response = NULL; protected $httpResponseCode = NULL; const SANDBOX_URL = "https://api.sandbox.paypal.com/"; const LIVE_URL = "https://api.paypal.com/"; const PARTNER_ATTRIBUTION_ID = "WHMCS_Ecom_PPCP"; public function setSandbox($enabled) { } public function setOptions($options) { } public function setAccessToken($accessToken) { } public function setSendPartnerId($send) { } protected function getBaseUrl() { } protected function getOptions() { } public function get($endpoint) { } public function post($endpoint, $data = NULL) { } protected function call($method, $endpoint, $data = NULL) { } public function setResponse($response, $httpCode) { } public function isError() { } public function getResponse() { } public function getFromResponse($key) { } public function getError() { } public function isAuthError() { } } class PaypalApi { public function getAccessToken($clientId, $clientSecret, $sandbox) { } public function createOrder($amount, $currency, $intent, $companyName, \WHMCS\User\Client $client = NULL, \WHMCS\Billing\Invoice $invoice = NULL) { } public function captureOrder($orderId) { } public function activateSubscription($subscriptionId) { } public function createProduct($name, $description) { } public function createProductPlan($productId, $productName, $productDescription, $totalDueToday, $recurringAmount, $billingCycle, $billingCyclePeriod, $currencyCode, $initialCycle = NULL, $initialPeriod = NULL) { } protected function getPaypalCycle($cycle) { } public function createSubscription($planId, \WHMCS\User\Client $client, $companyName, $returnUrl, $cancelUrl) { } public function getOrderDetails($orderId) { } public function getSubscriptionDetails($subscriptionId) { } public function refundPayment($invoiceId, $paymentId, $amount, $currencyCode) { } public function cancelSubscription($subscriptionId) { } public function getCaptureDetails($captureId) { } public function authorizeOrder($orderId) { } public function capturePayment($authId, $amount, $currency, $invoiceNumber) { } public function createWebhook($url, $eventTypes) { } public function listWebhooks() { } public function verifyWebhookSignature($authAlgo, $certUrl, $transmissionId, $transmissionSig, $transmissionTime, $webhookId, $webhookEvent) { } protected function call($method, $endpoint, $data = NULL, $sendPartnerId = false) { } } } namespace WHMCS { class Exception extends \Exception { } } namespace WHMCS\Module\Gateway\Paypalcheckout\Exception { class AuthError extends \WHMCS\Exception { } class PaymentIncomplete extends \WHMCS\Exception { } } namespace WHMCS\Route\Contracts { interface ProviderInterface { public function registerRoutes(\FastRoute\RouteCollector $routeCollector); } interface DeferredProviderInterface extends \WHMCS\Route\Contracts\ProviderInterface { public function getDeferredRoutePathNameAttribute(); } } namespace WHMCS\Route { trait ProviderTrait { public function getRoutes() { } public function addRoute(\FastRoute\RouteCollector $routeCollector, array $route, $group = "") { } public function getUriMap() { } public function getAuthenticationMap() { } public function getAuthorizationMap() { } public function getResponseTypeMap() { } public function applyGroupLevelAttributes($routes) { } public function addRouteGroups(\FastRoute\RouteCollector $routeCollector, array $routeGroup = array()) { } public function addDeferredRouteGroup(\FastRoute\RouteCollector $routeCollector, \WHMCS\Route\Contracts\ProviderInterface $provider, $group) { } public function registerRoutes(\FastRoute\RouteCollector $routeCollector) { } } } namespace WHMCS\Module\Gateway\Paypalcheckout { class PaypalRouteProvider implements \WHMCS\Route\Contracts\DeferredProviderInterface { use \WHMCS\Route\ProviderTrait; public function getRoutes() { } public function getDeferredRoutePathNameAttribute() { } } } namespace { class iDEAL_Payment { protected $partner_id = \NULL; protected $testmode = \false; protected $bank_id = \NULL; protected $amount = 0; protected $description = \NULL; protected $return_url = \NULL; protected $report_url = \NULL; protected $bank_url = \NULL; protected $payment_url = \NULL; protected $transaction_id = \NULL; protected $paid_status = \false; protected $consumer_info = array(); protected $error_message = ""; protected $error_code = 0; protected $api_host = "ssl://secure.mollie.nl"; protected $api_port = 443; const MIN_TRANS_AMOUNT = 118; public function __construct($partner_id, $api_host = "ssl://secure.mollie.nl", $api_port = 443) { } public function getBanks() { } public function createPayment($bank_id, $amount, $description, $return_url, $report_url) { } public function checkPayment($transaction_id) { } public function CreatePaymentLink($description, $amount) { } protected function _sendRequest($host, $port, $path, $data) { } protected function _XMLtoObject($xml) { } protected function _XMLisError($xml) { } public function setPartnerId($partner_id) { } public function getPartnerId() { } public function setTestmode($enable = \true) { } public function setBankId($bank_id) { } public function getBankId() { } public function setAmount($amount) { } public function getAmount() { } public function setDescription($description) { } public function getDescription() { } public function setReturnURL($return_url) { } public function getReturnURL() { } public function setReportURL($report_url) { } public function getReportURL() { } public function setTransactionId($transaction_id) { } public function getTransactionId() { } public function getBankURL() { } public function getPaymentURL() { } public function getPaidStatus() { } public function getConsumerInfo() { } public function getErrorMessage() { } public function getErrorCode() { } } class authorizenet_class { public $gateway_url = \NULL; public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function seturl($url) { } public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_response() { } } class eprocessing_class { public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_fields() { } public function dump_response() { } } class securepay_class { public $gateway_url = \NULL; public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function seturl($url) { } public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_fields() { } public function dump_response() { } } class BluePayment { public $accountId = \NULL; public $userId = \NULL; public $tps = \NULL; public $transType = \NULL; public $payType = \NULL; public $mode = \NULL; public $masterId = \NULL; public $secretKey = \NULL; public $account = \NULL; public $cvv2 = \NULL; public $expire = \NULL; public $ssn = \NULL; public $birthdate = \NULL; public $custId = \NULL; public $custIdState = \NULL; public $amount = \NULL; public $name1 = \NULL; public $name2 = \NULL; public $addr1 = \NULL; public $addr2 = \NULL; public $city = \NULL; public $state = \NULL; public $zip = \NULL; public $country = \NULL; public $phone = \NULL; public $email = \NULL; public $memo = \NULL; public $orderId = \NULL; public $invoiceId = \NULL; public $tip = \NULL; public $tax = \NULL; public $doRebill = \NULL; public $rebDate = \NULL; public $rebExpr = \NULL; public $rebCycles = \NULL; public $rebAmount = \NULL; public $doAutocap = \NULL; public $avsAllowed = \NULL; public $cvv2Allowed = \NULL; public $response = \NULL; public $transId = \NULL; public $status = \NULL; public $avsResp = \NULL; public $cvv2Resp = \NULL; public $authCode = \NULL; public $message = \NULL; public $rebid = \NULL; public function __construct($account = \ACCOUNT_ID, $key = \SECRET_KEY, $mode = \MODE) { } public function sale($amount) { } public function rebSale($transId, $amount = \NULL) { } public function auth($amount) { } public function autocapAuth($amount, $avsAllow = \NULL, $cvv2Allow = \NULL) { } public function addLevel2Qual($orderId = \NULL, $invoiceId = \NULL, $tip = \NULL, $tax = \NULL) { } public function refund($transId, $amount = \NULL) { } public function capture($transId) { } public function rebCancel($transId) { } public function rebAdd($amount, $date, $expr, $cycles) { } public function addAvsProofing($allow) { } public function addCvv2Proofing($allow) { } public function setAutocap() { } public function setCustInfo($account, $cvv2, $expire, $name1, $name2, $addr1, $city, $state, $zip, $country, $phone, $email, $addr2 = \NULL, $memo = \NULL) { } public function formatAmount($amount) { } public function setOrderId($orderId) { } public function calcTPS() { } public function process() { } public function parseResponse() { } public function getResponse() { } public function getTransId() { } public function getStatus() { } public function getAvsResp() { } public function getCvv2Resp() { } public function getAuthCode() { } public function getMessage() { } public function getRebid() { } } class PsiGatePayment { public $parser = \NULL; public $xmlData = \NULL; public $currentTag = \NULL; public $myGatewayURL = \NULL; public $myStoreID = \NULL; public $myPassphrase = \NULL; public $myPaymentType = \NULL; public $myCardAction = \NULL; public $mySubtotal = \NULL; public $myTaxTotal1 = \NULL; public $myTaxTotal2 = \NULL; public $myTaxTotal3 = \NULL; public $myTaxTotal4 = \NULL; public $myTaxTotal5 = \NULL; public $myShipTotal = \NULL; public $myCardNumber = \NULL; public $myCardExpMonth = \NULL; public $myCardExpYear = \NULL; public $myCardIDCode = \NULL; public $myCardIDNumber = \NULL; public $myTestResult = \NULL; public $myOrderID = \NULL; public $myUserID = \NULL; public $myBname = \NULL; public $myBcompany = \NULL; public $myBaddress1 = \NULL; public $myBaddress2 = \NULL; public $myBcity = \NULL; public $myBprovince = \NULL; public $myBpostalcode = \NULL; public $myBcountry = \NULL; public $mySname = \NULL; public $myScompany = \NULL; public $mySaddress1 = \NULL; public $mySaddress2 = \NULL; public $myScity = \NULL; public $mySprovince = \NULL; public $mySpostalcode = \NULL; public $myScountry = \NULL; public $myPhone = \NULL; public $myFax = \NULL; public $myEmail = \NULL; public $myComments = \NULL; public $myCustomerIP = \NULL; public $myRecurring = \NULL; public $myIteration = \NULL; public $myResultTrxnTransTime = \NULL; public $myResultTrxnOrderID = \NULL; public $myResultTrxnApproved = \NULL; public $myResultTrxnReturnCode = \NULL; public $myResultTrxnErrMsg = \NULL; public $myResultTrxnTaxTotal = \NULL; public $myResultTrxnShipTotal = \NULL; public $myResultTrxnSubTotal = \NULL; public $myResultTrxnFullTotal = \NULL; public $myResultTrxnPaymentType = \NULL; public $myResultTrxnCardNumber = \NULL; public $myResultTrxnCardExpMonth = \NULL; public $myResultTrxnCardExpYear = \NULL; public $myResultTrxnTransRefNumber = \NULL; public $myResultTrxnCardIDResult = \NULL; public $myResultTrxnAVSResult = \NULL; public $myResultTrxnCardAuthNumber = \NULL; public $myResultTrxnCardRefNumber = \NULL; public $myResultTrxnCardType = \NULL; public $myResultTrxnIPResult = \NULL; public $myResultTrxnIPCountry = \NULL; public $myResultTrxnIPRegion = \NULL; public $myResultTrxnIPCity = \NULL; public $myError = \NULL; public $myErrorMessage = \NULL; public function ElementStart($parser, $tag, $attributes) { } public function ElementEnd($parser, $tag) { } public function charachterData($parser, $cdata) { } public function setGatewayURL($GatewayURL) { } public function setStoreID($StoreID) { } public function setPassphrase($Passphrase) { } public function setPaymentType($PaymentType) { } public function setCardAction($CardAction) { } public function setSubtotal($Subtotal) { } public function setTaxTotal1($TaxTotal1) { } public function setTaxTotal2($TaxTotal2) { } public function setTaxTotal3($TaxTotal3) { } public function setTaxTotal4($TaxTotal4) { } public function setTaxTotal5($TaxTotal5) { } public function setShiptotal($Shiptotal) { } public function setCardNumber($CardNumber) { } public function setCardExpMonth($CardExpMonth) { } public function setCardExpYear($CardExpYear) { } public function setCardIDCode($CardIDCode) { } public function setCardIDNumber($CardIDNumber) { } public function setTestResult($TestResult) { } public function setOrderID($OrderID) { } public function setUserID($UserID) { } public function setBname($Bname) { } public function setBcompany($Bcompany) { } public function setBaddress1($Baddress1) { } public function setBaddress2($Baddress2) { } public function setBcity($Bcity) { } public function setBprovince($Bprovince) { } public function setBpostalcode($Bpostalcode) { } public function setBcountry($Bcountry) { } public function setSname($Sname) { } public function setScompany($Scompany) { } public function setSaddress1($Saddress1) { } public function setSaddress2($Saddress2) { } public function setScity($Scity) { } public function setSprovince($Sprovince) { } public function setSpostalcode($Spostalcode) { } public function setScountry($Scountry) { } public function setPhone($Phone) { } public function setFax($Fax) { } public function setEmail($Email) { } public function setComments($Comments) { } public function setCustomerIP($CustomerIP) { } public function setRecurring($Recurring) { } public function setIteration($Iteration) { } public function getTrxnTransTime() { } public function getTrxnOrderID() { } public function getTrxnApproved() { } public function getTrxnReturnCode() { } public function getTrxnErrMsg() { } public function getTrxnTaxTotal() { } public function getTrxnShipTotal() { } public function getTrxnSubTotal() { } public function getTrxnFullTotal() { } public function getTrxnPaymentType() { } public function getTrxnCardNumber() { } public function getTrxnCardExpMonth() { } public function getTrxnCardExpYear() { } public function getTrxnTransRefNumber() { } public function getTrxnCardIDResult() { } public function getTrxnAVSResult() { } public function getTrxnCardAuthNumber() { } public function getTrxnCardRefNumber() { } public function getTrxnCardType() { } public function getTrxnIPResult() { } public function getTrxnIPCountry() { } public function getTrxnIPRegion() { } public function getTrxnIPCity() { } public function getError() { } public function getErrorMessage() { } public function __construct() { } public function doPayment() { } } } namespace WHMCS\Module\Gateway\TCO { class Inline { public function link(array $params = array()) { } protected function buildHtmlForm(array $params, array $formParameters, array $recurringFormParameters = array()) { } public function callback(array $params = array()) { } public function clientCallback(array $params = array()) { } protected static function findInvoiceId($serviceId, $transactionId) { } protected static function saveRecurringSaleId(array $ids, $subscriptionId) { } } class Helper { protected static $languages = array("chinese" => "zh", "danish" => "da", "dutch" => "nl", "french" => "fr", "german" => "gr", "greek" => "el", "italian" => "it", "japanese" => "jp", "norwegian" => "no", "portuguese" => "pt", "slovenian" => "sl", "spanish" => "es_la", "swedish" => "sv", "english" => "en"); public static function convertCurrency($amount, \WHMCS\Billing\Currency $currency, \WHMCS\Billing\Invoice $invoice) { } public static function language($language) { } public static function languageInput($language) { } } class Standard { public function link(array $params = array()) { } public function callback(array $params = array()) { } public function clientCallback(array $params = array()) { } } class CallbackRequestHelper { public function __construct(\WHMCS\Http\Message\ServerRequest $request) { } public function shouldInlineBeUsed() { } public function getInvoiceId() { } public function isClientCallback() { } public function getCallable() { } protected function getRequest() { } protected function setRequest(\WHMCS\Http\Message\ServerRequest $request) { } public function getGatewayParams() { } } } namespace WHMCS\Module\Gateway\EwayV4 { class SecureFieldsJsClient { protected $publicApiKey = ""; protected $lang = array(); public function setPublicApiKey($publicApiKey) { } public function addLanguageKey($key, $value) { } public function setLanguage(array $lang = array()) { } public function render() { } public function renderAdmin() { } protected function startEwaySecureFieldsFunction() { } protected function ewaySecureFieldsVariables() { } protected function secureFieldCallback() { } } } namespace { class navigate_class { public $gateway_url = \NULL; public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function seturl($url) { } public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_fields() { } public function dump_response() { } } } namespace WHMCS\Module\Gateway\StripeAch { class StripeAchRouteProvider implements \WHMCS\Route\Contracts\DeferredProviderInterface { use \WHMCS\Route\ProviderTrait; protected function getRoutes() { } public function getDeferredRoutePathNameAttribute() { } } class StripeAchController { public function exchange(\WHMCS\Http\Message\ServerRequest $request) { } } } namespace Bitpay\Client { /** * Interface for class that sends request(s) to BitPay. * * @package Bitpay */ interface ClientInterface { const TESTNET = '0x6F'; const LIVENET = '0x00'; /** * These can be changed/updated so when the request is sent to BitPay it * gives insight into what is making the calls. * * @see RFC2616 section 14.43 for User-Agent Format */ const NAME = 'BitPay PHP Client'; const VERSION = '3.0.0-p1'; public function getCurrencies(); /** * @param InvoiceInterface $invoiceId * @return \Bitpay\Invoice * @throws \Exception */ public function createInvoice(\Bitpay\InvoiceInterface $invoice); /** * @param $invoiceId * @return InvoiceInterface * @throws \Exception */ public function getInvoice($invoiceId); /** * Create a Payout Request on Bitpay. * * @param PayoutInterface $payout * @return PayoutInterface|mixed * @throws \Exception */ public function createPayout(\Bitpay\PayoutInterface $payout); /** * @param null $status * @return array * @throws \Exception */ public function getPayouts($status = null); /** * @param $payoutId * @return \Bitpay\Payout * @throws \Exception */ public function getPayout($payoutId); /** * @param PayoutInterface * @return PayoutInterface|mixed * @throws \Exception */ public function deletePayout(\Bitpay\PayoutInterface $payout); /** * Get an array of tokens indexed by facade. * * @return array * @throws \Exception */ public function getTokens(); } /** * Client used to send requests and receive responses for BitPay's Web API. * * @package Bitpay */ class Client implements \Bitpay\Client\ClientInterface { /** * @var RequestInterface */ protected $request; /** * @var ResponseInterface */ protected $response; /** * @var TokenInterface */ protected $token; /** * @var AdapterInterface */ protected $adapter; /** * @var PublicKey */ protected $publicKey; /** * @var PrivateKey */ protected $privateKey; /** * @var NetworkInterface */ protected $network; /** * The network is either livenet or testnet and tells the client where to * send the requests. * * @param NetworkInterface $network */ public function setNetwork(\Bitpay\Network\NetworkInterface $network) { } /** * Set the Public Key to use to help identify who you are to BitPay. Please * note that you must first pair your keys and get a token in return to use. * * @param PublicKey $key */ public function setPublicKey(\Bitpay\PublicKey $key) { } /** * Set the Private Key to use, this is used when signing request strings * * @param PrivateKey $key */ public function setPrivateKey(\Bitpay\PrivateKey $key) { } /** * Set the network adapter object to use. * * @param AdapterInterface $adapter */ public function setAdapter(\Bitpay\Client\Adapter\AdapterInterface $adapter) { } /** * Assigns the token to use for a request. * * @param TokenInterface $token * @return ClientInterface */ public function setToken(\Bitpay\TokenInterface $token) { } /** * @inheritdoc */ public function createInvoice(\Bitpay\InvoiceInterface $invoice) { } /** * @inheritdoc */ public function getCurrencies() { } /** * @inheritdoc */ public function createPayout(\Bitpay\PayoutInterface $payout) { } /** * @inheritdoc */ public function getPayouts($status = null) { } /** * @inheritdoc */ public function deletePayout(\Bitpay\PayoutInterface $payout) { } /** * @inheritdoc */ public function getPayout($payoutId) { } /** * @inheritdoc */ public function getTokens() { } /** * @inheritdoc */ public function createToken(array $payload = array()) { } /** * Returns the Response object that BitPay returned from * the request that was sent. * * @return ResponseInterface */ public function getResponse() { } /** * Returns the request object that was sent to BitPay. * * @return RequestInterface */ public function getRequest() { } /** * @inheritdoc */ public function getInvoice($invoiceId) { } /** * @param RequestInterface $request * @return ResponseInterface */ public function sendRequest(\Bitpay\Client\RequestInterface $request) { } /** * @param RequestInterface $request * @throws \Exception */ protected function addIdentityHeader(\Bitpay\Client\RequestInterface $request) { } /** * @param RequestInterface $request * @throws \Exception */ protected function addSignatureHeader(\Bitpay\Client\RequestInterface $request) { } /** * @return RequestInterface */ protected function createNewRequest() { } /** * Prepares the request object by adding additional headers * * @see http://en.wikipedia.org/wiki/User_agent * @param RequestInterface $request */ protected function prepareRequestHeaders(\Bitpay\Client\RequestInterface $request) { } /** * @param string $price * @param string $currency * @throws \Exception */ protected function checkPriceAndCurrency($price, $currency) { } } } namespace WHMCS\Module\Gateway\BP { class Client extends \Bitpay\Client\Client { public function createInvoice(\Bitpay\InvoiceInterface $invoice) { } public function resendIpnNotifications($invoiceId) { } public function getPublicKey() { } } } namespace Bitpay { /** * @package Bitcore */ interface KeyInterface extends \Serializable { /** * Generates a new key */ public function generate(); /** * @return boolean */ public function isValid(); } /** * @package Bitcore */ interface PointInterface extends \Serializable { /** * Infinity constant * * @var string */ const INFINITY = 'inf'; /** * @return string */ public function getX(); /** * @return string */ public function getY(); /** * @return boolean */ public function isInfinity(); } /** * Object to represent a point on an elliptic curve * * @package Bitcore */ class Point implements \Bitpay\PointInterface { /** * MUST be a HEX value * * @var string */ protected $x; /** * MUST be a HEX value * * @var string */ protected $y; /** * @param string $x * @param string $y */ public function __construct($x, $y) { } /** * @return string */ public function __toString() { } /** * @return string */ public function getX() { } /** * @return string */ public function getY() { } /** * @return boolean */ public function isInfinity() { } /** * @inheritdoc */ public function serialize() { } /** * @inheritdoc */ public function unserialize($data) { } } /** * Abstract object that is used for Public, Private, and SIN keys * * @package Bitcore */ abstract class Key extends \Bitpay\Point implements \Bitpay\KeyInterface { /** * @var string */ protected $hex; /** * @var string */ protected $dec; /** * @var string */ protected $id; /** * @param string $id */ public function __construct($id = null) { } /** * @return string */ public function getId() { } /** * Returns a new instance of self. * * @param string $id * @return \Bitpay\KeyInterface */ public static function create($id = null) { } /** * @return string */ public function getHex() { } /** * @return string */ public function getDec() { } /** * @inheritdoc */ public function serialize() { } /** * @inheritdoc */ public function unserialize($data) { } /** * @return boolean */ public function isGenerated() { } } /** * @package Bitpay * @see https://en.bitcoin.it/wiki/List_of_address_prefixes */ class PrivateKey extends \Bitpay\Key { /** * @var PublicKey */ protected $publicKey; /** * @var string */ public $pemEncoded = ''; /** * @var array */ public $pemDecoded = array(); /** * @return string */ public function __toString() { } /** * @return PublicKey */ public function getPublicKey() { } /** * Generates an EC private key * * @return \Bitpay\PrivateKey */ public function generate() { } /** * Checks to see if the private key value is not empty and * the hex form only contains hexits and the decimal form * only contains devimal digits. * * @return boolean */ public function isValid() { } /** * @return boolean */ public function hasValidHex() { } /** * @return boolean */ public function hasValidDec() { } /** * Creates an ECDSA signature of $data. * * @param string * @return string * @throws \Exception */ public function sign($data) { } /** * ASN.1 DER encodes the signature based on the form: * 0x30 + size(all) + 0x02 + size(r) + r + 0x02 + size(s) + s * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf * * @param string * @param string * @return string */ public static function serializeSig($r, $s) { } /** * Decodes PEM data to retrieve the keypair. * * @param string $pem_data The data to decode. * @return array The keypair info. * @throws \Exception */ public function pemDecode($pem_data) { } /** * Encodes keypair data to PEM format. * * @param array $keypair The keypair info. * @return string The data to decode. * @throws \Exception */ public function pemEncode($keypair) { } } } namespace WHMCS\Module\Gateway\BP\Key { class PrivateKey extends \Bitpay\PrivateKey { public function setHex($hex) { } } } namespace WHMCS\Module\Gateway\BP { class BitPay { protected $params = array(); public function __construct(array $params) { } public function getConnectionClient() { } protected function getPrivateKey() { } protected function getPublicKey(\WHMCS\Module\Gateway\BP\Key\PrivateKey $privateKey) { } protected function getClient() { } protected function getCurlAdapter() { } protected function getNetwork() { } } } namespace WHMCS\Exception { class Information extends \WHMCS\Exception { } } namespace WHMCS\Module\Gateway\BP\Exception { class InvalidInvoice extends \WHMCS\Exception\Information { } } namespace WHMCS\Module\Gateway\GoCardless { class Client { protected $sandboxMode = false; protected $accessToken = ""; const URLS = array("sandbox" => "https://api-sandbox.gocardless.com/", "live" => "https://api.gocardless.com/"); const API_VERSION = "2015-07-06"; public function __construct($accessToken) { } public static function factory($accessToken) { } protected function getUrl() { } protected function isSandbox() { } protected function getUserAgent() { } protected function setSandboxMode($sandbox) { } protected function setAccessToken($accessToken) { } protected function getAccessToken() { } protected function getDefaultOptions() { } } class Resources { const RESOURCES = array("mandates" => "\\WHMCS\\Module\\Gateway\\GoCardless\\Resources\\Mandates", "payments" => "\\WHMCS\\Module\\Gateway\\GoCardless\\Resources\\Payments"); } } namespace WHMCS\Module\Gateway\GoCardless\Api { class Client { protected $client = NULL; protected $options = array(); const API_VERSION = "2015-07-06"; public function __construct(array $options) { } protected function getClient() { } public function get($path, $params = array()) { } public function put($path, $params) { } public function post($path, $params) { } protected function handleErrors($response) { } protected function castBooleanValuesToStrings($query) { } } class Response { public $headers = NULL; public $status_code = NULL; public $body = NULL; public function __construct($response) { } } } namespace WHMCS\Module\Gateway\GoCardless { class GoCardless { const SUPPORTED_CURRENCIES = array("AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK", "USD"); const SCHEMES = array("AUD" => "becs", "CAD" => "pad", "DKK" => "betalingsservice", "EUR" => "sepa", "GBP" => "bacs", "NZD" => "becs_nz", "SEK" => "autogiro", "USD" => "ach"); const SCHEME_NAMES = array("becs" => "BECS", "pad" => "PAD", "betalingsservice" => "Betalingsservice", "sepa" => "SEPA", "bacs" => "BACS", "becs_nz" => "BECS NZ", "autogiro" => "Autogiro", "ach" => "ACH"); } } namespace WHMCS\Module\Gateway\GoCardless\Exception { class ApiException extends \Exception { } class MalformedResponseException extends \Exception { } } namespace WHMCS\Module\Gateway\GoCardless\Resources { class AbstractResource { protected $params = array(); protected $client = NULL; public function __construct(array $gatewayParams) { } } class Mandates extends \WHMCS\Module\Gateway\GoCardless\Resources\AbstractResource { const STATUSES = array("pending_customer_approval" => "Pending Customer Approval", "pending_submission" => "Pending Submission", "submitted" => "Submitted", "active" => "Active", "failed" => "Failed", "cancelled" => "Cancelled", "expired" => "Expired"); public function cancelled(array $event) { } public function created(array $event) { } public function failed(array $event) { } public function reinstated(array $event) { } public function replaced(array $event) { } public function defaultAction(array $event) { } protected function getClientFromMandate($mandateId) { } } class Payments extends \WHMCS\Module\Gateway\GoCardless\Resources\AbstractResource { const CANCELLED_STATES = array("cancelled", "customer_approval_denied", "failed", "charged_back", "paid_out"); public function confirmed(array $event) { } public function failed(array $event) { } public function charged_back(array $event) { } public function cancelled(array $event) { } public function defaultAction(array $event) { } } } namespace WHMCS\Module\Gateway\CCAvenue { class CCAvenue { protected $key = NULL; protected $crypt = NULL; public static function factory($key) { } public function encrypt($plainText) { } public function decrypt($encryptedText) { } } } namespace { class lphp { public $debugging = \NULL; public $debugstr = \NULL; public function process($data) { } public function curl_process($data) { } public function decodeXML($xmlstg) { } public function buildXML($pdata) { } } class merchantpartners_class { public $gateway_url = \NULL; public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function seturl($url) { } public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_fields() { } public function dump_response() { } } class monerisvault_mpgHttpsPost { public $environment = \NULL; public $api_token = \NULL; public $store_id = \NULL; public $monerisvault_mpgRequest = \NULL; public $monerisvault_mpgResponse = \NULL; public function __construct($environment, $storeid, $apitoken, $monerisvault_mpgRequestOBJ) { } public function getmonerisvault_mpgResponse() { } public function toXML() { } } class monerisvault_mpgResponse { public $responseData = \NULL; public $p = \NULL; public $currentTag = \NULL; public $purchaseHash = array(); public $refundHash = \NULL; public $correctionHash = array(); public $isBatchTotals = \NULL; public $term_id = \NULL; public $receiptHash = array(); public $ecrHash = array(); public $CardType = \NULL; public $currentTxnType = \NULL; public $ecrs = array(); public $cards = array(); public $cardHash = array(); public $resolveData = \NULL; public $resolveDataHash = \NULL; public $data_key = ""; public $DataKeys = array(); public $ACSUrl = \NULL; public function __construct($xmlString) { } public function getmonerisvault_mpgResponseData() { } public function getRecurSuccess() { } public function getAvsResultCode() { } public function getCvdResultCode() { } public function getCardType() { } public function getTransAmount() { } public function getTxnNumber() { } public function getReceiptId() { } public function getTransType() { } public function getReferenceNum() { } public function getResponseCode() { } public function getISO() { } public function getBankTotals() { } public function getMessage() { } public function getAuthCode() { } public function getComplete() { } public function getTransDate() { } public function getTransTime() { } public function getTicket() { } public function getTimedOut() { } public function getCorporateCard() { } public function getRecurUpdateSuccess() { } public function getNextRecurDate() { } public function getRecurEndDate() { } public function getDataKey() { } public function getResSuccess() { } public function getPaymentType() { } public function getResolveData() { } public function setResolveData($data_key) { } public function getResolveDataHash() { } public function getDataKeys() { } public function getResDataDataKey() { } public function getResDataPaymentType() { } public function getResDataCustId() { } public function getResDataPhone() { } public function getResDataEmail() { } public function getResDataNote() { } public function getResDataPan() { } public function getResDataMaskedPan() { } public function getResDataExpDate() { } public function getResDataAvsStreetNumber() { } public function getResDataAvsStreetName() { } public function getResDataAvsZipcode() { } public function getResDataCryptType() { } public function getTerminalStatus($ecr_no) { } public function getPurchaseAmount($ecr_no, $card_type) { } public function getPurchaseCount($ecr_no, $card_type) { } public function getRefundAmount($ecr_no, $card_type) { } public function getRefundCount($ecr_no, $card_type) { } public function getCorrectionAmount($ecr_no, $card_type) { } public function getCorrectionCount($ecr_no, $card_type) { } public function getTerminalIDs() { } public function getCreditCardsAll() { } public function getCreditCards($ecr) { } public function characterHandler($parser, $data) { } public function startHandler($parser, $name, $attrs) { } public function endHandler($parser, $name) { } } class monerisvault_mpgRequest { public $txnTypes = array("purchase" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "refund" => array("order_id", "amount", "txn_number", "crypt_type"), "idebit_purchase" => array("order_id", "cust_id", "amount", "idebit_track2"), "idebit_refund" => array("order_id", "amount", "txn_number"), "ind_refund" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "preauth" => array("order_id", "cust_id", "amount", "pan", "expdate", "crypt_type"), "completion" => array("order_id", "comp_amount", "txn_number", "crypt_type"), "purchasecorrection" => array("order_id", "txn_number", "crypt_type"), "opentotals" => array("ecr_number"), "batchclose" => array("ecr_number"), "cavv_purchase" => array("order_id", "cust_id", "amount", "pan", "expdate", "cavv"), "cavv_preauth" => array("order_id", "cust_id", "amount", "pan", "expdate", "cavv"), "recur_update" => array("order_id", "cust_id", "pan", "expdate", "recur_amount", "add_num_recurs", "total_num_recurs", "hold", "terminate"), "res_add_cc" => array("cust_id", "phone", "email", "note", "pan", "expdate", "crypt_type"), "res_update_cc" => array("data_key", "cust_id", "phone", "email", "note", "pan", "expdate", "crypt_type"), "res_delete" => array("data_key"), "res_lookup_full" => array("data_key"), "res_lookup_masked" => array("data_key"), "res_get_expiring" => array(), "res_purchase_cc" => array("data_key", "order_id", "cust_id", "amount", "crypt_type"), "res_preauth_cc" => array("data_key", "order_id", "cust_id", "amount", "crypt_type"), "res_ind_refund_cc" => array("data_key", "order_id", "cust_id", "amount", "crypt_type"), "res_iscorporatecard" => array("data_key")); public $txnArray = \NULL; public function __construct($txn) { } public function getTransactionType() { } public function toXML() { } } class monerisvault_mpgCustInfo { public $level3template = array("cust_info" => array("email", "instructions", "billing" => array("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost"), "shipping" => array("first_name", "last_name", "company_name", "address", "city", "province", "postal_code", "country", "phone_number", "fax", "tax1", "tax2", "tax3", "shipping_cost"), "item" => array("name", "quantity", "product_code", "extended_amount"))); public $level3data = \NULL; public $email = \NULL; public $instructions = \NULL; public function __construct($custinfo = 0, $billing = 0, $shipping = 0, $items = 0) { } public function setCustInfo($custinfo) { } public function setEmail($email) { } public function setInstructions($instructions) { } public function setShipping($shipping) { } public function setBilling($billing) { } public function setItems($items) { } public function toXML() { } public function toXML_low($template, $txnType) { } } class monerisvault_mpgRecur { public $params = \NULL; public $recurTemplate = array("recur_unit", "start_now", "start_date", "num_recurs", "period", "recur_amount"); public function __construct($params) { } public function toXML() { } } class monerisvault_mpgAvsInfo { public $params = \NULL; public $avsTemplate = array("avs_street_number", "avs_street_name", "avs_zipcode"); public function __construct($params) { } public function toXML() { } } class monerisvault_mpgCvdInfo { public $params = \NULL; public $cvdTemplate = array("cvd_indicator", "cvd_value"); public function __construct($params) { } public function toXML() { } } class monerisvault_mpgTransaction { public $txn = \NULL; public $custInfo = \NULL; public $recur = \NULL; public function __construct($txn) { } public function getCustInfo() { } public function setCustInfo($custInfo) { } public function getRecur() { } public function setRecur($recur) { } public function getTransaction() { } public function getCvdInfo() { } public function setCvdInfo($cvd) { } public function getAvsInfo() { } public function setAvsInfo($avs) { } } } namespace net\authorize\util { /** * A class to send a request to the XML API. * * @package AuthorizeNet * @subpackage net\authorize\util */ class HttpClient { public $VERIFY_PEER = true; /** * Constructor. * */ public function __construct() { } /** * Set a log file. * * @param string $endPoint end point to hit from \net\authorize\api\constants\ANetEnvironment */ public function setPostUrl($endPoint = \net\authorize\api\constants\ANetEnvironment::CUSTOM) { } /** * @return string */ public function _getPostUrl() { } /** * Set a log file. * * @param string $filepath Path to log file. */ public function setLogFile($filepath) { } /** * Posts the request to AuthorizeNet endpoint using Curl & returns response. * * @param string $xmlRequest * @return string $xmlResponse The response. */ public function _sendRequest($xmlRequest) { } } } namespace WHMCS\Module\Gateway\AcceptJs { class AcceptJsHttpClient extends \net\authorize\util\HttpClient { protected $verifyHost = 2; protected $verifyPeer = true; public function __construct() { } public function setVerifyHost($value = 2) { } public function setVerifyPeer($value = true) { } public function _sendRequest($xmlRequest) { } } } namespace net\authorize\api\controller\base { interface IApiOperation { /** * @return \net\authorize\api\contract\v1\ANetApiResponseType */ public function getApiResponse(); /** * @return \net\authorize\api\contract\v1\ANetApiResponseType */ public function executeWithApiResponse($endPoint = null); /** * @return void */ public function execute($endPoint = null); /* //TS GetApiResponse(); AuthorizeNet.Api.Contracts.V1.ANetApiResponse GetErrorResponse(); //TS ExecuteWithApiResponse(AuthorizeNet.Environment environment = null); //void Execute(AuthorizeNet.Environment environment = null); AuthorizeNet.Api.Contracts.V1.messageTypeEnum GetResultCode(); List GetResults(); */ } abstract class ApiOperationBase implements \net\authorize\api\controller\base\IApiOperation { /** * @var \JMS\Serializer\Serializer; */ public $serializer = null; /** * @var \net\authorize\util\HttpClient; */ public $httpClient = null; /** * Constructor. * * @param \net\authorize\api\contract\v1\AnetApiRequestType $request ApiRequest to send * @param string $responseType response type expected * @throws InvalidArgumentException if invalid request */ public function __construct(\net\authorize\api\contract\v1\AnetApiRequestType $request, $responseType) { } /** * Retrieves response * @return \net\authorize\api\contract\v1\AnetApiResponseType */ public function getApiResponse() { } /** * Sends request and retrieves response * @return \net\authorize\api\contract\v1\AnetApiResponseType */ public function executeWithApiResponse($endPoint = \net\authorize\api\constants\ANetEnvironment::CUSTOM) { } public function execute($endPoint = \net\authorize\api\constants\ANetEnvironment::CUSTOM) { } protected function beforeExecute() { } protected function afterExecute() { } protected function validateRequest() { } //need to make this abstract protected function now() { } } } namespace net\authorize\api\controller { class AuthenticateTestController extends \net\authorize\api\controller\base\ApiOperationBase { public function __construct(\net\authorize\api\contract\v1\AnetApiRequestType $request) { } protected function validateRequest() { } } } namespace WHMCS\Module\Gateway\AcceptJs { class AcceptJsAuthenticateTestController extends \net\authorize\api\controller\AuthenticateTestController { public function __construct(\net\authorize\api\contract\v1\AnetApiRequestType $request) { } } } namespace { class planetauthorize_class { public $gateway_url = \NULL; public $field_string = \NULL; public $fields = array(); public $gatewayurls = array(); public $response_string = \NULL; public $response = array(); public function seturl($url) { } public function add_field($field, $value) { } public function process() { } public function get_response_reason_text() { } public function dump_response() { } } } namespace WHMCS\Module\Gateway\Stripe { class StripeRouteProvider implements \WHMCS\Route\Contracts\DeferredProviderInterface { use \WHMCS\Route\ProviderTrait; protected function getRoutes() { } public function getDeferredRoutePathNameAttribute() { } } class Constant { public static $apiVersion = "2019-03-14"; public static $appName = "WHMCS"; public static $appUrl = "https://www.whmcs.com"; public static $appPartnerId = "pp_partner_EzZDHkkVgTrj6n"; } class StripeController { public function intent(\WHMCS\Http\Message\ServerRequest $request) { } public function setupIntent(\WHMCS\Http\Message\ServerRequest $request) { } public function add(\WHMCS\Http\Message\ServerRequest $request) { } public function adminAdd(\WHMCS\Http\Message\ServerRequest $request) { } protected function addProcess(\WHMCS\Http\Message\ServerRequest $request, $sessionUserId = false) { } } } namespace WHMCS\Route { trait AdminProviderTrait { use \WHMCS\Route\ProviderTrait; protected function enforceAdminAuthentication(array $routeCollection) { } public function mutateAdminRoutesForCustomDirectory(array $adminRoutes = array()) { } public function registerRoutes(\FastRoute\RouteCollector $routeCollector) { } } } namespace WHMCS\Module\Gateway\Stripe\Admin { class StripeRouteProvider implements \WHMCS\Route\Contracts\DeferredProviderInterface { use \WHMCS\Route\AdminProviderTrait; protected function getRoutes() { } public function getDeferredRoutePathNameAttribute() { } } } namespace WHMCS\Module { abstract class AbstractWidget { protected $title = NULL; protected $description = NULL; protected $columns = 1; protected $weight = 100; protected $wrapper = true; protected $cache = false; protected $cachePerUser = false; protected $cacheExpiry = 3600; protected $requiredPermission = ""; protected $draggable = true; protected $adminUser = NULL; public function getId() { } public function getTitle() { } public function getDescription() { } public function getColumnSize() { } public function getWeight() { } public function showWrapper() { } public function isCachable() { } public function isCachedPerUser() { } public function getCacheExpiry() { } public function getRequiredPermission() { } public abstract function getData(); public abstract function generateOutput($data); protected function fetchData($forceRefresh = false) { } public function sanitizeData($data) { } public function render($forceRefresh = false) { } public function isDraggable() { } } } namespace WHMCS\Module\Widget { /** * MarketConnect Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class MarketConnect extends \WHMCS\Module\AbstractWidget { protected $title = 'MarketConnect'; protected $description = 'An overview of MarketConnect.'; protected $weight = 45; protected $cache = true; protected $cacheExpiry = 6 * 60; protected $requiredPermission = 'View MarketConnect Balance'; public function getData() { } public function generateOutput($data) { } } /** * Automation Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Automation extends \WHMCS\Module\AbstractWidget { protected $title = 'Automation Overview'; protected $description = 'An overview of system automation.'; protected $weight = 20; protected $cache = true; protected $requiredPermission = 'Configure Automation Settings'; public function getData() { } public function generateOutput($data) { } } /** * Abstract Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Support extends \WHMCS\Module\AbstractWidget { protected $title = 'Support'; protected $description = 'An overview of support.'; protected $weight = 30; protected $cache = true; protected $cacheExpiry = 120; protected $cachePerUser = true; protected $requiredPermission = 'List Support Tickets'; public function getData() { } public function generateOutput($data) { } } /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Badges extends \WHMCS\Module\AbstractWidget { protected $title = 'Badges'; protected $description = ''; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = true; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { } public function generateOutput($data) { } } /** * Staff Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Staff extends \WHMCS\Module\AbstractWidget { protected $title = 'Staff Online'; protected $description = 'An overview of staff.'; protected $weight = 50; protected $cache = true; protected $cacheExpiry = 60; public function getData() { } public function generateOutput($data) { } } /** * NetworkStatus Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class NetworkStatus extends \WHMCS\Module\AbstractWidget { protected $title = 'Network Status'; protected $description = 'An overview of Network Status.'; protected $weight = 80; protected $cache = true; public function getData() { } public function generateOutput($data) { } } /** * Client Activity Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class ClientActivity extends \WHMCS\Module\AbstractWidget { protected $title = 'Client Activity'; protected $description = 'Recent online clients.'; protected $weight = 70; protected $cache = true; protected $cacheExpiry = 300; protected $requiredPermission = 'List Clients'; public function getData() { } public function generateOutput($data) { } } /** * ToDo Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class ToDo extends \WHMCS\Module\AbstractWidget { protected $title = 'To-Do List'; protected $description = ''; protected $weight = 60; protected $cache = false; protected $requiredPermission = 'To-Do List'; public function getData() { } public function generateOutput($data) { } } /** * Billing Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Billing extends \WHMCS\Module\AbstractWidget { protected $title = 'Billing'; protected $description = 'An overview of billing.'; protected $weight = 40; protected $cache = true; protected $requiredPermission = 'View Income Totals'; public function getData() { } public function generateOutput($data) { } } /** * System Overview Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Overview extends \WHMCS\Module\AbstractWidget { protected $title = 'System Overview'; protected $description = 'An overview of orders and income.'; protected $columns = 2; protected $weight = 10; protected $requiredPermission = 'View Income Totals'; public function getData() { } public function generateOutput($data) { } } /** * Health Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Health extends \WHMCS\Module\AbstractWidget { protected $title = 'System Health'; protected $description = 'An overview of System Health.'; protected $weight = 90; protected $cache = true; protected $requiredPermission = 'Health and Updates'; public function getData() { } public function generateOutput($data) { } } /** * Activity Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Activity extends \WHMCS\Module\AbstractWidget { protected $title = 'Activity'; protected $description = 'Recent system activity.'; protected $weight = 100; protected $cache = true; protected $requiredPermission = 'View Activity Log'; public function getData() { } public function generateOutput($data) { } } } namespace { class HeartInternet_API { public $namespace = "urn:ietf:params:xml:ns:epp-1.0"; public function connect($test_mode = \false) { } public function getResponse() { } public function sendMessage($output, $no_parsing = \false) { } public function logIn($userid, $password, $objects, $extensions) { } public function buildXML($content) { } public function disconnect() { } } class Services_JSON_Error extends \PEAR_Error { public function __construct($message = "unknown error", $code = \NULL, $mode = \NULL, $options = \NULL, $userinfo = \NULL) { } } class Services_JSON { public function __construct($use = 0) { } public function utf162utf8($utf16) { } public function utf82utf16($utf8) { } public function encode($var) { } public function name_value($name, $value) { } public function reduce_string($str) { } public function decode($str) { } public function isError($data, $code = \NULL) { } } class IXR_Value { public $data = \NULL; public $type = \NULL; public function IXR_Value($data, $type = \false) { } public function calculateType() { } public function getXml() { } public function isStruct($array) { } } class IXR_Message { public $message = \NULL; public $messageType = \NULL; public $faultCode = \NULL; public $faultString = \NULL; public $methodName = \NULL; public $params = \NULL; public $_arraystructs = array(); public $_arraystructstypes = array(); public $_currentStructName = array(); public $_param = \NULL; public $_value = \NULL; public $_currentTag = \NULL; public $_currentTagContents = \NULL; public $_parser = \NULL; public function IXR_Message($message) { } public function parse() { } public function tag_open($parser, $tag, $attr) { } public function cdata($parser, $cdata) { } public function tag_close($parser, $tag) { } } class IXR_Server { public $data = \NULL; public $callbacks = array(); public $message = \NULL; public $capabilities = \NULL; public function IXR_Server($callbacks = \false, $data = \false) { } public function serve($data = \false) { } public function call($methodname, $args) { } public function error($error, $message = \false) { } public function output($xml) { } public function hasMethod($method) { } public function setCapabilities() { } public function getCapabilities($args) { } public function setCallbacks() { } public function listMethods($args) { } public function multiCall($methodcalls) { } } class IXR_Request { public $method = \NULL; public $args = \NULL; public $xml = \NULL; public function IXR_Request($method, $args) { } public function getLength() { } public function getXml() { } } class IXR_Client { public $server = \NULL; public $port = \NULL; public $path = \NULL; public $useragent = \NULL; public $response = \NULL; public $message = \false; public $debug = \false; public $error = \false; public function IXR_Client($server, $path = \false, $port = 80) { } public function query() { } public function getResponse() { } public function isError() { } public function getErrorCode() { } public function getErrorMessage() { } } class IXR_Error { public $code = \NULL; public $message = \NULL; public function IXR_Error($code, $message) { } public function getXml() { } } class IXR_Date { public $year = \NULL; public $month = \NULL; public $day = \NULL; public $hour = \NULL; public $minute = \NULL; public $second = \NULL; public function IXR_Date($time) { } public function parseTimestamp($timestamp) { } public function parseIso($iso) { } public function getIso() { } public function getXml() { } public function getTimestamp() { } } class IXR_Base64 { public $data = \NULL; public function IXR_Base64($data) { } public function getXml() { } } class IXR_IntrospectionServer extends \IXR_Server { public $signatures = \NULL; public $help = \NULL; public function IXR_IntrospectionServer() { } public function addCallback($method, $callback, $args, $help) { } public function call($methodname, $args) { } public function methodSignature($method) { } public function methodHelp($method) { } } class IXR_ClientMulticall extends \IXR_Client { public $calls = array(); public function IXR_ClientMulticall($server, $path = \false, $port = 80) { } public function addCall() { } public function query() { } } } namespace OAuth2\Controller { /** * This controller is called when a token is being requested. * it is called to handle all grant types the application supports. * It also validates the client's credentials * * ex: * > $tokenController->handleTokenRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response()); * > $response->send(); * */ interface TokenControllerInterface { /** * handleTokenRequest * * @param $request * OAuth2\RequestInterface - The current http request * @param $response * OAuth2\ResponseInterface - An instance of OAuth2\ResponseInterface to contain the response data * */ public function handleTokenRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); public function grantAccessToken(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); } /** * This controller is called when a "resource" is requested. * call verifyResourceRequest in order to determine if the request * contains a valid token. * * ex: * > if (!$resourceController->verifyResourceRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response())) { * > $response->send(); // authorization failed * > die(); * > } * > return json_encode($resource); // valid token! Send the stuff! * */ interface ResourceControllerInterface { public function verifyResourceRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, $scope = null); public function getAccessTokenData(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); } } namespace WHMCS\ApplicationLink\Server { interface ApplicationLinkServerInterface extends \OAuth2\Controller\TokenControllerInterface, \OAuth2\Controller\ResourceControllerInterface { public function postAccessTokenResponseAction(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); } } namespace OAuth2\Controller { /** * This controller is called when a user should be authorized * by an authorization server. As OAuth2 does not handle * authorization directly, this controller ensures the request is valid, but * requires the application to determine the value of $is_authorized * * ex: * > $user_id = $this->somehowDetermineUserId(); * > $is_authorized = $this->somehowDetermineUserAuthorization(); * > $response = new OAuth2\Response(); * > $authorizeController->handleAuthorizeRequest( * > OAuth2\Request::createFromGlobals(), * > $response, * > $is_authorized, * > $user_id); * > $response->send(); * */ interface AuthorizeControllerInterface { /** * List of possible authentication response types. * The "authorization_code" mechanism exclusively supports 'code' * and the "implicit" mechanism exclusively supports 'token'. * * @var string * @see http://tools.ietf.org/html/rfc6749#section-4.1.1 * @see http://tools.ietf.org/html/rfc6749#section-4.2.1 */ const RESPONSE_TYPE_AUTHORIZATION_CODE = 'code'; const RESPONSE_TYPE_ACCESS_TOKEN = 'token'; public function handleAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, $is_authorized, $user_id = null); public function validateAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); } } namespace OAuth2\OpenID\Controller { /** * This controller is called when the user claims for OpenID Connect's * UserInfo endpoint should be returned. * * ex: * > $response = new OAuth2\Response(); * > $userInfoController->handleUserInfoRequest( * > OAuth2\Request::createFromGlobals(), * > $response; * > $response->send(); * */ interface UserInfoControllerInterface { public function handleUserInfoRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response); } } namespace OAuth2 { /** * Server class for OAuth2 * This class serves as a convience class which wraps the other Controller classes * * @see OAuth2\Controller\ResourceController * @see OAuth2\Controller\AuthorizeController * @see OAuth2\Controller\TokenController */ class Server implements \OAuth2\Controller\ResourceControllerInterface, \OAuth2\Controller\AuthorizeControllerInterface, \OAuth2\Controller\TokenControllerInterface, \OAuth2\OpenID\Controller\UserInfoControllerInterface { // misc properties protected $response; protected $config; protected $storages; // servers protected $authorizeController; protected $tokenController; protected $resourceController; protected $userInfoController; // config classes protected $grantTypes; protected $responseTypes; protected $tokenType; protected $scopeUtil; protected $clientAssertionType; protected $storageMap = array('access_token' => 'OAuth2\\Storage\\AccessTokenInterface', 'authorization_code' => 'OAuth2\\Storage\\AuthorizationCodeInterface', 'client_credentials' => 'OAuth2\\Storage\\ClientCredentialsInterface', 'client' => 'OAuth2\\Storage\\ClientInterface', 'refresh_token' => 'OAuth2\\Storage\\RefreshTokenInterface', 'user_credentials' => 'OAuth2\\Storage\\UserCredentialsInterface', 'user_claims' => 'OAuth2\\OpenID\\Storage\\UserClaimsInterface', 'public_key' => 'OAuth2\\Storage\\PublicKeyInterface', 'jwt_bearer' => 'OAuth2\\Storage\\JWTBearerInterface', 'scope' => 'OAuth2\\Storage\\ScopeInterface'); protected $responseTypeMap = array('token' => 'OAuth2\\ResponseType\\AccessTokenInterface', 'code' => 'OAuth2\\ResponseType\\AuthorizationCodeInterface', 'id_token' => 'OAuth2\\OpenID\\ResponseType\\IdTokenInterface', 'id_token token' => 'OAuth2\\OpenID\\ResponseType\\IdTokenTokenInterface', 'code id_token' => 'OAuth2\\OpenID\\ResponseType\\CodeIdTokenInterface'); /** * @param mixed $storage (array or OAuth2\Storage) - single object or array of objects implementing the * required storage types (ClientCredentialsInterface and AccessTokenInterface as a minimum) * @param array $config specify a different token lifetime, token header name, etc * @param array $grantTypes An array of OAuth2\GrantType\GrantTypeInterface to use for granting access tokens * @param array $responseTypes Response types to use. array keys should be "code" and and "token" for * Access Token and Authorization Code response types * @param OAuth2\TokenType\TokenTypeInterface $tokenType The token type object to use. Valid token types are "bearer" and "mac" * @param OAuth2\ScopeInterface $scopeUtil The scope utility class to use to validate scope * @param OAuth2\ClientAssertionType\ClientAssertionTypeInterface $clientAssertionType The method in which to verify the client identity. Default is HttpBasic * * @ingroup oauth2_section_7 */ public function __construct($storage = array(), array $config = array(), array $grantTypes = array(), array $responseTypes = array(), \OAuth2\TokenType\TokenTypeInterface $tokenType = null, \OAuth2\ScopeInterface $scopeUtil = null, \OAuth2\ClientAssertionType\ClientAssertionTypeInterface $clientAssertionType = null) { } public function getAuthorizeController() { } public function getTokenController() { } public function getResourceController() { } public function getUserInfoController() { } /** * every getter deserves a setter */ public function setAuthorizeController(\OAuth2\Controller\AuthorizeControllerInterface $authorizeController) { } /** * every getter deserves a setter */ public function setTokenController(\OAuth2\Controller\TokenControllerInterface $tokenController) { } /** * every getter deserves a setter */ public function setResourceController(\OAuth2\Controller\ResourceControllerInterface $resourceController) { } /** * every getter deserves a setter */ public function setUserInfoController(\OAuth2\OpenID\Controller\UserInfoControllerInterface $userInfoController) { } /** * Return claims about the authenticated end-user. * This would be called from the "/UserInfo" endpoint as defined in the spec. * * @param $request - OAuth2\RequestInterface * Request object to grant access token * * @param $response - OAuth2\ResponseInterface * Response object containing error messages (failure) or user claims (success) * * @throws InvalidArgumentException * @throws LogicException * * @see http://openid.net/specs/openid-connect-core-1_0.html#UserInfo */ public function handleUserInfoRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } /** * Grant or deny a requested access token. * This would be called from the "/token" endpoint as defined in the spec. * Obviously, you can call your endpoint whatever you want. * * @param $request - OAuth2\RequestInterface * Request object to grant access token * * @param $response - OAuth2\ResponseInterface * Response object containing error messages (failure) or access token (success) * * @throws InvalidArgumentException * @throws LogicException * * @see http://tools.ietf.org/html/rfc6749#section-4 * @see http://tools.ietf.org/html/rfc6749#section-10.6 * @see http://tools.ietf.org/html/rfc6749#section-4.1.3 * * @ingroup oauth2_section_4 */ public function handleTokenRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } public function grantAccessToken(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } /** * Handle a revoke token request * This would be called from the "/revoke" endpoint as defined in the draft Token Revocation spec * * @see https://tools.ietf.org/html/rfc7009#section-2 * * @param RequestInterface $request * @param ResponseInterface $response * @return Response|ResponseInterface */ public function handleRevokeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } /** * Redirect the user appropriately after approval. * * After the user has approved or denied the resource request the * authorization server should call this function to redirect the user * appropriately. * * @param $request * The request should have the follow parameters set in the querystring: * - response_type: The requested response: an access token, an * authorization code, or both. * - client_id: The client identifier as described in Section 2. * - redirect_uri: An absolute URI to which the authorization server * will redirect the user-agent to when the end-user authorization * step is completed. * - scope: (optional) The scope of the resource request expressed as a * list of space-delimited strings. * - state: (optional) An opaque value used by the client to maintain * state between the request and callback. * @param $is_authorized * TRUE or FALSE depending on whether the user authorized the access. * @param $user_id * Identifier of user who authorized the client * * @see http://tools.ietf.org/html/rfc6749#section-4 * * @ingroup oauth2_section_4 */ public function handleAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, $is_authorized, $user_id = null) { } /** * Pull the authorization request data out of the HTTP request. * - The redirect_uri is OPTIONAL as per draft 20. But your implementation can enforce it * by setting $config['enforce_redirect'] to true. * - The state is OPTIONAL but recommended to enforce CSRF. Draft 21 states, however, that * CSRF protection is MANDATORY. You can enforce this by setting the $config['enforce_state'] to true. * * The draft specifies that the parameters should be retrieved from GET, override the Response * object to change this * * @return * The authorization parameters so the authorization server can prompt * the user for approval if valid. * * @see http://tools.ietf.org/html/rfc6749#section-4.1.1 * @see http://tools.ietf.org/html/rfc6749#section-10.12 * * @ingroup oauth2_section_3 */ public function validateAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } public function verifyResourceRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null, $scope = null) { } public function getAccessTokenData(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = null) { } public function addGrantType(\OAuth2\GrantType\GrantTypeInterface $grantType, $identifier = null) { } /** * Set a storage object for the server * * @param $storage * An object implementing one of the Storage interfaces * @param $key * If null, the storage is set to the key of each storage interface it implements * * @see storageMap */ public function addStorage($storage, $key = null) { } public function addResponseType(\OAuth2\ResponseType\ResponseTypeInterface $responseType, $key = null) { } public function getScopeUtil() { } /** * every getter deserves a setter */ public function setScopeUtil($scopeUtil) { } protected function createDefaultAuthorizeController() { } protected function createDefaultTokenController() { } protected function createDefaultResourceController() { } protected function createDefaultUserInfoController() { } protected function getDefaultTokenType() { } protected function getDefaultResponseTypes() { } protected function getDefaultGrantTypes() { } protected function getAccessTokenResponseType() { } protected function getIdTokenResponseType() { } protected function getIdTokenTokenResponseType() { } /** * For Resource Controller */ protected function createDefaultJwtAccessTokenStorage() { } /** * For Authorize and Token Controllers */ protected function createDefaultJwtAccessTokenResponseType() { } protected function createDefaultAccessTokenResponseType() { } protected function createDefaultIdTokenResponseType() { } protected function createDefaultIdTokenTokenResponseType() { } protected function validateOpenIdConnect() { } protected function normalizeResponseType($name) { } public function getResponse() { } public function getStorages() { } public function getStorage($name) { } public function getGrantTypes() { } public function getGrantType($name) { } public function getResponseTypes() { } public function getResponseType($name) { } public function getTokenType() { } public function getClientAssertionType() { } public function setConfig($name, $value) { } public function getConfig($name, $default = null) { } } } namespace WHMCS\ApplicationLink\Server { class Server extends \OAuth2\Server implements \WHMCS\ApplicationLink\Server\ApplicationLinkServerInterface { public function getAccessToken(\OAuth2\HttpFoundationBridge\Request $request) { } protected function findAccessToken($accessToken) { } public function postAccessTokenResponseAction(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response) { } public function getModuleApplicationLinkServer(\OAuth2\HttpFoundationBridge\Request $request) { } public function handleSingleSignOnRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, $requestedScope = "") { } protected function authenticateTokenUser(\OAuth2\RequestInterface $request, \WHMCS\ApplicationLink\AccessToken $token) { } public function getDiscoveryDocument() { } public function getJwks() { } public function base64urlEncode($data) { } public function base64urlDecode($data) { } public static function getIssuer() { } protected function createDefaultIdTokenResponseType() { } public function hasUserAuthorizedRequestedScopes(\WHMCS\User\Client $user) { } public function updateUserAuthorizedScopes(\WHMCS\User\Client $user, array $scopes = array()) { } public static function storeRequest(\OAuth2\HttpFoundationBridge\Request $request) { } public static function retrieveRequest($requestHash, $deleteAfterFetch = true) { } public function pruneExpiredAccessTokens() { } } } namespace Cpanel\ApplicationLink { class Server extends \WHMCS\ApplicationLink\Server\Server { public function handleTokenRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response = NULL) { } protected function preProcessHandleTokenRequest(\OAuth2\HttpFoundationBridge\Request $request, \OAuth2\HttpFoundationBridge\Response $response = NULL) { } protected function postProcessHandleTokenRequest(\OAuth2\ResponseInterface $response) { } public function postAccessTokenResponseAction(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response) { } } } namespace { abstract class CCBaseAPIClient { public $debug = \false; public $encoding = "UTF-8"; public $debugconsole = \false; public $raw_response = ""; public $raw_request = ""; public $remote_version = \false; public $message = ""; public $data = \NULL; public $success = \false; public $error = ""; protected $classname = ""; protected $methodname = ""; protected $ccurl = ""; protected $http_request_error = ""; public function call() { } public function __call($name, $args) { } protected function build_request_packet($methodname, $payload) { } protected function http_request($url, $postdata) { } public function handle_http_error($errno, $errstr, $errfile, $errline) { } protected function http_request_php($url, $postdata) { } protected function http_request_httpretriever($url, $postdata) { } protected function cc_initialize($ccurl) { } protected abstract function build_argument_payload($functionargs); protected function build_argument_xml($args) { } protected function parse_data($data) { } protected function parse_response_packet($packet) { } protected function api_request($packet) { } protected function set_error($msg) { } protected function _call($name, $args) { } } class CCServerAPIClient extends \CCBaseAPIClient { protected $classname = "server"; public function __construct($ccurl) { } protected function build_argument_payload($functionargs) { } } class CCSystemAPIClient extends \CCBaseAPIClient { protected $classname = "system"; public function __construct($ccurl) { } public function build_argument_payload($functionargs) { } } class CCAPIXML { public function parse($xml) { } public static function xmlentities($string) { } public static function xml_entity_decode($string) { } } abstract class Plesk_Manager_Base { public function __call($name, $args) { } public function getVersion() { } public function createTableForAccountStorage() { } protected function _checkErrors($result) { } } class Plesk_Manager_V1000 extends \Plesk_Manager_Base { protected function _getSupportedApiVersions() { } protected function _getSharedIpv4($params) { } protected function _getSharedIpv6($params) { } protected function _getFreeDedicatedIpv4() { } protected function _getFreeDedicatedIpv6() { } protected function _setAccountPassword($params) { } protected function _getIp($params, $version = \Plesk_Object_Ip::IPV4) { } protected function _setWebspaceStatus($params) { } protected function _deleteWebspace($params) { } protected function _setWebspacePassword($params) { } protected function _getClientAreaForm($params) { } protected function _getFreeDedicatedIp($version = \Plesk_Object_Ip::IPV4) { } protected function _getIpList($type = \Plesk_Object_Ip::SHARED, $version = \NULL) { } protected function _isIpv6($ip) { } protected function _getCustomerExternalId($params) { } protected function _getAccountInfo($params, $panelExternalId = \NULL) { } protected function _addAccount($params) { } protected function _getAddAccountParams($params) { } protected function _addIpToIpPool($accountId, $params) { } protected function _addWebspace($params) { } protected function _getWebspacesUsage($params) { } protected function _getWebspacesByOwnerId($ownerId) { } protected function _getIps($params) { } protected function _changeSubscriptionIp($params) { } protected function _checkRestrictions($params) { } protected function _getServicePlans() { } protected function _listAccounts(array $params) { } protected function _getCustomers(array $params) { } protected function _getCustomersByOwner(array $params) { } protected function _getResellers(array $params) { } protected function _getResellerByLogin(array $params) { } protected function _getServerData(array $params) { } } class Plesk_Manager_V1630 extends \Plesk_Manager_V1000 { protected function _getResellerPlans() { } protected function _getAccountInfo($params, $panelExternalId = \NULL) { } protected function _getAddAccountParams($params) { } protected function _addAccount($params) { } protected function _addWebspace($params) { } protected function _setResellerStatus($params) { } protected function _deleteReseller($params) { } protected function _setAccountPassword($params) { } protected function _deleteWebspace($params) { } protected function _switchSubscription($params) { } protected function _processAddons($params) { } protected function _getWebspacesUsage($params) { } protected function _getResellersUsage($params) { } protected function _addIpToIpPool($accountId, $params) { } protected function _getWebspacesByOwnerId($ownerId) { } protected function _getCustomerExternalId($params) { } protected function _changeSubscriptionIp($params) { } protected function _getLimits(\SimpleXMLElement $limits) { } protected function _getServicePlans() { } protected function _generateCSR($params) { } protected function _installSsl($params) { } protected function _getMxRecords($params) { } protected function _deleteMxRecords($params) { } protected function _addMxRecords($params) { } protected function _listAccounts(array $params) { } protected function _getCustomers(array $params) { } protected function _getCustomersByOwner(array $params) { } protected function _getResellers(array $params) { } protected function _getResellerByLogin(array $params) { } protected function _getServerData(array $params) { } } class Plesk_Manager_V1632 extends \Plesk_Manager_V1630 { protected function _processAddons($params) { } protected function _addWebspace($params) { } protected function _getSharedIpv4($params) { } protected function _getSharedIpv6($params) { } protected function _getFreeDedicatedIpv4() { } protected function _getFreeDedicatedIpv6() { } protected function _getIpList($type = \Plesk_Object_Ip::SHARED, $version = \NULL) { } protected function _getFreeDedicatedIp($version = \Plesk_Object_Ip::IPV4) { } protected function _getWebspacesUsage($params) { } protected function _changeSubscriptionIp($params) { } protected function _listAccounts(array $params) { } } class Plesk_Manager_V1635 extends \Plesk_Manager_V1632 { protected function _createSession($params) { } protected function _getClientAreaForm($params) { } } class Plesk_Manager_V1640 extends \Plesk_Manager_V1635 { protected function _getWebspacesUsage($params) { } } class Plesk_Manager_V1660 extends \Plesk_Manager_V1640 { protected function _getAddAccountParams($params) { } protected function _addAccount($params) { } } class Plesk_Manager_V1670 extends \Plesk_Manager_V1660 { protected function _generateCSR($params) { } protected function _installSsl($params) { } } class Plesk_Object_Ip { const SHARED = "shared"; const DEDICATED = "exclusive"; const IPV4 = "ipv4"; const IPV6 = "ipv6"; const ADDON_NAME_IPV4 = "Dedicated IPv4"; const ADDON_NAME_IPV6 = "Dedicated IPv6"; } class Plesk_Object_ResellerPlan { public $id = \NULL; public $name = \NULL; public function __construct($id, $name) { } } class Plesk_Object_Webspace { const STATUS_ACTIVE = 0; const TYPE_VRT_HST = "vrt_hst"; } class Plesk_Object_Customer { const STATUS_ACTIVE = 0; const STATUS_SUSPENDED_BY_ADMIN = 16; const STATUS_SUSPENDED_BY_RESELLER = 32; const TYPE_CLIENT = "hostingaccount"; const TYPE_RESELLER = "reselleraccount"; const EXTERNAL_ID_PREFIX = "whmcs_plesk_"; public static function getCustomerExternalId($params) { } } class Plesk_Object_Addon { const ADDON_PREFIX = "Plesk "; } class Plesk_Config { public static function get() { } public static function getDefaults() { } } class Plesk_Utils { public static function getAccountsCount($userId) { } } class Plesk_Loader { public static function init($params) { } public static function autoload($className) { } } class Plesk_Api { protected $_login = \NULL; protected $_password = \NULL; protected $_hostname = \NULL; protected $_port = \NULL; protected $_isSecure = \NULL; const STATUS_OK = "ok"; const STATUS_ERROR = "error"; const ERROR_AUTHENTICATION_FAILED = 1001; const ERROR_AGENT_INITIALIZATION_FAILED = 1003; const ERROR_OBJECT_NOT_FOUND = 1013; const ERROR_PARSING_XML = 1014; const ERROR_OPERATION_FAILED = 1023; public function __construct($login, $password, $hostname, $port, $isSecure) { } public function __call($name, $args) { } public function isAdmin() { } protected function request($command, $params) { } } class Plesk_Registry { public static function getInstance() { } public function __get($name) { } public function __set($name, $value) { } public function __isset($name) { } } class Plesk_Translate { public function __construct() { } public function translate($msg, $placeholders = array()) { } } class VPSNET { protected $_apiUrl = "https://api.vps.net"; protected $_apiUserAgent = "VPSNET_API_10_JSON/PHP"; public $last_errors = \NULL; public function __destruct() { } public function isAuthenticationInfoSet() { } public static function getInstance($username = "", $_auth_api_key = "", $proxy = "") { } public function __clone() { } public function setAPIResource($resource, $append_api_version = \true, $queryString = "") { } public function sendGETRequest() { } public function sendPOSTRequest($data = \NULL, $encodeasjson = \true) { } public function sendPUTRequest($data) { } public function sendDELETERequest() { } protected function sendRequest($data = \NULL) { } public function getNodes($consumer_id = 0) { } public function getIPAddresses($consumer_id = 0) { } public function getVirtualMachines($consumer_id = 0) { } public function getAvailableCloudsAndTemplates() { } public function addInternalIPAddresses($quantity, $consumer_id = 0) { } public function addExternalIPAddresses($quantity, $cloud_id, $consumer_id = 0) { } public function createVirtualMachine($virtualmachine) { } public function addNodes($quantity, $consumer_id = 0) { } public function _castObjectToClass($classname, $object) { } } class Node { public $virtual_machine_id = 0; public $id = 0; public $consumer_id = 0; public $deleted = 0; public function __construct($id = 0, $virtual_machine_id = 0) { } public function remove() { } } class IPAddress { public $id = 0; public $netmask = ""; public $network = ""; public $cloud_id = 0; public $ip_address = ""; public $consumer_id = 0; public $deleted = \false; public function isInternal() { } public function isExternal() { } public function remove() { } } class Backup { public $virtual_machine_id = 0; public $id = 0; public $label = ""; public $auto_backup_type = \NULL; public $deleted = \false; public function __construct($id = 0, $virtual_machine_id = 0) { } public function restore() { } public function remove() { } } class UpgradeSchedule { public $id = 0; public $label = ""; public $extra_slices = 0; public $temporary = \false; public $run_at = \NULL; public $days = \NULL; public function __construct($label, $extra_slices, $run_at, $days = 0) { } } class VirtualMachine { public $label = ""; public $hostname = ""; public $domain_name = ""; public $slices_count = 0; public $slices_required = 0; public $backups_enabled = 0; public $rsync_backups_enabled = 0; public $r1_soft_backups_enabled = 0; public $system_template_id = 0; public $cloud_id = 0; public $id = \NULL; public $consumer_id = 0; public $created_at = \NULL; public $updated_at = \NULL; public $password = ""; public $backups = array(); public $upgrade_schedules = array(); public $deleted = \false; public function __construct($label = "", $hostname = "", $slices_required = "", $backups_enabled = "", $cloud_id = "", $system_template_id = "", $consumer_id = 0) { } public function powerOn() { } public function powerOff() { } public function shutdown() { } public function reboot() { } public function createBackup($label) { } public function createTemporaryUpgradeSchedule($label, $extra_slices, $run_at, $days) { } public function showNetworkGraph($period) { } public function showCPUGraph($period) { } protected function showGraph($period, $type) { } public function showConsole() { } public function loadBackups() { } public function loadFully() { } public function update() { } public function remove() { } } } namespace WHMCS\Module\Contracts { interface NotificationModuleInterface { public function settings(); public function isActive(); public function getName(); public function getDisplayName(); public function getLogoPath(); public function testConnection($settings); public function notificationSettings(); public function getDynamicField($fieldName, $settings); public function sendNotification(\WHMCS\Notification\Contracts\NotificationInterface $notification, $moduleSettings, $notificationSettings); } } namespace WHMCS\Module\Notification { trait DescriptionTrait { protected $displayName = ""; protected $logoFileName = ""; public function isActive() { } public function getName() { } public function getDisplayName() { } public function setDisplayName($displayName) { } public function getLogoFileName() { } public function setLogoFileName($logoFileName) { } public function getLogoPath() { } } } namespace WHMCS\Module\Notification\Email { /** * Notification module for delivering notifications via email * * All notification modules must implement NotificationModuleInterface * * @copyright Copyright (c) WHMCS Limited 2005-2020 * @license http://www.whmcs.com/license/ WHMCS Eula */ class Email implements \WHMCS\Module\Contracts\NotificationModuleInterface { use \WHMCS\Module\Notification\DescriptionTrait; /** * Constructor * * Any instance of a notification module should have the display name and * logo filename at the ready. Therefore it is recommend to ensure these * values are set during object instantiation. * * The Email notification module utilizes the DescriptionTrait which * provides methods to fulfill this requirement. * * @see \WHMCS\Module\Notification\DescriptionTrait::setDisplayName() * @see \WHMCS\Module\Notification\DescriptionTrait::setLogoFileName() */ public function __construct() { } /** * Settings required for module configuration * * The method should provide a description of common settings required * for the notification module to function. * * For example, if the module connects to a remote messaging service this * might be username and password or OAuth token fields required to * authenticate to that service. * * This is used to build a form in the UI. The values submitted by the * admin based on the form will be validated prior to save. * @see testConnection() * * The return value should be an array structured like other WHMCS modules. * @link https://developers.whmcs.com/payment-gateways/configuration/ * * For the Email notification module, the module settings are the sender * name and email. Every email notification will use these values. * Other email values, like recipients are defined on a per notification * basis. * @see notifictionSettings() * * EX. * return [ * 'api_username' => [ * 'FriendlyName' => 'API Username', * 'Type' => 'text', * 'Description' => 'Required username to authenticate with message service', * ], * 'api_password' => [ * 'FriendlyName' => 'API Password', * 'Type' => 'password', * 'Description' => 'Required password to authenticate with message service', * ], * ]; * * @return array */ public function settings() { } /** * Validate settings for notification module * * This method will be invoked prior to saving any settings via the UI. * * Leverage this method to verify authentication and/or authorization when * the notification service requires a remote connection. * * For the Email notification module, connectivity details are already * defined by the WHMCS core system, and there are no settings which * require further validation, so this method will always return TRUE. * * @param array $settings * * @return boolean */ public function testConnection($settings) { } /** * The individual customisable settings for a notification. * * EX. * ['channel' => [ * 'FriendlyName' => 'Channel', * 'Type' => 'dynamic', * 'Description' => 'Select the desired channel for notification delivery.', * 'Required' => true, * ], * ] * * The "Type" of a setting can be text, textarea, yesno, system and dynamic * * @see getDynamicField for how to obtain dynamic values * * For the Email notification module, the notification should be configured * to use a email template and one or more recipients. * * @return array */ public function notificationSettings() { } /** * The option values available for a 'dynamic' Type notification setting * * @see notificationSettings() * * EX. * if ($fieldName == 'channel') { * return [ 'values' => [ * ['id' => 1, 'name' => 'Tech Support', 'description' => 'Channel ID',], * ['id' => 2, 'name' => 'Customer Service', 'description' => 'Channel ID',], * ],]; * } elseif ($fieldName == 'botname') { * $restClient = $this->factoryHttpClient($settings); * $operators = $restClient->get('/operators'); * return ['values' => $operators->toArray()]; * } * * For the Email notification module, a list of possible email templates is * aggregated. * * @param string $fieldName Notification setting field name * @param array $settings Settings for the module * * @return array */ public function getDynamicField($fieldName, $settings) { } /** * Deliver notification * * This method is invoked when rule criteria are met. * * In this method, you should craft an appropriately formatted message and * transmit it to the messaging service. * * For the Email notification module, an email template instance is created * along with a collection of merge field data (aggregated from all three * method arguments respectively). Those items are provided to the local * API 'sendmail' action, where an email message is generated and delivered. * * @param NotificationInterface $notification A notification to send * @param array $moduleSettings Configured settings of the notification module * @param array $notificationSettings Configured notification settings set by the triggered rule * * @throws Exception on error of sending email */ public function sendNotification(\WHMCS\Notification\Contracts\NotificationInterface $notification, $moduleSettings, $notificationSettings) { } } } namespace WHMCS\Module\Notification\Hipchat { class Hipchat implements \WHMCS\Module\Contracts\NotificationModuleInterface { use \WHMCS\Module\Notification\DescriptionTrait; const HOSTED_API_URL = "https://api.hipchat.com/v2/"; public function __construct() { } public function settings() { } public function testConnection($settings) { } public function notificationSettings() { } public function getDynamicField($fieldName, $settings) { } public function sendNotification(\WHMCS\Notification\Contracts\NotificationInterface $notification, $moduleSettings, $notificationSettings) { } protected function call($settings, $uri, $postdata = NULL) { } } class CardAttribute { public $value = NULL; public $label = NULL; public $url = NULL; public $style = NULL; public $icon = NULL; public $icon2 = NULL; public function value($value) { } public function label($label) { } public function url($url) { } public function style($style) { } public function icon($icon, $icon2 = NULL) { } public function toArray() { } } class Card { public $id = NULL; public $title = ""; public $style = "application"; public $content = ""; public $format = "html"; public $cardFormat = NULL; public $url = ""; public $activity = NULL; public $activityIcon = NULL; public $activityIcon2 = NULL; public $icon = NULL; public $icon2 = NULL; public $attributes = array(); public function __construct() { } public function title($title) { } public function id($id) { } public function style($style) { } public function message($content = "") { } public function cardFormat($cardFormat) { } public function url($url) { } public function activity($html, $icon = NULL, $icon2 = NULL) { } public function icon($icon, $icon2 = NULL) { } public function addAttribute(\WHMCS\Module\Notification\Hipchat\CardAttribute $attribute) { } public function toArray() { } } class Message { public $format = "html"; public $notify = false; public $level = "info"; public $color = "gray"; public $from = ""; public $content = ""; public $card = NULL; public function from($from) { } public function message($content = "") { } public function notify($notify = true) { } public function color($color) { } public function card($card) { } public function toArray() { } } } namespace WHMCS\Module\Notification\Slack { class Field { public $title = ""; public $value = ""; public $short = false; public function title($title) { } public function value($value) { } public function short() { } public function toArray() { } } class Attachment { public $fallback = ""; public $color = ""; public $pretext = ""; public $title = ""; public $title_link = ""; public $text = ""; public $fields = NULL; public $footer = ""; public $footer_icon = ""; public function fallback($fallback) { } public function color($color) { } public function pretext($pretext) { } public function title($title) { } public function title_link($title_link) { } public function text($text) { } public function footer($footer) { } public function footer_icon($footer_icon) { } public function addField(\WHMCS\Module\Notification\Slack\Field $field) { } public function toArray() { } } class Message { public $channel = ""; public $text = ""; public $asUser = true; public $username = ""; public $attachment = NULL; public function channel($channel) { } public function text($text) { } public function username($username) { } public function attachment($attachment) { } public function toArray() { } } class Slack implements \WHMCS\Module\Contracts\NotificationModuleInterface { use \WHMCS\Module\Notification\DescriptionTrait; const API_URL = "https://slack.com/api/"; public function __construct() { } public function settings() { } public function testConnection($settings) { } public function notificationSettings() { } public function getDynamicField($fieldName, $settings) { } public function sendNotification(\WHMCS\Notification\Contracts\NotificationInterface $notification, $moduleSettings, $notificationSettings) { } protected function call(array $settings, $uri, array $postdata = array(), $throwOnError = true) { } public function postRuleSave(array $moduleConfiguration, array $providerConfig) { } } } namespace { class twitterIntents { public function __construct($username = "", \WHMCS\Version\SemanticVersion $version) { } protected function doDependencyCheck() { } public function getTweets() { } protected function tidyHTML($html) { } protected function scrapePage() { } protected function findClassNodes($xpath, $tag, $classname = "", $attributes = "") { } protected function getCachedTweets() { } protected function cacheTweets($tweets = array()) { } } } namespace WHMCS\Module\Addon\ProjectManagement { class Router { protected $routes = array("watch" => "project@watch", "unwatch" => "project@unwatch", "saveProject" => "project@saveProject", "clientSearch" => "project@clientSearch", "duplicateProject" => "project@duplicateProject", "deletefile" => "files@delete", "uploadfile" => "files@upload", "addInvoice" => "invoices@associate", "createInvoice" => "invoices@create", "searchInvoices" => "invoices@search", "unlinkInvoice" => "invoices@unlink", "addmessage" => "messages@add", "deletemsg" => "messages@delete", "uploadFileForMessage" => "messages@uploadFile", "addtask" => "tasks@add", "assigntask" => "tasks@assign", "deletetask" => "tasks@delete", "deleteTaskTemplate" => "tasks@deleteTaskTemplate", "gettaskinfo" => "tasks@getSingle", "importTasks" => "tasks@import", "saveTaskList" => "tasks@saveList", "selectTaskList" => "tasks@select", "taskedit" => "tasks@edit", "taskduedate" => "tasks@setDueDate", "taskSearch" => "tasks@search", "tasksort" => "tasks@saveOrder", "taskstatustoggle" => "tasks@toggleStatus", "addticket" => "tickets@associate", "openticket" => "tickets@open", "parseMarkdown" => "tickets@parseMarkdown", "searchTickets" => "tickets@search", "unlinkTicket" => "tickets@unlink", "taskTimeAdd" => "timers@add", "deleteTimer" => "timers@delete", "endtimer" => "timers@end", "gettimerinfo" => "timers@getSingle", "invoiceItems" => "timers@invoiceItems", "prepareInvoiceTimers" => "timers@prepareInvoiceTimers", "starttimer" => "timers@start", "updateTimer" => "timers@update", "notify" => "notify@staff", "sendEmail" => "notify@sendEmail"); public function dispatch($action, $project = NULL) { } } abstract class BaseProjectEntity { public $project = NULL; public function __construct(\WHMCS\Module\Addon\ProjectManagement\Project $project) { } public function project() { } } class Timers extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { public function get($timerId = NULL) { } public function getSingle($timerId = NULL) { } public function getOpenTimerId() { } protected function endExistingTimers($taskId = 0) { } public function start() { } public function end() { } public function getStats() { } public function update() { } public function invoiceItems() { } public function add() { } public function delete() { } public function prepareInvoiceTimers() { } public function getTaskTimes() { } public function formatTimerSecondsToReadableTime($timer) { } protected function secondsToHours($secs, $padHours = false) { } } class Tickets extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { protected $statusColours = array(); protected function getTicketByMask($ticketMask) { } public function get() { } public function associate() { } public function getDepartments() { } public function parseMarkdown() { } public function open() { } public function search() { } public function unlink() { } protected function getStatusColour($status) { } protected function getContrastYIQ($hexColour) { } public function ticketLinks(array $ticketIds) { } } class Files extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { public function get($messageId = 0) { } public function upload() { } public function delete(\WHMCS\Module\Addon\ProjectManagement\Models\ProjectFile $specificFile = NULL) { } protected function formatFileSize($val, $digits = 3) { } protected function isAnImage($mimeType) { } protected function isBrowserViewable($mimeType) { } public function formatFilenameForDisplay($filename) { } protected function checkAndCreateDirectoryIndexes() { } } class Exception extends \WHMCS\Exception { } class Widget extends \WHMCS\Module\AbstractWidget { protected $title = "Project Management"; protected $description = "Project Management Activity."; protected $weight = 100; protected $cache = true; protected $cachePerUser = true; protected $requiredPermission = "Addon Modules"; protected $columns = 2; public function getId() { } public function getData() { } public function generateOutput($data) { } } class Invoices extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { public function get() { } public function search() { } public function associate() { } public function create() { } public function unlink() { } protected function getInvoiceById($invoiceId) { } public function getSingleInvoiceById($invoiceId) { } public function invoiceLinks(array $invoiceIds) { } } class Helper { public static function getCurrentAdminId() { } public static function getAdmins() { } public static function timeToHuman($sec) { } public static function timeToReadable($sec) { } public static function daysUntilDate($date) { } public static function getFriendlyDaysToGo($date, $lang) { } public static function getFriendlyMbValue($size) { } public static function getClientLink($userId) { } } class Messages extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { public function get($messageId = 0) { } public function add() { } public function delete() { } public function uploadFile() { } } } namespace WHMCS\Model\Contracts { interface ModelInterface { } } namespace Illuminate\Contracts\Support { interface Arrayable { /** * Get the instance as an array. * * @return array */ public function toArray(); } interface Jsonable { /** * Convert the object to its JSON representation. * * @param int $options * @return string */ public function toJson($options = 0); } } namespace Illuminate\Contracts\Queue { interface QueueableEntity { /** * Get the queueable identity for the entity. * * @return mixed */ public function getQueueableId(); } } namespace Illuminate\Contracts\Routing { interface UrlRoutable { /** * Get the value of the model's route key. * * @return mixed */ public function getRouteKey(); /** * Get the route key for the model. * * @return string */ public function getRouteKeyName(); } } namespace Illuminate\Database\Eloquent { abstract class Model implements \ArrayAccess, \Illuminate\Contracts\Support\Arrayable, \Illuminate\Contracts\Support\Jsonable, \JsonSerializable, \Illuminate\Contracts\Queue\QueueableEntity, \Illuminate\Contracts\Routing\UrlRoutable { /** * The connection name for the model. * * @var string */ protected $connection; /** * The table associated with the model. * * @var string */ protected $table; /** * The primary key for the model. * * @var string */ protected $primaryKey = 'id'; /** * The number of models to return for pagination. * * @var int */ protected $perPage = 15; /** * Indicates if the IDs are auto-incrementing. * * @var bool */ public $incrementing = true; /** * Indicates if the model should be timestamped. * * @var bool */ public $timestamps = true; /** * The model's attributes. * * @var array */ protected $attributes = []; /** * The model attribute's original state. * * @var array */ protected $original = []; /** * The loaded relationships for the model. * * @var array */ protected $relations = []; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = []; /** * The attributes that should be visible in arrays. * * @var array */ protected $visible = []; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = []; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = []; /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = ['*']; /** * The attributes that should be mutated to dates. * * @var array */ protected $dates = []; /** * The storage format of the model's date columns. * * @var string */ protected $dateFormat; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = []; /** * The relationships that should be touched on save. * * @var array */ protected $touches = []; /** * User exposed observable events. * * @var array */ protected $observables = []; /** * The relations to eager load on every query. * * @var array */ protected $with = []; /** * The class name to be used in polymorphic relations. * * @var string */ protected $morphClass; /** * Indicates if the model exists. * * @var bool */ public $exists = false; /** * Indicates if the model was inserted during the current request lifecycle. * * @var bool */ public $wasRecentlyCreated = false; /** * Indicates whether attributes are snake cased on arrays. * * @var bool */ public static $snakeAttributes = true; /** * The connection resolver instance. * * @var \Illuminate\Database\ConnectionResolverInterface */ protected static $resolver; /** * The event dispatcher instance. * * @var \Illuminate\Contracts\Events\Dispatcher */ protected static $dispatcher; /** * The array of booted models. * * @var array */ protected static $booted = []; /** * The array of global scopes on the model. * * @var array */ protected static $globalScopes = []; /** * Indicates if all mass assignment is enabled. * * @var bool */ protected static $unguarded = false; /** * The cache of the mutated attributes for each class. * * @var array */ protected static $mutatorCache = []; /** * The many to many relationship methods. * * @var array */ public static $manyMethods = ['belongsToMany', 'morphToMany', 'morphedByMany']; /** * The name of the "created at" column. * * @var string */ const CREATED_AT = 'created_at'; /** * The name of the "updated at" column. * * @var string */ const UPDATED_AT = 'updated_at'; /** * Create a new Eloquent model instance. * * @param array $attributes * @return void */ public function __construct(array $attributes = []) { } /** * Check if the model needs to be booted and if so, do it. * * @return void */ protected function bootIfNotBooted() { } /** * The "booting" method of the model. * * @return void */ protected static function boot() { } /** * Boot all of the bootable traits on the model. * * @return void */ protected static function bootTraits() { } /** * Clear the list of booted models so they will be re-booted. * * @return void */ public static function clearBootedModels() { } /** * Register a new global scope on the model. * * @param \Illuminate\Database\Eloquent\Scope|\Closure|string $scope * @param \Closure|null $implementation * @return mixed * * @throws \InvalidArgumentException */ public static function addGlobalScope($scope, \Closure $implementation = null) { } /** * Determine if a model has a global scope. * * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return bool */ public static function hasGlobalScope($scope) { } /** * Get a global scope registered with the model. * * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return \Illuminate\Database\Eloquent\Scope|\Closure|null */ public static function getGlobalScope($scope) { } /** * Get the global scopes for this class instance. * * @return array */ public function getGlobalScopes() { } /** * Register an observer with the Model. * * @param object|string $class * @param int $priority * @return void */ public static function observe($class, $priority = 0) { } /** * Fill the model with an array of attributes. * * @param array $attributes * @return $this * * @throws \Illuminate\Database\Eloquent\MassAssignmentException */ public function fill(array $attributes) { } /** * Fill the model with an array of attributes. Force mass assignment. * * @param array $attributes * @return $this */ public function forceFill(array $attributes) { } /** * Get the fillable attributes of a given array. * * @param array $attributes * @return array */ protected function fillableFromArray(array $attributes) { } /** * Create a new instance of the given model. * * @param array $attributes * @param bool $exists * @return static */ public function newInstance($attributes = [], $exists = false) { } /** * Create a new model instance that is existing. * * @param array $attributes * @param string|null $connection * @return static */ public function newFromBuilder($attributes = [], $connection = null) { } /** * Create a collection of models from plain arrays. * * @param array $items * @param string|null $connection * @return \Illuminate\Database\Eloquent\Collection */ public static function hydrate(array $items, $connection = null) { } /** * Create a collection of models from a raw query. * * @param string $query * @param array $bindings * @param string|null $connection * @return \Illuminate\Database\Eloquent\Collection */ public static function hydrateRaw($query, $bindings = [], $connection = null) { } /** * Save a new model and return the instance. * * @param array $attributes * @return static */ public static function create(array $attributes = []) { } /** * Save a new model and return the instance. Allow mass-assignment. * * @param array $attributes * @return static */ public static function forceCreate(array $attributes) { } /** * Begin querying the model. * * @return \Illuminate\Database\Eloquent\Builder */ public static function query() { } /** * Begin querying the model on a given connection. * * @param string|null $connection * @return \Illuminate\Database\Eloquent\Builder */ public static function on($connection = null) { } /** * Begin querying the model on the write connection. * * @return \Illuminate\Database\Query\Builder */ public static function onWriteConnection() { } /** * Get all of the models from the database. * * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Collection|static[] */ public static function all($columns = ['*']) { } /** * Reload a fresh model instance from the database. * * @param array|string $with * @return $this|null */ public function fresh($with = []) { } /** * Eager load relations on the model. * * @param array|string $relations * @return $this */ public function load($relations) { } /** * Begin querying a model with eager loading. * * @param array|string $relations * @return \Illuminate\Database\Eloquent\Builder|static */ public static function with($relations) { } /** * Append attributes to query when building a query. * * @param array|string $attributes * @return $this */ public function append($attributes) { } /** * Define a one-to-one relationship. * * @param string $related * @param string $foreignKey * @param string $localKey * @return \Illuminate\Database\Eloquent\Relations\HasOne */ public function hasOne($related, $foreignKey = null, $localKey = null) { } /** * Define a polymorphic one-to-one relationship. * * @param string $related * @param string $name * @param string $type * @param string $id * @param string $localKey * @return \Illuminate\Database\Eloquent\Relations\MorphOne */ public function morphOne($related, $name, $type = null, $id = null, $localKey = null) { } /** * Define an inverse one-to-one or many relationship. * * @param string $related * @param string $foreignKey * @param string $otherKey * @param string $relation * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) { } /** * Define a polymorphic, inverse one-to-one or many relationship. * * @param string $name * @param string $type * @param string $id * @return \Illuminate\Database\Eloquent\Relations\MorphTo */ public function morphTo($name = null, $type = null, $id = null) { } /** * Retrieve the fully qualified class name from a slug. * * @param string $class * @return string */ public function getActualClassNameForMorph($class) { } /** * Define a one-to-many relationship. * * @param string $related * @param string $foreignKey * @param string $localKey * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function hasMany($related, $foreignKey = null, $localKey = null) { } /** * Define a has-many-through relationship. * * @param string $related * @param string $through * @param string|null $firstKey * @param string|null $secondKey * @param string|null $localKey * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough */ public function hasManyThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null) { } /** * Define a polymorphic one-to-many relationship. * * @param string $related * @param string $name * @param string $type * @param string $id * @param string $localKey * @return \Illuminate\Database\Eloquent\Relations\MorphMany */ public function morphMany($related, $name, $type = null, $id = null, $localKey = null) { } /** * Define a many-to-many relationship. * * @param string $related * @param string $table * @param string $foreignKey * @param string $otherKey * @param string $relation * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) { } /** * Define a polymorphic many-to-many relationship. * * @param string $related * @param string $name * @param string $table * @param string $foreignKey * @param string $otherKey * @param bool $inverse * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function morphToMany($related, $name, $table = null, $foreignKey = null, $otherKey = null, $inverse = false) { } /** * Define a polymorphic, inverse many-to-many relationship. * * @param string $related * @param string $name * @param string $table * @param string $foreignKey * @param string $otherKey * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ public function morphedByMany($related, $name, $table = null, $foreignKey = null, $otherKey = null) { } /** * Get the relationship name of the belongs to many. * * @return string */ protected function getBelongsToManyCaller() { } /** * Get the joining table name for a many-to-many relation. * * @param string $related * @return string */ public function joiningTable($related) { } /** * Destroy the models for the given IDs. * * @param array|int $ids * @return int */ public static function destroy($ids) { } /** * Delete the model from the database. * * @return bool|null * * @throws \Exception */ public function delete() { } /** * Force a hard delete on a soft deleted model. * * This method protects developers from running forceDelete when trait is missing. * * @return bool|null */ public function forceDelete() { } /** * Perform the actual delete query on this model instance. * * @return void */ protected function performDeleteOnModel() { } /** * Register a saving model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function saving($callback, $priority = 0) { } /** * Register a saved model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function saved($callback, $priority = 0) { } /** * Register an updating model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function updating($callback, $priority = 0) { } /** * Register an updated model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function updated($callback, $priority = 0) { } /** * Register a creating model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function creating($callback, $priority = 0) { } /** * Register a created model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function created($callback, $priority = 0) { } /** * Register a deleting model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function deleting($callback, $priority = 0) { } /** * Register a deleted model event with the dispatcher. * * @param \Closure|string $callback * @param int $priority * @return void */ public static function deleted($callback, $priority = 0) { } /** * Remove all of the event listeners for the model. * * @return void */ public static function flushEventListeners() { } /** * Register a model event with the dispatcher. * * @param string $event * @param \Closure|string $callback * @param int $priority * @return void */ protected static function registerModelEvent($event, $callback, $priority = 0) { } /** * Get the observable event names. * * @return array */ public function getObservableEvents() { } /** * Set the observable event names. * * @param array $observables * @return $this */ public function setObservableEvents(array $observables) { } /** * Add an observable event name. * * @param array|mixed $observables * @return void */ public function addObservableEvents($observables) { } /** * Remove an observable event name. * * @param array|mixed $observables * @return void */ public function removeObservableEvents($observables) { } /** * Increment a column's value by a given amount. * * @param string $column * @param int $amount * @param array $extra * @return int */ protected function increment($column, $amount = 1, array $extra = []) { } /** * Decrement a column's value by a given amount. * * @param string $column * @param int $amount * @param array $extra * @return int */ protected function decrement($column, $amount = 1, array $extra = []) { } /** * Run the increment or decrement method on the model. * * @param string $column * @param int $amount * @param array $extra * @param string $method * @return int */ protected function incrementOrDecrement($column, $amount, $extra, $method) { } /** * Increment the underlying attribute value and sync with original. * * @param string $column * @param int $amount * @param string $method * @return void */ protected function incrementOrDecrementAttributeValue($column, $amount, $method) { } /** * Update the model in the database. * * @param array $attributes * @param array $options * @return bool|int */ public function update(array $attributes = [], array $options = []) { } /** * Save the model and all of its relationships. * * @return bool */ public function push() { } /** * Save the model to the database. * * @param array $options * @return bool */ public function save(array $options = []) { } /** * Save the model to the database using transaction. * * @param array $options * @return bool * * @throws \Throwable */ public function saveOrFail(array $options = []) { } /** * Finish processing on a successful save operation. * * @param array $options * @return void */ protected function finishSave(array $options) { } /** * Perform a model update operation. * * @param \Illuminate\Database\Eloquent\Builder $query * @param array $options * @return bool */ protected function performUpdate(\Illuminate\Database\Eloquent\Builder $query, array $options = []) { } /** * Perform a model insert operation. * * @param \Illuminate\Database\Eloquent\Builder $query * @param array $options * @return bool */ protected function performInsert(\Illuminate\Database\Eloquent\Builder $query, array $options = []) { } /** * Insert the given attributes and set the ID on the model. * * @param \Illuminate\Database\Eloquent\Builder $query * @param array $attributes * @return void */ protected function insertAndSetId(\Illuminate\Database\Eloquent\Builder $query, $attributes) { } /** * Touch the owning relations of the model. * * @return void */ public function touchOwners() { } /** * Determine if the model touches a given relation. * * @param string $relation * @return bool */ public function touches($relation) { } /** * Fire the given event for the model. * * @param string $event * @param bool $halt * @return mixed */ protected function fireModelEvent($event, $halt = true) { } /** * Set the keys for a save update query. * * @param \Illuminate\Database\Eloquent\Builder $query * @return \Illuminate\Database\Eloquent\Builder */ protected function setKeysForSaveQuery(\Illuminate\Database\Eloquent\Builder $query) { } /** * Get the primary key value for a save query. * * @return mixed */ protected function getKeyForSaveQuery() { } /** * Update the model's update timestamp. * * @return bool */ public function touch() { } /** * Update the creation and update timestamps. * * @return void */ protected function updateTimestamps() { } /** * Set the value of the "created at" attribute. * * @param mixed $value * @return $this */ public function setCreatedAt($value) { } /** * Set the value of the "updated at" attribute. * * @param mixed $value * @return $this */ public function setUpdatedAt($value) { } /** * Get the name of the "created at" column. * * @return string */ public function getCreatedAtColumn() { } /** * Get the name of the "updated at" column. * * @return string */ public function getUpdatedAtColumn() { } /** * Get a fresh timestamp for the model. * * @return \Carbon\Carbon */ public function freshTimestamp() { } /** * Get a fresh timestamp for the model. * * @return string */ public function freshTimestampString() { } /** * Get a new query builder for the model's table. * * @return \Illuminate\Database\Eloquent\Builder */ public function newQuery() { } /** * Get a new query instance without a given scope. * * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return \Illuminate\Database\Eloquent\Builder */ public function newQueryWithoutScope($scope) { } /** * Get a new query builder that doesn't have any global scopes. * * @return \Illuminate\Database\Eloquent\Builder|static */ public function newQueryWithoutScopes() { } /** * Create a new Eloquent query builder for the model. * * @param \Illuminate\Database\Query\Builder $query * @return \Illuminate\Database\Eloquent\Builder|static */ public function newEloquentBuilder($query) { } /** * Get a new query builder instance for the connection. * * @return \Illuminate\Database\Query\Builder */ protected function newBaseQueryBuilder() { } /** * Create a new Eloquent Collection instance. * * @param array $models * @return \Illuminate\Database\Eloquent\Collection */ public function newCollection(array $models = []) { } /** * Create a new pivot model instance. * * @param \Illuminate\Database\Eloquent\Model $parent * @param array $attributes * @param string $table * @param bool $exists * @return \Illuminate\Database\Eloquent\Relations\Pivot */ public function newPivot(\Illuminate\Database\Eloquent\Model $parent, array $attributes, $table, $exists) { } /** * Get the table associated with the model. * * @return string */ public function getTable() { } /** * Set the table associated with the model. * * @param string $table * @return $this */ public function setTable($table) { } /** * Get the value of the model's primary key. * * @return mixed */ public function getKey() { } /** * Get the queueable identity for the entity. * * @return mixed */ public function getQueueableId() { } /** * Get the primary key for the model. * * @return string */ public function getKeyName() { } /** * Set the primary key for the model. * * @param string $key * @return $this */ public function setKeyName($key) { } /** * Get the table qualified key name. * * @return string */ public function getQualifiedKeyName() { } /** * Get the value of the model's route key. * * @return mixed */ public function getRouteKey() { } /** * Get the route key for the model. * * @return string */ public function getRouteKeyName() { } /** * Determine if the model uses timestamps. * * @return bool */ public function usesTimestamps() { } /** * Get the polymorphic relationship columns. * * @param string $name * @param string $type * @param string $id * @return array */ protected function getMorphs($name, $type, $id) { } /** * Get the class name for polymorphic relations. * * @return string */ public function getMorphClass() { } /** * Get the number of models to return per page. * * @return int */ public function getPerPage() { } /** * Set the number of models to return per page. * * @param int $perPage * @return $this */ public function setPerPage($perPage) { } /** * Get the default foreign key name for the model. * * @return string */ public function getForeignKey() { } /** * Get the hidden attributes for the model. * * @return array */ public function getHidden() { } /** * Set the hidden attributes for the model. * * @param array $hidden * @return $this */ public function setHidden(array $hidden) { } /** * Add hidden attributes for the model. * * @param array|string|null $attributes * @return void */ public function addHidden($attributes = null) { } /** * Make the given, typically hidden, attributes visible. * * @param array|string $attributes * @return $this */ public function makeVisible($attributes) { } /** * Make the given, typically hidden, attributes visible. * * @param array|string $attributes * @return $this * * @deprecated since version 5.2. Use the "makeVisible" method directly. */ public function withHidden($attributes) { } /** * Get the visible attributes for the model. * * @return array */ public function getVisible() { } /** * Set the visible attributes for the model. * * @param array $visible * @return $this */ public function setVisible(array $visible) { } /** * Add visible attributes for the model. * * @param array|string|null $attributes * @return void */ public function addVisible($attributes = null) { } /** * Set the accessors to append to model arrays. * * @param array $appends * @return $this */ public function setAppends(array $appends) { } /** * Get the fillable attributes for the model. * * @return array */ public function getFillable() { } /** * Set the fillable attributes for the model. * * @param array $fillable * @return $this */ public function fillable(array $fillable) { } /** * Get the guarded attributes for the model. * * @return array */ public function getGuarded() { } /** * Set the guarded attributes for the model. * * @param array $guarded * @return $this */ public function guard(array $guarded) { } /** * Disable all mass assignable restrictions. * * @param bool $state * @return void */ public static function unguard($state = true) { } /** * Enable the mass assignment restrictions. * * @return void */ public static function reguard() { } /** * Determine if current state is "unguarded". * * @return bool */ public static function isUnguarded() { } /** * Run the given callable while being unguarded. * * @param callable $callback * @return mixed */ public static function unguarded(callable $callback) { } /** * Determine if the given attribute may be mass assigned. * * @param string $key * @return bool */ public function isFillable($key) { } /** * Determine if the given key is guarded. * * @param string $key * @return bool */ public function isGuarded($key) { } /** * Determine if the model is totally guarded. * * @return bool */ public function totallyGuarded() { } /** * Remove the table name from a given key. * * @param string $key * @return string */ protected function removeTableFromKey($key) { } /** * Get the relationships that are touched on save. * * @return array */ public function getTouchedRelations() { } /** * Set the relationships that are touched on save. * * @param array $touches * @return $this */ public function setTouchedRelations(array $touches) { } /** * Get the value indicating whether the IDs are incrementing. * * @return bool */ public function getIncrementing() { } /** * Set whether IDs are incrementing. * * @param bool $value * @return $this */ public function setIncrementing($value) { } /** * Convert the model instance to JSON. * * @param int $options * @return string */ public function toJson($options = 0) { } /** * Convert the object into something JSON serializable. * * @return array */ public function jsonSerialize() { } /** * Convert the model instance to an array. * * @return array */ public function toArray() { } /** * Convert the model's attributes to an array. * * @return array */ public function attributesToArray() { } /** * Get an attribute array of all arrayable attributes. * * @return array */ protected function getArrayableAttributes() { } /** * Get all of the appendable values that are arrayable. * * @return array */ protected function getArrayableAppends() { } /** * Get the model's relationships in array form. * * @return array */ public function relationsToArray() { } /** * Get an attribute array of all arrayable relations. * * @return array */ protected function getArrayableRelations() { } /** * Get an attribute array of all arrayable values. * * @param array $values * @return array */ protected function getArrayableItems(array $values) { } /** * Get an attribute from the model. * * @param string $key * @return mixed */ public function getAttribute($key) { } /** * Get a plain attribute (not a relationship). * * @param string $key * @return mixed */ public function getAttributeValue($key) { } /** * Get a relationship. * * @param string $key * @return mixed */ public function getRelationValue($key) { } /** * Get an attribute from the $attributes array. * * @param string $key * @return mixed */ protected function getAttributeFromArray($key) { } /** * Get a relationship value from a method. * * @param string $method * @return mixed * * @throws \LogicException */ protected function getRelationshipFromMethod($method) { } /** * Determine if a get mutator exists for an attribute. * * @param string $key * @return bool */ public function hasGetMutator($key) { } /** * Get the value of an attribute using its mutator. * * @param string $key * @param mixed $value * @return mixed */ protected function mutateAttribute($key, $value) { } /** * Get the value of an attribute using its mutator for array conversion. * * @param string $key * @param mixed $value * @return mixed */ protected function mutateAttributeForArray($key, $value) { } /** * Determine whether an attribute should be cast to a native type. * * @param string $key * @param array|string|null $types * @return bool */ public function hasCast($key, $types = null) { } /** * Get the casts array. * * @return array */ public function getCasts() { } /** * Determine whether a value is Date / DateTime castable for inbound manipulation. * * @param string $key * @return bool */ protected function isDateCastable($key) { } /** * Determine whether a value is JSON castable for inbound manipulation. * * @param string $key * @return bool */ protected function isJsonCastable($key) { } /** * Get the type of cast for a model attribute. * * @param string $key * @return string */ protected function getCastType($key) { } /** * Cast an attribute to a native PHP type. * * @param string $key * @param mixed $value * @return mixed */ protected function castAttribute($key, $value) { } /** * Set a given attribute on the model. * * @param string $key * @param mixed $value * @return $this */ public function setAttribute($key, $value) { } /** * Determine if a set mutator exists for an attribute. * * @param string $key * @return bool */ public function hasSetMutator($key) { } /** * Get the attributes that should be converted to dates. * * @return array */ public function getDates() { } /** * Convert a DateTime to a storable string. * * @param \DateTime|int $value * @return string */ public function fromDateTime($value) { } /** * Return a timestamp as DateTime object. * * @param mixed $value * @return \Carbon\Carbon */ protected function asDateTime($value) { } /** * Return a timestamp as unix timestamp. * * @param mixed $value * @return int */ protected function asTimeStamp($value) { } /** * Prepare a date for array / JSON serialization. * * @param \DateTime $date * @return string */ protected function serializeDate(\DateTime $date) { } /** * Get the format for database stored dates. * * @return string */ protected function getDateFormat() { } /** * Set the date format used by the model. * * @param string $format * @return $this */ public function setDateFormat($format) { } /** * Encode the given value as JSON. * * @param mixed $value * @return string */ protected function asJson($value) { } /** * Decode the given JSON back into an array or object. * * @param string $value * @param bool $asObject * @return mixed */ public function fromJson($value, $asObject = false) { } /** * Clone the model into a new, non-existing instance. * * @param array|null $except * @return \Illuminate\Database\Eloquent\Model */ public function replicate(array $except = null) { } /** * Get all of the current attributes on the model. * * @return array */ public function getAttributes() { } /** * Set the array of model attributes. No checking is done. * * @param array $attributes * @param bool $sync * @return $this */ public function setRawAttributes(array $attributes, $sync = false) { } /** * Get the model's original attribute values. * * @param string|null $key * @param mixed $default * @return mixed|array */ public function getOriginal($key = null, $default = null) { } /** * Sync the original attributes with the current. * * @return $this */ public function syncOriginal() { } /** * Sync a single original attribute with its current value. * * @param string $attribute * @return $this */ public function syncOriginalAttribute($attribute) { } /** * Determine if the model or given attribute(s) have been modified. * * @param array|string|null $attributes * @return bool */ public function isDirty($attributes = null) { } /** * Get the attributes that have been changed since last sync. * * @return array */ public function getDirty() { } /** * Determine if the new and old values for a given key are numerically equivalent. * * @param string $key * @return bool */ protected function originalIsNumericallyEquivalent($key) { } /** * Get all the loaded relations for the instance. * * @return array */ public function getRelations() { } /** * Get a specified relationship. * * @param string $relation * @return mixed */ public function getRelation($relation) { } /** * Determine if the given relation is loaded. * * @param string $key * @return bool */ public function relationLoaded($key) { } /** * Set the specific relationship in the model. * * @param string $relation * @param mixed $value * @return $this */ public function setRelation($relation, $value) { } /** * Set the entire relations array on the model. * * @param array $relations * @return $this */ public function setRelations(array $relations) { } /** * Get the database connection for the model. * * @return \Illuminate\Database\Connection */ public function getConnection() { } /** * Get the current connection name for the model. * * @return string */ public function getConnectionName() { } /** * Set the connection associated with the model. * * @param string $name * @return $this */ public function setConnection($name) { } /** * Resolve a connection instance. * * @param string|null $connection * @return \Illuminate\Database\Connection */ public static function resolveConnection($connection = null) { } /** * Get the connection resolver instance. * * @return \Illuminate\Database\ConnectionResolverInterface */ public static function getConnectionResolver() { } /** * Set the connection resolver instance. * * @param \Illuminate\Database\ConnectionResolverInterface $resolver * @return void */ public static function setConnectionResolver(\Illuminate\Database\ConnectionResolverInterface $resolver) { } /** * Unset the connection resolver for models. * * @return void */ public static function unsetConnectionResolver() { } /** * Get the event dispatcher instance. * * @return \Illuminate\Contracts\Events\Dispatcher */ public static function getEventDispatcher() { } /** * Set the event dispatcher instance. * * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher * @return void */ public static function setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $dispatcher) { } /** * Unset the event dispatcher for models. * * @return void */ public static function unsetEventDispatcher() { } /** * Get the mutated attributes for a given instance. * * @return array */ public function getMutatedAttributes() { } /** * Extract and cache all the mutated attributes of a class. * * @param string $class * @return void */ public static function cacheMutatedAttributes($class) { } /** * Dynamically retrieve attributes on the model. * * @param string $key * @return mixed */ public function __get($key) { } /** * Dynamically set attributes on the model. * * @param string $key * @param mixed $value * @return void */ public function __set($key, $value) { } /** * Determine if the given attribute exists. * * @param mixed $offset * @return bool */ public function offsetExists($offset) { } /** * Get the value for a given offset. * * @param mixed $offset * @return mixed */ public function offsetGet($offset) { } /** * Set the value for a given offset. * * @param mixed $offset * @param mixed $value * @return void */ public function offsetSet($offset, $value) { } /** * Unset the value for a given offset. * * @param mixed $offset * @return void */ public function offsetUnset($offset) { } /** * Determine if an attribute or relation exists on the model. * * @param string $key * @return bool */ public function __isset($key) { } /** * Unset an attribute on the model. * * @param string $key * @return void */ public function __unset($key) { } /** * Handle dynamic method calls into the model. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Handle dynamic static method calls into the method. * * @param string $method * @param array $parameters * @return mixed */ public static function __callStatic($method, $parameters) { } /** * Convert the model to its string representation. * * @return string */ public function __toString() { } /** * When a model is being unserialized, check if it needs to be booted. * * @return void */ public function __wakeup() { } } } namespace WHMCS\Model { class AbstractModel extends \Illuminate\Database\Eloquent\Model implements \WHMCS\Model\Contracts\ModelInterface { public $unique = array(); public $guardedForUpdate = array(); protected $columnMap = array(); protected $booleans = array(); protected $strings = array(); protected $ints = array(); protected $semanticVersions = array(); protected $commaSeparated = array(); protected $characterSeparated = array(); protected static $tableColumnCache = array(); protected $rules = array(); protected $errors = NULL; protected $customValidationMessages = array(); public static function boot() { } public function clearColumnCache() { } protected function hasColumn($column) { } public function getAttribute($key) { } public function isAttributeSet($key) { } public function setAttribute($key, $value) { } public function getRawAttribute($key = NULL, $default = NULL) { } public function fromBoolean($value) { } public function fromString($value) { } public function fromInt($value) { } public function asBoolean($value) { } public function asArrayFromCharacterSeparatedValue($data = "", $character = ",") { } public function fromArrayToCharacterSeparatedValue(array $list = array(), $character = ",") { } public function fromSemanticVersion(\WHMCS\Version\SemanticVersion $version) { } public function asSemanticVersion($version) { } public static function convertBoolean($value) { } public static function convertBooleanColumn($column) { } public static function convertUnixTimestampIntegerToTimestampColumn($column) { } protected function isBooleanColumn($column) { } protected function isSemanticVersionColumn($column) { } protected function isCommaSeparatedColumn($column) { } protected function decryptValue($cipherText, $key) { } protected function encryptValue($text, $key) { } protected function aesEncryptValue($text, $key) { } protected function aesDecryptValue($text, $key) { } protected function serializeDate(\DateTime $date) { } protected function decrypt($value) { } protected function encrypt($value) { } protected function asDateTime($value) { } public function fromDateTime($value) { } public function toArrayUsingColumnMapNames() { } public function validate() { } public function setCustomValidationMessages(array $messages) { } public function errors() { } public function getCustomFieldValuesAttribute() { } protected function getCustomFieldType() { } protected function getCustomFieldRelId() { } } } namespace WHMCS\Billing { class Invoice extends \WHMCS\Model\AbstractModel { protected $table = "tblinvoices"; protected $dates = array("date", "dateCreated", "duedate", "dateDue", "datepaid", "datePaid", "lastCaptureAttempt", "dateRefunded", "dateCancelled"); protected $columnMap = array("clientId" => "userid", "invoiceNumber" => "invoicenum", "dateCreated" => "date", "dateDue" => "duedate", "datePaid" => "datepaid", "tax1" => "tax", "taxRate1" => "taxrate", "paymentGateway" => "paymentmethod", "adminNotes" => "notes", "lineItems" => "items", "dateRefunded" => "date_refunded", "dateCancelled" => "date_cancelled"); protected $appends = array("balance", "paymentGatewayName", "amountPaid"); const STATUS_CANCELLED = "Cancelled"; const STATUS_COLLECTIONS = "Collections"; const STATUS_DRAFT = "Draft"; const STATUS_PAID = "Paid"; const STATUS_PAYMENT_PENDING = "Payment Pending"; const STATUS_REFUNDED = "Refunded"; const STATUS_UNPAID = "Unpaid"; public static function boot() { } public function getViewInvoiceUrl($additionalQueryStringParams = NULL) { } public function getInvoiceNumber() { } public function getCurrency() { } public function getCurrencyCodeAttribute() { } public function client() { } public function transactions() { } public function items() { } public function snapshot() { } public function order() { } public function scopeUnpaid(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeOverdue(\Illuminate\Database\Eloquent\Builder $query) { } public function scopePaid(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeCancelled(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeRefunded(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeCollections(\Illuminate\Database\Eloquent\Builder $query) { } public function scopePaymentPending(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeUnpaidOrPaymentPending(\Illuminate\Database\Eloquent\Builder $query) { } public function scopeMassPay(\Illuminate\Database\Eloquent\Builder $query, $isMassPay = true) { } public function scopeWithLastCaptureAttempt(\Illuminate\Database\Eloquent\Builder $query, \WHMCS\Carbon $date) { } public function getBalanceAttribute() { } public function getPaymentGatewayNameAttribute() { } public function getAmountPaidAttribute() { } public function addPayment($amount, $transactionId = "", $fees = 0, $gateway = "", $noEmail = false, \WHMCS\Carbon $date = NULL) { } public function addPaymentIfNotExists($amount, $transactionId = "", $fees = 0, $gateway = "", $noEmail = false, \WHMCS\Carbon $date = NULL) { } public function getBillingValues() { } public function shouldRenewRun($relatedId, $registrationDate, $type = "Hosting") { } public function vat() { } public static function newInvoice($clientId, $gateway = NULL, $taxRate1 = NULL, $taxRate2 = NULL) { } public function setStatusUnpaid() { } public function setStatusPending() { } public function setStatusRefunded() { } public function data() { } public function transactionHistory() { } public function payMethod() { } public function getPayMethodRemoteToken() { } public function setPayMethodRemoteToken($remoteToken) { } public function deletePayMethod() { } public function convertLocalCardToRemote($remoteToken) { } public function convertLocalBankAccountToRemote($remoteToken) { } public function saveRemoteCard($cardLastFour, $cardType, $expiryDate, $remoteToken) { } public function saveRemoteBankAccount($bankName, $remoteToken) { } public function cart() { } public function runCreationHooks($source) { } public function getSubscriptionIds($paymentMethods = NULL) { } public function saveSubscriptionId($subscriptionId) { } public function scopeSubscriptionId(\Illuminate\Database\Eloquent\Builder $query, $subscriptionId) { } public function getLink() { } public function setPaymentMethod($gatewayName) { } public function setPayMethodId($payMethodId) { } public function clearPayMethodId() { } } } namespace WHMCS\Module\Addon\ProjectManagement\Models { class WHMCSInvoice extends \WHMCS\Billing\Invoice { protected $appends = array("balance"); } class ProjectFile extends \WHMCS\Model\AbstractModel { protected $table = "mod_project_management_files"; public function createTable($drop = false) { } public function dropTable() { } } } namespace WHMCS\Module\Addon\ProjectManagement\Models\Task { class Template extends \WHMCS\Model\AbstractModel { protected $table = "mod_projecttasktpls"; public $timestamps = false; protected $fillable = array("name", "tasks"); protected $casts = array("tasks" => "array"); public function createTable($drop = false) { } public function dropTable() { } } } namespace WHMCS\Module\Addon\ProjectManagement { class Notify extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { protected function getProjectRelatedAdmins() { } public function staff(array $projectChanges, $isNewProject = false) { } public function sendEmail() { } } class Project { public $id = NULL; public $client = NULL; protected $commaSeparatedValues = array("ticketids", "invoiceids", "watchers"); protected $dateValues = array("created", "duedate", "lastmodified"); protected $language = array(); public function __construct($projectId, array $language = array()) { } public static function create($vars) { } public function save() { } public function files() { } public function messages() { } public function tasks() { } public function tickets() { } public function timers() { } public function log() { } public function invoices() { } public function watch() { } public function unwatch() { } public function isWatcher() { } public function notify() { } public function saveProject() { } public function permissions() { } public function duplicateProject() { } public function getLanguage() { } } class Permission { protected $permissions = array("Create New Projects", "View All Projects", "13" => "View Only Assigned Projects", "2" => "Edit Project Details", "3" => "Update Status", "4" => "Create Tasks", "5" => "Edit Tasks", "6" => "Delete Tasks", "7" => "Bill Tasks", "8" => "Associate Tickets", "9" => "Post Messages", "10" => "View Reports", "11" => "Delete Messages", "12" => "Delete Projects", "View Recent Activity"); protected function isMasterAdmin($roleId = 0, $adminId = 0) { } public function check($permissionName) { } public static function getPermissionList() { } } class Log extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { protected function formatLogTime($date) { } public function get() { } public function add($message) { } } class Tasks extends \WHMCS\Module\Addon\ProjectManagement\BaseProjectEntity { protected function get($taskId = NULL) { } public function listall() { } public function getSingle($taskId = NULL) { } public function getTaskSummary() { } public function add() { } public function delete() { } public function toggleStatus() { } public function assign() { } public function setDueDate() { } public function edit() { } public function search() { } public function select() { } public function import() { } public function saveList() { } public function deleteTaskTemplate() { } public function saveOrder() { } } } namespace WHMCS\Module\Addon\Mailchimp { class Dispatcher { public function dispatch($action, $parameters) { } public function renderView($action, $parameters) { } } class SettingsHelper { public $vars = array(); public function __construct($vars) { } public function request($key) { } public function get($key) { } public function set($key, $value) { } } class Api { protected $apiKey = NULL; protected $dc = NULL; protected $testmode = false; public function setApiKey($apiKey) { } public function info() { } public function getLists() { } public function createList($name, $fromEmail, $fromName, $permissionReminder, $contactCompany, $contactAddr1, $contactCity, $contactState, $contactZip, $contactCountry) { } public function getStores() { } public function deleteStore() { } public function getWhmcsStoreListId() { } public function createStore($listId, $currencyCode, $currencyPrefix) { } public function getProducts() { } public function createProduct($type, $productId, $group, $title, $description, $url, $pricing, $qty) { } public function updateProduct($type, $productId, $group, $title, $description, $url, $pricing, $qty) { } public function updateCustomer($id, $email, $optInStatus, $company, $firstName, $lastName, $orderCount, $totalSpent, $address1, $address2, $city, $state, $postcode, $country, $countryCode, \Illuminate\Support\Collection $settings) { } public function createOrder($orderId, $customer, $currencyCode, $discountTotal, $taxTotal, $total, $lineItems) { } public function updateOrder($orderId, $isPaid = false, $isShipped = false, $isCancelled = false, $isRefunded = false) { } public function deleteOrder($orderId) { } public function createCart($cartId, $customer, $currencyCode, $total, $lineItems) { } public function deleteCart($cartId) { } protected function getCustomerId($userId) { } protected function getOrderId($orderId) { } protected function formatLineItems($lineItems, $prefix) { } protected function getApiUrl() { } protected function getApiKey() { } protected function get($action) { } protected function post($action, $data) { } protected function patch($action, $data) { } protected function put($action, $data) { } protected function delete($action) { } protected function call($method, $action, $data) { } protected function processResponse($response) { } public function enableTestMode() { } } } namespace WHMCS\Module\Addon\Mailchimp\Exceptions { class ApiException extends \WHMCS\Exception { } class InvalidApiKey extends \WHMCS\Exception { } } namespace WHMCS\Module\Addon\Mailchimp { class Controller { protected $api = NULL; public function __construct() { } public function index($vars) { } public function settings($vars, $saveSuccess = false, $errorMsg = "") { } public function savesettings($vars) { } public function setup($vars) { } protected function apikeyinput($vars, $errorMsg = NULL) { } public function validateapikey($vars) { } protected function showlistchoice($vars, $errorMsg = NULL) { } public function validateprimarylist($vars) { } public function sync($vars) { } public function runsync($vars) { } public function disconnect($vars) { } public function disconnectconfirm($vars) { } } } namespace WHMCS\Module\Fraud { interface ModuleInterface { public function validateRules(array $params, \WHMCS\Module\Fraud\ResponseInterface $response); public function formatResponse(\WHMCS\Module\Fraud\ResponseInterface $response); } class AbstractModule { protected $fieldMapping = array(); protected $meteredFields = array(); protected $booleanFields = array(); } } namespace WHMCS\Module\Fraud\FraudLabs { class FraudLabs extends \WHMCS\Module\Fraud\AbstractModule implements \WHMCS\Module\Fraud\ModuleInterface { protected $fieldMapping = array("ip" => array("ip_country", "is_country_match", "ip_region", "ip_city", "ip_continent", "ip_latitude", "ip_longitude", "ip_timezone", "ip_domain", "ip_isp_name", "ip_usage_type", "is_proxy_ip_address", "is_ip_blacklist"), "billing" => array("is_high_risk_country", "is_phone_blacklist", "is_export_controlled_country", "user_order_id"), "email" => array("is_free_email", "is_disposable_email", "is_new_domain_name", "is_domain_exists", "is_email_blacklist"), "general" => array("fraudlabspro_id", "fraudlabspro_distribution", "fraudlabspro_status", "fraudlabspro_version", "fraudlabspro_credits")); protected $meteredFields = array("fraudlabspro_distribution"); protected $booleanFields = array("is_country_match", "is_high_risk_country", "is_free_email", "is_disposable_email", "is_new_domain_name", "is_domain_exists", "is_proxy_ip_address", "is_ip_blacklist", "is_email_blacklist", "is_phone_blacklist", "is_export_controlled_country"); public function validateRules(array $params, \WHMCS\Module\Fraud\ResponseInterface $response) { } public function formatResponse(\WHMCS\Module\Fraud\ResponseInterface $response) { } protected function generateHtmlOutput(\WHMCS\Module\Fraud\FraudLabs\Response $response, array $panels) { } public static function hash($string) { } } } namespace WHMCS\Module\Fraud { interface RequestInterface { public function setLicenseKey($licenseKey); public function call($data); } class AbstractRequest { protected $licenseKey = NULL; protected function log($action, $request, $response, $processedResponse) { } protected function getClient() { } } } namespace WHMCS\Module\Fraud\FraudLabs { class Request extends \WHMCS\Module\Fraud\AbstractRequest implements \WHMCS\Module\Fraud\RequestInterface { const URL = "https://api.fraudlabspro.com/v1/order/screen"; public function setLicenseKey($licenseKey) { } public function call($data) { } protected function getApiEndpointUrl() { } } } namespace WHMCS\Module\Fraud { interface ResponseInterface { public function __construct($jsonData, $httpCode); public function isSuccessful(); public function getHttpCode(); public function isEmpty(); public function get($key); public function toArray(); public function toJson(); } class AbstractResponse { protected $data = NULL; protected $httpCode = 200; public function __construct($jsonData, $httpCode = NULL) { } protected function parseResponseJson($jsonData) { } public function isSuccessful() { } public function getHttpCode() { } public function isEmpty() { } public function get($key) { } public function toArray() { } public function toJson() { } } } namespace WHMCS\Module\Fraud\FraudLabs { class Response extends \WHMCS\Module\Fraud\AbstractResponse implements \WHMCS\Module\Fraud\ResponseInterface { protected $failureErrorCodes = array(101, 102, 103, 104, 203, 204, 210, 211); public function isSuccessful() { } } } namespace WHMCS\Module\Fraud\MaxMind { class Payment extends \WHMCS\Model\AbstractModel { protected $table = "mod_maxmind_payment"; protected $fillable = array("processor", "whmcs_module"); public function createTable($drop = false) { } protected function getDefaultTableData() { } public static function getPaymentModule($paymentModule) { } } class Maxmind extends \WHMCS\Module\Fraud\AbstractModule implements \WHMCS\Module\Fraud\ModuleInterface { protected $fieldMapping = array("ip" => array("ip_address.city.names.en", "ip_address.city.confidence", "ip_address.subdivisions.0.iso_code", "ip_address.subdivisions.0.names.en", "ip_address.subdivisions.0.confidence", "ip_address.continent.code", "ip_address.continent.names.en", "ip_address.country.confidence", "ip_address.country.iso_code", "ip_address.country.names.en", "ip_address.location.accuracy_radius", "ip_address.location.latitude", "ip_address.location.longitude", "ip_address.location.time_zone", "ip_address.traits.user_type", "ip_address.traits.autonomous_system_number", "ip_address.traits.autonomous_system_organization", "ip_address.traits.isp", "ip_address.traits.is_anonymous", "ip_address.traits.is_anonymous_vpn"), "subscores" => array("subscores.billing_address", "subscores.billing_address_distance_to_ip_location", "subscores.browser", "subscores.country", "subscores.country_mismatch", "subscores.email_address", "subscores.email_domain", "subscores.order_amount", "subscores.phone_number", "subscores.time_of_day"), "billing" => array("billing_address.latitude", "billing_address.longitude", "billing_address.distance_to_ip_location", "billing_address.is_in_ip_country"), "credit_card" => array("credit_card.issuer.name", "credit_card.issuer.phone_number", "credit_card.brand", "credit_card.country", "credit_card.is_issued_in_billing_address_country", "credit_card.is_prepaid", "credit_card.is_virtual", "credit_card.type"), "email" => array("email.first_seen", "email.is_free", "email.is_high_risk"), "general" => array("id", "funds_remaining", "queries_remaining")); protected $meteredFields = array("ip_address.city.confidence", "ip_address.country.confidence", "ip_address.subdivisions.0.confidence", "subscores.billing_address", "subscores.billing_address_distance_to_ip_location", "subscores.browser", "subscores.country", "subscores.country_mismatch", "subscores.email_address", "subscores.email_domain", "subscores.order_amount", "subscores.phone_number", "subscores.time_of_day"); protected $booleanFields = array("email.is_free", "email.is_high_risk", "billing_address.is_in_ip_country", "ip_address.traits.is_anonymous", "ip_address.traits.is_anonymous_vpn", "credit_card.is_issued_in_billing_address_country", "credit_card.is_prepaid", "credit_card.is_virtual"); public function validateRules(array $params, \WHMCS\Module\Fraud\ResponseInterface $response) { } public function formatResponse(\WHMCS\Module\Fraud\ResponseInterface $response) { } protected function generateHtmlOutput(\WHMCS\Module\Fraud\MaxMind\Response $response, array $panels) { } public function legacyResultsFormatHandler($results) { } } class Request extends \WHMCS\Module\Fraud\AbstractRequest implements \WHMCS\Module\Fraud\RequestInterface { protected $accountId = NULL; protected $licenseKey = NULL; protected $serviceType = NULL; const URL = "https://minfraud.maxmind.com/minfraud/v2.0/"; public function setAccountId($accountId) { } public function setLicenseKey($licenseKey) { } public function setServiceType($serviceType) { } public function call($data) { } protected function getApiEndpointUrl() { } } class Response extends \WHMCS\Module\Fraud\AbstractResponse implements \WHMCS\Module\Fraud\ResponseInterface { } } namespace { class HeartInternetReg_API { public $namespace = "urn:ietf:params:xml:ns:epp-1.0"; public function connect($test_mode = \false) { } public function getResponse() { } public function sendMessage($output, $no_parsing = \false) { } public function logIn($userid, $password, $objects, $extensions) { } public function buildXML($content) { } public function disconnect() { } } class OPS extends \PEAR { var $_OPS_VERSION = '0.9'; var $_OPT = ''; var $_SPACER = ' '; /* indent character */ var $_CRLF = "\n"; var $_MSGTYPE_STD = 'standard'; var $_SESSID; var $_MSGCNT; var $CRLF = "\r\n"; var $_log = array(); var $_data; var $_pointers; var $_last_was_data_block; /** * Class constructor * * Initialize variables, logs, etc. * * @param array allows for setting various options (right now, just whether * to use compression or not on the generated XML) */ function OPS($args = \false) { } /** * Writes a message to a socket (buffered IO) * * @param int socket handle * * @param string message to write * */ function writeData(&$fh, $msg) { } /** * Encodes and writes a message to a socket * * @param int socket handle * * @param string message to encode and write * */ function writeMessage(&$fh, $hr) { } /** * Reads data from a socket * * @param int socket handle * * @param int timeout for read * * @return mixed buffer with data, or an error for a short read * */ function readData(&$fh, $timeout = 5) { } /** * Reads and decodes data from a socket * * @param int socket handle * * @param int timeout for read * * @return mixed associative array of data, or an error * */ function readMessage(&$fh, $timeout = 5) { } /** * Checks a socket for timeout or EOF * * @param int socket handle * * @return boolean true if the socket has timed out or is EOF * */ function socketStatus(&$fh) { } /** * Internal method to generate error codes hashes * * @param int error code * * @param string error message * * @return array error hash * */ function _opsError($err_code, $err_text) { } # # DECODING METHODS # Converts XML OPS messages into PHP data # /** * Accepts an OPS protocol message or an file handle * and decodes the data into a PHP array * * @param string OPS message * * @return mixed PHP array, or error * */ function decode($in) { } /** * XML Parser that converts an OPS protocol message into a PHP array * * @param string OPS message * * @return mixed PHP array, or error * */ function XML2PHP($msg) { } # # ENCODING METHODS # Converts PHP data into XML OPS messages # /** * Converts a PHP array into an OPS message * * @param array PHP array * * @return string OPS XML message * */ function encode($array) { } /** * Converts a PHP array into an OPS data_block tag * * @param array PHP array * * @return string OPS data_block tag * */ function PHP2XML($data) { } /** * Recursivly converts PHP data into XML * * @param mixed PHP array or data * * @param int ident level * * @return string XML string * */ function _convertData(&$array, $indent = 0) { } /** * Quotes special XML characters * * @param string string to quote * * @return string quoted string * */ function _quoteXMLChars($string) { } /** * Determines if an array is associative or not, since PHP * doesn't really distinguish between the two, but Perl/OPS does * * @param array array to check * * @return boolean true if the array is associative * */ function _is_assoc(&$array) { } /** * Internal loggging method * * @param string which log to log to * * @param string type of log message ('r'ead, 'w'rite, 'i'nfo or 'e'rror) * * @param int message * */ function _log($log, $type, $msg) { } /** * Show internal log * * @param string which log to log show, 'raw' or 'xml' * * @param string format to display: 'html' (default) or 'raw' * */ function showLog($log, $format = 'html') { } } class openSRS_base extends \PEAR { var $USERNAME = ''; var $HRS_USERNAME = ''; var $PRIVATE_KEY = ''; var $TEST_PRIVATE_KEY = ''; var $LIVE_PRIVATE_KEY = ''; var $HRS_PRIVATE_KEY = ''; var $VERSION = 'XML:0.1'; var $base_class_version = '2.8.0'; var $environment = 'LIVE'; /* 'TEST' or 'LIVE' or 'HRS' */ var $protocol = 'XCP'; /* 'XCP' or 'TPP' */ var $LIVE_host = 'rr-n1-tor.opensrs.net'; var $LIVE_port = 55000; var $LIVE_sslport = 55443; var $TEST_host = 'horizon.opensrs.net'; var $TEST_port = 55000; var $TEST_sslport = 55443; var $HRS_host; var $HRS_port; var $HRS_sslport; var $REMOTE_HOST; var $REMOTE_PORT; var $connect_timeout = 20; /* seconds */ var $read_timeout = 20; /* seconds */ var $log = array(); var $CRLF = "\r\n"; var $_socket = \false; var $_socket_error_num = \false; var $_socket_error_msg = \false; var $_session_key = \false; var $_authenticated = \false; var $_OPS; var $_CBC; var $lookup_all_tlds = \false; var $_CRYPT; var $_iv; var $crypt_type = 'SSL'; /* 'DES' or 'BLOWFISH' or 'SSL' */ var $crypt_mode = 'CBC'; /* only 'CBC' */ var $crypt_rand_source = \MCRYPT_DEV_URANDOM; /* or MCRYPT_DEV_RANDOM or MCRYPT_RAND */ var $affiliate_id; var $PERMISSIONS = array('f_modify_owner' => 1, 'f_modify_admin' => 2, 'f_modify_billing' => 4, 'f_modify_tech' => 8, 'f_modify_nameservers' => 16); var $REG_PERIODS = array(1 => '1 Year', 2 => '2 Years', 3 => '3 Years', 4 => '4 Years', 5 => '5 Years', 6 => '6 Years', 7 => '7 Years', 8 => '8 Years', 9 => '9 Years', 10 => '10 Years'); var $UK_REG_PERIODS = array(2 => '2 Years'); var $TV_REG_PERIODS = array(1 => '1 Year', 2 => '2 Years', 3 => '3 Years', 5 => '5 Years', 10 => '10 Years'); var $TRANSFER_PERIODS = array(1 => '1 Year'); var $OPENSRS_TLDS_REGEX = '(\\.ca|\\.(bc|ab|sk|mb|on|qc|nb|ns|pe|nf|nt|nv|yk)\\.ca|\\.com|\\.net|\\.org|\\.co\\.uk|\\.org\\.uk|\\.tv|\\.vc|\\.cc|\\.info|\\.biz|\\.name|\\.us)'; var $CA_LEGAL_TYPES = array('ABO' => 'Aboriginal', 'ASS' => 'Association', 'CCO' => 'Canadian Corporation', 'CCT' => 'Canadian Citizen', 'EDU' => 'Educational Institute', 'GOV' => 'Government', 'HOP' => 'Hospital', 'INB' => 'Indian Band', 'LAM' => 'Library, Archive or Museum', 'LGR' => 'Legal Respresentative', 'MAJ' => 'Her Majesty the Queen', 'OMK' => 'Protected by Trade-marks Act', 'PLT' => 'Political Party', 'PRT' => 'Partnership', 'RES' => 'Permanent Resident', 'TDM' => 'Trade-mark Owner', 'TRD' => 'Trade Union', 'TRS' => 'Trust'); var $CA_LANGUAGE_TYPES = array('EN' => 'English', 'FR' => 'French'); var $CA_NATIONALITIES = array('CND' => 'Canadian citizen', 'OTH' => 'Foreign citizenship', 'RES' => 'Canadian permanent resident'); var $OPENSRS_ACTIONS = array('get_domain' => \true, 'get_userinfo' => \true, 'modify_domain' => \true, 'renew_domain' => \true, 'register_domain' => \true, 'get_nameserver' => \true, 'create_nameserver' => \true, 'modify_nameserver' => \true, 'delete_nameserver' => \true, 'get_subuser' => \true, 'add_subuser' => \true, 'modify_subuser' => \true, 'delete_subuser' => \true, 'change_password' => \true, 'change_ownership' => \true, 'set_cookie' => \true, 'delete_cookie' => \true, 'update_cookie' => \true, 'sw_register_domain' => \true, 'bulk_transfer_domain' => \true, 'register_domain' => \true, 'lookup_domain' => \true, 'get_price_domain' => \true, 'check_transfer_domain' => \true, 'quit_session' => \true, 'buy_webcert' => \true, 'refund_webcert' => \true, 'query_webcert' => \true, 'cprefget_webcert' => \true, 'cprefset_webcert' => \true, 'cancel_pending_webcert' => \true, 'update_webcert' => \true); # # BASIC PUBLIC FUNCTIONS # /** * Class constructor * * Initialize variables, logs, etc. * * @param string Which environment to use (LIVE or TEST or HRS) * @param string Which protocol to use (XCP or TPP) * */ function openSRS_base($environment = \NULL, $protocol = \NULL, $regusername = \NULL, $regprivatekey = \NULL) { } # # setProtocol() # Switch between XCP and TPP # function setProtocol($proto) { } # # logout() # Send a 'quit' command to the server # function logout() { } # # send_cmd() # Send a command to the server # function send_cmd($request) { } # # validate() # Check data for validity # function validate($data, $params = array()) { } # # version() # return base class version # function version() { } # # PRIVATE FUNCTIONS # # # init_socket() # Initialize a socket connection to the OpenSRS server # function init_socket() { } # # authenticate() # Authenticate the connection with the username/private key # function authenticate($username = \false, $private_key = \false) { } # # lookup_domain() # Special case for domain lookups # # # NOTE: I have changed the error codes returned by this function. # Instead of having all syntax errors return a 400 code, they return # codes in the range 490 to 499 range, depending on the type of error. # This makes it much easier to determine what *kind* of lookup error # happened, by having *us* parse through response_text for various strings. # # 490 No domain given # 491 TLD not supported # 492 Domain name too long # 493 Invalid characters # 499 Other error # # Syntax errors coming back from the server will likely still have error # code 400. Oh well. # function lookup_domain($lookupData) { } # # close_socket() # Close the socket connection # function close_socket() { } # # read_data() # Reads a response from the server # function read_data($args = array()) { } # # send_data() # Sends request to the server # function send_data($message, $args = array()) { } # # check_email_syntax() # Regex check for valid email # function check_email_syntax($email) { } # # check_domain_syntax() # Regex check for valid domain # function check_domain_syntax($domain) { } # # prune_private_keys() # Recursively remove keys that start with 'p_' from an array # function prune_private_keys(&$data) { } # # getRelatedTLDs() # function getRelatedTLDs($tld) { } # # _log() # Internal logging method # function _log($type, $data) { } # # showlog() # output the debugging log # function showlog() { } /** * Writes a message to a socket (buffered IO) * * @param int socket handle * * @param string message to write * */ function writeData(&$fh, $msg) { } /** * Reads header data * * @param int socket handle * * @param int timeout for read * * @return hash hash containing header key/value pairs * */ function readHeader($fh, $timeout = 5) { } /** * Reads data from a socket * * @param int socket handle * * @param int timeout for read * * @return mixed buffer with data, or an error for a short read * */ function readData(&$fh, $timeout = 5) { } } class Transip_Db { public $name = \NULL; public $username = \NULL; public $maxDiskUsage = \NULL; public function __construct($name, $username = "", $maxDiskUsage = 100) { } } class Transip_WebHost { public $domainName = \NULL; public $cronjobs = \NULL; public $mailBoxes = \NULL; public $dbs = \NULL; public $mailForwards = \NULL; public $subDomains = \NULL; } class Transip_Cronjob { public $name = \NULL; public $url = \NULL; public $email = \NULL; public $minuteTrigger = \NULL; public $hourTrigger = \NULL; public $dayTrigger = \NULL; public $monthTrigger = \NULL; public $weekdayTrigger = \NULL; public function __construct($name, $url, $email, $minuteTrigger, $hourTrigger, $dayTrigger, $monthTrigger, $weekdayTrigger) { } } class Transip_Nameserver { public $hostname = ""; public $ipv4 = ""; public $ipv6 = ""; public function __construct($hostname, $ipv4 = "", $ipv6 = "") { } } class Transip_ApiSettings { public static $mode = "readwrite"; public static $endpoint = "api.transip.nl"; public static $login = ""; public static $privateKey = ""; } class Transip_DomainAction { public $name = \NULL; public $hasFailed = \NULL; public $message = \NULL; } class Transip_Domain { public $name = ""; public $nameservers = array(); public $contacts = array(); public $dnsEntries = array(); public $branding = \NULL; public $authCode = ""; public $isLocked = \false; public $registrationDate = ""; public $renewalDate = ""; public function __construct($name, $nameservers = array(), $contacts = array(), $dnsEntries = array(), $branding = \NULL) { } } class Transip_DomainBranding { public $companyName = \NULL; public $supportEmail = \NULL; public $companyUrl = \NULL; public $termsOfUsageUrl = \NULL; public $bannerLine1 = \NULL; public $bannerLine2 = \NULL; public $bannerLine3 = \NULL; } class Transip_MailBox { public $address = \NULL; public $spamCheckerStrength = \NULL; public $maxDiskUsage = \NULL; public $hasVacationReply = \NULL; public $vacationReplySubject = \NULL; public $vacationReplyMessage = \NULL; const SPAMCHECKER_STRENGTH_AVERAGE = "AVERAGE"; const SPAMCHECKER_STRENGTH_OFF = "OFF"; const SPAMCHECKER_STRENGTH_LOW = "LOW"; const SPAMCHECKER_STRENGTH_HIGH = "HIGH"; public function __construct($address, $spamCheckerStrength = "AVERAGE", $maxDiskUsage = 20, $hasVacationReply = \false, $vacationReplySubject = "", $vacationReplyMessage = "") { } } class Transip_DnsEntry { public $name = \NULL; public $expire = \NULL; public $type = \NULL; public $content = \NULL; const TYPE_A = "A"; const TYPE_AAAA = "AAAA"; const TYPE_CNAME = "CNAME"; const TYPE_MX = "MX"; const TYPE_NS = "NS"; const TYPE_TXT = "TXT"; const TYPE_SRV = "SRV"; public function __construct($name, $expire, $type, $content) { } } class Transip_SubDomain { public $name = \NULL; public function __construct($name) { } } class Transip_WhoisContact { public static $possibleCompanyTypes = array("BV" => "BV - Besloten Vennootschap", "BVI/O" => "BV i.o. - BV in oprichting", "COOP" => "Cooperatie", "CV" => "CV - Commanditaire Vennootschap", "EENMANSZAAK" => "Eenmanszaak", "KERK" => "Kerkgenootschap", "NV" => "NV - Naamloze Vennootschap", "OWM" => "Onderlinge Waarborg Maatschappij", "REDR" => "Rederij", "STICHTING" => "Stichting", "VERENIGING" => "Vereniging", "VOF" => "VoF - Vennootschap onder firma", "BEG" => "Buitenlandse EG vennootschap", "BRO" => "Buitenlandse rechtsvorm/onderneming", "EESV" => "Europees Economisch Samenwerkingsverband", "ANDERS" => "Anders", "" => "Geen"); public static $possibleCountryCodes = array("af" => "Afghanistan", "al" => "Albania", "dz" => "Algeria", "as" => "American Samoa", "ad" => "Andorra", "ao" => "Angola", "ai" => "Anguilla", "aq" => "Antarctica", "ag" => "Antigua and Barbuda", "ar" => "Argentina", "am" => "Armenia", "aw" => "Aruba", "au" => "Australia", "at" => "Austria", "az" => "Azerbaijan", "bs" => "Bahamas", "bh" => "Bahrain", "bd" => "Bangladesh", "bb" => "Barbados", "by" => "Belarus", "be" => "Belgium", "bz" => "Belize", "bj" => "Benin", "bm" => "Bermuda", "bt" => "Bhutan", "bo" => "Bolivia", "ba" => "Bosnia and Herzegovina", "bw" => "Botswana", "bv" => "Bouvet Island", "br" => "Brazil", "io" => "British Indian Ocean Territory", "bn" => "Brunei Darussalem", "bg" => "Bulgaria", "bf" => "Burkina Faso", "bi" => "Burundi", "kh" => "Cambodia", "cm" => "Cameroon", "ca" => "Canada", "cv" => "Cape Verde", "ky" => "Cayman Islands", "cf" => "Central African Republic", "td" => "Chad", "cl" => "Chile", "cn" => "China", "cx" => "Christmas Island", "cc" => "Cocos (Keeling) Islands", "co" => "Colombia", "km" => "Comoros", "cg" => "Congo", "cd" => "Congo, the Democratic Republic of the", "ck" => "Cook Islands", "cr" => "Costa Rica", "hr" => "Croatia", "cu" => "Cuba", "cy" => "Cyprus", "cz" => "Czech Republic", "ci" => "Côte d'Ivoire", "dk" => "Denmark", "dj" => "Djibouti", "dm" => "Dominica", "do" => "Dominican Republic", "ec" => "Ecuador", "eg" => "Egypt", "sv" => "El Salvador", "gq" => "Equatorial Guinea", "er" => "Eritrea", "ee" => "Estonia", "et" => "Ethiopia", "fk" => "Falkland Islands (Malvinas)", "fo" => "Faroe Islands", "fj" => "Fiji", "fi" => "Finland", "fr" => "France", "gf" => "French Guiana", "pf" => "French Polynesia", "tf" => "French Southern Territories", "ga" => "Gabon", "gm" => "Gambia", "ge" => "Georgia", "de" => "Germany", "gh" => "Ghana", "gi" => "Gibraltar", "gr" => "Greece", "gl" => "Greenland", "gd" => "Grenada", "gp" => "Guadeloupe", "gu" => "Guam", "gt" => "Guatemala", "gg" => "Guernsey", "gn" => "Guinea", "gw" => "Guinea-Bissau", "gy" => "Guyana", "ht" => "Haiti", "hm" => "Heard Island and McDonald Islands", "va" => "Holy See (Vatican City State)", "hn" => "Honduras", "hk" => "Hong Kong", "hu" => "Hungary", "is" => "Iceland", "in" => "India", "id" => "Indonesia", "ir" => "Iran, Islamic Republic of", "iq" => "Iraq", "ie" => "Ireland", "im" => "Isle of Man", "il" => "Israel", "it" => "Italy", "jm" => "Jamaica", "jp" => "Japan", "je" => "Jersey", "jo" => "Jordan", "kz" => "Kazakhstan", "ke" => "Kenya", "ki" => "Kiribati", "kp" => "Korea, Democratic People's Republic of", "kr" => "Korea, Republic of", "kw" => "Kuwait", "kg" => "Kyrgyzstan", "la" => "Lao People's Democratic Republic", "lv" => "Latvia", "lb" => "Lebanon", "ls" => "Lesotho", "lr" => "Liberia", "ly" => "Libyan Arab Jamahiriya", "li" => "Liechtenstein", "lt" => "Lithuania", "lu" => "Luxembourg", "mo" => "Macao", "mk" => "Macedonia, the former Yugoslav Republic of", "mg" => "Madagascar", "mw" => "Malawi", "my" => "Malaysia", "mv" => "Maldives", "ml" => "Mali", "mt" => "Malta", "mh" => "Marshall Islands", "mq" => "Martinique", "mr" => "Mauritania", "mu" => "Mauritius", "yt" => "Mayotte", "mx" => "Mexico", "fm" => "Micronesia, Federated States of", "md" => "Moldova", "mc" => "Monaco", "mn" => "Mongolia", "me" => "Montenegro", "ms" => "Montserrat", "ma" => "Morocco", "mz" => "Mozambique", "mm" => "Myanmar", "na" => "Namibia", "nr" => "Nauru", "np" => "Nepal", "nl" => "Netherlands", "an" => "Netherlands Antilles", "nc" => "New Caledonia", "nz" => "New Zealand", "ni" => "Nicaragua", "ne" => "Niger", "ng" => "Nigeria", "nu" => "Niue", "nf" => "Norfolk Island", "mp" => "Northern Mariana Islands", "no" => "Norway", "om" => "Oman", "pk" => "Pakistan", "pw" => "Palau", "ps" => "Palestinian Territory, Occupied", "pa" => "Panama", "pg" => "Papua New Guinea", "py" => "Paraguay", "pe" => "Peru", "ph" => "Philippines", "pn" => "Pitcairn", "pl" => "Poland", "pt" => "Portugal", "pr" => "Puerto Rico", "qa" => "Qatar", "ro" => "Romania", "ru" => "Russian Federation", "rw" => "Rwanda", "re" => "Réunion", "bl" => "Saint Barthélemy", "sh" => "Saint Helena", "kn" => "Saint Kitts and Nevis", "lc" => "Saint Lucia", "mf" => "Saint Martin (French part)", "pm" => "Saint Pierre and Miquelon", "vc" => "Saint Vincent and the Grenadines", "ws" => "Samoa", "sm" => "San Marino", "st" => "Sao Tome and Principe", "sa" => "Saudi Arabia", "sn" => "Senegal", "rs" => "Serbia", "sc" => "Seychelles", "sl" => "Sierra Leone", "sg" => "Singapore", "sk" => "Slovakia", "si" => "Slovenia", "sb" => "Solomon Islands", "so" => "Somalia", "za" => "South Africa", "gs" => "South Georgia and the South Sandwich Islands", "es" => "Spain", "lk" => "Sri Lanka", "sd" => "Sudan", "sr" => "Suriname", "sj" => "Svalbard and Jan Mayen", "sz" => "Swaziland", "se" => "Sweden", "ch" => "Switzerland", "sy" => "Syrian Arab Republic", "tw" => "Taiwan, Province of China", "tj" => "Tajikistan", "tz" => "Tanzania, United Republic of", "th" => "Thailand", "tl" => "Timor-Leste", "tg" => "Togo", "tk" => "Tokelau", "to" => "Tonga", "tt" => "Trinidad and Tobago", "tn" => "Tunisia", "tr" => "Turkey", "tm" => "Turkmenistan", "tc" => "Turks and Caicos Islands", "tv" => "Tuvalu", "ug" => "Uganda", "ua" => "Ukraine", "ae" => "United Arab Emirates", "gb" => "United Kingdom", "us" => "United States", "um" => "United States Minor Outlying Islands", "uy" => "Uruguay", "uz" => "Uzbekistan", "vu" => "Vanuatu", "ve" => "Venezuela", "vn" => "Viet Nam", "vg" => "Virgin Islands, British", "vi" => "Virgin Islands, U.S.", "wf" => "Wallis and Futuna", "eh" => "Western Sahara", "ye" => "Yemen", "zm" => "Zambia", "zw" => "Zimbabwe", "ax" => "Åland Islands"); public $type = \NULL; public $firstName = \NULL; public $middleName = \NULL; public $lastName = \NULL; public $companyName = \NULL; public $companyKvk = \NULL; public $companyType = \NULL; public $street = \NULL; public $number = \NULL; public $postalCode = \NULL; public $city = \NULL; public $phoneNumber = \NULL; public $faxNumber = \NULL; public $email = \NULL; public $country = \NULL; const TYPE_REGISTRANT = "registrant"; const TYPE_ADMINISTRATIVE = "administrative"; const TYPE_TECHNICAL = "technical"; } class Transip_DataCenterVisitor { public $name = \NULL; public $reservationNumber = \NULL; public $accessCode = \NULL; public $hasBeenRegisteredBefore = \NULL; } class Transip_ForwardService { protected static $_soapClient = \NULL; const SERVICE = "ForwardService"; const CANCELLATIONTIME_END = "end"; const CANCELLATIONTIME_IMMEDIATELY = "immediately"; public static function _getSoapClient($parameters = array()) { } protected static function _sign($parameters) { } protected static function _sha512Asn1($data) { } protected static function _encodeParameters($parameters, $keyPrefix = \NULL) { } protected static function _urlencode($string) { } public static function getForwardDomainNames() { } public static function getInfo($forwardDomainName) { } public static function order($forward) { } public static function cancel($forwardDomainName, $endTime) { } public static function modify($forward) { } } class Transip_MailForward { public $name = \NULL; public $targetAddress = \NULL; public function __construct($name, $targetAddress) { } } class Transip_DomainService { protected static $_soapClient = \NULL; const SERVICE = "DomainService"; const AVAILABILITY_INYOURACCOUNT = "inyouraccount"; const AVAILABILITY_UNAVAILABLE = "unavailable"; const AVAILABILITY_NOTFREE = "notfree"; const AVAILABILITY_FREE = "free"; const CANCELLATIONTIME_END = "end"; const CANCELLATIONTIME_IMMEDIATELY = "immediately"; public static function _getSoapClient($parameters = array()) { } protected static function _sign($parameters) { } protected static function _sha512Asn1($data) { } protected static function _encodeParameters($parameters, $keyPrefix = \NULL) { } protected static function _urlencode($string) { } public static function batchCheckAvailability($domainNames) { } public static function checkAvailability($domainName) { } public static function getWhois($domainName) { } public static function getDomainNames() { } public static function getInfo($domainName) { } public static function batchGetInfo($domainNames) { } public static function getAuthCode($domainName) { } public static function getIsLocked($domainName) { } public static function register($domain) { } public static function cancel($domainName, $endTime) { } public static function transferWithOwnerChange($domain, $authCode) { } public static function transferWithoutOwnerChange($domain, $authCode) { } public static function setNameservers($domainName, $nameservers) { } public static function setLock($domainName) { } public static function unsetLock($domainName) { } public static function setDnsEntries($domainName, $dnsEntries) { } public static function setOwner($domainName, $registrantWhoisContact) { } public static function setContacts($domainName, $contacts) { } public static function getAllTldInfos() { } public static function getTldInfo($tldName) { } public static function getCurrentDomainAction($domainName) { } public static function retryCurrentDomainActionWithNewData($domain) { } public static function retryTransferWithDifferentAuthCode($domain, $newAuthCode) { } public static function cancelDomainAction($domain) { } } class Transip_ColocationService { protected static $_soapClient = \NULL; const SERVICE = "ColocationService"; public static function _getSoapClient($parameters = array()) { } protected static function _sign($parameters) { } protected static function _sha512Asn1($data) { } protected static function _encodeParameters($parameters, $keyPrefix = \NULL) { } protected static function _urlencode($string) { } public static function requestAccess($when, $duration, $visitors, $phoneNumber) { } public static function requestRemoteHands($coloName, $contactName, $phoneNumber, $expectedDuration, $instructions) { } public static function getColoNames() { } public static function getIpAddresses($coloName) { } public static function getIpRanges($coloName) { } public static function createIpAddress($ipAddress, $reverseDns) { } public static function deleteIpAddress($ipAddress) { } public static function getReverseDns($ipAddress) { } public static function setReverseDns($ipAddress, $reverseDns) { } } class Transip_WebhostingPackage { public $name = \NULL; public $description = \NULL; public $price = \NULL; public $renewalPrice = \NULL; } class Transip_WebhostingService { protected static $_soapClient = \NULL; const SERVICE = "WebhostingService"; const CANCELLATIONTIME_END = "end"; const CANCELLATIONTIME_IMMEDIATELY = "immediately"; public static function _getSoapClient($parameters = array()) { } protected static function _sign($parameters) { } protected static function _sha512Asn1($data) { } protected static function _encodeParameters($parameters, $keyPrefix = \NULL) { } protected static function _urlencode($string) { } public static function getWebhostingDomainNames() { } public static function getAvailablePackages() { } public static function getInfo($domainName) { } public static function order($domainName, $webhostingPackage) { } public static function getAvailableUpgrades($domainName) { } public static function upgrade($domainName, $newWebhostingPackage) { } public static function cancel($domainName, $endTime) { } public static function setFtpPassword($domainName, $newPassword) { } public static function createCronjob($domainName, $cronjob) { } public static function deleteCronjob($domainName, $cronjob) { } public static function createMailBox($domainName, $mailBox) { } public static function modifyMailBox($domainName, $mailBox) { } public static function setMailBoxPassword($domainName, $mailBox, $newPassword) { } public static function deleteMailBox($domainName, $mailBox) { } public static function createMailForward($domainName, $mailForward) { } public static function modifyMailForward($domainName, $mailForward) { } public static function deleteMailForward($domainName, $mailForward) { } public static function createDatabase($domainName, $db) { } public static function modifyDatabase($domainName, $db) { } public static function setDatabasePassword($domainName, $db, $newPassword) { } public static function deleteDatabase($domainName, $db) { } public static function createSubdomain($domainName, $subDomain) { } public static function deleteSubdomain($domainName, $subDomain) { } } class Transip_DomainCheckResult { public $domainName = \NULL; public $status = \NULL; } class Transip_Tld { public $name = \NULL; public $price = \NULL; public $renewalPrice = \NULL; public $capabilities = \NULL; public $registrationPeriodLength = \NULL; public $cancelTimeFrame = \NULL; const CAPABILITY_REQUIRESAUTHCODE = "requiresAuthCode"; const CAPABILITY_CANREGISTER = "canRegister"; const CAPABILITY_CANTRANSFERWITHOWNERCHANGE = "canTransferWithOwnerChange"; const CAPABILITY_CANTRANSFERWITHOUTOWNERCHANGE = "canTransferWithoutOwnerChange"; const CAPABILITY_CANSETLOCK = "canSetLock"; const CAPABILITY_CANSETOWNER = "canSetOwner"; const CAPABILITY_CANSETCONTACTS = "canSetContacts"; const CAPABILITY_CANSETNAMESERVERS = "canSetNameservers"; } class Transip_Forward { public $domainName = \NULL; public $forwardTo = \NULL; public $forwardMethod = \NULL; public $frameTitle = \NULL; public $frameIcon = \NULL; public $forwardEverything = \NULL; public $forwardSubdomains = \NULL; public $forwardEmailTo = \NULL; const FORWARDMETHOD_DIRECT = "direct"; const FORWARDMETHOD_FRAME = "frame"; public function __construct($domainName, $forwardTo, $forwardMethod = "direct", $frameTitle = "", $frameIcon = "", $forwardEveryThing = \true, $forwardSubdomains = "", $forwardEmailTo = "") { } } class WHMCS_Nominet { public function __construct() { } public static function init($params) { } public function getLastError() { } public function setError($errmsg) { } public function getParam($key) { } public function getDomain() { } public function connect() { } public function getResponse() { } public function getResponseArray() { } public function getResultCode() { } public function isErrorCode() { } public function getErrorDesc() { } public function call($xml) { } public function login() { } public function connectAndLogin() { } public function escapeParam($param) { } } } namespace WHMCS\Module\Registrar\GoDaddy { class Client { protected $apiKey = ""; protected $apiSecret = ""; protected $sandboxMode = false; protected $apiVersion = 1; const URLS = array("sandbox" => "https://api.ote-godaddy.com/v", "live" => "https://api.godaddy.com/v"); const DATE_FORMAT = "Y-m-d\\TH:i:s.u\\Z"; public function __construct($apiKey, $apiSecret, $sandbox = false) { } public static function factory($apiKey, $apiSecret, $sandbox = false) { } protected function getApiKey() { } public function setApiKey($apiKey) { } protected function getApiSecret() { } public function setApiSecret($apiSecret) { } public function isSandboxMode() { } public function setSandboxMode($sandboxMode) { } protected function getUrl() { } protected function getAuth() { } protected function getDefaultOptions() { } public function setApiVersion($version = 1) { } } } namespace WHMCS\Module\Registrar\GoDaddy\Api { class Client { protected $client = NULL; protected $options = array(); public function __construct(array $options) { } protected function getClient() { } public function get($path, $params = array()) { } public function put($path, $params) { } public function post($path, $params) { } public function patch($path, $params) { } public function delete($path, $params) { } protected function handleErrors($response, $emptyJsonOk = false) { } protected function castBooleanValuesToStrings($query) { } } class Response { public $headers = NULL; public $status_code = NULL; public $body = NULL; public function __construct(\GuzzleHttp\Message\ResponseInterface $response) { } } } namespace WHMCS\Module\Registrar\GoDaddy { class Shopper { public static function findShopperId($userId, array $params) { } public static function create(array $params) { } } } namespace WHMCS\Module\Registrar\GoDaddy\Exception { class ApiException extends \WHMCS\Exception { } class MalformedResponseException extends \WHMCS\Exception { } } namespace { class NamecheapRegistrarApi { public static $url = "https://api.namecheap.com/xml.response"; public static $testUrl = "https://api.sandbox.namecheap.com/xml.response"; public function __construct($apiUser, $apiKey, $testMode = \true) { } /** * getLastUrl * @return string */ public function getLastUrl() { } /** * getLastParams * @return string */ public function getLastParams() { } /** * getLastResponse * @return string */ public function getLastResponse() { } /** * Parse the response into an array. * * @throws NamecheapRegistrarApiException * * @param string $response * * @return array */ public function parseResponse($response) { } /** * Send the request to the API * * @throws NamecheapRegistrarApiException * * @param string $command * @param array $params * * @return string */ public function request($command, array $params) { } /** * setTestMode * @param boolean $flag */ public function setTestMode($flag) { } public function parseResultSyncHelper($items, $domainNameKey = "DomainName") { } } class NamecheapRegistrarApiException extends \Exception { } class NamecheapRegistrarIDNA { public function __construct($sld, $tld) { } public function getIdnCode($param) { } public function sldWasEncoded() { } public function getEncodedSld() { } public function getCodeOptions() { } public function getTldList() { } } class Net_IDNA2 { // }}} // {{{ constructor /** * Constructor * * @param array $options Options to initialise the object with * * @access public * @see setParams() */ public function __construct($options = \null) { } // }}} /** * Sets a new option value. Available options and values: * * [utf8 - Use either UTF-8 or ISO-8859-1 as input (true for UTF-8, false * otherwise); The output is always UTF-8] * [overlong - Unicode does not allow unnecessarily long encodings of chars, * to allow this, set this parameter to true, else to false; * default is false.] * [strict - true: strict mode, good for registration purposes - Causes errors * on failures; false: loose mode, ideal for "wildlife" applications * by silently ignoring errors and returning the original input instead] * * @throws InvalidArgumentException * * @param string|array $option Parameter to set (string: single parameter; array of Parameter => Value pairs) * @param boolean $value Value to use (if parameter 1 is a string) * * @return boolean true on success, false otherwise * @access public */ public function setParams($option, $value = \false) { } /** * Encode a given UTF-8 domain name. * * @param string $decoded Domain name (UTF-8 or UCS-4) * @param boolean $one_time_encoding Desired input encoding, see {@link set_parameter} * If not given will use default-encoding * * @return string Encoded Domain name (ACE string) * @return mixed processed string * @throws InvalidArgumentException * @access public */ public function encode($decoded, $one_time_encoding = \false) { } /** * Decode a given ACE domain name. * * @param string $input Domain name (ACE string) * @param bool $one_time_encoding Desired output encoding, see {@link set_parameter} * * @return array|string Decoded Domain name (UTF-8 or UCS-4) * @throws InvalidArgumentException * @access public */ public function decode($input, $one_time_encoding = \false) { } // }}}} // {{{ factory /** * Attempts to return a concrete IDNA instance for either php4 or php5. * * @param array $params Set of paramaters * * @return Net_IDNA2 * @access public */ function getInstance($params = array()) { } // }}} // {{{ singleton /** * Attempts to return a concrete IDNA instance for either php4 or php5, * only creating a new instance if no IDNA instance with the same * parameters currently exists. * * @param array $params Set of paramaters * * @return object Net_IDNA2 * @access public */ function singleton($params = array()) { } // }}} } } namespace WHMCS\Module\Registrar\Enom { class ApiInterface { protected $PostString = ""; protected $RawData = ""; public $Values = array(); public function NewRequest() { } protected function AddError($error) { } protected function ParseResponse($buffer) { } public function AddParam($Name, $Value) { } public function DoTransaction(array $params, $processResponse = true) { } protected function getActionFromQuery($query) { } public function parseXMLResponseToArray($priority = "value") { } protected function doParseXMLToArray($contents, $get_attributes = 1, $priority = "value") { } } } namespace { abstract class TPPW_API { protected $url = \NULL; protected $params = \NULL; protected static $sessionId = \false; protected function __construct($script, $params) { } protected function getPostParams($object, $action) { } protected function execute($postParams, $existingSession = \true) { } protected function getDomain() { } protected function getTLD() { } protected function getClientId() { } } class TPPW_AuthAPI extends \TPPW_API { public function __construct($params) { } public function authenticate($accountNo, $userId, $password) { } } class TPPW_QueryAPI extends \TPPW_API { public static $domainWhois = \false; public function __construct($params) { } public function domainWhois() { } public function domainSync($domains = \NULL) { } public function domainPassword($domains) { } public function accountInfo() { } public function orderStatus($workflow = \true) { } public function checkTransferability() { } } class TPPW_ResourceAPI extends \TPPW_API { public function __construct($params) { } public function domainAdd() { } public function domainUpgrade() { } public function domainSuspendProduct() { } public function domainUnSuspendProduct() { } public function domainCancelProduct() { } } class TPPW_OrderAPI extends \TPPW_API { public function __construct($params) { } public function domainRegister() { } public function domainRenewal() { } public function domainTransfer() { } public function domainDelegation() { } public function domainLock() { } public function hostCreate() { } public function hostUpdate() { } public function hostRemove() { } public function contactsUpdate() { } } class TPPW_APIResult { public function __construct($response) { } public function getResponse() { } public function isSuccess() { } public function getParams($prefix) { } public function get($key) { } public function getArray($key) { } public function getModuleResults() { } public function getModuleError() { } public function getModuleErrorCode() { } } class TPPW_APIUtils { public static $BRAND_NAME = "TPP Wholesale"; public static $MODULE_NAME = "tppwregistrar"; public static $API_IP = "114.141.204.99"; public static $API_HOST = "theconsole.tppwholesale.com.au"; public static $API_PATH = "/api/"; public static $URL_SUPPORT = "http://www.tppwholesale.com.au/support/category/getting-started/whmcs"; public static $API_COMMON_PARAMS = array("Requester" => "WHMCS", "Version" => "2.4", "Type" => "Domains"); public static $ERROR_UNKNOWN = "Unknown error occurred"; public static $ERROR_CODES = array("100" => "Missing parameters", "102" => "Authentication failed", "105" => "Request is coming from incorrect IP address", "202" => "Invalid API Type", "203" => "API call has not been implemented yet", "301" => "Invalid order ID", "302" => "Domain name is either invalid or not supplied", "303" => "Domain prices are not setted up", "304" => "Domain registration failed", "305" => "Domain renewal failed", "306" => "Domain transfer failed", "307" => "Incorrect auth code provided", "309" => "Invalid domain extension", "311" => "Domain does not exist in your reseller account", "312" => "Invalid username/password", "313" => "Account does not exist in your reseller profile", "401" => "Failed to connect to registry, please retry", "500" => "Prepaid account does not have enough funds to cover the cost of this order", "501" => "Invalid credit card type", "502" => "Invalid credit card number", "503" => "Invalid credit card expiry date", "505" => "Credit card transaction failed", "600" => "Failed to create/update contact", "601" => "Failed to create order", "602" => "Invalid hosts supplied", "603" => "Invalid eligibility fields supplied", "604" => "Invalid IP Address", "610" => "Failed to connect to registry, please retry", "611" => "Domain renewal/transfer failed", "612" => "Locking is not available for this domain", "614" => "Failed to lock/unlock domain", "615" => "Domain delegation failed", "700" => "Invalid Product", "701" => "Domain already exists", "888" => "Order is still being processed. Current Status", "889" => "No OrderID for this domain name was found"); public static $CONTACT_TYPES = array("Owner" => "Registrant", "Administration" => "Admin", "Technical" => "Tech", "Billing" => "Billing"); public static $CHECK_PERIOD_BEFORE_XFER = array("com.au", "net.au", "org.au", "asn.au", "id.au"); public static $CONTACT_FIELDS = array("FirstName" => "firstname", "LastName" => "lastname", "Address1" => "address1", "Address2" => "address2", "City" => "city", "Region" => "state", "PostalCode" => "postcode", "CountryCode" => "country", "Email" => "email", "PhoneNumber" => "phonenumber"); public static $TRANSFORM_CONTACT_FIELDS = array("First Name" => "FirstName", "Last Name" => "LastName", "Address 1" => "Address1", "Address 2" => "Address2", "Postcode" => "PostalCode", "Country" => "CountryCode", "Phone Number" => "PhoneNumber", "Organisation Name" => "OrganisationName", "Email Address" => "Email"); public static $ASIA_LEGAL_TYPES = array("naturalPerson" => "naturalPerson", "corporation" => "corporation", "cooperative" => "cooperative", "partnership" => "partnership", "government" => "government", "politicalParty" => "politicalParty", "society" => "society", "institution" => "institution"); public static $ASIA_IDENTITY_FORMS = array("passport" => "passport", "politicalPartyRegistry" => "politicalPartyRegistry", "societyRegistry" => "societiesRegistry", "legislation" => "legislation", "certificate" => "certificate"); public static $ELIGIBILITY_ID_TYPES = array("ACN" => 1, "ACT BN" => 2, "NSW BN" => 3, "NT BN" => 4, "QLD BN" => 5, "SA BN" => 6, "TAS BN" => 7, "VIC BN" => 8, "WA BN" => 9, "Trademark" => 10, "Other" => 11, "ABN" => 12, "Australian Company Number (ACN)" => 1, "ACT Business Number" => 2, "NSW Business Number" => 3, "NT Business Number" => 4, "QLD Business Number" => 5, "SA Business Number" => 6, "TAS Business Number" => 7, "VIC Business Number" => 8, "WA Business Number" => 9, "Trademark (TM)" => 10, "Other - Used to record an Incorporated Association number" => 11, "Australian Business Number (ABN)" => 12, "Business Registration Number" => 11); public static $ELIGIBILITY_TYPES = array("Charity" => 1, "Citizen/Resident" => 2, "Club" => 3, "Commercial Statutory Body" => 4, "Company" => 5, "Incorporated Association" => 6, "Industry Body" => 8, "Non-profit Organisation" => 9, "Other" => 10, "Partnership" => 11, "Pending TM Owner" => 12, "Political Party" => 13, "Registered Business" => 14, "Religious/Church Group" => 15, "Sole Trader" => 16, "Trade Union" => 17, "Trademark Owner" => 18, "Child Care Centre" => 19, "Government School" => 20, "Higher Education Institution" => 21, "National Body" => 22, "Non-Government School" => 23, "Pre-school" => 24, "Research Organisation" => 25, "Training Organisation" => 26); public static $ELIGIBILITY_REASONS = array("Domain name is an Exact Match Abbreviation or Acronym of your Entity or Trading Name." => 1, "Close and substantial connection between the domain name and the operations of your Entity." => 2); public static function getValue($array, $key, $defaultValue) { } public static function getValueConverted($array, $key, $valueMap, $defaultValue = \false) { } public static function getWorkflowID($domainID) { } public static function setWorkflowID($domainID, $wfID) { } } } namespace M101Domain { class DomainFields { public static $m101domain_fieldconfig = NULL; public static function init() { } } class Domain { public $name = NULL; public $status = array(); public $registrant = NULL; public $contacts = array(); public $ns = array(); public $cr_date = NULL; public $up_date = NULL; public $ex_date = NULL; public $key = NULL; protected $lockedStatuses = array("clientTransferProhibited", "clientHold", "serverTransferProhibited", "serverHold"); public function isLocked() { } } class Host { public $name = NULL; public $v4 = array(); public $v6 = array(); public $cr_date = NULL; public $cr_id = NULL; } class Contact { public $handle = NULL; public $first_name = NULL; public $last_name = NULL; public $company = NULL; public $address1 = NULL; public $address2 = NULL; public $address3 = NULL; public $city = NULL; public $state = NULL; public $postal = NULL; public $country = NULL; public $email = NULL; public $phone = NULL; public $phone_ext = NULL; public $fax = NULL; public $fax_ext = NULL; public static $labels = array("first_name" => "First Name", "last_name" => "Last Name", "company" => "Company", "address1" => "Address 1", "address2" => "Address 2", "address3" => "Address 3", "city" => "City", "state" => "State or Province", "postal" => "Postal Code", "country" => "Country Code", "email" => "Email Address", "phone" => "Phone", "phone_ext" => "Phone Ext", "fax" => "Fax", "fax_ext" => "Fax Extension"); public function normalize() { } } } namespace M101Domain\Exception { class Error extends \Exception { } } namespace M101Domain { class Result { public $error_code = NULL; public $error_message = NULL; public $reason = array(); public $resData = NULL; public $extension = NULL; public $xml = NULL; } class Cache { public static $cache = array(); } } namespace { class ComposerAutoloaderInit323f23780403defe5009107249f44a2f { public static function loadClassLoader($class) { } public static function getLoader() { } } } namespace Yubico\Auth { /** * Class for verifying Yubico One-Time-Passcodes * * @category Auth * @package Auth_Yubico * @author Simon Josefsson , Olov Danielson * @copyright 2007-2015 Yubico AB * @license https://opensource.org/licenses/bsd-license.php New BSD License * @version 2.0 * @link https://www.yubico.com/ * * Updated by WHMCS: * [2018-12-21] * * Include copy of BSD license as provided in source library's COPYING file * * Format code for PSR-1 & PSR-2 conformity * * Rename, relocate, and namespace class for PSR-4 compatibility * * Remove reliance on PEAR; never returns a PEAR_ERROR instance * * Always throw exceptions for errors or failed verification * * Update class docblock (namely usage example; leave @ annotations as-is for now) * * Correct method docblock annotations; remove "@access" annotations * * Remove legacy constructor arg for HTTPS * * Class for verifying Yubico One-Time-Passcodes * * @example * * require_once 'Auth/Yubico.php'; * $otp = "ccbbddeertkrctjkkcglfndnlihhnvekchkcctif"; * * # Generate a new id+key from https://api.yubico.com/get-api-key/ * $yubi = new \Yubico\Auth\Otp('42', 'FOOBAR='); * try { * $auth = $yubi->verify($otp); * print "

You are authenticated!"; * } catch (\Exception $e) { * print "

Authentication failed: " . $e->getMessage(); * print "

Debug output from server: " . $yubi->getLastResponse(); * } * */ class Otp { /** * Status response values * * @link https://developers.yubico.com/OTP/Specifications/OTP_validation_protocol.html */ const STATUS_REPLAYED_OTP = 'REPLAYED_OTP'; const STATUS_OK = 'OK'; const STATUS_BAD_OTP = 'BAD_OTP'; const STATUS_BAD_SIGNATURE = 'BAD_SIGNATURE'; const STATUS_MISSING_PARAMETER = 'MISSING_PARAMETER'; const STATUS_NO_SUCH_CLIENT = 'NO_SUCH_CLIENT'; const STATUS_OPERATION_NOT_ALLOWED = 'OPERATION_NOT_ALLOWED'; const STATUS_BACKEND_ERROR = 'BACKEND_ERROR'; const STATUS_NOT_ENOUGH_ANSWERS = 'NOT_ENOUGH_ANSWERS'; const STATUS_REPLAYED_REQUEST = 'REPLAYED_REQUEST'; /** * Constructor * * Sets up the object * @param string $id The client identity * @param string $key The client MAC key (optional) * @param boolean $httpsverify Flag whether to use verify HTTPS * server certificates (optional, * default true) */ public function __construct($id, $key = '', $httpsverify = true) { } /** * @param string $message * @return mixed */ protected function raiseError($message) { } /** * Specify to use a different URL part for verification. * The default is "api.yubico.com/wsapi/verify". * * @param string $url New server URL part to use */ public function setURLpart($url) { } /** * Get next URL part from list to use for validation. * * @return mixed string with URL part of false if no more URLs in list */ public function getNextURLpart() { } /** * Resets index to URL list */ public function URLreset() { } /** * Add another URLpart. * * @param string $URLpart */ public function addURLpart($URLpart) { } /** * Return the last query sent to the server, if any. * * @return string Request to server */ public function getLastQuery() { } /** * Return the last data received from the server, if any. * * @return string Output from server */ public function getLastResponse() { } /** * Parse input string into password, yubikey prefix, * ciphertext, and OTP. * * @param string Input string to parse * @param string Optional delimiter re-class, default is '[:]' * @return array|false Keyed array with fields */ public static function parsePasswordOTP($str, $delim = '[:]') { } /** * Parse parameters from last response * * example: getParameters("timestamp", "sessioncounter", "sessionuse"); * * @param array @parameters Array with strings representing * parameters to parse * @return array parameter array from last response */ public function getParameters($parameters) { } /** * Verify Yubico OTP against multiple URLs * Protocol specification 2.0 is used to construct validation requests * * @param string $token Yubico OTP * @param int $use_timestamp 1=>send request with ×tamp=1 to * get timestamp and session information * in the response * @param boolean $wait_for_all If true, wait until all * servers responds (for debugging) * @param string $sl Sync level in percentage between 0 * and 100 or "fast" or "secure". * @param int $timeout Max number of seconds to wait * for responses * @return mixed PEAR error on error, true otherwise */ public function verify($token, $use_timestamp = null, $wait_for_all = false, $sl = null, $timeout = null) { } } } namespace { class MyOauth { public $twoFactorAuthentication = \NULL; public function setTokenData($token) { } public function getData($username) { } public function putData($username, $data) { } public function getUsers() { } } abstract class GoogleAuthenticator { public function __construct($totpskew = 1, $hotpskew = 10, $hotphuntvalue = 200000) { } public abstract function getData($username); public abstract function putData($username, $data); public abstract function getUsers(); public function createEmptyData() { } public function internalGetData($username) { } public function internalPutData($username, $data) { } public function setTokenType($username, $tokentype) { } public function setUser($username, $ttype = "HOTP", $key = "", $hexkey = "") { } public function hasToken($username) { } public function setUserKey($username, $key) { } public function deleteUser($username) { } public function authenticateUser($username, $code) { } public function resyncCode($username, $code1, $code2) { } public function getErrorText() { } public function createURL($user) { } public function createBase32Key() { } public function getKey($username) { } public function getTokenType($username) { } public function helperb322hex($b32) { } public function helperhex2b32($hex) { } public function oath_hotp($key, $counter) { } public function oath_truncate($hash, $length = 6) { } } class qrstr { public static function set(&$srctab, $x, $y, $repl, $replLen = \false) { } } // maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images //---- qrtools.php ----------------------------- /* * PHP QR Code encoder * * Toolset, handy and debug utilites. * * PHP QR Code is distributed under LGPL 3 * Copyright (C) 2010 Dominik Dzienia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class QRtools { //---------------------------------------------------------------------- public static function binarize($frame) { } //---------------------------------------------------------------------- public static function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') { } //---------------------------------------------------------------------- public static function clearCache() { } //---------------------------------------------------------------------- public static function buildCache() { } //---------------------------------------------------------------------- public static function log($outfile, $err) { } //---------------------------------------------------------------------- public static function dumpMask($frame) { } //---------------------------------------------------------------------- public static function markTime($markerId) { } //---------------------------------------------------------------------- public static function timeBenchmark() { } } class QRspec { public static $capacity = array( array(0, 0, 0, array(0, 0, 0, 0)), array(21, 26, 0, array(7, 10, 13, 17)), // 1 array(25, 44, 7, array(10, 16, 22, 28)), array(29, 70, 7, array(15, 26, 36, 44)), array(33, 100, 7, array(20, 36, 52, 64)), array(37, 134, 7, array(26, 48, 72, 88)), // 5 array(41, 172, 7, array(36, 64, 96, 112)), array(45, 196, 0, array(40, 72, 108, 130)), array(49, 242, 0, array(48, 88, 132, 156)), array(53, 292, 0, array(60, 110, 160, 192)), array(57, 346, 0, array(72, 130, 192, 224)), //10 array(61, 404, 0, array(80, 150, 224, 264)), array(65, 466, 0, array(96, 176, 260, 308)), array(69, 532, 0, array(104, 198, 288, 352)), array(73, 581, 3, array(120, 216, 320, 384)), array(77, 655, 3, array(132, 240, 360, 432)), //15 array(81, 733, 3, array(144, 280, 408, 480)), array(85, 815, 3, array(168, 308, 448, 532)), array(89, 901, 3, array(180, 338, 504, 588)), array(93, 991, 3, array(196, 364, 546, 650)), array(97, 1085, 3, array(224, 416, 600, 700)), //20 array(101, 1156, 4, array(224, 442, 644, 750)), array(105, 1258, 4, array(252, 476, 690, 816)), array(109, 1364, 4, array(270, 504, 750, 900)), array(113, 1474, 4, array(300, 560, 810, 960)), array(117, 1588, 4, array(312, 588, 870, 1050)), //25 array(121, 1706, 4, array(336, 644, 952, 1110)), array(125, 1828, 4, array(360, 700, 1020, 1200)), array(129, 1921, 3, array(390, 728, 1050, 1260)), array(133, 2051, 3, array(420, 784, 1140, 1350)), array(137, 2185, 3, array(450, 812, 1200, 1440)), //30 array(141, 2323, 3, array(480, 868, 1290, 1530)), array(145, 2465, 3, array(510, 924, 1350, 1620)), array(149, 2611, 3, array(540, 980, 1440, 1710)), array(153, 2761, 3, array(570, 1036, 1530, 1800)), array(157, 2876, 0, array(570, 1064, 1590, 1890)), //35 array(161, 3034, 0, array(600, 1120, 1680, 1980)), array(165, 3196, 0, array(630, 1204, 1770, 2100)), array(169, 3362, 0, array(660, 1260, 1860, 2220)), array(173, 3532, 0, array(720, 1316, 1950, 2310)), array(177, 3706, 0, array(750, 1372, 2040, 2430)), ); //---------------------------------------------------------------------- public static function getDataLength($version, $level) { } //---------------------------------------------------------------------- public static function getECCLength($version, $level) { } //---------------------------------------------------------------------- public static function getWidth($version) { } //---------------------------------------------------------------------- public static function getRemainder($version) { } //---------------------------------------------------------------------- public static function getMinimumVersion($size, $level) { } //###################################################################### public static $lengthTableBits = array(array(10, 12, 14), array(9, 11, 13), array(8, 16, 16), array(8, 10, 12)); //---------------------------------------------------------------------- public static function lengthIndicator($mode, $version) { } //---------------------------------------------------------------------- public static function maximumWords($mode, $version) { } // Error correction code ----------------------------------------------- // Table of the error correction code (Reed-Solomon block) // See Table 12-16 (pp.30-36), JIS X0510:2004. public static $eccTable = array( array(array(0, 0), array(0, 0), array(0, 0), array(0, 0)), array(array(1, 0), array(1, 0), array(1, 0), array(1, 0)), // 1 array(array(1, 0), array(1, 0), array(1, 0), array(1, 0)), array(array(1, 0), array(1, 0), array(2, 0), array(2, 0)), array(array(1, 0), array(2, 0), array(2, 0), array(4, 0)), array(array(1, 0), array(2, 0), array(2, 2), array(2, 2)), // 5 array(array(2, 0), array(4, 0), array(4, 0), array(4, 0)), array(array(2, 0), array(4, 0), array(2, 4), array(4, 1)), array(array(2, 0), array(2, 2), array(4, 2), array(4, 2)), array(array(2, 0), array(3, 2), array(4, 4), array(4, 4)), array(array(2, 2), array(4, 1), array(6, 2), array(6, 2)), //10 array(array(4, 0), array(1, 4), array(4, 4), array(3, 8)), array(array(2, 2), array(6, 2), array(4, 6), array(7, 4)), array(array(4, 0), array(8, 1), array(8, 4), array(12, 4)), array(array(3, 1), array(4, 5), array(11, 5), array(11, 5)), array(array(5, 1), array(5, 5), array(5, 7), array(11, 7)), //15 array(array(5, 1), array(7, 3), array(15, 2), array(3, 13)), array(array(1, 5), array(10, 1), array(1, 15), array(2, 17)), array(array(5, 1), array(9, 4), array(17, 1), array(2, 19)), array(array(3, 4), array(3, 11), array(17, 4), array(9, 16)), array(array(3, 5), array(3, 13), array(15, 5), array(15, 10)), //20 array(array(4, 4), array(17, 0), array(17, 6), array(19, 6)), array(array(2, 7), array(17, 0), array(7, 16), array(34, 0)), array(array(4, 5), array(4, 14), array(11, 14), array(16, 14)), array(array(6, 4), array(6, 14), array(11, 16), array(30, 2)), array(array(8, 4), array(8, 13), array(7, 22), array(22, 13)), //25 array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), array(array(8, 4), array(22, 3), array(8, 26), array(12, 28)), array(array(3, 10), array(3, 23), array(4, 31), array(11, 31)), array(array(7, 7), array(21, 7), array(1, 37), array(19, 26)), array(array(5, 10), array(19, 10), array(15, 25), array(23, 25)), //30 array(array(13, 3), array(2, 29), array(42, 1), array(23, 28)), array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), //35 array(array(6, 14), array(6, 34), array(46, 10), array(2, 64)), array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), array(array(4, 18), array(13, 32), array(48, 14), array(42, 32)), array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)), ); //---------------------------------------------------------------------- // CACHEABLE!!! public static function getEccSpec($version, $level, array &$spec) { } // Alignment pattern --------------------------------------------------- // Positions of alignment patterns. // This array includes only the second and the third position of the // alignment patterns. Rest of them can be calculated from the distance // between them. // See Table 1 in Appendix E (pp.71) of JIS X0510:2004. public static $alignmentPattern = array( array(0, 0), array(0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), //11-15 array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), //16-20 array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), //21-25 array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), //26-30 array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), //31-35 array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58), ); /** -------------------------------------------------------------------- * Put an alignment marker. * @param frame * @param width * @param ox,oy center coordinate of the pattern */ public static function putAlignmentMarker(array &$frame, $ox, $oy) { } //---------------------------------------------------------------------- public static function putAlignmentPattern($version, &$frame, $width) { } // Version information pattern ----------------------------------------- // Version information pattern (BCH coded). // See Table 1 in Appendix D (pp.68) of JIS X0510:2004. // size: [QRSPEC_VERSION_MAX - 6] public static $versionPattern = array(0x7c94, 0x85bc, 0x9a99, 0xa4d3, 0xbbf6, 0xc762, 0xd847, 0xe60d, 0xf928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, 0x27541, 0x28c69); //---------------------------------------------------------------------- public static function getVersionPattern($version) { } // Format information -------------------------------------------------- // See calcFormatInfo in tests/test_qrspec.c (orginal qrencode c lib) public static $formatInfo = array(array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x762, 0x255, 0xd0c, 0x83b)); public static function getFormatInfo($mask, $level) { } // Frame --------------------------------------------------------------- // Cache of initial frames. public static $frames = array(); /** -------------------------------------------------------------------- * Put a finder pattern. * @param frame * @param width * @param ox,oy upper-left coordinate of the pattern */ public static function putFinderPattern(&$frame, $ox, $oy) { } //---------------------------------------------------------------------- public static function createFrame($version) { } //---------------------------------------------------------------------- public static function debug($frame, $binary_mode = \false) { } //---------------------------------------------------------------------- public static function serial($frame) { } //---------------------------------------------------------------------- public static function unserial($code) { } //---------------------------------------------------------------------- public static function newFrame($version) { } //---------------------------------------------------------------------- public static function rsBlockNum($spec) { } public static function rsBlockNum1($spec) { } public static function rsDataCodes1($spec) { } public static function rsEccCodes1($spec) { } public static function rsBlockNum2($spec) { } public static function rsDataCodes2($spec) { } public static function rsEccCodes2($spec) { } public static function rsDataLength($spec) { } public static function rsEccLength($spec) { } } class QRimage { //---------------------------------------------------------------------- public static function png($frame, $filename = \false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = \FALSE) { } //---------------------------------------------------------------------- public static function jpg($frame, $filename = \false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) { } } class QRinputItem { public $mode; public $size; public $data; public $bstream; public function __construct($mode, $size, $data, $bstream = \null) { } //---------------------------------------------------------------------- public function encodeModeNum($version) { } //---------------------------------------------------------------------- public function encodeModeAn($version) { } //---------------------------------------------------------------------- public function encodeMode8($version) { } //---------------------------------------------------------------------- public function encodeModeKanji($version) { } //---------------------------------------------------------------------- public function encodeModeStructure() { } //---------------------------------------------------------------------- public function estimateBitStreamSizeOfEntry($version) { } //---------------------------------------------------------------------- public function encodeBitStream($version) { } } //########################################################################## class QRinput { public $items; //---------------------------------------------------------------------- public function __construct($version = 0, $level = \QR_ECLEVEL_L) { } //---------------------------------------------------------------------- public function getVersion() { } //---------------------------------------------------------------------- public function setVersion($version) { } //---------------------------------------------------------------------- public function getErrorCorrectionLevel() { } //---------------------------------------------------------------------- public function setErrorCorrectionLevel($level) { } //---------------------------------------------------------------------- public function appendEntry(\QRinputItem $entry) { } //---------------------------------------------------------------------- public function append($mode, $size, $data) { } //---------------------------------------------------------------------- public function insertStructuredAppendHeader($size, $index, $parity) { } //---------------------------------------------------------------------- public function calcParity() { } //---------------------------------------------------------------------- public static function checkModeNum($size, $data) { } //---------------------------------------------------------------------- public static function estimateBitsModeNum($size) { } //---------------------------------------------------------------------- public static $anTable = array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); //---------------------------------------------------------------------- public static function lookAnTable($c) { } //---------------------------------------------------------------------- public static function checkModeAn($size, $data) { } //---------------------------------------------------------------------- public static function estimateBitsModeAn($size) { } //---------------------------------------------------------------------- public static function estimateBitsMode8($size) { } //---------------------------------------------------------------------- public static function estimateBitsModeKanji($size) { } //---------------------------------------------------------------------- public static function checkModeKanji($size, $data) { } /*********************************************************************** * Validation **********************************************************************/ public static function check($mode, $size, $data) { } //---------------------------------------------------------------------- public function estimateBitStreamSize($version) { } //---------------------------------------------------------------------- public function estimateVersion() { } //---------------------------------------------------------------------- public static function lengthOfCode($mode, $version, $bits) { } //---------------------------------------------------------------------- public function createBitStream() { } //---------------------------------------------------------------------- public function convertData() { } //---------------------------------------------------------------------- public function appendPaddingBit(&$bstream) { } //---------------------------------------------------------------------- public function mergeBitStream() { } //---------------------------------------------------------------------- public function getBitStream() { } //---------------------------------------------------------------------- public function getByteStream() { } } //---- qrbitstream.php ----------------------------- /* * PHP QR Code encoder * * Bitstream class * * Based on libqrencode C library distributed under LGPL 2.1 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi * * PHP QR Code is distributed under LGPL 3 * Copyright (C) 2010 Dominik Dzienia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class QRbitstream { public $data = array(); //---------------------------------------------------------------------- public function size() { } //---------------------------------------------------------------------- public function allocate($setLength) { } //---------------------------------------------------------------------- public static function newFromNum($bits, $num) { } //---------------------------------------------------------------------- public static function newFromBytes($size, $data) { } //---------------------------------------------------------------------- public function append(\QRbitstream $arg) { } //---------------------------------------------------------------------- public function appendNum($bits, $num) { } //---------------------------------------------------------------------- public function appendBytes($size, $data) { } //---------------------------------------------------------------------- public function toByte() { } } //---- qrsplit.php ----------------------------- /* * PHP QR Code encoder * * Input splitting classes * * Based on libqrencode C library distributed under LGPL 2.1 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi * * PHP QR Code is distributed under LGPL 3 * Copyright (C) 2010 Dominik Dzienia * * The following data / specifications are taken from * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) * or * "Automatic identification and data capture techniques -- * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class QRsplit { public $dataStr = ''; public $input; public $modeHint; //---------------------------------------------------------------------- public function __construct($dataStr, $input, $modeHint) { } //---------------------------------------------------------------------- public static function isdigitat($str, $pos) { } //---------------------------------------------------------------------- public static function isalnumat($str, $pos) { } //---------------------------------------------------------------------- public function identifyMode($pos) { } //---------------------------------------------------------------------- public function eatNum() { } //---------------------------------------------------------------------- public function eatAn() { } //---------------------------------------------------------------------- public function eatKanji() { } //---------------------------------------------------------------------- public function eat8() { } //---------------------------------------------------------------------- public function splitString() { } //---------------------------------------------------------------------- public function toUpper() { } //---------------------------------------------------------------------- public static function splitStringToQRinput($string, \QRinput $input, $modeHint, $casesensitive = \true) { } } //---- qrrscode.php ----------------------------- /* * PHP QR Code encoder * * Reed-Solomon error correction support * * Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q * (libfec is released under the GNU Lesser General Public License.) * * Based on libqrencode C library distributed under LGPL 2.1 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi * * PHP QR Code is distributed under LGPL 3 * Copyright (C) 2010 Dominik Dzienia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class QRrsItem { public $mm; // Bits per symbol public $nn; // Symbols per block (= (1< * * PHP QR Code is distributed under LGPL 3 * Copyright (C) 2010 Dominik Dzienia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class QRrsblock { public $dataLength; public $data = array(); public $eccLength; public $ecc = array(); public function __construct($dl, $data, $el, &$ecc, \QRrsItem $rs) { } } //########################################################################## class QRrawcode { public $version; public $datacode = array(); public $ecccode = array(); public $blocks; public $rsblocks = array(); //of RSblock public $count; public $dataLength; public $eccLength; public $b1; //---------------------------------------------------------------------- public function __construct(\QRinput $input) { } //---------------------------------------------------------------------- public function init(array $spec) { } //---------------------------------------------------------------------- public function getCode() { } } //########################################################################## class QRcode { public $version; public $width; public $data; //---------------------------------------------------------------------- public function encodeMask(\QRinput $input, $mask) { } //---------------------------------------------------------------------- public function encodeInput(\QRinput $input) { } //---------------------------------------------------------------------- public function encodeString8bit($string, $version, $level) { } //---------------------------------------------------------------------- public function encodeString($string, $version, $level, $hint, $casesensitive) { } //---------------------------------------------------------------------- public static function png($text, $outfile = \false, $level = \QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint = \false) { } //---------------------------------------------------------------------- public static function text($text, $outfile = \false, $level = \QR_ECLEVEL_L, $size = 3, $margin = 4) { } //---------------------------------------------------------------------- public static function raw($text, $outfile = \false, $level = \QR_ECLEVEL_L, $size = 3, $margin = 4) { } } //########################################################################## class FrameFiller { public $width; public $frame; public $x; public $y; public $dir; public $bit; //---------------------------------------------------------------------- public function __construct($width, &$frame) { } //---------------------------------------------------------------------- public function setFrameAt($at, $val) { } //---------------------------------------------------------------------- public function getFrameAt($at) { } //---------------------------------------------------------------------- public function next() { } } //########################################################################## class QRencode { public $casesensitive = \true; public $eightbit = \false; public $version = 0; public $size = 3; public $margin = 4; public $structured = 0; // not supported yet public $level = \QR_ECLEVEL_L; public $hint = \QR_MODE_8; //---------------------------------------------------------------------- public static function factory($level = \QR_ECLEVEL_L, $size = 3, $margin = 4) { } //---------------------------------------------------------------------- public function encodeRAW($intext, $outfile = \false) { } //---------------------------------------------------------------------- public function encode($intext, $outfile = \false) { } //---------------------------------------------------------------------- public function encodePNG($intext, $outfile = \false, $saveandprint = \false) { } } } namespace Carbon { /** * A simple API extension for DateInterval. * The implemenation provides helpers to handle weeks but only days are saved. * Weeks are calculated based on the total days of the current instance. * * @property int $years Total years of the current interval. * @property int $months Total months of the current interval. * @property int $weeks Total weeks of the current interval calculated from the days. * @property int $dayz Total days of the current interval (weeks * 7 + days). * @property int $hours Total hours of the current interval. * @property int $minutes Total minutes of the current interval. * @property int $seconds Total seconds of the current interval. * * @property-read integer $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). * @property-read integer $daysExcludeWeeks alias of dayzExcludeWeeks * * @method static CarbonInterval years($years = 1) Create instance specifying a number of years. * @method static CarbonInterval year($years = 1) Alias for years() * @method static CarbonInterval months($months = 1) Create instance specifying a number of months. * @method static CarbonInterval month($months = 1) Alias for months() * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks. * @method static CarbonInterval week($weeks = 1) Alias for weeks() * @method static CarbonInterval days($days = 1) Create instance specifying a number of days. * @method static CarbonInterval dayz($days = 1) Alias for days() * @method static CarbonInterval day($days = 1) Alias for days() * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours. * @method static CarbonInterval hour($hours = 1) Alias for hours() * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes. * @method static CarbonInterval minute($minutes = 1) Alias for minutes() * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds. * @method static CarbonInterval second($seconds = 1) Alias for seconds() * @method CarbonInterval years() years($years = 1) Set the years portion of the current interval. * @method CarbonInterval year() year($years = 1) Alias for years(). * @method CarbonInterval months() months($months = 1) Set the months portion of the current interval. * @method CarbonInterval month() month($months = 1) Alias for months(). * @method CarbonInterval weeks() weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value. * @method CarbonInterval week() week($weeks = 1) Alias for weeks(). * @method CarbonInterval days() days($days = 1) Set the days portion of the current interval. * @method CarbonInterval dayz() dayz($days = 1) Alias for days(). * @method CarbonInterval day() day($days = 1) Alias for days(). * @method CarbonInterval hours() hours($hours = 1) Set the hours portion of the current interval. * @method CarbonInterval hour() hour($hours = 1) Alias for hours(). * @method CarbonInterval minutes() minutes($minutes = 1) Set the minutes portion of the current interval. * @method CarbonInterval minute() minute($minutes = 1) Alias for minutes(). * @method CarbonInterval seconds() seconds($seconds = 1) Set the seconds portion of the current interval. * @method CarbonInterval second() second($seconds = 1) Alias for seconds(). */ class CarbonInterval extends \DateInterval { /** * Interval spec period designators */ const PERIOD_PREFIX = 'P'; const PERIOD_YEARS = 'Y'; const PERIOD_MONTHS = 'M'; const PERIOD_DAYS = 'D'; const PERIOD_TIME_PREFIX = 'T'; const PERIOD_HOURS = 'H'; const PERIOD_MINUTES = 'M'; const PERIOD_SECONDS = 'S'; /** * A translator to ... er ... translate stuff * * @var TranslatorInterface */ protected static $translator; /** * Before PHP 5.4.20/5.5.4 instead of FALSE days will be set to -99999 when the interval instance * was created by DateTime:diff(). */ const PHP_DAYS_FALSE = -99999; /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Create a new CarbonInterval instance. * * @param int $years * @param int $months * @param int $weeks * @param int $days * @param int $hours * @param int $minutes * @param int $seconds */ public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) { } /** * Create a new CarbonInterval instance from specific values. * This is an alias for the constructor that allows better fluent * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than * (new CarbonInterval(1))->fn(). * * @param int $years * @param int $months * @param int $weeks * @param int $days * @param int $hours * @param int $minutes * @param int $seconds * * @return static */ public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) { } /** * Provide static helpers to create instances. Allows CarbonInterval::years(3). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $name * @param array $args * * @return static */ public static function __callStatic($name, $args) { } /** * Create a CarbonInterval instance from a DateInterval one. Can not instance * DateInterval objects created from DateTime::diff() as you can't externally * set the $days field. * * @param DateInterval $di * * @throws InvalidArgumentException * * @return static */ public static function instance(\DateInterval $di) { } /////////////////////////////////////////////////////////////////// /////////////////////// LOCALIZATION ////////////////////////////// /////////////////////////////////////////////////////////////////// /** * Intialize the translator instance if necessary. * * @return TranslatorInterface */ protected static function translator() { } /** * Get the translator instance in use * * @return TranslatorInterface */ public static function getTranslator() { } /** * Set the translator instance to use * * @param TranslatorInterface $translator */ public static function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) { } /** * Get the current translator locale * * @return string */ public static function getLocale() { } /** * Set the current translator locale * * @param string $locale */ public static function setLocale($locale) { } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the CarbonInterval object * * @param string $name * * @throws InvalidArgumentException * * @return int */ public function __get($name) { } /** * Set a part of the CarbonInterval object * * @param string $name * @param int $val * * @throws InvalidArgumentException */ public function __set($name, $val) { } /** * Allow setting of weeks and days to be cumulative. * * @param int $weeks Number of weeks to set * @param int $days Number of days to set * * @return static */ public function weeksAndDays($weeks, $days) { } /** * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). * * Note: This is done using the magic method to allow static and instance methods to * have the same names. * * @param string $name * @param array $args * * @return static */ public function __call($name, $args) { } /** * Get the current interval in a human readable format in the current locale. * * @return string */ public function forHumans() { } /** * Format the instance as a string using the forHumans() function. * * @return string */ public function __toString() { } /** * Add the passed interval to the current instance * * @param DateInterval $interval * * @return static */ public function add(\DateInterval $interval) { } } /** * A simple API extension for DateTime * * @property int $year * @property int $yearIso * @property int $month * @property int $day * @property int $hour * @property int $minute * @property int $second * @property int $timestamp seconds since the Unix Epoch * @property DateTimeZone $timezone the current timezone * @property DateTimeZone $tz alias of timezone * @property-read integer $micro * @property-read integer $dayOfWeek 0 (for Sunday) through 6 (for Saturday) * @property-read integer $dayOfYear 0 through 365 * @property-read integer $weekOfMonth 1 through 5 * @property-read integer $weekOfYear ISO-8601 week number of year, weeks starting on Monday * @property-read integer $daysInMonth number of days in the given month * @property-read integer $age does a diffInYears() with default parameters * @property-read integer $quarter the quarter of this instance, 1 - 4 * @property-read integer $offset the timezone offset in seconds from UTC * @property-read integer $offsetHours the timezone offset in hours from UTC * @property-read boolean $dst daylight savings time indicator, true if DST, false otherwise * @property-read boolean $local checks if the timezone is local, true if local, false otherwise * @property-read boolean $utc checks if the timezone is UTC, true if UTC, false otherwise * @property-read string $timezoneName * @property-read string $tzName */ class Carbon extends \DateTime { /** * The day constants */ const SUNDAY = 0; const MONDAY = 1; const TUESDAY = 2; const WEDNESDAY = 3; const THURSDAY = 4; const FRIDAY = 5; const SATURDAY = 6; /** * Names of days of the week. * * @var array */ protected static $days = array(self::SUNDAY => 'Sunday', self::MONDAY => 'Monday', self::TUESDAY => 'Tuesday', self::WEDNESDAY => 'Wednesday', self::THURSDAY => 'Thursday', self::FRIDAY => 'Friday', self::SATURDAY => 'Saturday'); /** * Terms used to detect if a time passed is a relative date for testing purposes * * @var array */ protected static $relativeKeywords = array('this', 'next', 'last', 'tomorrow', 'yesterday', '+', '-', 'first', 'last', 'ago'); /** * Number of X in Y */ const YEARS_PER_CENTURY = 100; const YEARS_PER_DECADE = 10; const MONTHS_PER_YEAR = 12; const WEEKS_PER_YEAR = 52; const DAYS_PER_WEEK = 7; const HOURS_PER_DAY = 24; const MINUTES_PER_HOUR = 60; const SECONDS_PER_MINUTE = 60; /** * Default format to use for __toString method when type juggling occurs. * * @var string */ const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; /** * Format to use for __toString method when type juggling occurs. * * @var string */ protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT; /** * First day of week * * @var int */ protected static $weekStartsAt = self::MONDAY; /** * Last day of week * * @var int */ protected static $weekEndsAt = self::SUNDAY; /** * Days of weekend * * @var array */ protected static $weekendDays = array(self::SATURDAY, self::SUNDAY); /** * A test Carbon instance to be returned when now instances are created * * @var Carbon */ protected static $testNow; /** * A translator to ... er ... translate stuff * * @var TranslatorInterface */ protected static $translator; /** * Creates a DateTimeZone from a string or a DateTimeZone * * @param DateTimeZone|string|null $object * * @throws InvalidArgumentException * * @return DateTimeZone */ protected static function safeCreateDateTimeZone($object) { } /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Create a new Carbon instance. * * Please see the testing aids section (specifically static::setTestNow()) * for more on the possibility of this constructor returning a test instance. * * @param string|null $time * @param DateTimeZone|string|null $tz */ public function __construct($time = null, $tz = null) { } /** * Create a Carbon instance from a DateTime one * * @param DateTime $dt * * @return static */ public static function instance(\DateTime $dt) { } /** * Create a carbon instance from a string. This is an alias for the * constructor that allows better fluent syntax as it allows you to do * Carbon::parse('Monday next week')->fn() rather than * (new Carbon('Monday next week'))->fn() * * @param string|null $time * @param DateTimeZone|string|null $tz * * @return static */ public static function parse($time = null, $tz = null) { } /** * Get a Carbon instance for the current date and time * * @param DateTimeZone|string|null $tz * * @return static */ public static function now($tz = null) { } /** * Create a Carbon instance for today * * @param DateTimeZone|string|null $tz * * @return static */ public static function today($tz = null) { } /** * Create a Carbon instance for tomorrow * * @param DateTimeZone|string|null $tz * * @return static */ public static function tomorrow($tz = null) { } /** * Create a Carbon instance for yesterday * * @param DateTimeZone|string|null $tz * * @return static */ public static function yesterday($tz = null) { } /** * Create a Carbon instance for the greatest supported date. * * @return Carbon */ public static function maxValue() { } /** * Create a Carbon instance for the lowest supported date. * * @return Carbon */ public static function minValue() { } /** * Create a new Carbon instance from a specific date and time. * * If any of $year, $month or $day are set to null their now() values * will be used. * * If $hour is null it will be set to its now() value and the default values * for $minute and $second will be their now() values. * If $hour is not null then the default values for $minute and $second * will be 0. * * @param int|null $year * @param int|null $month * @param int|null $day * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|null $tz * * @return static */ public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) { } /** * Create a Carbon instance from just a date. The time portion is set to now. * * @param int|null $year * @param int|null $month * @param int|null $day * @param DateTimeZone|string|null $tz * * @return static */ public static function createFromDate($year = null, $month = null, $day = null, $tz = null) { } /** * Create a Carbon instance from just a time. The date portion is set to today. * * @param int|null $hour * @param int|null $minute * @param int|null $second * @param DateTimeZone|string|null $tz * * @return static */ public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null) { } /** * Create a Carbon instance from a specific format * * @param string $format * @param string $time * @param DateTimeZone|string|null $tz * * @throws InvalidArgumentException * * @return static */ public static function createFromFormat($format, $time, $tz = null) { } /** * Create a Carbon instance from a timestamp * * @param int $timestamp * @param DateTimeZone|string|null $tz * * @return static */ public static function createFromTimestamp($timestamp, $tz = null) { } /** * Create a Carbon instance from an UTC timestamp * * @param int $timestamp * * @return static */ public static function createFromTimestampUTC($timestamp) { } /** * Get a copy of the instance * * @return static */ public function copy() { } /////////////////////////////////////////////////////////////////// ///////////////////////// GETTERS AND SETTERS ///////////////////// /////////////////////////////////////////////////////////////////// /** * Get a part of the Carbon object * * @param string $name * * @throws InvalidArgumentException * * @return string|int|DateTimeZone */ public function __get($name) { } /** * Check if an attribute exists on the object * * @param string $name * * @return bool */ public function __isset($name) { } /** * Set a part of the Carbon object * * @param string $name * @param string|int|DateTimeZone $value * * @throws InvalidArgumentException */ public function __set($name, $value) { } /** * Set the instance's year * * @param int $value * * @return static */ public function year($value) { } /** * Set the instance's month * * @param int $value * * @return static */ public function month($value) { } /** * Set the instance's day * * @param int $value * * @return static */ public function day($value) { } /** * Set the instance's hour * * @param int $value * * @return static */ public function hour($value) { } /** * Set the instance's minute * * @param int $value * * @return static */ public function minute($value) { } /** * Set the instance's second * * @param int $value * * @return static */ public function second($value) { } /** * Set the date and time all together * * @param int $year * @param int $month * @param int $day * @param int $hour * @param int $minute * @param int $second * * @return static */ public function setDateTime($year, $month, $day, $hour, $minute, $second = 0) { } /** * Set the time by time string * * @param string $time * * @return static */ public function setTimeFromTimeString($time) { } /** * Set the instance's timestamp * * @param int $value * * @return static */ public function timestamp($value) { } /** * Alias for setTimezone() * * @param DateTimeZone|string $value * * @return static */ public function timezone($value) { } /** * Alias for setTimezone() * * @param DateTimeZone|string $value * * @return static */ public function tz($value) { } /** * Set the instance's timezone from a string or object * * @param DateTimeZone|string $value * * @return static */ public function setTimezone($value) { } /////////////////////////////////////////////////////////////////// /////////////////////// WEEK SPECIAL DAYS ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Get the first day of week * * @return int */ public static function getWeekStartsAt() { } /** * Set the first day of week * * @param int */ public static function setWeekStartsAt($day) { } /** * Get the last day of week * * @return int */ public static function getWeekEndsAt() { } /** * Set the first day of week * * @param int */ public static function setWeekEndsAt($day) { } /** * Get weekend days * * @return array */ public static function getWeekendDays() { } /** * Set weekend days * * @param array */ public static function setWeekendDays($days) { } /////////////////////////////////////////////////////////////////// ///////////////////////// TESTING AIDS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned * specifically under the following conditions: * - A call to the static now() method, ex. Carbon::now() * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') * * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * * To clear the test instance call this method using the default * parameter of null. * * @param Carbon|null $testNow */ public static function setTestNow(\Carbon\Carbon $testNow = null) { } /** * Get the Carbon instance (real or mock) to be returned when a "now" * instance is created. * * @return static the current instance used for testing */ public static function getTestNow() { } /** * Determine if there is a valid test instance set. A valid test instance * is anything that is not null. * * @return bool true if there is a test instance, otherwise false */ public static function hasTestNow() { } /** * Determine if there is a relative keyword in the time string, this is to * create dates relative to now for test instances. e.g.: next tuesday * * @param string $time * * @return bool true if there is a keyword, otherwise false */ public static function hasRelativeKeywords($time) { } /////////////////////////////////////////////////////////////////// /////////////////////// LOCALIZATION ////////////////////////////// /////////////////////////////////////////////////////////////////// /** * Intialize the translator instance if necessary. * * @return TranslatorInterface */ protected static function translator() { } /** * Get the translator instance in use * * @return TranslatorInterface */ public static function getTranslator() { } /** * Set the translator instance to use * * @param TranslatorInterface $translator */ public static function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) { } /** * Get the current translator locale * * @return string */ public static function getLocale() { } /** * Set the current translator locale * * @param string $locale */ public static function setLocale($locale) { } /////////////////////////////////////////////////////////////////// /////////////////////// STRING FORMATTING ///////////////////////// /////////////////////////////////////////////////////////////////// /** * Format the instance with the current locale. You can set the current * locale using setlocale() http://php.net/setlocale. * * @param string $format * * @return string */ public function formatLocalized($format) { } /** * Reset the format used to the default when type juggling a Carbon instance to a string */ public static function resetToStringFormat() { } /** * Set the default format used when type juggling a Carbon instance to a string * * @param string $format */ public static function setToStringFormat($format) { } /** * Format the instance as a string using the set format * * @return string */ public function __toString() { } /** * Format the instance as date * * @return string */ public function toDateString() { } /** * Format the instance as a readable date * * @return string */ public function toFormattedDateString() { } /** * Format the instance as time * * @return string */ public function toTimeString() { } /** * Format the instance as date and time * * @return string */ public function toDateTimeString() { } /** * Format the instance with day, date and time * * @return string */ public function toDayDateTimeString() { } /** * Format the instance as ATOM * * @return string */ public function toAtomString() { } /** * Format the instance as COOKIE * * @return string */ public function toCookieString() { } /** * Format the instance as ISO8601 * * @return string */ public function toIso8601String() { } /** * Format the instance as RFC822 * * @return string */ public function toRfc822String() { } /** * Format the instance as RFC850 * * @return string */ public function toRfc850String() { } /** * Format the instance as RFC1036 * * @return string */ public function toRfc1036String() { } /** * Format the instance as RFC1123 * * @return string */ public function toRfc1123String() { } /** * Format the instance as RFC2822 * * @return string */ public function toRfc2822String() { } /** * Format the instance as RFC3339 * * @return string */ public function toRfc3339String() { } /** * Format the instance as RSS * * @return string */ public function toRssString() { } /** * Format the instance as W3C * * @return string */ public function toW3cString() { } /////////////////////////////////////////////////////////////////// ////////////////////////// COMPARISONS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Determines if the instance is equal to another * * @param Carbon $dt * * @return bool */ public function eq(\Carbon\Carbon $dt) { } /** * Determines if the instance is not equal to another * * @param Carbon $dt * * @return bool */ public function ne(\Carbon\Carbon $dt) { } /** * Determines if the instance is greater (after) than another * * @param Carbon $dt * * @return bool */ public function gt(\Carbon\Carbon $dt) { } /** * Determines if the instance is greater (after) than or equal to another * * @param Carbon $dt * * @return bool */ public function gte(\Carbon\Carbon $dt) { } /** * Determines if the instance is less (before) than another * * @param Carbon $dt * * @return bool */ public function lt(\Carbon\Carbon $dt) { } /** * Determines if the instance is less (before) or equal to another * * @param Carbon $dt * * @return bool */ public function lte(\Carbon\Carbon $dt) { } /** * Determines if the instance is between two others * * @param Carbon $dt1 * @param Carbon $dt2 * @param bool $equal Indicates if a > and < comparison should be used or <= or >= * * @return bool */ public function between(\Carbon\Carbon $dt1, \Carbon\Carbon $dt2, $equal = true) { } /** * Get the closest date from the instance. * * @param Carbon $dt1 * @param Carbon $dt2 * * @return static */ public function closest(\Carbon\Carbon $dt1, \Carbon\Carbon $dt2) { } /** * Get the farthest date from the instance. * * @param Carbon $dt1 * @param Carbon $dt2 * * @return static */ public function farthest(\Carbon\Carbon $dt1, \Carbon\Carbon $dt2) { } /** * Get the minimum instance between a given instance (default now) and the current instance. * * @param Carbon|null $dt * * @return static */ public function min(\Carbon\Carbon $dt = null) { } /** * Get the maximum instance between a given instance (default now) and the current instance. * * @param Carbon|null $dt * * @return static */ public function max(\Carbon\Carbon $dt = null) { } /** * Determines if the instance is a weekday * * @return bool */ public function isWeekday() { } /** * Determines if the instance is a weekend day * * @return bool */ public function isWeekend() { } /** * Determines if the instance is yesterday * * @return bool */ public function isYesterday() { } /** * Determines if the instance is today * * @return bool */ public function isToday() { } /** * Determines if the instance is tomorrow * * @return bool */ public function isTomorrow() { } /** * Determines if the instance is in the future, ie. greater (after) than now * * @return bool */ public function isFuture() { } /** * Determines if the instance is in the past, ie. less (before) than now * * @return bool */ public function isPast() { } /** * Determines if the instance is a leap year * * @return bool */ public function isLeapYear() { } /** * Checks if the passed in date is the same day as the instance current day. * * @param Carbon $dt * * @return bool */ public function isSameDay(\Carbon\Carbon $dt) { } /** * Checks if this day is a Sunday. * * @return bool */ public function isSunday() { } /** * Checks if this day is a Monday. * * @return bool */ public function isMonday() { } /** * Checks if this day is a Tuesday. * * @return bool */ public function isTuesday() { } /** * Checks if this day is a Wednesday. * * @return bool */ public function isWednesday() { } /** * Checks if this day is a Thursday. * * @return bool */ public function isThursday() { } /** * Checks if this day is a Friday. * * @return bool */ public function isFriday() { } /** * Checks if this day is a Saturday. * * @return bool */ public function isSaturday() { } /////////////////////////////////////////////////////////////////// /////////////////// ADDITIONS AND SUBTRACTIONS //////////////////// /////////////////////////////////////////////////////////////////// /** * Add years to the instance. Positive $value travel forward while * negative $value travel into the past. * * @param int $value * * @return static */ public function addYears($value) { } /** * Add a year to the instance * * @param int $value * * @return static */ public function addYear($value = 1) { } /** * Remove a year from the instance * * @param int $value * * @return static */ public function subYear($value = 1) { } /** * Remove years from the instance. * * @param int $value * * @return static */ public function subYears($value) { } /** * Add months to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addMonths($value) { } /** * Add a month to the instance * * @param int $value * * @return static */ public function addMonth($value = 1) { } /** * Remove a month from the instance * * @param int $value * * @return static */ public function subMonth($value = 1) { } /** * Remove months from the instance * * @param int $value * * @return static */ public function subMonths($value) { } /** * Add months without overflowing to the instance. Positive $value * travels forward while negative $value travels into the past. * * @param int $value * * @return static */ public function addMonthsNoOverflow($value) { } /** * Add a month with no overflow to the instance * * @param int $value * * @return static */ public function addMonthNoOverflow($value = 1) { } /** * Remove a month with no overflow from the instance * * @param int $value * * @return static */ public function subMonthNoOverflow($value = 1) { } /** * Remove months with no overflow from the instance * * @param int $value * * @return static */ public function subMonthsNoOverflow($value) { } /** * Add days to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addDays($value) { } /** * Add a day to the instance * * @param int $value * * @return static */ public function addDay($value = 1) { } /** * Remove a day from the instance * * @param int $value * * @return static */ public function subDay($value = 1) { } /** * Remove days from the instance * * @param int $value * * @return static */ public function subDays($value) { } /** * Add weekdays to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addWeekdays($value) { } /** * Add a weekday to the instance * * @param int $value * * @return static */ public function addWeekday($value = 1) { } /** * Remove a weekday from the instance * * @param int $value * * @return static */ public function subWeekday($value = 1) { } /** * Remove weekdays from the instance * * @param int $value * * @return static */ public function subWeekdays($value) { } /** * Add weeks to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addWeeks($value) { } /** * Add a week to the instance * * @param int $value * * @return static */ public function addWeek($value = 1) { } /** * Remove a week from the instance * * @param int $value * * @return static */ public function subWeek($value = 1) { } /** * Remove weeks to the instance * * @param int $value * * @return static */ public function subWeeks($value) { } /** * Add hours to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addHours($value) { } /** * Add an hour to the instance * * @param int $value * * @return static */ public function addHour($value = 1) { } /** * Remove an hour from the instance * * @param int $value * * @return static */ public function subHour($value = 1) { } /** * Remove hours from the instance * * @param int $value * * @return static */ public function subHours($value) { } /** * Add minutes to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addMinutes($value) { } /** * Add a minute to the instance * * @param int $value * * @return static */ public function addMinute($value = 1) { } /** * Remove a minute from the instance * * @param int $value * * @return static */ public function subMinute($value = 1) { } /** * Remove minutes from the instance * * @param int $value * * @return static */ public function subMinutes($value) { } /** * Add seconds to the instance. Positive $value travels forward while * negative $value travels into the past. * * @param int $value * * @return static */ public function addSeconds($value) { } /** * Add a second to the instance * * @param int $value * * @return static */ public function addSecond($value = 1) { } /** * Remove a second from the instance * * @param int $value * * @return static */ public function subSecond($value = 1) { } /** * Remove seconds from the instance * * @param int $value * * @return static */ public function subSeconds($value) { } /////////////////////////////////////////////////////////////////// /////////////////////////// DIFFERENCES /////////////////////////// /////////////////////////////////////////////////////////////////// /** * Get the difference in years * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInYears(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in months * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInMonths(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in weeks * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInWeeks(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in days * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInDays(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in days using a filter closure * * @param Closure $callback * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInDaysFiltered(\Closure $callback, \Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in hours using a filter closure * * @param Closure $callback * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInHoursFiltered(\Closure $callback, \Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference by the given interval using a filter closure * * @param CarbonInterval $ci An interval to traverse by * @param Closure $callback * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffFiltered(\Carbon\CarbonInterval $ci, \Closure $callback, \Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in weekdays * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInWeekdays(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in weekend days using a filter * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInWeekendDays(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in hours * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInHours(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in minutes * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInMinutes(\Carbon\Carbon $dt = null, $abs = true) { } /** * Get the difference in seconds * * @param Carbon|null $dt * @param bool $abs Get the absolute of the difference * * @return int */ public function diffInSeconds(\Carbon\Carbon $dt = null, $abs = true) { } /** * The number of seconds since midnight. * * @return int */ public function secondsSinceMidnight() { } /** * The number of seconds until 23:23:59. * * @return int */ public function secondsUntilEndOfDay() { } /** * Get the difference in a human readable format in the current locale. * * When comparing a value in the past to default now: * 1 hour ago * 5 months ago * * When comparing a value in the future to default now: * 1 hour from now * 5 months from now * * When comparing a value in the past to another value: * 1 hour before * 5 months before * * When comparing a value in the future to another value: * 1 hour after * 5 months after * * @param Carbon|null $other * @param bool $absolute removes time difference modifiers ago, after, etc * * @return string */ public function diffForHumans(\Carbon\Carbon $other = null, $absolute = false) { } /////////////////////////////////////////////////////////////////// //////////////////////////// MODIFIERS //////////////////////////// /////////////////////////////////////////////////////////////////// /** * Resets the time to 00:00:00 * * @return static */ public function startOfDay() { } /** * Resets the time to 23:59:59 * * @return static */ public function endOfDay() { } /** * Resets the date to the first day of the month and the time to 00:00:00 * * @return static */ public function startOfMonth() { } /** * Resets the date to end of the month and time to 23:59:59 * * @return static */ public function endOfMonth() { } /** * Resets the date to the first day of the year and the time to 00:00:00 * * @return static */ public function startOfYear() { } /** * Resets the date to end of the year and time to 23:59:59 * * @return static */ public function endOfYear() { } /** * Resets the date to the first day of the decade and the time to 00:00:00 * * @return static */ public function startOfDecade() { } /** * Resets the date to end of the decade and time to 23:59:59 * * @return static */ public function endOfDecade() { } /** * Resets the date to the first day of the century and the time to 00:00:00 * * @return static */ public function startOfCentury() { } /** * Resets the date to end of the century and time to 23:59:59 * * @return static */ public function endOfCentury() { } /** * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 * * @return static */ public function startOfWeek() { } /** * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59 * * @return static */ public function endOfWeek() { } /** * Modify to the next occurrence of a given day of the week. * If no dayOfWeek is provided, modify to the next occurrence * of the current day of the week. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function next($dayOfWeek = null) { } /** * Modify to the previous occurrence of a given day of the week. * If no dayOfWeek is provided, modify to the previous occurrence * of the current day of the week. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function previous($dayOfWeek = null) { } /** * Modify to the first occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * first day of the current month. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfMonth($dayOfWeek = null) { } /** * Modify to the last occurrence of a given day of the week * in the current month. If no dayOfWeek is provided, modify to the * last day of the current month. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfMonth($dayOfWeek = null) { } /** * Modify to the given occurrence of a given day of the week * in the current month. If the calculated occurrence is outside the scope * of the current month, then return false and no modifications are made. * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfMonth($nth, $dayOfWeek) { } /** * Modify to the first occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * first day of the current quarter. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfQuarter($dayOfWeek = null) { } /** * Modify to the last occurrence of a given day of the week * in the current quarter. If no dayOfWeek is provided, modify to the * last day of the current quarter. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfQuarter($dayOfWeek = null) { } /** * Modify to the given occurrence of a given day of the week * in the current quarter. If the calculated occurrence is outside the scope * of the current quarter, then return false and no modifications are made. * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfQuarter($nth, $dayOfWeek) { } /** * Modify to the first occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * first day of the current year. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function firstOfYear($dayOfWeek = null) { } /** * Modify to the last occurrence of a given day of the week * in the current year. If no dayOfWeek is provided, modify to the * last day of the current year. Use the supplied consts * to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int|null $dayOfWeek * * @return static */ public function lastOfYear($dayOfWeek = null) { } /** * Modify to the given occurrence of a given day of the week * in the current year. If the calculated occurrence is outside the scope * of the current year, then return false and no modifications are made. * Use the supplied consts to indicate the desired dayOfWeek, ex. static::MONDAY. * * @param int $nth * @param int $dayOfWeek * * @return mixed */ public function nthOfYear($nth, $dayOfWeek) { } /** * Modify the current instance to the average of a given instance (default now) and the current instance. * * @param Carbon|null $dt * * @return static */ public function average(\Carbon\Carbon $dt = null) { } /** * Check if its the birthday. Compares the date/month values of the two dates. * * @param Carbon|null $dt The instance to compare with or null to use current day. * * @return bool */ public function isBirthday(\Carbon\Carbon $dt = null) { } } } namespace phpseclib\Net\SFTP { /** * SFTP Stream Wrapper * * @package SFTP * @author Jim Wigginton * @access public */ class Stream { /** * SFTP instances * * Rather than re-create the connection we re-use instances if possible * * @var array */ static $instances; /** * SFTP instance * * @var object * @access private */ var $sftp; /** * Path * * @var string * @access private */ var $path; /** * Mode * * @var string * @access private */ var $mode; /** * Position * * @var int * @access private */ var $pos; /** * Size * * @var int * @access private */ var $size; /** * Directory entries * * @var array * @access private */ var $entries; /** * EOF flag * * @var bool * @access private */ var $eof; /** * Context resource * * Technically this needs to be publically accessible so PHP can set it directly * * @var resource * @access public */ var $context; /** * Notification callback function * * @var callable * @access public */ var $notification; /** * Registers this class as a URL wrapper. * * @param string $protocol The wrapper name to be registered. * @return bool True on success, false otherwise. * @access public */ static function register($protocol = 'sftp') { } /** * The Constructor * * @access public */ function __construct() { } /** * Path Parser * * Extract a path from a URI and actually connect to an SSH server if appropriate * * If "notification" is set as a context parameter the message code for successful login is * NET_SSH2_MSG_USERAUTH_SUCCESS. For a failed login it's NET_SSH2_MSG_USERAUTH_FAILURE. * * @param string $path * @return string * @access private */ function _parse_path($path) { } /** * Opens file or URL * * @param string $path * @param string $mode * @param int $options * @param string $opened_path * @return bool * @access public */ function _stream_open($path, $mode, $options, &$opened_path) { } /** * Read from stream * * @param int $count * @return mixed * @access public */ function _stream_read($count) { } /** * Write to stream * * @param string $data * @return mixed * @access public */ function _stream_write($data) { } /** * Retrieve the current position of a stream * * @return int * @access public */ function _stream_tell() { } /** * Tests for end-of-file on a file pointer * * In my testing there are four classes functions that normally effect the pointer: * fseek, fputs / fwrite, fgets / fread and ftruncate. * * Only fgets / fread, however, results in feof() returning true. do fputs($fp, 'aaa') on a blank file and feof() * will return false. do fread($fp, 1) and feof() will then return true. do fseek($fp, 10) on ablank file and feof() * will return false. do fread($fp, 1) and feof() will then return true. * * @return bool * @access public */ function _stream_eof() { } /** * Seeks to specific location in a stream * * @param int $offset * @param int $whence * @return bool * @access public */ function _stream_seek($offset, $whence) { } /** * Change stream options * * @param string $path * @param int $option * @param mixed $var * @return bool * @access public */ function _stream_metadata($path, $option, $var) { } /** * Retrieve the underlaying resource * * @param int $cast_as * @return resource * @access public */ function _stream_cast($cast_as) { } /** * Advisory file locking * * @param int $operation * @return bool * @access public */ function _stream_lock($operation) { } /** * Renames a file or directory * * Attempts to rename oldname to newname, moving it between directories if necessary. * If newname exists, it will be overwritten. This is a departure from what \phpseclib\Net\SFTP * does. * * @param string $path_from * @param string $path_to * @return bool * @access public */ function _rename($path_from, $path_to) { } /** * Open directory handle * * The only $options is "whether or not to enforce safe_mode (0x04)". Since safe mode was deprecated in 5.3 and * removed in 5.4 I'm just going to ignore it. * * Also, nlist() is the best that this function is realistically going to be able to do. When an SFTP client * sends a SSH_FXP_READDIR packet you don't generally get info on just one file but on multiple files. Quoting * the SFTP specs: * * The SSH_FXP_NAME response has the following format: * * uint32 id * uint32 count * repeats count times: * string filename * string longname * ATTRS attrs * * @param string $path * @param int $options * @return bool * @access public */ function _dir_opendir($path, $options) { } /** * Read entry from directory handle * * @return mixed * @access public */ function _dir_readdir() { } /** * Rewind directory handle * * @return bool * @access public */ function _dir_rewinddir() { } /** * Close directory handle * * @return bool * @access public */ function _dir_closedir() { } /** * Create a directory * * Only valid $options is STREAM_MKDIR_RECURSIVE * * @param string $path * @param int $mode * @param int $options * @return bool * @access public */ function _mkdir($path, $mode, $options) { } /** * Removes a directory * * Only valid $options is STREAM_MKDIR_RECURSIVE per , however, * does not have a $recursive parameter as mkdir() does so I don't know how * STREAM_MKDIR_RECURSIVE is supposed to be set. Also, when I try it out with rmdir() I get 8 as * $options. What does 8 correspond to? * * @param string $path * @param int $mode * @param int $options * @return bool * @access public */ function _rmdir($path, $options) { } /** * Flushes the output * * See . Always returns true because \phpseclib\Net\SFTP doesn't cache stuff before writing * * @return bool * @access public */ function _stream_flush() { } /** * Retrieve information about a file resource * * @return mixed * @access public */ function _stream_stat() { } /** * Delete a file * * @param string $path * @return bool * @access public */ function _unlink($path) { } /** * Retrieve information about a file * * Ignores the STREAM_URL_STAT_QUIET flag because the entirety of \phpseclib\Net\SFTP\Stream is quiet by default * might be worthwhile to reconstruct bits 12-16 (ie. the file type) if mode doesn't have them but we'll * cross that bridge when and if it's reached * * @param string $path * @param int $flags * @return mixed * @access public */ function _url_stat($path, $flags) { } /** * Truncate stream * * @param int $new_size * @return bool * @access public */ function _stream_truncate($new_size) { } /** * Change stream options * * STREAM_OPTION_WRITE_BUFFER isn't supported for the same reason stream_flush isn't. * The other two aren't supported because of limitations in \phpseclib\Net\SFTP. * * @param int $option * @param int $arg1 * @param int $arg2 * @return bool * @access public */ function _stream_set_option($option, $arg1, $arg2) { } /** * Close an resource * * @access public */ function _stream_close() { } /** * __call Magic Method * * When you're utilizing an SFTP stream you're not calling the methods in this class directly - PHP is calling them for you. * Which kinda begs the question... what methods is PHP calling and what parameters is it passing to them? This function * lets you figure that out. * * If NET_SFTP_STREAM_LOGGING is defined all calls will be output on the screen and then (regardless of whether or not * NET_SFTP_STREAM_LOGGING is enabled) the parameters will be passed through to the appropriate method. * * @param string * @param array * @return mixed * @access public */ function __call($name, $arguments) { } } } namespace phpseclib\Net { /** * Pure-PHP implementation of SSHv2. * * @package SSH2 * @author Jim Wigginton * @access public */ class SSH2 { /**#@+ * Execution Bitmap Masks * * @see \phpseclib\Net\SSH2::bitmap * @access private */ const MASK_CONSTRUCTOR = 0x1; const MASK_CONNECTED = 0x2; const MASK_LOGIN_REQ = 0x4; const MASK_LOGIN = 0x8; const MASK_SHELL = 0x10; const MASK_WINDOW_ADJUST = 0x20; /**#@-*/ /**#@+ * Channel constants * * RFC4254 refers not to client and server channels but rather to sender and recipient channels. we don't refer * to them in that way because RFC4254 toggles the meaning. the client sends a SSH_MSG_CHANNEL_OPEN message with * a sender channel and the server sends a SSH_MSG_CHANNEL_OPEN_CONFIRMATION in response, with a sender and a * recepient channel. at first glance, you might conclude that SSH_MSG_CHANNEL_OPEN_CONFIRMATION's sender channel * would be the same thing as SSH_MSG_CHANNEL_OPEN's sender channel, but it's not, per this snipet: * The 'recipient channel' is the channel number given in the original * open request, and 'sender channel' is the channel number allocated by * the other side. * * @see \phpseclib\Net\SSH2::_send_channel_packet() * @see \phpseclib\Net\SSH2::_get_channel_packet() * @access private */ const CHANNEL_EXEC = 1; // PuTTy uses 0x100 const CHANNEL_SHELL = 2; const CHANNEL_SUBSYSTEM = 3; const CHANNEL_AGENT_FORWARD = 4; /**#@-*/ /**#@+ * @access public * @see \phpseclib\Net\SSH2::getLog() */ /** * Returns the message numbers */ const LOG_SIMPLE = 1; /** * Returns the message content */ const LOG_COMPLEX = 2; /** * Outputs the content real-time */ const LOG_REALTIME = 3; /** * Dumps the content real-time to a file */ const LOG_REALTIME_FILE = 4; /** * Make sure that the log never gets larger than this */ const LOG_MAX_SIZE = 1048576; // 1024 * 1024 /**#@-*/ /**#@+ * @access public * @see \phpseclib\Net\SSH2::read() */ /** * Returns when a string matching $expect exactly is found */ const READ_SIMPLE = 1; /** * Returns when a string matching the regular expression $expect is found */ const READ_REGEX = 2; /** * Returns when a string matching the regular expression $expect is found */ const READ_NEXT = 3; /**#@-*/ /** * The SSH identifier * * @var string * @access private */ var $identifier; /** * The Socket Object * * @var object * @access private */ var $fsock; /** * Execution Bitmap * * The bits that are set represent functions that have been called already. This is used to determine * if a requisite function has been successfully executed. If not, an error should be thrown. * * @var int * @access private */ var $bitmap = 0; /** * Error information * * @see self::getErrors() * @see self::getLastError() * @var string * @access private */ var $errors = array(); /** * Server Identifier * * @see self::getServerIdentification() * @var array|false * @access private */ var $server_identifier = false; /** * Key Exchange Algorithms * * @see self::getKexAlgorithims() * @var array|false * @access private */ var $kex_algorithms = false; /** * Minimum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods * * @see self::_key_exchange() * @var int * @access private */ var $kex_dh_group_size_min = 1536; /** * Preferred Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods * * @see self::_key_exchange() * @var int * @access private */ var $kex_dh_group_size_preferred = 2048; /** * Maximum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods * * @see self::_key_exchange() * @var int * @access private */ var $kex_dh_group_size_max = 4096; /** * Server Host Key Algorithms * * @see self::getServerHostKeyAlgorithms() * @var array|false * @access private */ var $server_host_key_algorithms = false; /** * Encryption Algorithms: Client to Server * * @see self::getEncryptionAlgorithmsClient2Server() * @var array|false * @access private */ var $encryption_algorithms_client_to_server = false; /** * Encryption Algorithms: Server to Client * * @see self::getEncryptionAlgorithmsServer2Client() * @var array|false * @access private */ var $encryption_algorithms_server_to_client = false; /** * MAC Algorithms: Client to Server * * @see self::getMACAlgorithmsClient2Server() * @var array|false * @access private */ var $mac_algorithms_client_to_server = false; /** * MAC Algorithms: Server to Client * * @see self::getMACAlgorithmsServer2Client() * @var array|false * @access private */ var $mac_algorithms_server_to_client = false; /** * Compression Algorithms: Client to Server * * @see self::getCompressionAlgorithmsClient2Server() * @var array|false * @access private */ var $compression_algorithms_client_to_server = false; /** * Compression Algorithms: Server to Client * * @see self::getCompressionAlgorithmsServer2Client() * @var array|false * @access private */ var $compression_algorithms_server_to_client = false; /** * Languages: Server to Client * * @see self::getLanguagesServer2Client() * @var array|false * @access private */ var $languages_server_to_client = false; /** * Languages: Client to Server * * @see self::getLanguagesClient2Server() * @var array|false * @access private */ var $languages_client_to_server = false; /** * Block Size for Server to Client Encryption * * "Note that the length of the concatenation of 'packet_length', * 'padding_length', 'payload', and 'random padding' MUST be a multiple * of the cipher block size or 8, whichever is larger. This constraint * MUST be enforced, even when using stream ciphers." * * -- http://tools.ietf.org/html/rfc4253#section-6 * * @see self::__construct() * @see self::_send_binary_packet() * @var int * @access private */ var $encrypt_block_size = 8; /** * Block Size for Client to Server Encryption * * @see self::__construct() * @see self::_get_binary_packet() * @var int * @access private */ var $decrypt_block_size = 8; /** * Server to Client Encryption Object * * @see self::_get_binary_packet() * @var object * @access private */ var $decrypt = false; /** * Client to Server Encryption Object * * @see self::_send_binary_packet() * @var object * @access private */ var $encrypt = false; /** * Client to Server HMAC Object * * @see self::_send_binary_packet() * @var object * @access private */ var $hmac_create = false; /** * Server to Client HMAC Object * * @see self::_get_binary_packet() * @var object * @access private */ var $hmac_check = false; /** * Size of server to client HMAC * * We need to know how big the HMAC will be for the server to client direction so that we know how many bytes to read. * For the client to server side, the HMAC object will make the HMAC as long as it needs to be. All we need to do is * append it. * * @see self::_get_binary_packet() * @var int * @access private */ var $hmac_size = false; /** * Server Public Host Key * * @see self::getServerPublicHostKey() * @var string * @access private */ var $server_public_host_key; /** * Session identifier * * "The exchange hash H from the first key exchange is additionally * used as the session identifier, which is a unique identifier for * this connection." * * -- http://tools.ietf.org/html/rfc4253#section-7.2 * * @see self::_key_exchange() * @var string * @access private */ var $session_id = false; /** * Exchange hash * * The current exchange hash * * @see self::_key_exchange() * @var string * @access private */ var $exchange_hash = false; /** * Message Numbers * * @see self::__construct() * @var array * @access private */ var $message_numbers = array(); /** * Disconnection Message 'reason codes' defined in RFC4253 * * @see self::__construct() * @var array * @access private */ var $disconnect_reasons = array(); /** * SSH_MSG_CHANNEL_OPEN_FAILURE 'reason codes', defined in RFC4254 * * @see self::__construct() * @var array * @access private */ var $channel_open_failure_reasons = array(); /** * Terminal Modes * * @link http://tools.ietf.org/html/rfc4254#section-8 * @see self::__construct() * @var array * @access private */ var $terminal_modes = array(); /** * SSH_MSG_CHANNEL_EXTENDED_DATA's data_type_codes * * @link http://tools.ietf.org/html/rfc4254#section-5.2 * @see self::__construct() * @var array * @access private */ var $channel_extended_data_type_codes = array(); /** * Send Sequence Number * * See 'Section 6.4. Data Integrity' of rfc4253 for more info. * * @see self::_send_binary_packet() * @var int * @access private */ var $send_seq_no = 0; /** * Get Sequence Number * * See 'Section 6.4. Data Integrity' of rfc4253 for more info. * * @see self::_get_binary_packet() * @var int * @access private */ var $get_seq_no = 0; /** * Server Channels * * Maps client channels to server channels * * @see self::_get_channel_packet() * @see self::exec() * @var array * @access private */ var $server_channels = array(); /** * Channel Buffers * * If a client requests a packet from one channel but receives two packets from another those packets should * be placed in a buffer * * @see self::_get_channel_packet() * @see self::exec() * @var array * @access private */ var $channel_buffers = array(); /** * Channel Status * * Contains the type of the last sent message * * @see self::_get_channel_packet() * @var array * @access private */ var $channel_status = array(); /** * Packet Size * * Maximum packet size indexed by channel * * @see self::_send_channel_packet() * @var array * @access private */ var $packet_size_client_to_server = array(); /** * Message Number Log * * @see self::getLog() * @var array * @access private */ var $message_number_log = array(); /** * Message Log * * @see self::getLog() * @var array * @access private */ var $message_log = array(); /** * The Window Size * * Bytes the other party can send before it must wait for the window to be adjusted (0x7FFFFFFF = 2GB) * * @var int * @see self::_send_channel_packet() * @see self::exec() * @access private */ var $window_size = 0x7fffffff; /** * Window size, server to client * * Window size indexed by channel * * @see self::_send_channel_packet() * @var array * @access private */ var $window_size_server_to_client = array(); /** * Window size, client to server * * Window size indexed by channel * * @see self::_get_channel_packet() * @var array * @access private */ var $window_size_client_to_server = array(); /** * Server signature * * Verified against $this->session_id * * @see self::getServerPublicHostKey() * @var string * @access private */ var $signature = ''; /** * Server signature format * * ssh-rsa or ssh-dss. * * @see self::getServerPublicHostKey() * @var string * @access private */ var $signature_format = ''; /** * Interactive Buffer * * @see self::read() * @var array * @access private */ var $interactiveBuffer = ''; /** * Current log size * * Should never exceed self::LOG_MAX_SIZE * * @see self::_send_binary_packet() * @see self::_get_binary_packet() * @var int * @access private */ var $log_size; /** * Timeout * * @see self::setTimeout() * @access private */ var $timeout; /** * Current Timeout * * @see self::_get_channel_packet() * @access private */ var $curTimeout; /** * Real-time log file pointer * * @see self::_append_log() * @var resource * @access private */ var $realtime_log_file; /** * Real-time log file size * * @see self::_append_log() * @var int * @access private */ var $realtime_log_size; /** * Has the signature been validated? * * @see self::getServerPublicHostKey() * @var bool * @access private */ var $signature_validated = false; /** * Real-time log file wrap boolean * * @see self::_append_log() * @access private */ var $realtime_log_wrap; /** * Flag to suppress stderr from output * * @see self::enableQuietMode() * @access private */ var $quiet_mode = false; /** * Time of first network activity * * @var int * @access private */ var $last_packet; /** * Exit status returned from ssh if any * * @var int * @access private */ var $exit_status; /** * Flag to request a PTY when using exec() * * @var bool * @see self::enablePTY() * @access private */ var $request_pty = false; /** * Flag set while exec() is running when using enablePTY() * * @var bool * @access private */ var $in_request_pty_exec = false; /** * Flag set after startSubsystem() is called * * @var bool * @access private */ var $in_subsystem; /** * Contents of stdError * * @var string * @access private */ var $stdErrorLog; /** * The Last Interactive Response * * @see self::_keyboard_interactive_process() * @var string * @access private */ var $last_interactive_response = ''; /** * Keyboard Interactive Request / Responses * * @see self::_keyboard_interactive_process() * @var array * @access private */ var $keyboard_requests_responses = array(); /** * Banner Message * * Quoting from the RFC, "in some jurisdictions, sending a warning message before * authentication may be relevant for getting legal protection." * * @see self::_filter() * @see self::getBannerMessage() * @var string * @access private */ var $banner_message = ''; /** * Did read() timeout or return normally? * * @see self::isTimeout() * @var bool * @access private */ var $is_timeout = false; /** * Log Boundary * * @see self::_format_log() * @var string * @access private */ var $log_boundary = ':'; /** * Log Long Width * * @see self::_format_log() * @var int * @access private */ var $log_long_width = 65; /** * Log Short Width * * @see self::_format_log() * @var int * @access private */ var $log_short_width = 16; /** * Hostname * * @see self::__construct() * @see self::_connect() * @var string * @access private */ var $host; /** * Port Number * * @see self::__construct() * @see self::_connect() * @var int * @access private */ var $port; /** * Number of columns for terminal window size * * @see self::getWindowColumns() * @see self::setWindowColumns() * @see self::setWindowSize() * @var int * @access private */ var $windowColumns = 80; /** * Number of columns for terminal window size * * @see self::getWindowRows() * @see self::setWindowRows() * @see self::setWindowSize() * @var int * @access private */ var $windowRows = 24; /** * Crypto Engine * * @see self::setCryptoEngine() * @see self::_key_exchange() * @var int * @access private */ var $crypto_engine = false; /** * A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario * * @var System_SSH_Agent * @access private */ var $agent; /** * Send the identification string first? * * @var bool * @access private */ var $send_id_string_first = true; /** * Send the key exchange initiation packet first? * * @var bool * @access private */ var $send_kex_first = true; /** * Some versions of OpenSSH incorrectly calculate the key size * * @var bool * @access private */ var $bad_key_size_fix = false; /** * The selected decryption algorithm * * @var string * @access private */ var $decrypt_algorithm = ''; /** * Should we try to re-connect to re-establish keys? * * @var bool * @access private */ var $retry_connect = false; /** * Binary Packet Buffer * * @var string|false * @access private */ var $binary_packet_buffer = false; /** * Default Constructor. * * $host can either be a string, representing the host, or a stream resource. * * @param mixed $host * @param int $port * @param int $timeout * @see self::login() * @return \phpseclib\Net\SSH2 * @access public */ function __construct($host, $port = 22, $timeout = 10) { } /** * Set Crypto Engine Mode * * Possible $engine values: * CRYPT_MODE_INTERNAL, CRYPT_MODE_MCRYPT * * @param int $engine * @access public */ function setCryptoEngine($engine) { } /** * Send Identification String First * * https://tools.ietf.org/html/rfc4253#section-4.2 says "when the connection has been established, * both sides MUST send an identification string". It does not say which side sends it first. In * theory it shouldn't matter but it is a fact of life that some SSH servers are simply buggy * * @access public */ function sendIdentificationStringFirst() { } /** * Send Identification String Last * * https://tools.ietf.org/html/rfc4253#section-4.2 says "when the connection has been established, * both sides MUST send an identification string". It does not say which side sends it first. In * theory it shouldn't matter but it is a fact of life that some SSH servers are simply buggy * * @access public */ function sendIdentificationStringLast() { } /** * Send SSH_MSG_KEXINIT First * * https://tools.ietf.org/html/rfc4253#section-7.1 says "key exchange begins by each sending * sending the [SSH_MSG_KEXINIT] packet". It does not say which side sends it first. In theory * it shouldn't matter but it is a fact of life that some SSH servers are simply buggy * * @access public */ function sendKEXINITFirst() { } /** * Send SSH_MSG_KEXINIT Last * * https://tools.ietf.org/html/rfc4253#section-7.1 says "key exchange begins by each sending * sending the [SSH_MSG_KEXINIT] packet". It does not say which side sends it first. In theory * it shouldn't matter but it is a fact of life that some SSH servers are simply buggy * * @access public */ function sendKEXINITLast() { } /** * Connect to an SSHv2 server * * @return bool * @access private */ function _connect() { } /** * Generates the SSH identifier * * You should overwrite this method in your own class if you want to use another identifier * * @access protected * @return string */ function _generate_identifier() { } /** * Key Exchange * * @param string $kexinit_payload_server optional * @access private */ function _key_exchange($kexinit_payload_server = false) { } /** * Maps an encryption algorithm name to the number of key bytes. * * @param string $algorithm Name of the encryption algorithm * @return int|null Number of bytes as an integer or null for unknown * @access private */ function _encryption_algorithm_to_key_size($algorithm) { } /** * Maps an encryption algorithm name to an instance of a subclass of * \phpseclib\Crypt\Base. * * @param string $algorithm Name of the encryption algorithm * @return mixed Instance of \phpseclib\Crypt\Base or null for unknown * @access private */ function _encryption_algorithm_to_crypt_instance($algorithm) { } /* * Tests whether or not proposed algorithm has a potential for issues * * @link https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/ssh2-aesctr-openssh.html * @link https://bugzilla.mindrot.org/show_bug.cgi?id=1291 * @param string $algorithm Name of the encryption algorithm * @return bool * @access private */ function _bad_algorithm_candidate($algorithm) { } /** * Login * * The $password parameter can be a plaintext password, a \phpseclib\Crypt\RSA object or an array * * @param string $username * @param mixed $password * @param mixed $... * @return bool * @see self::_login() * @access public */ function login($username) { } /** * Login Helper * * @param string $username * @param mixed $password * @param mixed $... * @return bool * @see self::_login_helper() * @access private */ function _login($username) { } /** * Login Helper * * @param string $username * @param string $password * @return bool * @access private * @internal It might be worthwhile, at some point, to protect against {@link http://tools.ietf.org/html/rfc4251#section-9.3.9 traffic analysis} * by sending dummy SSH_MSG_IGNORE messages. */ function _login_helper($username, $password = null) { } /** * Login via keyboard-interactive authentication * * See {@link http://tools.ietf.org/html/rfc4256 RFC4256} for details. This is not a full-featured keyboard-interactive authenticator. * * @param string $username * @param string $password * @return bool * @access private */ function _keyboard_interactive_login($username, $password) { } /** * Handle the keyboard-interactive requests / responses. * * @param string $responses... * @return bool * @access private */ function _keyboard_interactive_process() { } /** * Login with an ssh-agent provided key * * @param string $username * @param \phpseclib\System\SSH\Agent $agent * @return bool * @access private */ function _ssh_agent_login($username, $agent) { } /** * Login with an RSA private key * * @param string $username * @param \phpseclib\Crypt\RSA $password * @return bool * @access private * @internal It might be worthwhile, at some point, to protect against {@link http://tools.ietf.org/html/rfc4251#section-9.3.9 traffic analysis} * by sending dummy SSH_MSG_IGNORE messages. */ function _privatekey_login($username, $privatekey) { } /** * Set Timeout * * $ssh->exec('ping 127.0.0.1'); on a Linux host will never return and will run indefinitely. setTimeout() makes it so it'll timeout. * Setting $timeout to false or 0 will mean there is no timeout. * * @param mixed $timeout * @access public */ function setTimeout($timeout) { } /** * Get the output from stdError * * @access public */ function getStdError() { } /** * Execute Command * * If $callback is set to false then \phpseclib\Net\SSH2::_get_channel_packet(self::CHANNEL_EXEC) will need to be called manually. * In all likelihood, this is not a feature you want to be taking advantage of. * * @param string $command * @param Callback $callback * @return string * @access public */ function exec($command, $callback = null) { } /** * Creates an interactive shell * * @see self::read() * @see self::write() * @return bool * @access private */ function _initShell() { } /** * Return the channel to be used with read() / write() * * @see self::read() * @see self::write() * @return int * @access public */ function _get_interactive_channel() { } /** * Return an available open channel * * @return int * @access public */ function _get_open_channel() { } /** * Returns the output of an interactive shell * * Returns when there's a match for $expect, which can take the form of a string literal or, * if $mode == self::READ_REGEX, a regular expression. * * @see self::write() * @param string $expect * @param int $mode * @return string * @access public */ function read($expect = '', $mode = self::READ_SIMPLE) { } /** * Inputs a command into an interactive shell. * * @see self::read() * @param string $cmd * @return bool * @access public */ function write($cmd) { } /** * Start a subsystem. * * Right now only one subsystem at a time is supported. To support multiple subsystem's stopSubsystem() could accept * a string that contained the name of the subsystem, but at that point, only one subsystem of each type could be opened. * To support multiple subsystem's of the same name maybe it'd be best if startSubsystem() generated a new channel id and * returns that and then that that was passed into stopSubsystem() but that'll be saved for a future date and implemented * if there's sufficient demand for such a feature. * * @see self::stopSubsystem() * @param string $subsystem * @return bool * @access public */ function startSubsystem($subsystem) { } /** * Stops a subsystem. * * @see self::startSubsystem() * @return bool * @access public */ function stopSubsystem() { } /** * Closes a channel * * If read() timed out you might want to just close the channel and have it auto-restart on the next read() call * * @access public */ function reset() { } /** * Is timeout? * * Did exec() or read() return because they timed out or because they encountered the end? * * @access public */ function isTimeout() { } /** * Disconnect * * @access public */ function disconnect() { } /** * Destructor. * * Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call * disconnect(). * * @access public */ function __destruct() { } /** * Is the connection still active? * * @return bool * @access public */ function isConnected() { } /** * Have you successfully been logged in? * * @return bool * @access public */ function isAuthenticated() { } /** * Resets a connection for re-use * * @param int $reason * @access private */ function _reset_connection($reason) { } /** * Gets Binary Packets * * See '6. Binary Packet Protocol' of rfc4253 for more info. * * @see self::_send_binary_packet() * @return string * @access private */ function _get_binary_packet($skip_channel_filter = false) { } /** * Filter Binary Packets * * Because some binary packets need to be ignored... * * @see self::_get_binary_packet() * @return string * @access private */ function _filter($payload, $skip_channel_filter) { } /** * Enable Quiet Mode * * Suppress stderr from output * * @access public */ function enableQuietMode() { } /** * Disable Quiet Mode * * Show stderr in output * * @access public */ function disableQuietMode() { } /** * Returns whether Quiet Mode is enabled or not * * @see self::enableQuietMode() * @see self::disableQuietMode() * @access public * @return bool */ function isQuietModeEnabled() { } /** * Enable request-pty when using exec() * * @access public */ function enablePTY() { } /** * Disable request-pty when using exec() * * @access public */ function disablePTY() { } /** * Returns whether request-pty is enabled or not * * @see self::enablePTY() * @see self::disablePTY() * @access public * @return bool */ function isPTYEnabled() { } /** * Gets channel data * * Returns the data as a string if it's available and false if not. * * @param $client_channel * @return mixed * @access private */ function _get_channel_packet($client_channel, $skip_extended = false) { } /** * Sends Binary Packets * * See '6. Binary Packet Protocol' of rfc4253 for more info. * * @param string $data * @param string $logged * @see self::_get_binary_packet() * @return bool * @access private */ function _send_binary_packet($data, $logged = null) { } /** * Logs data packets * * Makes sure that only the last 1MB worth of packets will be logged * * @param string $data * @access private */ function _append_log($message_number, $message) { } /** * Sends channel data * * Spans multiple SSH_MSG_CHANNEL_DATAs if appropriate * * @param int $client_channel * @param string $data * @return bool * @access private */ function _send_channel_packet($client_channel, $data) { } /** * Closes and flushes a channel * * \phpseclib\Net\SSH2 doesn't properly close most channels. For exec() channels are normally closed by the server * and for SFTP channels are presumably closed when the client disconnects. This functions is intended * for SCP more than anything. * * @param int $client_channel * @param bool $want_reply * @return bool * @access private */ function _close_channel($client_channel, $want_reply = false) { } /** * Disconnect * * @param int $reason * @return bool * @access private */ function _disconnect($reason) { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @return string * @access private */ function _string_shift(&$string, $index = 1) { } /** * Define Array * * Takes any number of arrays whose indices are integers and whose values are strings and defines a bunch of * named constants from it, using the value as the name of the constant and the index as the value of the constant. * If any of the constants that would be defined already exists, none of the constants will be defined. * * @param array $array * @access private */ function _define_array() { } /** * Returns a log of the packets that have been sent and received. * * Returns a string if NET_SSH2_LOGGING == self::LOG_COMPLEX, an array if NET_SSH2_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING') * * @access public * @return array|false|string */ function getLog() { } /** * Formats a log for printing * * @param array $message_log * @param array $message_number_log * @access private * @return string */ function _format_log($message_log, $message_number_log) { } /** * Helper function for _format_log * * For use with preg_replace_callback() * * @param array $matches * @access private * @return string */ function _format_log_helper($matches) { } /** * Helper function for agent->_on_channel_open() * * Used when channels are created to inform agent * of said channel opening. Must be called after * channel open confirmation received * * @access private */ function _on_channel_open() { } /** * Returns the first value of the intersection of two arrays or false if * the intersection is empty. The order is defined by the first parameter. * * @param array $array1 * @param array $array2 * @return mixed False if intersection is empty, else intersected value. * @access private */ function _array_intersect_first($array1, $array2) { } /** * Returns all errors * * @return string[] * @access public */ function getErrors() { } /** * Returns the last error * * @return string * @access public */ function getLastError() { } /** * Return the server identification. * * @return string * @access public */ function getServerIdentification() { } /** * Return a list of the key exchange algorithms the server supports. * * @return array * @access public */ function getKexAlgorithms() { } /** * Return a list of the host key (public key) algorithms the server supports. * * @return array * @access public */ function getServerHostKeyAlgorithms() { } /** * Return a list of the (symmetric key) encryption algorithms the server supports, when receiving stuff from the client. * * @return array * @access public */ function getEncryptionAlgorithmsClient2Server() { } /** * Return a list of the (symmetric key) encryption algorithms the server supports, when sending stuff to the client. * * @return array * @access public */ function getEncryptionAlgorithmsServer2Client() { } /** * Return a list of the MAC algorithms the server supports, when receiving stuff from the client. * * @return array * @access public */ function getMACAlgorithmsClient2Server() { } /** * Return a list of the MAC algorithms the server supports, when sending stuff to the client. * * @return array * @access public */ function getMACAlgorithmsServer2Client() { } /** * Return a list of the compression algorithms the server supports, when receiving stuff from the client. * * @return array * @access public */ function getCompressionAlgorithmsClient2Server() { } /** * Return a list of the compression algorithms the server supports, when sending stuff to the client. * * @return array * @access public */ function getCompressionAlgorithmsServer2Client() { } /** * Return a list of the languages the server supports, when sending stuff to the client. * * @return array * @access public */ function getLanguagesServer2Client() { } /** * Return a list of the languages the server supports, when receiving stuff from the client. * * @return array * @access public */ function getLanguagesClient2Server() { } /** * Returns the banner message. * * Quoting from the RFC, "in some jurisdictions, sending a warning message before * authentication may be relevant for getting legal protection." * * @return string * @access public */ function getBannerMessage() { } /** * Returns the server public host key. * * Caching this the first time you connect to a server and checking the result on subsequent connections * is recommended. Returns false if the server signature is not signed correctly with the public host key. * * @return mixed * @access public */ function getServerPublicHostKey() { } /** * Returns the exit status of an SSH command or false. * * @return false|int * @access public */ function getExitStatus() { } /** * Returns the number of columns for the terminal window size. * * @return int * @access public */ function getWindowColumns() { } /** * Returns the number of rows for the terminal window size. * * @return int * @access public */ function getWindowRows() { } /** * Sets the number of columns for the terminal window size. * * @param int $value * @access public */ function setWindowColumns($value) { } /** * Sets the number of rows for the terminal window size. * * @param int $value * @access public */ function setWindowRows($value) { } /** * Sets the number of columns and rows for the terminal window size. * * @param int $columns * @param int $rows * @access public */ function setWindowSize($columns = 80, $rows = 24) { } } /** * Pure-PHP implementations of SFTP. * * @package SFTP * @author Jim Wigginton * @access public */ class SFTP extends \phpseclib\Net\SSH2 { /** * SFTP channel constant * * \phpseclib\Net\SSH2::exec() uses 0 and \phpseclib\Net\SSH2::read() / \phpseclib\Net\SSH2::write() use 1. * * @see \phpseclib\Net\SSH2::_send_channel_packet() * @see \phpseclib\Net\SSH2::_get_channel_packet() * @access private */ const CHANNEL = 0x100; /**#@+ * @access public * @see \phpseclib\Net\SFTP::put() */ /** * Reads data from a local file. */ const SOURCE_LOCAL_FILE = 1; /** * Reads data from a string. */ // this value isn't really used anymore but i'm keeping it reserved for historical reasons const SOURCE_STRING = 2; /** * Reads data from callback: * function callback($length) returns string to proceed, null for EOF */ const SOURCE_CALLBACK = 16; /** * Resumes an upload */ const RESUME = 4; /** * Append a local file to an already existing remote file */ const RESUME_START = 8; /**#@-*/ /** * Packet Types * * @see self::__construct() * @var array * @access private */ var $packet_types = array(); /** * Status Codes * * @see self::__construct() * @var array * @access private */ var $status_codes = array(); /** * The Request ID * * The request ID exists in the off chance that a packet is sent out-of-order. Of course, this library doesn't support * concurrent actions, so it's somewhat academic, here. * * @var int * @see self::_send_sftp_packet() * @access private */ var $request_id = false; /** * The Packet Type * * The request ID exists in the off chance that a packet is sent out-of-order. Of course, this library doesn't support * concurrent actions, so it's somewhat academic, here. * * @var int * @see self::_get_sftp_packet() * @access private */ var $packet_type = -1; /** * Packet Buffer * * @var string * @see self::_get_sftp_packet() * @access private */ var $packet_buffer = ''; /** * Extensions supported by the server * * @var array * @see self::_initChannel() * @access private */ var $extensions = array(); /** * Server SFTP version * * @var int * @see self::_initChannel() * @access private */ var $version; /** * Current working directory * * @var string * @see self::realpath() * @see self::chdir() * @access private */ var $pwd = false; /** * Packet Type Log * * @see self::getLog() * @var array * @access private */ var $packet_type_log = array(); /** * Packet Log * * @see self::getLog() * @var array * @access private */ var $packet_log = array(); /** * Error information * * @see self::getSFTPErrors() * @see self::getLastSFTPError() * @var array * @access private */ var $sftp_errors = array(); /** * Stat Cache * * Rather than always having to open a directory and close it immediately there after to see if a file is a directory * we'll cache the results. * * @see self::_update_stat_cache() * @see self::_remove_from_stat_cache() * @see self::_query_stat_cache() * @var array * @access private */ var $stat_cache = array(); /** * Max SFTP Packet Size * * @see self::__construct() * @see self::get() * @var array * @access private */ var $max_sftp_packet; /** * Stat Cache Flag * * @see self::disableStatCache() * @see self::enableStatCache() * @var bool * @access private */ var $use_stat_cache = true; /** * Sort Options * * @see self::_comparator() * @see self::setListOrder() * @var array * @access private */ var $sortOptions = array(); /** * Canonicalization Flag * * Determines whether or not paths should be canonicalized before being * passed on to the remote server. * * @see self::enablePathCanonicalization() * @see self::disablePathCanonicalization() * @see self::realpath() * @var bool * @access private */ var $canonicalize_paths = true; /** * Default Constructor. * * Connects to an SFTP server * * @param string $host * @param int $port * @param int $timeout * @return \phpseclib\Net\SFTP * @access public */ function __construct($host, $port = 22, $timeout = 10) { } /** * Login * * @param string $username * @param string $password * @return bool * @access public */ function login($username) { } /** * Disable the stat cache * * @access public */ function disableStatCache() { } /** * Enable the stat cache * * @access public */ function enableStatCache() { } /** * Clear the stat cache * * @access public */ function clearStatCache() { } /** * Enable path canonicalization * * @access public */ function enablePathCanonicalization() { } /** * Enable path canonicalization * * @access public */ function disablePathCanonicalization() { } /** * Returns the current directory name * * @return mixed * @access public */ function pwd() { } /** * Logs errors * * @param string $response * @param int $status * @access public */ function _logError($response, $status = -1) { } /** * Returns canonicalized absolute pathname * * realpath() expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input * path and returns the canonicalized absolute pathname. * * @param string $path * @return mixed * @access public */ function realpath($path) { } /** * Canonicalize the Server-Side Path Name * * SFTP doesn't provide a mechanism by which the current working directory can be changed, so we'll emulate it. Returns * the absolute (canonicalized) path. * * If canonicalize_paths has been disabled using disablePathCanonicalization(), $path is returned as-is. * * @see self::chdir() * @see self::disablePathCanonicalization() * @param string $path * @return mixed * @access private */ function _realpath($path) { } /** * Changes the current directory * * @param string $dir * @return bool * @access public */ function chdir($dir) { } /** * Returns a list of files in the given directory * * @param string $dir * @param bool $recursive * @return mixed * @access public */ function nlist($dir = '.', $recursive = false) { } /** * Helper method for nlist * * @param string $dir * @param bool $recursive * @param string $relativeDir * @return mixed * @access private */ function _nlist_helper($dir, $recursive, $relativeDir) { } /** * Returns a detailed list of files in the given directory * * @param string $dir * @param bool $recursive * @return mixed * @access public */ function rawlist($dir = '.', $recursive = false) { } /** * Reads a list, be it detailed or not, of files in the given directory * * @param string $dir * @param bool $raw * @return mixed * @access private */ function _list($dir, $raw = true) { } /** * Compares two rawlist entries using parameters set by setListOrder() * * Intended for use with uasort() * * @param array $a * @param array $b * @return int * @access private */ function _comparator($a, $b) { } /** * Defines how nlist() and rawlist() will be sorted - if at all. * * If sorting is enabled directories and files will be sorted independently with * directories appearing before files in the resultant array that is returned. * * Any parameter returned by stat is a valid sort parameter for this function. * Filename comparisons are case insensitive. * * Examples: * * $sftp->setListOrder('filename', SORT_ASC); * $sftp->setListOrder('size', SORT_DESC, 'filename', SORT_ASC); * $sftp->setListOrder(true); * Separates directories from files but doesn't do any sorting beyond that * $sftp->setListOrder(); * Don't do any sort of sorting * * @access public */ function setListOrder() { } /** * Returns the file size, in bytes, or false, on failure * * Files larger than 4GB will show up as being exactly 4GB. * * @param string $filename * @return mixed * @access public */ function size($filename) { } /** * Save files / directories to cache * * @param string $path * @param mixed $value * @access private */ function _update_stat_cache($path, $value) { } /** * Remove files / directories from cache * * @param string $path * @return bool * @access private */ function _remove_from_stat_cache($path) { } /** * Checks cache for path * * Mainly used by file_exists * * @param string $dir * @return mixed * @access private */ function _query_stat_cache($path) { } /** * Returns general information about a file. * * Returns an array on success and false otherwise. * * @param string $filename * @return mixed * @access public */ function stat($filename) { } /** * Returns general information about a file or symbolic link. * * Returns an array on success and false otherwise. * * @param string $filename * @return mixed * @access public */ function lstat($filename) { } /** * Returns general information about a file or symbolic link * * Determines information without calling \phpseclib\Net\SFTP::realpath(). * The second parameter can be either NET_SFTP_STAT or NET_SFTP_LSTAT. * * @param string $filename * @param int $type * @return mixed * @access private */ function _stat($filename, $type) { } /** * Truncates a file to a given length * * @param string $filename * @param int $new_size * @return bool * @access public */ function truncate($filename, $new_size) { } /** * Sets access and modification time of file. * * If the file does not exist, it will be created. * * @param string $filename * @param int $time * @param int $atime * @return bool * @access public */ function touch($filename, $time = null, $atime = null) { } /** * Changes file or directory owner * * Returns true on success or false on error. * * @param string $filename * @param int $uid * @param bool $recursive * @return bool * @access public */ function chown($filename, $uid, $recursive = false) { } /** * Changes file or directory group * * Returns true on success or false on error. * * @param string $filename * @param int $gid * @param bool $recursive * @return bool * @access public */ function chgrp($filename, $gid, $recursive = false) { } /** * Set permissions on a file. * * Returns the new file permissions on success or false on error. * If $recursive is true than this just returns true or false. * * @param int $mode * @param string $filename * @param bool $recursive * @return mixed * @access public */ function chmod($mode, $filename, $recursive = false) { } /** * Sets information about a file * * @param string $filename * @param string $attr * @param bool $recursive * @return bool * @access private */ function _setstat($filename, $attr, $recursive) { } /** * Recursively sets information on directories on the SFTP server * * Minimizes directory lookups and SSH_FXP_STATUS requests for speed. * * @param string $path * @param string $attr * @param int $i * @return bool * @access private */ function _setstat_recursive($path, $attr, &$i) { } /** * Return the target of a symbolic link * * @param string $link * @return mixed * @access public */ function readlink($link) { } /** * Create a symlink * * symlink() creates a symbolic link to the existing target with the specified name link. * * @param string $target * @param string $link * @return bool * @access public */ function symlink($target, $link) { } /** * Creates a directory. * * @param string $dir * @return bool * @access public */ function mkdir($dir, $mode = -1, $recursive = false) { } /** * Helper function for directory creation * * @param string $dir * @return bool * @access private */ function _mkdir_helper($dir, $attr) { } /** * Removes a directory. * * @param string $dir * @return bool * @access public */ function rmdir($dir) { } /** * Uploads a file to the SFTP server. * * By default, \phpseclib\Net\SFTP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. * So, for example, if you set $data to 'filename.ext' and then do \phpseclib\Net\SFTP::get(), you will get a file, twelve bytes * long, containing 'filename.ext' as its contents. * * Setting $mode to self::SOURCE_LOCAL_FILE will change the above behavior. With self::SOURCE_LOCAL_FILE, $remote_file will * contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how * large $remote_file will be, as well. * * Setting $mode to self::SOURCE_CALLBACK will use $data as callback function, which gets only one parameter -- number of bytes to return, and returns a string if there is some data or null if there is no more data * * If $data is a resource then it'll be used as a resource instead. * * Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take * care of that, yourself. * * $mode can take an additional two parameters - self::RESUME and self::RESUME_START. These are bitwise AND'd with * $mode. So if you want to resume upload of a 300mb file on the local file system you'd set $mode to the following: * * self::SOURCE_LOCAL_FILE | self::RESUME * * If you wanted to simply append the full contents of a local file to the full contents of a remote file you'd replace * self::RESUME with self::RESUME_START. * * If $mode & (self::RESUME | self::RESUME_START) then self::RESUME_START will be assumed. * * $start and $local_start give you more fine grained control over this process and take precident over self::RESUME * when they're non-negative. ie. $start could let you write at the end of a file (like self::RESUME) or in the middle * of one. $local_start could let you start your reading from the end of a file (like self::RESUME_START) or in the * middle of one. * * Setting $local_start to > 0 or $mode | self::RESUME_START doesn't do anything unless $mode | self::SOURCE_LOCAL_FILE. * * @param string $remote_file * @param string|resource $data * @param int $mode * @param int $start * @param int $local_start * @param callable|null $progressCallback * @return bool * @access public * @internal ASCII mode for SFTPv4/5/6 can be supported by adding a new function - \phpseclib\Net\SFTP::setMode(). */ function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null) { } /** * Reads multiple successive SSH_FXP_WRITE responses * * Sending an SSH_FXP_WRITE packet and immediately reading its response isn't as efficient as blindly sending out $i * SSH_FXP_WRITEs, in succession, and then reading $i responses. * * @param int $i * @return bool * @access private */ function _read_put_responses($i) { } /** * Close handle * * @param string $handle * @return bool * @access private */ function _close_handle($handle) { } /** * Downloads a file from the SFTP server. * * Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if * the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the * operation. * * $offset and $length can be used to download files in chunks. * * @param string $remote_file * @param string $local_file * @param int $offset * @param int $length * @return mixed * @access public */ function get($remote_file, $local_file = false, $offset = 0, $length = -1) { } /** * Deletes a file on the SFTP server. * * @param string $path * @param bool $recursive * @return bool * @access public */ function delete($path, $recursive = true) { } /** * Recursively deletes directories on the SFTP server * * Minimizes directory lookups and SSH_FXP_STATUS requests for speed. * * @param string $path * @param int $i * @return bool * @access private */ function _delete_recursive($path, &$i) { } /** * Checks whether a file or directory exists * * @param string $path * @return bool * @access public */ function file_exists($path) { } /** * Tells whether the filename is a directory * * @param string $path * @return bool * @access public */ function is_dir($path) { } /** * Tells whether the filename is a regular file * * @param string $path * @return bool * @access public */ function is_file($path) { } /** * Tells whether the filename is a symbolic link * * @param string $path * @return bool * @access public */ function is_link($path) { } /** * Tells whether a file exists and is readable * * @param string $path * @return bool * @access public */ function is_readable($path) { } /** * Tells whether the filename is writable * * @param string $path * @return bool * @access public */ function is_writable($path) { } /** * Tells whether the filename is writeable * * Alias of is_writable * * @param string $path * @return bool * @access public */ function is_writeable($path) { } /** * Gets last access time of file * * @param string $path * @return mixed * @access public */ function fileatime($path) { } /** * Gets file modification time * * @param string $path * @return mixed * @access public */ function filemtime($path) { } /** * Gets file permissions * * @param string $path * @return mixed * @access public */ function fileperms($path) { } /** * Gets file owner * * @param string $path * @return mixed * @access public */ function fileowner($path) { } /** * Gets file group * * @param string $path * @return mixed * @access public */ function filegroup($path) { } /** * Gets file size * * @param string $path * @return mixed * @access public */ function filesize($path) { } /** * Gets file type * * @param string $path * @return mixed * @access public */ function filetype($path) { } /** * Return a stat properity * * Uses cache if appropriate. * * @param string $path * @param string $prop * @return mixed * @access private */ function _get_stat_cache_prop($path, $prop) { } /** * Return an lstat properity * * Uses cache if appropriate. * * @param string $path * @param string $prop * @return mixed * @access private */ function _get_lstat_cache_prop($path, $prop) { } /** * Return a stat or lstat properity * * Uses cache if appropriate. * * @param string $path * @param string $prop * @return mixed * @access private */ function _get_xstat_cache_prop($path, $prop, $type) { } /** * Renames a file or a directory on the SFTP server * * @param string $oldname * @param string $newname * @return bool * @access public */ function rename($oldname, $newname) { } /** * Parse Attributes * * See '7. File Attributes' of draft-ietf-secsh-filexfer-13 for more info. * * @param string $response * @return array * @access private */ function _parseAttributes(&$response) { } /** * Attempt to identify the file type * * Quoting the SFTP RFC, "Implementations MUST NOT send bits that are not defined" but they seem to anyway * * @param int $mode * @return int * @access private */ function _parseMode($mode) { } /** * Parse Longname * * SFTPv3 doesn't provide any easy way of identifying a file type. You could try to open * a file as a directory and see if an error is returned or you could try to parse the * SFTPv3-specific longname field of the SSH_FXP_NAME packet. That's what this function does. * The result is returned using the * {@link http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-5.2 SFTPv4 type constants}. * * If the longname is in an unrecognized format bool(false) is returned. * * @param string $longname * @return mixed * @access private */ function _parseLongname($longname) { } /** * Sends SFTP Packets * * See '6. General Packet Format' of draft-ietf-secsh-filexfer-13 for more info. * * @param int $type * @param string $data * @see self::_get_sftp_packet() * @see self::_send_channel_packet() * @return bool * @access private */ function _send_sftp_packet($type, $data) { } /** * Receives SFTP Packets * * See '6. General Packet Format' of draft-ietf-secsh-filexfer-13 for more info. * * Incidentally, the number of SSH_MSG_CHANNEL_DATA messages has no bearing on the number of SFTP packets present. * There can be one SSH_MSG_CHANNEL_DATA messages containing two SFTP packets or there can be two SSH_MSG_CHANNEL_DATA * messages containing one SFTP packet. * * @see self::_send_sftp_packet() * @return string * @access private */ function _get_sftp_packet() { } /** * Returns a log of the packets that have been sent and received. * * Returns a string if NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX, an array if NET_SFTP_LOGGING == NET_SFTP_LOG_SIMPLE and false if !defined('NET_SFTP_LOGGING') * * @access public * @return string or Array */ function getSFTPLog() { } /** * Returns all errors * * @return array * @access public */ function getSFTPErrors() { } /** * Returns the last error * * @return string * @access public */ function getLastSFTPError() { } /** * Get supported SFTP versions * * @return array * @access public */ function getSupportedVersions() { } /** * Disconnect * * @param int $reason * @return bool * @access private */ function _disconnect($reason) { } } /** * Pure-PHP implementations of SCP. * * @package SCP * @author Jim Wigginton * @access public */ class SCP { /**#@+ * @access public * @see \phpseclib\Net\SCP::put() */ /** * Reads data from a local file. */ const SOURCE_LOCAL_FILE = 1; /** * Reads data from a string. */ const SOURCE_STRING = 2; /**#@-*/ /**#@+ * @access private * @see \phpseclib\Net\SCP::_send() * @see \phpseclib\Net\SCP::_receive() */ /** * SSH1 is being used. */ const MODE_SSH1 = 1; /** * SSH2 is being used. */ const MODE_SSH2 = 2; /**#@-*/ /** * SSH Object * * @var object * @access private */ var $ssh; /** * Packet Size * * @var int * @access private */ var $packet_size; /** * Mode * * @var int * @access private */ var $mode; /** * Default Constructor. * * Connects to an SSH server * * @param \phpseclib\Net\SSH1|\phpseclib\Net\SSH2 $ssh * @return \phpseclib\Net\SCP * @access public */ function __construct($ssh) { } /** * Uploads a file to the SCP server. * * By default, \phpseclib\Net\SCP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. * So, for example, if you set $data to 'filename.ext' and then do \phpseclib\Net\SCP::get(), you will get a file, twelve bytes * long, containing 'filename.ext' as its contents. * * Setting $mode to self::SOURCE_LOCAL_FILE will change the above behavior. With self::SOURCE_LOCAL_FILE, $remote_file will * contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how * large $remote_file will be, as well. * * Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take * care of that, yourself. * * @param string $remote_file * @param string $data * @param int $mode * @param callable $callback * @return bool * @access public */ function put($remote_file, $data, $mode = self::SOURCE_STRING, $callback = null) { } /** * Downloads a file from the SCP server. * * Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if * the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the * operation * * @param string $remote_file * @param string $local_file * @return mixed * @access public */ function get($remote_file, $local_file = false) { } /** * Sends a packet to an SSH server * * @param string $data * @access private */ function _send($data) { } /** * Receives a packet from an SSH server * * @return string * @access private */ function _receive() { } /** * Closes the connection to an SSH server * * @access private */ function _close() { } } /** * Pure-PHP implementation of SSHv1. * * @package SSH1 * @author Jim Wigginton * @access public */ class SSH1 { /**#@+ * Encryption Methods * * @see \phpseclib\Net\SSH1::getSupportedCiphers() * @access public */ /** * No encryption * * Not supported. */ const CIPHER_NONE = 0; /** * IDEA in CFB mode * * Not supported. */ const CIPHER_IDEA = 1; /** * DES in CBC mode */ const CIPHER_DES = 2; /** * Triple-DES in CBC mode * * All implementations are required to support this */ const CIPHER_3DES = 3; /** * TRI's Simple Stream encryption CBC * * Not supported nor is it defined in the official SSH1 specs. OpenSSH, however, does define it (see cipher.h), * although it doesn't use it (see cipher.c) */ const CIPHER_BROKEN_TSS = 4; /** * RC4 * * Not supported. * * @internal According to the SSH1 specs: * * "The first 16 bytes of the session key are used as the key for * the server to client direction. The remaining 16 bytes are used * as the key for the client to server direction. This gives * independent 128-bit keys for each direction." * * This library currently only supports encryption when the same key is being used for both directions. This is * because there's only one $crypto object. Two could be added ($encrypt and $decrypt, perhaps). */ const CIPHER_RC4 = 5; /** * Blowfish * * Not supported nor is it defined in the official SSH1 specs. OpenSSH, however, defines it (see cipher.h) and * uses it (see cipher.c) */ const CIPHER_BLOWFISH = 6; /**#@-*/ /**#@+ * Authentication Methods * * @see \phpseclib\Net\SSH1::getSupportedAuthentications() * @access public */ /** * .rhosts or /etc/hosts.equiv */ const AUTH_RHOSTS = 1; /** * pure RSA authentication */ const AUTH_RSA = 2; /** * password authentication * * This is the only method that is supported by this library. */ const AUTH_PASSWORD = 3; /** * .rhosts with RSA host authentication */ const AUTH_RHOSTS_RSA = 4; /**#@-*/ /**#@+ * Terminal Modes * * @link http://3sp.com/content/developer/maverick-net/docs/Maverick.SSH.PseudoTerminalModesMembers.html * @access private */ const TTY_OP_END = 0; /**#@-*/ /** * The Response Type * * @see \phpseclib\Net\SSH1::_get_binary_packet() * @access private */ const RESPONSE_TYPE = 1; /** * The Response Data * * @see \phpseclib\Net\SSH1::_get_binary_packet() * @access private */ const RESPONSE_DATA = 2; /**#@+ * Execution Bitmap Masks * * @see \phpseclib\Net\SSH1::bitmap * @access private */ const MASK_CONSTRUCTOR = 0x1; const MASK_CONNECTED = 0x2; const MASK_LOGIN = 0x4; const MASK_SHELL = 0x8; /**#@-*/ /**#@+ * @access public * @see \phpseclib\Net\SSH1::getLog() */ /** * Returns the message numbers */ const LOG_SIMPLE = 1; /** * Returns the message content */ const LOG_COMPLEX = 2; /** * Outputs the content real-time */ const LOG_REALTIME = 3; /** * Dumps the content real-time to a file */ const LOG_REALTIME_FILE = 4; /**#@-*/ /**#@+ * @access public * @see \phpseclib\Net\SSH1::read() */ /** * Returns when a string matching $expect exactly is found */ const READ_SIMPLE = 1; /** * Returns when a string matching the regular expression $expect is found */ const READ_REGEX = 2; /**#@-*/ /** * The SSH identifier * * @var string * @access private */ var $identifier = 'SSH-1.5-phpseclib'; /** * The Socket Object * * @var object * @access private */ var $fsock; /** * The cryptography object * * @var object * @access private */ var $crypto = false; /** * Execution Bitmap * * The bits that are set represent functions that have been called already. This is used to determine * if a requisite function has been successfully executed. If not, an error should be thrown. * * @var int * @access private */ var $bitmap = 0; /** * The Server Key Public Exponent * * Logged for debug purposes * * @see self::getServerKeyPublicExponent() * @var string * @access private */ var $server_key_public_exponent; /** * The Server Key Public Modulus * * Logged for debug purposes * * @see self::getServerKeyPublicModulus() * @var string * @access private */ var $server_key_public_modulus; /** * The Host Key Public Exponent * * Logged for debug purposes * * @see self::getHostKeyPublicExponent() * @var string * @access private */ var $host_key_public_exponent; /** * The Host Key Public Modulus * * Logged for debug purposes * * @see self::getHostKeyPublicModulus() * @var string * @access private */ var $host_key_public_modulus; /** * Supported Ciphers * * Logged for debug purposes * * @see self::getSupportedCiphers() * @var array * @access private */ var $supported_ciphers = array(self::CIPHER_NONE => 'No encryption', self::CIPHER_IDEA => 'IDEA in CFB mode', self::CIPHER_DES => 'DES in CBC mode', self::CIPHER_3DES => 'Triple-DES in CBC mode', self::CIPHER_BROKEN_TSS => 'TRI\'s Simple Stream encryption CBC', self::CIPHER_RC4 => 'RC4', self::CIPHER_BLOWFISH => 'Blowfish'); /** * Supported Authentications * * Logged for debug purposes * * @see self::getSupportedAuthentications() * @var array * @access private */ var $supported_authentications = array(self::AUTH_RHOSTS => '.rhosts or /etc/hosts.equiv', self::AUTH_RSA => 'pure RSA authentication', self::AUTH_PASSWORD => 'password authentication', self::AUTH_RHOSTS_RSA => '.rhosts with RSA host authentication'); /** * Server Identification * * @see self::getServerIdentification() * @var string * @access private */ var $server_identification = ''; /** * Protocol Flags * * @see self::__construct() * @var array * @access private */ var $protocol_flags = array(); /** * Protocol Flag Log * * @see self::getLog() * @var array * @access private */ var $protocol_flag_log = array(); /** * Message Log * * @see self::getLog() * @var array * @access private */ var $message_log = array(); /** * Real-time log file pointer * * @see self::_append_log() * @var resource * @access private */ var $realtime_log_file; /** * Real-time log file size * * @see self::_append_log() * @var int * @access private */ var $realtime_log_size; /** * Real-time log file wrap boolean * * @see self::_append_log() * @var bool * @access private */ var $realtime_log_wrap; /** * Interactive Buffer * * @see self::read() * @var array * @access private */ var $interactiveBuffer = ''; /** * Timeout * * @see self::setTimeout() * @access private */ var $timeout; /** * Current Timeout * * @see self::_get_channel_packet() * @access private */ var $curTimeout; /** * Log Boundary * * @see self::_format_log() * @access private */ var $log_boundary = ':'; /** * Log Long Width * * @see self::_format_log() * @access private */ var $log_long_width = 65; /** * Log Short Width * * @see self::_format_log() * @access private */ var $log_short_width = 16; /** * Hostname * * @see self::__construct() * @see self::_connect() * @var string * @access private */ var $host; /** * Port Number * * @see self::__construct() * @see self::_connect() * @var int * @access private */ var $port; /** * Timeout for initial connection * * Set by the constructor call. Calling setTimeout() is optional. If it's not called functions like * exec() won't timeout unless some PHP setting forces it too. The timeout specified in the constructor, * however, is non-optional. There will be a timeout, whether or not you set it. If you don't it'll be * 10 seconds. It is used by fsockopen() in that function. * * @see self::__construct() * @see self::_connect() * @var int * @access private */ var $connectionTimeout; /** * Default cipher * * @see self::__construct() * @see self::_connect() * @var int * @access private */ var $cipher; /** * Default Constructor. * * Connects to an SSHv1 server * * @param string $host * @param int $port * @param int $timeout * @param int $cipher * @return \phpseclib\Net\SSH1 * @access public */ function __construct($host, $port = 22, $timeout = 10, $cipher = self::CIPHER_3DES) { } /** * Connect to an SSHv1 server * * @return bool * @access private */ function _connect() { } /** * Login * * @param string $username * @param string $password * @return bool * @access public */ function login($username, $password = '') { } /** * Set Timeout * * $ssh->exec('ping 127.0.0.1'); on a Linux host will never return and will run indefinitely. setTimeout() makes it so it'll timeout. * Setting $timeout to false or 0 will mean there is no timeout. * * @param mixed $timeout */ function setTimeout($timeout) { } /** * Executes a command on a non-interactive shell, returns the output, and quits. * * An SSH1 server will close the connection after a command has been executed on a non-interactive shell. SSH2 * servers don't, however, this isn't an SSH2 client. The way this works, on the server, is by initiating a * shell with the -s option, as discussed in the following links: * * {@link http://www.faqs.org/docs/bashman/bashref_65.html http://www.faqs.org/docs/bashman/bashref_65.html} * {@link http://www.faqs.org/docs/bashman/bashref_62.html http://www.faqs.org/docs/bashman/bashref_62.html} * * To execute further commands, a new \phpseclib\Net\SSH1 object will need to be created. * * Returns false on failure and the output, otherwise. * * @see self::interactiveRead() * @see self::interactiveWrite() * @param string $cmd * @return mixed * @access public */ function exec($cmd, $block = true) { } /** * Creates an interactive shell * * @see self::interactiveRead() * @see self::interactiveWrite() * @return bool * @access private */ function _initShell() { } /** * Inputs a command into an interactive shell. * * @see self::interactiveWrite() * @param string $cmd * @return bool * @access public */ function write($cmd) { } /** * Returns the output of an interactive shell when there's a match for $expect * * $expect can take the form of a string literal or, if $mode == self::READ_REGEX, * a regular expression. * * @see self::write() * @param string $expect * @param int $mode * @return bool * @access public */ function read($expect, $mode = self::READ_SIMPLE) { } /** * Inputs a command into an interactive shell. * * @see self::interactiveRead() * @param string $cmd * @return bool * @access public */ function interactiveWrite($cmd) { } /** * Returns the output of an interactive shell when no more output is available. * * Requires PHP 4.3.0 or later due to the use of the stream_select() function. If you see stuff like * "^[[00m", you're seeing ANSI escape codes. According to * {@link http://support.microsoft.com/kb/101875 How to Enable ANSI.SYS in a Command Window}, "Windows NT * does not support ANSI escape sequences in Win32 Console applications", so if you're a Windows user, * there's not going to be much recourse. * * @see self::interactiveRead() * @return string * @access public */ function interactiveRead() { } /** * Disconnect * * @access public */ function disconnect() { } /** * Destructor. * * Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call * disconnect(). * * @access public */ function __destruct() { } /** * Disconnect * * @param string $msg * @access private */ function _disconnect($msg = 'Client Quit') { } /** * Gets Binary Packets * * See 'The Binary Packet Protocol' of protocol-1.5.txt for more info. * * Also, this function could be improved upon by adding detection for the following exploit: * http://www.securiteam.com/securitynews/5LP042K3FY.html * * @see self::_send_binary_packet() * @return array * @access private */ function _get_binary_packet() { } /** * Sends Binary Packets * * Returns true on success, false on failure. * * @see self::_get_binary_packet() * @param string $data * @return bool * @access private */ function _send_binary_packet($data) { } /** * Cyclic Redundancy Check (CRC) * * PHP's crc32 function is implemented slightly differently than the one that SSH v1 uses, so * we've reimplemented it. A more detailed discussion of the differences can be found after * $crc_lookup_table's initialization. * * @see self::_get_binary_packet() * @see self::_send_binary_packet() * @param string $data * @return int * @access private */ function _crc($data) { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @return string * @access private */ function _string_shift(&$string, $index = 1) { } /** * RSA Encrypt * * Returns mod(pow($m, $e), $n), where $n should be the product of two (large) primes $p and $q and where $e * should be a number with the property that gcd($e, ($p - 1) * ($q - 1)) == 1. Could just make anything that * calls this call modexp, instead, but I think this makes things clearer, maybe... * * @see self::__construct() * @param BigInteger $m * @param array $key * @return BigInteger * @access private */ function _rsa_crypt($m, $key) { } /** * Define Array * * Takes any number of arrays whose indices are integers and whose values are strings and defines a bunch of * named constants from it, using the value as the name of the constant and the index as the value of the constant. * If any of the constants that would be defined already exists, none of the constants will be defined. * * @param array $array * @access private */ function _define_array() { } /** * Returns a log of the packets that have been sent and received. * * Returns a string if NET_SSH1_LOGGING == self::LOG_COMPLEX, an array if NET_SSH1_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SSH1_LOGGING') * * @access public * @return array|false|string */ function getLog() { } /** * Formats a log for printing * * @param array $message_log * @param array $message_number_log * @access private * @return string */ function _format_log($message_log, $message_number_log) { } /** * Helper function for _format_log * * For use with preg_replace_callback() * * @param array $matches * @access private * @return string */ function _format_log_helper($matches) { } /** * Return the server key public exponent * * Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, * the raw bytes. This behavior is similar to PHP's md5() function. * * @param bool $raw_output * @return string * @access public */ function getServerKeyPublicExponent($raw_output = false) { } /** * Return the server key public modulus * * Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, * the raw bytes. This behavior is similar to PHP's md5() function. * * @param bool $raw_output * @return string * @access public */ function getServerKeyPublicModulus($raw_output = false) { } /** * Return the host key public exponent * * Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, * the raw bytes. This behavior is similar to PHP's md5() function. * * @param bool $raw_output * @return string * @access public */ function getHostKeyPublicExponent($raw_output = false) { } /** * Return the host key public modulus * * Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, * the raw bytes. This behavior is similar to PHP's md5() function. * * @param bool $raw_output * @return string * @access public */ function getHostKeyPublicModulus($raw_output = false) { } /** * Return a list of ciphers supported by SSH1 server. * * Just because a cipher is supported by an SSH1 server doesn't mean it's supported by this library. If $raw_output * is set to true, returns, instead, an array of constants. ie. instead of array('Triple-DES in CBC mode'), you'll * get array(self::CIPHER_3DES). * * @param bool $raw_output * @return array * @access public */ function getSupportedCiphers($raw_output = false) { } /** * Return a list of authentications supported by SSH1 server. * * Just because a cipher is supported by an SSH1 server doesn't mean it's supported by this library. If $raw_output * is set to true, returns, instead, an array of constants. ie. instead of array('password authentication'), you'll * get array(self::AUTH_PASSWORD). * * @param bool $raw_output * @return array * @access public */ function getSupportedAuthentications($raw_output = false) { } /** * Return the server identification. * * @return string * @access public */ function getServerIdentification() { } /** * Logs data packets * * Makes sure that only the last 1MB worth of packets will be logged * * @param string $data * @access private */ function _append_log($protocol_flags, $message) { } } } namespace phpseclib\Math { /** * Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 * numbers. * * @package BigInteger * @author Jim Wigginton * @access public */ class BigInteger { /**#@+ * Reduction constants * * @access private * @see BigInteger::_reduce() */ /** * @see BigInteger::_montgomery() * @see BigInteger::_prepMontgomery() */ const MONTGOMERY = 0; /** * @see BigInteger::_barrett() */ const BARRETT = 1; /** * @see BigInteger::_mod2() */ const POWEROF2 = 2; /** * @see BigInteger::_remainder() */ const CLASSIC = 3; /** * @see BigInteger::__clone() */ const NONE = 4; /**#@-*/ /**#@+ * Array constants * * Rather than create a thousands and thousands of new BigInteger objects in repeated function calls to add() and * multiply() or whatever, we'll just work directly on arrays, taking them in as parameters and returning them. * * @access private */ /** * $result[self::VALUE] contains the value. */ const VALUE = 0; /** * $result[self::SIGN] contains the sign. */ const SIGN = 1; /**#@-*/ /**#@+ * @access private * @see BigInteger::_montgomery() * @see BigInteger::_barrett() */ /** * Cache constants * * $cache[self::VARIABLE] tells us whether or not the cached data is still valid. */ const VARIABLE = 0; /** * $cache[self::DATA] contains the cached data. */ const DATA = 1; /**#@-*/ /**#@+ * Mode constants. * * @access private * @see BigInteger::__construct() */ /** * To use the pure-PHP implementation */ const MODE_INTERNAL = 1; /** * To use the BCMath library * * (if enabled; otherwise, the internal implementation will be used) */ const MODE_BCMATH = 2; /** * To use the GMP library * * (if present; otherwise, either the BCMath or the internal implementation will be used) */ const MODE_GMP = 3; /**#@-*/ /** * Karatsuba Cutoff * * At what point do we switch between Karatsuba multiplication and schoolbook long multiplication? * * @access private */ const KARATSUBA_CUTOFF = 25; /**#@+ * Static properties used by the pure-PHP implementation. * * @see __construct() */ protected static $base; protected static $baseFull; protected static $maxDigit; protected static $msb; /** * $max10 in greatest $max10Len satisfying * $max10 = 10**$max10Len <= 2**$base. */ protected static $max10; /** * $max10Len in greatest $max10Len satisfying * $max10 = 10**$max10Len <= 2**$base. */ protected static $max10Len; protected static $maxDigit2; /**#@-*/ /** * Holds the BigInteger's value. * * @var array * @access private */ var $value; /** * Holds the BigInteger's magnitude. * * @var bool * @access private */ var $is_negative = false; /** * Precision * * @see self::setPrecision() * @access private */ var $precision = -1; /** * Precision Bitmask * * @see self::setPrecision() * @access private */ var $bitmask = false; /** * Mode independent value used for serialization. * * If the bcmath or gmp extensions are installed $this->value will be a non-serializable resource, hence the need for * a variable that'll be serializable regardless of whether or not extensions are being used. Unlike $this->value, * however, $this->hex is only calculated when $this->__sleep() is called. * * @see self::__sleep() * @see self::__wakeup() * @var string * @access private */ var $hex; /** * Converts base-2, base-10, base-16, and binary strings (base-256) to BigIntegers. * * If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using * two's compliment. The sole exception to this is -10, which is treated the same as 10 is. * * Here's an example: * * toString(); // outputs 50 * ?> * * * @param $x base-10 number or base-$base number if $base set. * @param int $base * @return \phpseclib\Math\BigInteger * @access public */ function __construct($x = 0, $base = 10) { } /** * Converts a BigInteger to a byte string (eg. base-256). * * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're * saved as two's compliment. * * Here's an example: * * toBytes(); // outputs chr(65) * ?> * * * @param bool $twos_compliment * @return string * @access public * @internal Converts a base-2**26 number to base-2**8 */ function toBytes($twos_compliment = false) { } /** * Converts a BigInteger to a hex string (eg. base-16)). * * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're * saved as two's compliment. * * Here's an example: * * toHex(); // outputs '41' * ?> * * * @param bool $twos_compliment * @return string * @access public * @internal Converts a base-2**26 number to base-2**8 */ function toHex($twos_compliment = false) { } /** * Converts a BigInteger to a bit string (eg. base-2). * * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're * saved as two's compliment. * * Here's an example: * * toBits(); // outputs '1000001' * ?> * * * @param bool $twos_compliment * @return string * @access public * @internal Converts a base-2**26 number to base-2**2 */ function toBits($twos_compliment = false) { } /** * Converts a BigInteger to a base-10 number. * * Here's an example: * * toString(); // outputs 50 * ?> * * * @return string * @access public * @internal Converts a base-2**26 number to base-10**7 (which is pretty much base-10) */ function toString() { } /** * Copy an object * * PHP5 passes objects by reference while PHP4 passes by value. As such, we need a function to guarantee * that all objects are passed by value, when appropriate. More information can be found here: * * {@link http://php.net/language.oop5.basic#51624} * * @access public * @see self::__clone() * @return \phpseclib\Math\BigInteger */ function copy() { } /** * __toString() magic method * * Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call * toString(). * * @access public * @internal Implemented per a suggestion by Techie-Michael - thanks! */ function __toString() { } /** * __clone() magic method * * Although you can call BigInteger::__toString() directly in PHP5, you cannot call BigInteger::__clone() directly * in PHP5. You can in PHP4 since it's not a magic method, but in PHP5, you have to call it by using the PHP5 * only syntax of $y = clone $x. As such, if you're trying to write an application that works on both PHP4 and * PHP5, call BigInteger::copy(), instead. * * @access public * @see self::copy() * @return \phpseclib\Math\BigInteger */ function __clone() { } /** * __sleep() magic method * * Will be called, automatically, when serialize() is called on a BigInteger object. * * @see self::__wakeup() * @access public */ function __sleep() { } /** * __wakeup() magic method * * Will be called, automatically, when unserialize() is called on a BigInteger object. * * @see self::__sleep() * @access public */ function __wakeup() { } /** * __debugInfo() magic method * * Will be called, automatically, when print_r() or var_dump() are called * * @access public */ function __debugInfo() { } /** * Adds two BigIntegers. * * Here's an example: * * add($b); * * echo $c->toString(); // outputs 30 * ?> * * * @param \phpseclib\Math\BigInteger $y * @return \phpseclib\Math\BigInteger * @access public * @internal Performs base-2**52 addition */ function add($y) { } /** * Performs addition. * * @param array $x_value * @param bool $x_negative * @param array $y_value * @param bool $y_negative * @return array * @access private */ function _add($x_value, $x_negative, $y_value, $y_negative) { } /** * Subtracts two BigIntegers. * * Here's an example: * * subtract($b); * * echo $c->toString(); // outputs -10 * ?> * * * @param \phpseclib\Math\BigInteger $y * @return \phpseclib\Math\BigInteger * @access public * @internal Performs base-2**52 subtraction */ function subtract($y) { } /** * Performs subtraction. * * @param array $x_value * @param bool $x_negative * @param array $y_value * @param bool $y_negative * @return array * @access private */ function _subtract($x_value, $x_negative, $y_value, $y_negative) { } /** * Multiplies two BigIntegers * * Here's an example: * * multiply($b); * * echo $c->toString(); // outputs 200 * ?> * * * @param \phpseclib\Math\BigInteger $x * @return \phpseclib\Math\BigInteger * @access public */ function multiply($x) { } /** * Performs multiplication. * * @param array $x_value * @param bool $x_negative * @param array $y_value * @param bool $y_negative * @return array * @access private */ function _multiply($x_value, $x_negative, $y_value, $y_negative) { } /** * Performs long multiplication on two BigIntegers * * Modeled after 'multiply' in MutableBigInteger.java. * * @param array $x_value * @param array $y_value * @return array * @access private */ function _regularMultiply($x_value, $y_value) { } /** * Performs Karatsuba multiplication on two BigIntegers * * See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=120 MPM 5.2.3}. * * @param array $x_value * @param array $y_value * @return array * @access private */ function _karatsuba($x_value, $y_value) { } /** * Performs squaring * * @param array $x * @return array * @access private */ function _square($x = false) { } /** * Performs traditional squaring on two BigIntegers * * Squaring can be done faster than multiplying a number by itself can be. See * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=7 HAC 14.2.4} / * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information. * * @param array $value * @return array * @access private */ function _baseSquare($value) { } /** * Performs Karatsuba "squaring" on two BigIntegers * * See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}. * * @param array $value * @return array * @access private */ function _karatsubaSquare($value) { } /** * Divides two BigIntegers. * * Returns an array whose first element contains the quotient and whose second element contains the * "common residue". If the remainder would be positive, the "common residue" and the remainder are the * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * * Here's an example: * * divide($b); * * echo $quotient->toString(); // outputs 0 * echo "\r\n"; * echo $remainder->toString(); // outputs 10 * ?> * * * @param \phpseclib\Math\BigInteger $y * @return array * @access public * @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}. */ function divide($y) { } /** * Divides a BigInteger by a regular integer * * abc / x = a00 / x + b0 / x + c / x * * @param array $dividend * @param array $divisor * @return array * @access private */ function _divide_digit($dividend, $divisor) { } /** * Performs modular exponentiation. * * Here's an example: * * modPow($b, $c); * * echo $c->toString(); // outputs 10 * ?> * * * @param \phpseclib\Math\BigInteger $e * @param \phpseclib\Math\BigInteger $n * @return \phpseclib\Math\BigInteger * @access public * @internal The most naive approach to modular exponentiation has very unreasonable requirements, and * and although the approach involving repeated squaring does vastly better, it, too, is impractical * for our purposes. The reason being that division - by far the most complicated and time-consuming * of the basic operations (eg. +,-,*,/) - occurs multiple times within it. * * Modular reductions resolve this issue. Although an individual modular reduction takes more time * then an individual division, when performed in succession (with the same modulo), they're a lot faster. * * The two most commonly used modular reductions are Barrett and Montgomery reduction. Montgomery reduction, * although faster, only works when the gcd of the modulo and of the base being used is 1. In RSA, when the * base is a power of two, the modulo - a product of two primes - is always going to have a gcd of 1 (because * the product of two odd numbers is odd), but what about when RSA isn't used? * * In contrast, Barrett reduction has no such constraint. As such, some bigint implementations perform a * Barrett reduction after every operation in the modpow function. Others perform Barrett reductions when the * modulo is even and Montgomery reductions when the modulo is odd. BigInteger.java's modPow method, however, * uses a trick involving the Chinese Remainder Theorem to factor the even modulo into two numbers - one odd and * the other, a power of two - and recombine them, later. This is the method that this modPow function uses. * {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates. */ function modPow($e, $n) { } /** * Performs modular exponentiation. * * Alias for modPow(). * * @param \phpseclib\Math\BigInteger $e * @param \phpseclib\Math\BigInteger $n * @return \phpseclib\Math\BigInteger * @access public */ function powMod($e, $n) { } /** * Sliding Window k-ary Modular Exponentiation * * Based on {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=27 HAC 14.85} / * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=210 MPM 7.7}. In a departure from those algorithims, * however, this function performs a modular reduction after every multiplication and squaring operation. * As such, this function has the same preconditions that the reductions being used do. * * @param \phpseclib\Math\BigInteger $e * @param \phpseclib\Math\BigInteger $n * @param int $mode * @return \phpseclib\Math\BigInteger * @access private */ function _slidingWindow($e, $n, $mode) { } /** * Modular reduction * * For most $modes this will return the remainder. * * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @param int $mode * @return array */ function _reduce($x, $n, $mode) { } /** * Modular reduction preperation * * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @param int $mode * @return array */ function _prepareReduce($x, $n, $mode) { } /** * Modular multiply * * @see self::_slidingWindow() * @access private * @param array $x * @param array $y * @param array $n * @param int $mode * @return array */ function _multiplyReduce($x, $y, $n, $mode) { } /** * Modular square * * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @param int $mode * @return array */ function _squareReduce($x, $n, $mode) { } /** * Modulos for Powers of Two * * Calculates $x%$n, where $n = 2**$e, for some $e. Since this is basically the same as doing $x & ($n-1), * we'll just use this function as a wrapper for doing that. * * @see self::_slidingWindow() * @access private * @param \phpseclib\Math\BigInteger * @return \phpseclib\Math\BigInteger */ function _mod2($n) { } /** * Barrett Modular Reduction * * See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=14 HAC 14.3.3} / * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=165 MPM 6.2.5} for more information. Modified slightly, * so as not to require negative numbers (initially, this script didn't support negative numbers). * * Employs "folding", as described at * {@link http://www.cosic.esat.kuleuven.be/publications/thesis-149.pdf#page=66 thesis-149.pdf#page=66}. To quote from * it, "the idea [behind folding] is to find a value x' such that x (mod m) = x' (mod m), with x' being smaller than x." * * Unfortunately, the "Barrett Reduction with Folding" algorithm described in thesis-149.pdf is not, as written, all that * usable on account of (1) its not using reasonable radix points as discussed in * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=162 MPM 6.2.2} and (2) the fact that, even with reasonable * radix points, it only works when there are an even number of digits in the denominator. The reason for (2) is that * (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line * comments for details. * * @see self::_slidingWindow() * @access private * @param array $n * @param array $m * @return array */ function _barrett($n, $m) { } /** * (Regular) Barrett Modular Reduction * * For numbers with more than four digits BigInteger::_barrett() is faster. The difference between that and this * is that this function does not fold the denominator into a smaller form. * * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @return array */ function _regularBarrett($x, $n) { } /** * Performs long multiplication up to $stop digits * * If you're going to be doing array_slice($product->value, 0, $stop), some cycles can be saved. * * @see self::_regularBarrett() * @param array $x_value * @param bool $x_negative * @param array $y_value * @param bool $y_negative * @param int $stop * @return array * @access private */ function _multiplyLower($x_value, $x_negative, $y_value, $y_negative, $stop) { } /** * Montgomery Modular Reduction * * ($x->_prepMontgomery($n))->_montgomery($n) yields $x % $n. * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=170 MPM 6.3} provides insights on how this can be * improved upon (basically, by using the comba method). gcd($n, 2) must be equal to one for this function * to work correctly. * * @see self::_prepMontgomery() * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @return array */ function _montgomery($x, $n) { } /** * Montgomery Multiply * * Interleaves the montgomery reduction and long multiplication algorithms together as described in * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=13 HAC 14.36} * * @see self::_prepMontgomery() * @see self::_montgomery() * @access private * @param array $x * @param array $y * @param array $m * @return array */ function _montgomeryMultiply($x, $y, $m) { } /** * Prepare a number for use in Montgomery Modular Reductions * * @see self::_montgomery() * @see self::_slidingWindow() * @access private * @param array $x * @param array $n * @return array */ function _prepMontgomery($x, $n) { } /** * Modular Inverse of a number mod 2**26 (eg. 67108864) * * Based off of the bnpInvDigit function implemented and justified in the following URL: * * {@link http://www-cs-students.stanford.edu/~tjw/jsbn/jsbn.js} * * The following URL provides more info: * * {@link http://groups.google.com/group/sci.crypt/msg/7a137205c1be7d85} * * As for why we do all the bitmasking... strange things can happen when converting from floats to ints. For * instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields * int(-2147483648). To avoid problems stemming from this, we use bitmasks to guarantee that ints aren't * auto-converted to floats. The outermost bitmask is present because without it, there's no guarantee that * the "residue" returned would be the so-called "common residue". We use fmod, in the last step, because the * maximum possible $x is 26 bits and the maximum $result is 16 bits. Thus, we have to be able to handle up to * 40 bits, which only 64-bit floating points will support. * * Thanks to Pedro Gimeno Fortea for input! * * @see self::_montgomery() * @access private * @param array $x * @return int */ function _modInverse67108864($x) { } /** * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * * Here's an example: * * modInverse($b); * echo $c->toString(); // outputs 4 * * echo "\r\n"; * * $d = $a->multiply($c); * list(, $d) = $d->divide($b); * echo $d; // outputs 1 (as per the definition of modular inverse) * ?> * * * @param \phpseclib\Math\BigInteger $n * @return \phpseclib\Math\BigInteger|false * @access public * @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information. */ function modInverse($n) { } /** * Calculates the greatest common divisor and Bezout's identity. * * Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that * 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which * combination is returned is dependent upon which mode is in use. See * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information. * * Here's an example: * * extendedGCD($b)); * * echo $gcd->toString() . "\r\n"; // outputs 21 * echo $a->toString() * $x->toString() + $b->toString() * $y->toString(); // outputs 21 * ?> * * * @param \phpseclib\Math\BigInteger $n * @return \phpseclib\Math\BigInteger * @access public * @internal Calculates the GCD using the binary xGCD algorithim described in * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=19 HAC 14.61}. As the text above 14.61 notes, * the more traditional algorithim requires "relatively costly multiple-precision divisions". */ function extendedGCD($n) { } /** * Calculates the greatest common divisor * * Say you have 693 and 609. The GCD is 21. * * Here's an example: * * extendedGCD($b); * * echo $gcd->toString() . "\r\n"; // outputs 21 * ?> * * * @param \phpseclib\Math\BigInteger $n * @return \phpseclib\Math\BigInteger * @access public */ function gcd($n) { } /** * Absolute value. * * @return \phpseclib\Math\BigInteger * @access public */ function abs() { } /** * Compares two numbers. * * Although one might think !$x->compare($y) means $x != $y, it, in fact, means the opposite. The reason for this is * demonstrated thusly: * * $x > $y: $x->compare($y) > 0 * $x < $y: $x->compare($y) < 0 * $x == $y: $x->compare($y) == 0 * * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * * @param \phpseclib\Math\BigInteger $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @access public * @see self::equals() * @internal Could return $this->subtract($x), but that's not as fast as what we do do. */ function compare($y) { } /** * Compares two numbers. * * @param array $x_value * @param bool $x_negative * @param array $y_value * @param bool $y_negative * @return int * @see self::compare() * @access private */ function _compare($x_value, $x_negative, $y_value, $y_negative) { } /** * Tests the equality of two numbers. * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * * @param \phpseclib\Math\BigInteger $x * @return bool * @access public * @see self::compare() */ function equals($x) { } /** * Set Precision * * Some bitwise operations give different results depending on the precision being used. Examples include left * shift, not, and rotates. * * @param int $bits * @access public */ function setPrecision($bits) { } /** * Logical And * * @param \phpseclib\Math\BigInteger $x * @access public * @internal Implemented per a request by Lluis Pamies i Juarez * @return \phpseclib\Math\BigInteger */ function bitwise_and($x) { } /** * Logical Or * * @param \phpseclib\Math\BigInteger $x * @access public * @internal Implemented per a request by Lluis Pamies i Juarez * @return \phpseclib\Math\BigInteger */ function bitwise_or($x) { } /** * Logical Exclusive-Or * * @param \phpseclib\Math\BigInteger $x * @access public * @internal Implemented per a request by Lluis Pamies i Juarez * @return \phpseclib\Math\BigInteger */ function bitwise_xor($x) { } /** * Logical Not * * @access public * @internal Implemented per a request by Lluis Pamies i Juarez * @return \phpseclib\Math\BigInteger */ function bitwise_not() { } /** * Logical Right Shift * * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * * @param int $shift * @return \phpseclib\Math\BigInteger * @access public * @internal The only version that yields any speed increases is the internal version. */ function bitwise_rightShift($shift) { } /** * Logical Left Shift * * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * * @param int $shift * @return \phpseclib\Math\BigInteger * @access public * @internal The only version that yields any speed increases is the internal version. */ function bitwise_leftShift($shift) { } /** * Logical Left Rotate * * Instead of the top x bits being dropped they're appended to the shifted bit string. * * @param int $shift * @return \phpseclib\Math\BigInteger * @access public */ function bitwise_leftRotate($shift) { } /** * Logical Right Rotate * * Instead of the bottom x bits being dropped they're prepended to the shifted bit string. * * @param int $shift * @return \phpseclib\Math\BigInteger * @access public */ function bitwise_rightRotate($shift) { } /** * Generates a random BigInteger * * Byte length is equal to $length. Uses \phpseclib\Crypt\Random if it's loaded and mt_rand if it's not. * * @param int $length * @return \phpseclib\Math\BigInteger * @access private */ function _random_number_helper($size) { } /** * Generate a random number * * Returns a random number between $min and $max where $min and $max * can be defined using one of the two methods: * * $min->random($max) * $max->random($min) * * @param \phpseclib\Math\BigInteger $arg1 * @param \phpseclib\Math\BigInteger $arg2 * @return \phpseclib\Math\BigInteger * @access public * @internal The API for creating random numbers used to be $a->random($min, $max), where $a was a BigInteger object. * That method is still supported for BC purposes. */ function random($arg1, $arg2 = false) { } /** * Generate a random prime number. * * If there's not a prime within the given range, false will be returned. * If more than $timeout seconds have elapsed, give up and return false. * * @param \phpseclib\Math\BigInteger $arg1 * @param \phpseclib\Math\BigInteger $arg2 * @param int $timeout * @return Math_BigInteger|false * @access public * @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=15 HAC 4.44}. */ function randomPrime($arg1, $arg2 = false, $timeout = false) { } /** * Make the current number odd * * If the current number is odd it'll be unchanged. If it's even, one will be added to it. * * @see self::randomPrime() * @access private */ function _make_odd() { } /** * Checks a numer to see if it's prime * * Assuming the $t parameter is not set, this function has an error rate of 2**-80. The main motivation for the * $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads * on a website instead of just one. * * @param \phpseclib\Math\BigInteger $t * @return bool * @access public * @internal Uses the * {@link http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test Miller-Rabin primality test}. See * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=8 HAC 4.24}. */ function isPrime($t = false) { } /** * Logical Left Shift * * Shifts BigInteger's by $shift bits. * * @param int $shift * @access private */ function _lshift($shift) { } /** * Logical Right Shift * * Shifts BigInteger's by $shift bits. * * @param int $shift * @access private */ function _rshift($shift) { } /** * Normalize * * Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * * @param \phpseclib\Math\BigInteger * @return \phpseclib\Math\BigInteger * @see self::_trim() * @access private */ function _normalize($result) { } /** * Trim * * Removes leading zeros * * @param array $value * @return \phpseclib\Math\BigInteger * @access private */ function _trim($value) { } /** * Array Repeat * * @param $input Array * @param $multiplier mixed * @return array * @access private */ function _array_repeat($input, $multiplier) { } /** * Logical Left Shift * * Shifts binary strings $shift bits, essentially multiplying by 2**$shift. * * @param $x String * @param $shift Integer * @return string * @access private */ function _base256_lshift(&$x, $shift) { } /** * Logical Right Shift * * Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder. * * @param $x String * @param $shift Integer * @return string * @access private */ function _base256_rshift(&$x, $shift) { } // one quirk about how the following functions are implemented is that PHP defines N to be an unsigned long // at 32-bits, while java's longs are 64-bits. /** * Converts 32-bit integers to bytes. * * @param int $x * @return string * @access private */ function _int2bytes($x) { } /** * Converts bytes to 32-bit integers * * @param string $x * @return int * @access private */ function _bytes2int($x) { } /** * DER-encode an integer * * The ability to DER-encode integers is needed to create RSA public keys for use with OpenSSL * * @see self::modPow() * @access private * @param int $length * @return string */ function _encodeASN1Length($length) { } /** * Single digit division * * Even if int64 is being used the division operator will return a float64 value * if the dividend is not evenly divisible by the divisor. Since a float64 doesn't * have the precision of int64 this is a problem so, when int64 is being used, * we'll guarantee that the dividend is divisible by first subtracting the remainder. * * @access private * @param int $x * @param int $y * @return int */ function _safe_divide($x, $y) { } } } namespace phpseclib\Crypt { /** * Base Class for all \phpseclib\Crypt\* cipher classes * * @package Base * @author Jim Wigginton * @author Hans-Juergen Petrich */ abstract class Base { /**#@+ * @access public * @see \phpseclib\Crypt\Base::encrypt() * @see \phpseclib\Crypt\Base::decrypt() */ /** * Encrypt / decrypt using the Counter mode. * * Set to -1 since that's what Crypt/Random.php uses to index the CTR mode. * * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29 */ const MODE_CTR = -1; /** * Encrypt / decrypt using the Electronic Code Book mode. * * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 */ const MODE_ECB = 1; /** * Encrypt / decrypt using the Code Book Chaining mode. * * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29 */ const MODE_CBC = 2; /** * Encrypt / decrypt using the Cipher Feedback mode. * * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29 */ const MODE_CFB = 3; /** * Encrypt / decrypt using the Output Feedback mode. * * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29 */ const MODE_OFB = 4; /** * Encrypt / decrypt using streaming mode. */ const MODE_STREAM = 5; /**#@-*/ /** * Whirlpool available flag * * @see \phpseclib\Crypt\Base::_hashInlineCryptFunction() * @var bool * @access private */ static $WHIRLPOOL_AVAILABLE; /**#@+ * @access private * @see \phpseclib\Crypt\Base::__construct() */ /** * Base value for the internal implementation $engine switch */ const ENGINE_INTERNAL = 1; /** * Base value for the mcrypt implementation $engine switch */ const ENGINE_MCRYPT = 2; /** * Base value for the mcrypt implementation $engine switch */ const ENGINE_OPENSSL = 3; /**#@-*/ /** * The Encryption Mode * * @see self::__construct() * @var int * @access private */ var $mode; /** * The Block Length of the block cipher * * @var int * @access private */ var $block_size = 16; /** * The Key * * @see self::setKey() * @var string * @access private */ var $key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; /** * The Initialization Vector * * @see self::setIV() * @var string * @access private */ var $iv; /** * A "sliding" Initialization Vector * * @see self::enableContinuousBuffer() * @see self::_clearBuffers() * @var string * @access private */ var $encryptIV; /** * A "sliding" Initialization Vector * * @see self::enableContinuousBuffer() * @see self::_clearBuffers() * @var string * @access private */ var $decryptIV; /** * Continuous Buffer status * * @see self::enableContinuousBuffer() * @var bool * @access private */ var $continuousBuffer = false; /** * Encryption buffer for CTR, OFB and CFB modes * * @see self::encrypt() * @see self::_clearBuffers() * @var array * @access private */ var $enbuffer; /** * Decryption buffer for CTR, OFB and CFB modes * * @see self::decrypt() * @see self::_clearBuffers() * @var array * @access private */ var $debuffer; /** * mcrypt resource for encryption * * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. * * @see self::encrypt() * @var resource * @access private */ var $enmcrypt; /** * mcrypt resource for decryption * * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. * * @see self::decrypt() * @var resource * @access private */ var $demcrypt; /** * Does the enmcrypt resource need to be (re)initialized? * * @see \phpseclib\Crypt\Twofish::setKey() * @see \phpseclib\Crypt\Twofish::setIV() * @var bool * @access private */ var $enchanged = true; /** * Does the demcrypt resource need to be (re)initialized? * * @see \phpseclib\Crypt\Twofish::setKey() * @see \phpseclib\Crypt\Twofish::setIV() * @var bool * @access private */ var $dechanged = true; /** * mcrypt resource for CFB mode * * mcrypt's CFB mode, in (and only in) buffered context, * is broken, so phpseclib implements the CFB mode by it self, * even when the mcrypt php extension is available. * * In order to do the CFB-mode work (fast) phpseclib * use a separate ECB-mode mcrypt resource. * * @link http://phpseclib.sourceforge.net/cfb-demo.phps * @see self::encrypt() * @see self::decrypt() * @see self::_setupMcrypt() * @var resource * @access private */ var $ecb; /** * Optimizing value while CFB-encrypting * * Only relevant if $continuousBuffer enabled * and $engine == self::ENGINE_MCRYPT * * It's faster to re-init $enmcrypt if * $buffer bytes > $cfb_init_len than * using the $ecb resource furthermore. * * This value depends of the chosen cipher * and the time it would be needed for it's * initialization [by mcrypt_generic_init()] * which, typically, depends on the complexity * on its internaly Key-expanding algorithm. * * @see self::encrypt() * @var int * @access private */ var $cfb_init_len = 600; /** * Does internal cipher state need to be (re)initialized? * * @see self::setKey() * @see self::setIV() * @see self::disableContinuousBuffer() * @var bool * @access private */ var $changed = true; /** * Padding status * * @see self::enablePadding() * @var bool * @access private */ var $padding = true; /** * Is the mode one that is paddable? * * @see self::__construct() * @var bool * @access private */ var $paddable = false; /** * Holds which crypt engine internaly should be use, * which will be determined automatically on __construct() * * Currently available $engines are: * - self::ENGINE_OPENSSL (very fast, php-extension: openssl, extension_loaded('openssl') required) * - self::ENGINE_MCRYPT (fast, php-extension: mcrypt, extension_loaded('mcrypt') required) * - self::ENGINE_INTERNAL (slower, pure php-engine, no php-extension required) * * @see self::_setEngine() * @see self::encrypt() * @see self::decrypt() * @var int * @access private */ var $engine; /** * Holds the preferred crypt engine * * @see self::_setEngine() * @see self::setPreferredEngine() * @var int * @access private */ var $preferredEngine; /** * The mcrypt specific name of the cipher * * Only used if $engine == self::ENGINE_MCRYPT * * @link http://www.php.net/mcrypt_module_open * @link http://www.php.net/mcrypt_list_algorithms * @see self::_setupMcrypt() * @var string * @access private */ var $cipher_name_mcrypt; /** * The openssl specific name of the cipher * * Only used if $engine == self::ENGINE_OPENSSL * * @link http://www.php.net/openssl-get-cipher-methods * @var string * @access private */ var $cipher_name_openssl; /** * The openssl specific name of the cipher in ECB mode * * If OpenSSL does not support the mode we're trying to use (CTR) * it can still be emulated with ECB mode. * * @link http://www.php.net/openssl-get-cipher-methods * @var string * @access private */ var $cipher_name_openssl_ecb; /** * The default salt used by setPassword() * * @see self::setPassword() * @var string * @access private */ var $password_default_salt = 'phpseclib/salt'; /** * The name of the performance-optimized callback function * * Used by encrypt() / decrypt() * only if $engine == self::ENGINE_INTERNAL * * @see self::encrypt() * @see self::decrypt() * @see self::_setupInlineCrypt() * @see self::$use_inline_crypt * @var Callback * @access private */ var $inline_crypt; /** * Holds whether performance-optimized $inline_crypt() can/should be used. * * @see self::encrypt() * @see self::decrypt() * @see self::inline_crypt * @var mixed * @access private */ var $use_inline_crypt; /** * If OpenSSL can be used in ECB but not in CTR we can emulate CTR * * @see self::_openssl_ctr_process() * @var bool * @access private */ var $openssl_emulate_ctr = false; /** * Determines what options are passed to openssl_encrypt/decrypt * * @see self::isValidEngine() * @var mixed * @access private */ var $openssl_options; /** * Has the key length explicitly been set or should it be derived from the key, itself? * * @see self::setKeyLength() * @var bool * @access private */ var $explicit_key_length = false; /** * Don't truncate / null pad key * * @see self::_clearBuffers() * @var bool * @access private */ var $skip_key_adjustment = false; /** * Default Constructor. * * Determines whether or not the mcrypt extension should be used. * * $mode could be: * * - self::MODE_ECB * * - self::MODE_CBC * * - self::MODE_CTR * * - self::MODE_CFB * * - self::MODE_OFB * * If not explicitly set, self::MODE_CBC will be used. * * @param int $mode * @access public */ function __construct($mode = self::MODE_CBC) { } /** * Sets the initialization vector. (optional) * * SetIV is not required when self::MODE_ECB (or ie for AES: \phpseclib\Crypt\AES::MODE_ECB) is being used. If not explicitly set, it'll be assumed * to be all zero's. * * @access public * @param string $iv * @internal Can be overwritten by a sub class, but does not have to be */ function setIV($iv) { } /** * Sets the key length. * * Keys with explicitly set lengths need to be treated accordingly * * @access public * @param int $length */ function setKeyLength($length) { } /** * Returns the current key length in bits * * @access public * @return int */ function getKeyLength() { } /** * Returns the current block length in bits * * @access public * @return int */ function getBlockLength() { } /** * Sets the key. * * The min/max length(s) of the key depends on the cipher which is used. * If the key not fits the length(s) of the cipher it will paded with null bytes * up to the closest valid key length. If the key is more than max length, * we trim the excess bits. * * If the key is not explicitly set, it'll be assumed to be all null bytes. * * @access public * @param string $key * @internal Could, but not must, extend by the child Crypt_* class */ function setKey($key) { } /** * Sets the password. * * Depending on what $method is set to, setPassword()'s (optional) parameters are as follows: * {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2} or pbkdf1: * $hash, $salt, $count, $dkLen * * Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php * * @see Crypt/Hash.php * @param string $password * @param string $method * @return bool * @access public * @internal Could, but not must, extend by the child Crypt_* class */ function setPassword($password, $method = 'pbkdf2') { } /** * Encrypts a message. * * $plaintext will be padded with additional bytes such that it's length is a multiple of the block size. Other cipher * implementations may or may not pad in the same manner. Other common approaches to padding and the reasons why it's * necessary are discussed in the following * URL: * * {@link http://www.di-mgt.com.au/cryptopad.html http://www.di-mgt.com.au/cryptopad.html} * * An alternative to padding is to, separately, send the length of the file. This is what SSH, in fact, does. * strlen($plaintext) will still need to be a multiple of the block size, however, arbitrary values can be added to make it that * length. * * @see self::decrypt() * @access public * @param string $plaintext * @return string $ciphertext * @internal Could, but not must, extend by the child Crypt_* class */ function encrypt($plaintext) { } /** * Decrypts a message. * * If strlen($ciphertext) is not a multiple of the block size, null bytes will be added to the end of the string until * it is. * * @see self::encrypt() * @access public * @param string $ciphertext * @return string $plaintext * @internal Could, but not must, extend by the child Crypt_* class */ function decrypt($ciphertext) { } /** * OpenSSL CTR Processor * * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream * for CTR is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() * and Base::decrypt(). Also, OpenSSL doesn't implement CTR for all of it's symmetric ciphers so this * function will emulate CTR with ECB when necessary. * * @see self::encrypt() * @see self::decrypt() * @param string $plaintext * @param string $encryptIV * @param array $buffer * @return string * @access private */ function _openssl_ctr_process($plaintext, &$encryptIV, &$buffer) { } /** * OpenSSL OFB Processor * * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream * for OFB is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() * and Base::decrypt(). * * @see self::encrypt() * @see self::decrypt() * @param string $plaintext * @param string $encryptIV * @param array $buffer * @return string * @access private */ function _openssl_ofb_process($plaintext, &$encryptIV, &$buffer) { } /** * phpseclib <-> OpenSSL Mode Mapper * * May need to be overwritten by classes extending this one in some cases * * @return int * @access private */ function _openssl_translate_mode() { } /** * Pad "packets". * * Block ciphers working by encrypting between their specified [$this->]block_size at a time * If you ever need to encrypt or decrypt something that isn't of the proper length, it becomes necessary to * pad the input so that it is of the proper length. * * Padding is enabled by default. Sometimes, however, it is undesirable to pad strings. Such is the case in SSH, * where "packets" are padded with random bytes before being encrypted. Unpad these packets and you risk stripping * away characters that shouldn't be stripped away. (SSH knows how many bytes are added because the length is * transmitted separately) * * @see self::disablePadding() * @access public */ function enablePadding() { } /** * Do not pad packets. * * @see self::enablePadding() * @access public */ function disablePadding() { } /** * Treat consecutive "packets" as if they are a continuous buffer. * * Say you have a 32-byte plaintext $plaintext. Using the default behavior, the two following code snippets * will yield different outputs: * * * echo $rijndael->encrypt(substr($plaintext, 0, 16)); * echo $rijndael->encrypt(substr($plaintext, 16, 16)); * * * echo $rijndael->encrypt($plaintext); * * * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates * another, as demonstrated with the following: * * * $rijndael->encrypt(substr($plaintext, 0, 16)); * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); * * * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); * * * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different * outputs. The reason is due to the fact that the initialization vector's change after every encryption / * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. * * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\*() object changes after each * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), * however, they are also less intuitive and more likely to cause you problems. * * @see self::disableContinuousBuffer() * @access public * @internal Could, but not must, extend by the child Crypt_* class */ function enableContinuousBuffer() { } /** * Treat consecutive packets as if they are a discontinuous buffer. * * The default behavior. * * @see self::enableContinuousBuffer() * @access public * @internal Could, but not must, extend by the child Crypt_* class */ function disableContinuousBuffer() { } /** * Test for engine validity * * @see self::__construct() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Sets the preferred crypt engine * * Currently, $engine could be: * * - \phpseclib\Crypt\Base::ENGINE_OPENSSL [very fast] * * - \phpseclib\Crypt\Base::ENGINE_MCRYPT [fast] * * - \phpseclib\Crypt\Base::ENGINE_INTERNAL [slow] * * If the preferred crypt engine is not available the fastest available one will be used * * @see self::__construct() * @param int $engine * @access public */ function setPreferredEngine($engine) { } /** * Returns the engine currently being utilized * * @see self::_setEngine() * @access public */ function getEngine() { } /** * Sets the engine as appropriate * * @see self::__construct() * @access private */ function _setEngine() { } /** * Encrypts a block * * Note: Must be extended by the child \phpseclib\Crypt\* class * * @access private * @param string $in * @return string */ abstract function _encryptBlock($in); /** * Decrypts a block * * Note: Must be extended by the child \phpseclib\Crypt\* class * * @access private * @param string $in * @return string */ abstract function _decryptBlock($in); /** * Setup the key (expansion) * * Only used if $engine == self::ENGINE_INTERNAL * * Note: Must extend by the child \phpseclib\Crypt\* class * * @see self::_setup() * @access private */ abstract function _setupKey(); /** * Setup the self::ENGINE_INTERNAL $engine * * (re)init, if necessary, the internal cipher $engine and flush all $buffers * Used (only) if $engine == self::ENGINE_INTERNAL * * _setup() will be called each time if $changed === true * typically this happens when using one or more of following public methods: * * - setKey() * * - setIV() * * - disableContinuousBuffer() * * - First run of encrypt() / decrypt() with no init-settings * * @see self::setKey() * @see self::setIV() * @see self::disableContinuousBuffer() * @access private * @internal _setup() is always called before en/decryption. * @internal Could, but not must, extend by the child Crypt_* class */ function _setup() { } /** * Setup the self::ENGINE_MCRYPT $engine * * (re)init, if necessary, the (ext)mcrypt resources and flush all $buffers * Used (only) if $engine = self::ENGINE_MCRYPT * * _setupMcrypt() will be called each time if $changed === true * typically this happens when using one or more of following public methods: * * - setKey() * * - setIV() * * - disableContinuousBuffer() * * - First run of encrypt() / decrypt() * * @see self::setKey() * @see self::setIV() * @see self::disableContinuousBuffer() * @access private * @internal Could, but not must, extend by the child Crypt_* class */ function _setupMcrypt() { } /** * Pads a string * * Pads a string using the RSA PKCS padding standards so that its length is a multiple of the blocksize. * $this->block_size - (strlen($text) % $this->block_size) bytes are added, each of which is equal to * chr($this->block_size - (strlen($text) % $this->block_size) * * If padding is disabled and $text is not a multiple of the blocksize, the string will be padded regardless * and padding will, hence forth, be enabled. * * @see self::_unpad() * @param string $text * @access private * @return string */ function _pad($text) { } /** * Unpads a string. * * If padding is enabled and the reported padding length is invalid the encryption key will be assumed to be wrong * and false will be returned. * * @see self::_pad() * @param string $text * @access private * @return string */ function _unpad($text) { } /** * Clears internal buffers * * Clearing/resetting the internal buffers is done everytime * after disableContinuousBuffer() or on cipher $engine (re)init * ie after setKey() or setIV() * * @access public * @internal Could, but not must, extend by the child Crypt_* class */ function _clearBuffers() { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @access private * @return string */ function _string_shift(&$string, $index = 1) { } /** * String Pop * * Inspired by array_pop * * @param string $string * @param int $index * @access private * @return string */ function _string_pop(&$string, $index = 1) { } /** * Increment the current string * * @see self::decrypt() * @see self::encrypt() * @param string $var * @access private */ function _increment_str(&$var) { } /** * Setup the performance-optimized function for de/encrypt() * * Stores the created (or existing) callback function-name * in $this->inline_crypt * * Internally for phpseclib developers: * * _setupInlineCrypt() would be called only if: * * - $engine == self::ENGINE_INTERNAL and * * - $use_inline_crypt === true * * - each time on _setup(), after(!) _setupKey() * * * This ensures that _setupInlineCrypt() has always a * full ready2go initializated internal cipher $engine state * where, for example, the keys allready expanded, * keys/block_size calculated and such. * * It is, each time if called, the responsibility of _setupInlineCrypt(): * * - to set $this->inline_crypt to a valid and fully working callback function * as a (faster) replacement for encrypt() / decrypt() * * - NOT to create unlimited callback functions (for memory reasons!) * no matter how often _setupInlineCrypt() would be called. At some * point of amount they must be generic re-useable. * * - the code of _setupInlineCrypt() it self, * and the generated callback code, * must be, in following order: * - 100% safe * - 100% compatible to encrypt()/decrypt() * - using only php5+ features/lang-constructs/php-extensions if * compatibility (down to php4) or fallback is provided * - readable/maintainable/understandable/commented and... not-cryptic-styled-code :-) * - >= 10% faster than encrypt()/decrypt() [which is, by the way, * the reason for the existence of _setupInlineCrypt() :-)] * - memory-nice * - short (as good as possible) * * Note: - _setupInlineCrypt() is using _createInlineCryptFunction() to create the full callback function code. * - In case of using inline crypting, _setupInlineCrypt() must extend by the child \phpseclib\Crypt\* class. * - The following variable names are reserved: * - $_* (all variable names prefixed with an underscore) * - $self (object reference to it self. Do not use $this, but $self instead) * - $in (the content of $in has to en/decrypt by the generated code) * - The callback function should not use the 'return' statement, but en/decrypt'ing the content of $in only * * * @see self::_setup() * @see self::_createInlineCryptFunction() * @see self::encrypt() * @see self::decrypt() * @access private * @internal If a Crypt_* class providing inline crypting it must extend _setupInlineCrypt() */ function _setupInlineCrypt() { } /** * Creates the performance-optimized function for en/decrypt() * * Internally for phpseclib developers: * * _createInlineCryptFunction(): * * - merge the $cipher_code [setup'ed by _setupInlineCrypt()] * with the current [$this->]mode of operation code * * - create the $inline function, which called by encrypt() / decrypt() * as its replacement to speed up the en/decryption operations. * * - return the name of the created $inline callback function * * - used to speed up en/decryption * * * * The main reason why can speed up things [up to 50%] this way are: * * - using variables more effective then regular. * (ie no use of expensive arrays but integers $k_0, $k_1 ... * or even, for example, the pure $key[] values hardcoded) * * - avoiding 1000's of function calls of ie _encryptBlock() * but inlining the crypt operations. * in the mode of operation for() loop. * * - full loop unroll the (sometimes key-dependent) rounds * avoiding this way ++$i counters and runtime-if's etc... * * The basic code architectur of the generated $inline en/decrypt() * lambda function, in pseudo php, is: * * * +----------------------------------------------------------------------------------------------+ * | callback $inline = create_function: | * | lambda_function_0001_crypt_ECB($action, $text) | * | { | * | INSERT PHP CODE OF: | * | $cipher_code['init_crypt']; // general init code. | * | // ie: $sbox'es declarations used for | * | // encrypt and decrypt'ing. | * | | * | switch ($action) { | * | case 'encrypt': | * | INSERT PHP CODE OF: | * | $cipher_code['init_encrypt']; // encrypt sepcific init code. | * | ie: specified $key or $box | * | declarations for encrypt'ing. | * | | * | foreach ($ciphertext) { | * | $in = $block_size of $ciphertext; | * | | * | INSERT PHP CODE OF: | * | $cipher_code['encrypt_block']; // encrypt's (string) $in, which is always: | * | // strlen($in) == $this->block_size | * | // here comes the cipher algorithm in action | * | // for encryption. | * | // $cipher_code['encrypt_block'] has to | * | // encrypt the content of the $in variable | * | | * | $plaintext .= $in; | * | } | * | return $plaintext; | * | | * | case 'decrypt': | * | INSERT PHP CODE OF: | * | $cipher_code['init_decrypt']; // decrypt sepcific init code | * | ie: specified $key or $box | * | declarations for decrypt'ing. | * | foreach ($plaintext) { | * | $in = $block_size of $plaintext; | * | | * | INSERT PHP CODE OF: | * | $cipher_code['decrypt_block']; // decrypt's (string) $in, which is always | * | // strlen($in) == $this->block_size | * | // here comes the cipher algorithm in action | * | // for decryption. | * | // $cipher_code['decrypt_block'] has to | * | // decrypt the content of the $in variable | * | $ciphertext .= $in; | * | } | * | return $ciphertext; | * | } | * | } | * +----------------------------------------------------------------------------------------------+ * * * See also the \phpseclib\Crypt\*::_setupInlineCrypt()'s for * productive inline $cipher_code's how they works. * * Structure of: * * $cipher_code = array( * 'init_crypt' => (string) '', // optional * 'init_encrypt' => (string) '', // optional * 'init_decrypt' => (string) '', // optional * 'encrypt_block' => (string) '', // required * 'decrypt_block' => (string) '' // required * ); * * * @see self::_setupInlineCrypt() * @see self::encrypt() * @see self::decrypt() * @param array $cipher_code * @access private * @return string (the name of the created callback function) */ function _createInlineCryptFunction($cipher_code) { } /** * Holds the lambda_functions table (classwide) * * Each name of the lambda function, created from * _setupInlineCrypt() && _createInlineCryptFunction() * is stored, classwide (!), here for reusing. * * The string-based index of $function is a classwide * unique value representing, at least, the $mode of * operation (or more... depends of the optimizing level) * for which $mode the lambda function was created. * * @access private * @return array &$functions */ function &_getLambdaFunctions() { } /** * Generates a digest from $bytes * * @see self::_setupInlineCrypt() * @access private * @param $bytes * @return string */ function _hashInlineCryptFunction($bytes) { } /** * Convert float to int * * On ARM CPUs converting floats to ints doesn't always work * * @access private * @param string $x * @return int */ function safe_intval($x) { } /** * eval()'able string for in-line float to int * * @access private * @return string */ function safe_intval_inline() { } } /** * Pure-PHP implementation of RC2. * * @package RC2 * @access public */ class RC2 extends \phpseclib\Crypt\Base { /** * Block Length of the cipher * * @see \phpseclib\Crypt\Base::block_size * @var int * @access private */ var $block_size = 8; /** * The Key * * @see \phpseclib\Crypt\Base::key * @see self::setKey() * @var string * @access private */ var $key; /** * The Original (unpadded) Key * * @see \phpseclib\Crypt\Base::key * @see self::setKey() * @see self::encrypt() * @see self::decrypt() * @var string * @access private */ var $orig_key; /** * Don't truncate / null pad key * * @see \phpseclib\Crypt\Base::_clearBuffers() * @var bool * @access private */ var $skip_key_adjustment = true; /** * Key Length (in bytes) * * @see \phpseclib\Crypt\RC2::setKeyLength() * @var int * @access private */ var $key_length = 16; // = 128 bits /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'rc2'; /** * Optimizing value while CFB-encrypting * * @see \phpseclib\Crypt\Base::cfb_init_len * @var int * @access private */ var $cfb_init_len = 500; /** * The key length in bits. * * @see self::setKeyLength() * @see self::setKey() * @var int * @access private * @internal Should be in range [1..1024]. * @internal Changing this value after setting the key has no effect. */ var $default_key_length = 1024; /** * The key length in bits. * * @see self::isValidEnine() * @see self::setKey() * @var int * @access private * @internal Should be in range [1..1024]. */ var $current_key_length; /** * The Key Schedule * * @see self::_setupKey() * @var array * @access private */ var $keys; /** * Key expansion randomization table. * Twice the same 256-value sequence to save a modulus in key expansion. * * @see self::setKey() * @var array * @access private */ var $pitable = array(0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x9, 0x81, 0x7d, 0x32, 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0xb, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, 0x6f, 0xbf, 0xe, 0xda, 0x46, 0x69, 0x7, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x3, 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x6, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, 0x8, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x4, 0x18, 0xa4, 0xec, 0xc2, 0xe0, 0x41, 0x6e, 0xf, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x2, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x5, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, 0xd3, 0x0, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x1, 0x3f, 0x58, 0xe2, 0x89, 0xa9, 0xd, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0xc, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0xa, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad, 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x9, 0x81, 0x7d, 0x32, 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0xb, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, 0x6f, 0xbf, 0xe, 0xda, 0x46, 0x69, 0x7, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x3, 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x6, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, 0x8, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x4, 0x18, 0xa4, 0xec, 0xc2, 0xe0, 0x41, 0x6e, 0xf, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x2, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x5, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, 0xd3, 0x0, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x1, 0x3f, 0x58, 0xe2, 0x89, 0xa9, 0xd, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0xc, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0xa, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad); /** * Inverse key expansion randomization table. * * @see self::setKey() * @var array * @access private */ var $invpitable = array(0xd1, 0xda, 0xb9, 0x6f, 0x9c, 0xc8, 0x78, 0x66, 0x80, 0x2c, 0xf8, 0x37, 0xea, 0xe0, 0x62, 0xa4, 0xcb, 0x71, 0x50, 0x27, 0x4b, 0x95, 0xd9, 0x20, 0x9d, 0x4, 0x91, 0xe3, 0x47, 0x6a, 0x7e, 0x53, 0xfa, 0x3a, 0x3b, 0xb4, 0xa8, 0xbc, 0x5f, 0x68, 0x8, 0xca, 0x8f, 0x14, 0xd7, 0xc0, 0xef, 0x7b, 0x5b, 0xbf, 0x2f, 0xe5, 0xe2, 0x8c, 0xba, 0x12, 0xe1, 0xaf, 0xb2, 0x54, 0x5d, 0x59, 0x76, 0xdb, 0x32, 0xa2, 0x58, 0x6e, 0x1c, 0x29, 0x64, 0xf3, 0xe9, 0x96, 0xc, 0x98, 0x19, 0x8d, 0x3e, 0x26, 0xab, 0xa5, 0x85, 0x16, 0x40, 0xbd, 0x49, 0x67, 0xdc, 0x22, 0x94, 0xbb, 0x3c, 0xc1, 0x9b, 0xeb, 0x45, 0x28, 0x18, 0xd8, 0x1a, 0x42, 0x7d, 0xcc, 0xfb, 0x65, 0x8e, 0x3d, 0xcd, 0x2a, 0xa3, 0x60, 0xae, 0x93, 0x8a, 0x48, 0x97, 0x51, 0x15, 0xf7, 0x1, 0xb, 0xb7, 0x36, 0xb1, 0x2e, 0x11, 0xfd, 0x84, 0x2d, 0x3f, 0x13, 0x88, 0xb3, 0x34, 0x24, 0x1b, 0xde, 0xc5, 0x1d, 0x4d, 0x2b, 0x17, 0x31, 0x74, 0xa9, 0xc6, 0x43, 0x6d, 0x39, 0x90, 0xbe, 0xc3, 0xb0, 0x21, 0x6b, 0xf6, 0xf, 0xd5, 0x99, 0xd, 0xac, 0x1f, 0x5c, 0x9e, 0xf5, 0xf9, 0x4c, 0xd6, 0xdf, 0x89, 0xe4, 0x8b, 0xff, 0xc7, 0xaa, 0xe7, 0xed, 0x46, 0x25, 0xb6, 0x6, 0x5e, 0x35, 0xb5, 0xec, 0xce, 0xe8, 0x6c, 0x30, 0x55, 0x61, 0x4a, 0xfe, 0xa0, 0x79, 0x3, 0xf0, 0x10, 0x72, 0x7c, 0xcf, 0x52, 0xa6, 0xa7, 0xee, 0x44, 0xd3, 0x9a, 0x57, 0x92, 0xd0, 0x5a, 0x7a, 0x41, 0x7f, 0xe, 0x0, 0x63, 0xf2, 0x4f, 0x5, 0x83, 0xc9, 0xa1, 0xd4, 0xdd, 0xc4, 0x56, 0xf4, 0xd2, 0x77, 0x81, 0x9, 0x82, 0x33, 0x9f, 0x7, 0x86, 0x75, 0x38, 0x4e, 0x69, 0xf1, 0xad, 0x23, 0x73, 0x87, 0x70, 0x2, 0xc2, 0x1e, 0xb8, 0xa, 0xfc, 0xe6); /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::__construct() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Sets the key length. * * Valid key lengths are 8 to 1024. * Calling this function after setting the key has no effect until the next * \phpseclib\Crypt\RC2::setKey() call. * * @access public * @param int $length in bits */ function setKeyLength($length) { } /** * Returns the current key length * * @access public * @return int */ function getKeyLength() { } /** * Sets the key. * * Keys can be of any length. RC2, itself, uses 8 to 1024 bit keys (eg. * strlen($key) <= 128), however, we only use the first 128 bytes if $key * has more then 128 bytes in it, and set $key to a single null byte if * it is empty. * * If the key is not explicitly set, it'll be assumed to be a single * null byte. * * @see \phpseclib\Crypt\Base::setKey() * @access public * @param string $key * @param int $t1 optional Effective key length in bits. */ function setKey($key, $t1 = 0) { } /** * Encrypts a message. * * Mostly a wrapper for \phpseclib\Crypt\Base::encrypt, with some additional OpenSSL handling code * * @see self::decrypt() * @access public * @param string $plaintext * @return string $ciphertext */ function encrypt($plaintext) { } /** * Decrypts a message. * * Mostly a wrapper for \phpseclib\Crypt\Base::decrypt, with some additional OpenSSL handling code * * @see self::encrypt() * @access public * @param string $ciphertext * @return string $plaintext */ function decrypt($ciphertext) { } /** * Encrypts a block * * @see \phpseclib\Crypt\Base::_encryptBlock() * @see \phpseclib\Crypt\Base::encrypt() * @access private * @param string $in * @return string */ function _encryptBlock($in) { } /** * Decrypts a block * * @see \phpseclib\Crypt\Base::_decryptBlock() * @see \phpseclib\Crypt\Base::decrypt() * @access private * @param string $in * @return string */ function _decryptBlock($in) { } /** * Setup the \phpseclib\Crypt\Base::ENGINE_MCRYPT $engine * * @see \phpseclib\Crypt\Base::_setupMcrypt() * @access private */ function _setupMcrypt() { } /** * Creates the key schedule * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Setup the performance-optimized function for de/encrypt() * * @see \phpseclib\Crypt\Base::_setupInlineCrypt() * @access private */ function _setupInlineCrypt() { } } /** * Pure-PHP Random Number Generator * * @package Random * @author Jim Wigginton * @access public */ class Random { /** * Generate a random string. * * Although microoptimizations are generally discouraged as they impair readability this function is ripe with * microoptimizations because this function has the potential of being called a huge number of times. * eg. for RSA key generation. * * @param int $length * @return string */ static function string($length) { } } /** * Pure-PHP implementation of Rijndael. * * @package Rijndael * @author Jim Wigginton * @access public */ class Rijndael extends \phpseclib\Crypt\Base { /** * The mcrypt specific name of the cipher * * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable * or not for the current $block_size/$key_length. * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly. * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @see \phpseclib\Crypt\Base::engine * @see self::isValidEngine() * @var string * @access private */ var $cipher_name_mcrypt = 'rijndael-128'; /** * The default salt used by setPassword() * * @see \phpseclib\Crypt\Base::password_default_salt * @see \phpseclib\Crypt\Base::setPassword() * @var string * @access private */ var $password_default_salt = 'phpseclib'; /** * The Key Schedule * * @see self::_setup() * @var array * @access private */ var $w; /** * The Inverse Key Schedule * * @see self::_setup() * @var array * @access private */ var $dw; /** * The Block Length divided by 32 * * @see self::setBlockLength() * @var int * @access private * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu * of that, we'll just precompute it once. */ var $Nb = 4; /** * The Key Length (in bytes) * * @see self::setKeyLength() * @var int * @access private * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu * of that, we'll just precompute it once. */ var $key_length = 16; /** * The Key Length divided by 32 * * @see self::setKeyLength() * @var int * @access private * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4 */ var $Nk = 4; /** * The Number of Rounds * * @var int * @access private * @internal The max value is 14, the min value is 10. */ var $Nr; /** * Shift offsets * * @var array * @access private */ var $c; /** * Holds the last used key- and block_size information * * @var array * @access private */ var $kl; /** * Sets the key length. * * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. * * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to * 192/256 bits as, for example, mcrypt will do. * * That said, if you want be compatible with other Rijndael and AES implementations, * you should not setKeyLength(160) or setKeyLength(224). * * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use * the mcrypt php extension, even if available. * This results then in slower encryption. * * @access public * @param int $length */ function setKeyLength($length) { } /** * Sets the block length * * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. * * @access public * @param int $length */ function setBlockLength($length) { } /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::__construct() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Encrypts a block * * @access private * @param string $in * @return string */ function _encryptBlock($in) { } /** * Decrypts a block * * @access private * @param string $in * @return string */ function _decryptBlock($in) { } /** * Setup the key (expansion) * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Performs S-Box substitutions * * @access private * @param int $word */ function _subWord($word) { } /** * Provides the mixColumns and sboxes tables * * @see self::_encryptBlock() * @see self::_setupInlineCrypt() * @see self::_subWord() * @access private * @return array &$tables */ function &_getTables() { } /** * Provides the inverse mixColumns and inverse sboxes tables * * @see self::_decryptBlock() * @see self::_setupInlineCrypt() * @see self::_setupKey() * @access private * @return array &$tables */ function &_getInvTables() { } /** * Setup the performance-optimized function for de/encrypt() * * @see \phpseclib\Crypt\Base::_setupInlineCrypt() * @access private */ function _setupInlineCrypt() { } } /** * Pure-PHP implementation of Blowfish. * * @package Blowfish * @author Jim Wigginton * @author Hans-Juergen Petrich * @access public */ class Blowfish extends \phpseclib\Crypt\Base { /** * Block Length of the cipher * * @see \phpseclib\Crypt\Base::block_size * @var int * @access private */ var $block_size = 8; /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'blowfish'; /** * Optimizing value while CFB-encrypting * * @see \phpseclib\Crypt\Base::cfb_init_len * @var int * @access private */ var $cfb_init_len = 500; /** * The fixed subkeys boxes ($sbox0 - $sbox3) with 256 entries each * * S-Box 0 * * @access private * @var array */ var $sbox0 = array(0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0xd95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0xf6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x75372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x4c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x2e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x8ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x8ba4799, 0x6e85076a); /** * S-Box 1 * * @access private * @var array */ var $sbox1 = array(0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x21ecc5e, 0x9686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0xfd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x43556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x18cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0xe358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x95bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0xc55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0xe1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7); /** * S-Box 2 * * @access private * @var array */ var $sbox2 = array(0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x3bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0xa2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x4272f70, 0x80bb155c, 0x5282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x7f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0xe12b4c2, 0x2e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0xa476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x6a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0xa121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x9f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0xba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0xde6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x6058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x8fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0); /** * S-Box 3 * * @access private * @var array */ var $sbox3 = array(0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x22b8b51, 0x96d5ac3a, 0x17da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x3a16125, 0x564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x3563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x9072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x115af84, 0xe1b00428, 0x95983a1d, 0x6b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x11a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0xf91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0xfe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x2fb8a8c, 0x1c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6); /** * P-Array consists of 18 32-bit subkeys * * @var array * @access private */ var $parray = array(0x243f6a88, 0x85a308d3, 0x13198a2e, 0x3707344, 0xa4093822, 0x299f31d0, 0x82efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b); /** * The BCTX-working Array * * Holds the expanded key [p] and the key-depended s-boxes [sb] * * @var array * @access private */ var $bctx; /** * Holds the last used key * * @var array * @access private */ var $kl; /** * The Key Length (in bytes) * * @see \phpseclib\Crypt\Base::setKeyLength() * @var int * @access private * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu * of that, we'll just precompute it once. */ var $key_length = 16; /** * Sets the key length. * * Key lengths can be between 32 and 448 bits. * * @access public * @param int $length */ function setKeyLength($length) { } /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::isValidEngine() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Setup the key (expansion) * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Encrypts a block * * @access private * @param string $in * @return string */ function _encryptBlock($in) { } /** * Decrypts a block * * @access private * @param string $in * @return string */ function _decryptBlock($in) { } /** * Setup the performance-optimized function for de/encrypt() * * @see \phpseclib\Crypt\Base::_setupInlineCrypt() * @access private */ function _setupInlineCrypt() { } } /** * Pure-PHP implementation of Twofish. * * @package Twofish * @author Jim Wigginton * @author Hans-Juergen Petrich * @access public */ class Twofish extends \phpseclib\Crypt\Base { /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'twofish'; /** * Optimizing value while CFB-encrypting * * @see \phpseclib\Crypt\Base::cfb_init_len * @var int * @access private */ var $cfb_init_len = 800; /** * Q-Table * * @var array * @access private */ var $q0 = array(0xa9, 0x67, 0xb3, 0xe8, 0x4, 0xfd, 0xa3, 0x76, 0x9a, 0x92, 0x80, 0x78, 0xe4, 0xdd, 0xd1, 0x38, 0xd, 0xc6, 0x35, 0x98, 0x18, 0xf7, 0xec, 0x6c, 0x43, 0x75, 0x37, 0x26, 0xfa, 0x13, 0x94, 0x48, 0xf2, 0xd0, 0x8b, 0x30, 0x84, 0x54, 0xdf, 0x23, 0x19, 0x5b, 0x3d, 0x59, 0xf3, 0xae, 0xa2, 0x82, 0x63, 0x1, 0x83, 0x2e, 0xd9, 0x51, 0x9b, 0x7c, 0xa6, 0xeb, 0xa5, 0xbe, 0x16, 0xc, 0xe3, 0x61, 0xc0, 0x8c, 0x3a, 0xf5, 0x73, 0x2c, 0x25, 0xb, 0xbb, 0x4e, 0x89, 0x6b, 0x53, 0x6a, 0xb4, 0xf1, 0xe1, 0xe6, 0xbd, 0x45, 0xe2, 0xf4, 0xb6, 0x66, 0xcc, 0x95, 0x3, 0x56, 0xd4, 0x1c, 0x1e, 0xd7, 0xfb, 0xc3, 0x8e, 0xb5, 0xe9, 0xcf, 0xbf, 0xba, 0xea, 0x77, 0x39, 0xaf, 0x33, 0xc9, 0x62, 0x71, 0x81, 0x79, 0x9, 0xad, 0x24, 0xcd, 0xf9, 0xd8, 0xe5, 0xc5, 0xb9, 0x4d, 0x44, 0x8, 0x86, 0xe7, 0xa1, 0x1d, 0xaa, 0xed, 0x6, 0x70, 0xb2, 0xd2, 0x41, 0x7b, 0xa0, 0x11, 0x31, 0xc2, 0x27, 0x90, 0x20, 0xf6, 0x60, 0xff, 0x96, 0x5c, 0xb1, 0xab, 0x9e, 0x9c, 0x52, 0x1b, 0x5f, 0x93, 0xa, 0xef, 0x91, 0x85, 0x49, 0xee, 0x2d, 0x4f, 0x8f, 0x3b, 0x47, 0x87, 0x6d, 0x46, 0xd6, 0x3e, 0x69, 0x64, 0x2a, 0xce, 0xcb, 0x2f, 0xfc, 0x97, 0x5, 0x7a, 0xac, 0x7f, 0xd5, 0x1a, 0x4b, 0xe, 0xa7, 0x5a, 0x28, 0x14, 0x3f, 0x29, 0x88, 0x3c, 0x4c, 0x2, 0xb8, 0xda, 0xb0, 0x17, 0x55, 0x1f, 0x8a, 0x7d, 0x57, 0xc7, 0x8d, 0x74, 0xb7, 0xc4, 0x9f, 0x72, 0x7e, 0x15, 0x22, 0x12, 0x58, 0x7, 0x99, 0x34, 0x6e, 0x50, 0xde, 0x68, 0x65, 0xbc, 0xdb, 0xf8, 0xc8, 0xa8, 0x2b, 0x40, 0xdc, 0xfe, 0x32, 0xa4, 0xca, 0x10, 0x21, 0xf0, 0xd3, 0x5d, 0xf, 0x0, 0x6f, 0x9d, 0x36, 0x42, 0x4a, 0x5e, 0xc1, 0xe0); /** * Q-Table * * @var array * @access private */ var $q1 = array(0x75, 0xf3, 0xc6, 0xf4, 0xdb, 0x7b, 0xfb, 0xc8, 0x4a, 0xd3, 0xe6, 0x6b, 0x45, 0x7d, 0xe8, 0x4b, 0xd6, 0x32, 0xd8, 0xfd, 0x37, 0x71, 0xf1, 0xe1, 0x30, 0xf, 0xf8, 0x1b, 0x87, 0xfa, 0x6, 0x3f, 0x5e, 0xba, 0xae, 0x5b, 0x8a, 0x0, 0xbc, 0x9d, 0x6d, 0xc1, 0xb1, 0xe, 0x80, 0x5d, 0xd2, 0xd5, 0xa0, 0x84, 0x7, 0x14, 0xb5, 0x90, 0x2c, 0xa3, 0xb2, 0x73, 0x4c, 0x54, 0x92, 0x74, 0x36, 0x51, 0x38, 0xb0, 0xbd, 0x5a, 0xfc, 0x60, 0x62, 0x96, 0x6c, 0x42, 0xf7, 0x10, 0x7c, 0x28, 0x27, 0x8c, 0x13, 0x95, 0x9c, 0xc7, 0x24, 0x46, 0x3b, 0x70, 0xca, 0xe3, 0x85, 0xcb, 0x11, 0xd0, 0x93, 0xb8, 0xa6, 0x83, 0x20, 0xff, 0x9f, 0x77, 0xc3, 0xcc, 0x3, 0x6f, 0x8, 0xbf, 0x40, 0xe7, 0x2b, 0xe2, 0x79, 0xc, 0xaa, 0x82, 0x41, 0x3a, 0xea, 0xb9, 0xe4, 0x9a, 0xa4, 0x97, 0x7e, 0xda, 0x7a, 0x17, 0x66, 0x94, 0xa1, 0x1d, 0x3d, 0xf0, 0xde, 0xb3, 0xb, 0x72, 0xa7, 0x1c, 0xef, 0xd1, 0x53, 0x3e, 0x8f, 0x33, 0x26, 0x5f, 0xec, 0x76, 0x2a, 0x49, 0x81, 0x88, 0xee, 0x21, 0xc4, 0x1a, 0xeb, 0xd9, 0xc5, 0x39, 0x99, 0xcd, 0xad, 0x31, 0x8b, 0x1, 0x18, 0x23, 0xdd, 0x1f, 0x4e, 0x2d, 0xf9, 0x48, 0x4f, 0xf2, 0x65, 0x8e, 0x78, 0x5c, 0x58, 0x19, 0x8d, 0xe5, 0x98, 0x57, 0x67, 0x7f, 0x5, 0x64, 0xaf, 0x63, 0xb6, 0xfe, 0xf5, 0xb7, 0x3c, 0xa5, 0xce, 0xe9, 0x68, 0x44, 0xe0, 0x4d, 0x43, 0x69, 0x29, 0x2e, 0xac, 0x15, 0x59, 0xa8, 0xa, 0x9e, 0x6e, 0x47, 0xdf, 0x34, 0x35, 0x6a, 0xcf, 0xdc, 0x22, 0xc9, 0xc0, 0x9b, 0x89, 0xd4, 0xed, 0xab, 0x12, 0xa2, 0xd, 0x52, 0xbb, 0x2, 0x2f, 0xa9, 0xd7, 0x61, 0x1e, 0xb4, 0x50, 0x4, 0xf6, 0xc2, 0x16, 0x25, 0x86, 0x56, 0x55, 0x9, 0xbe, 0x91); /** * M-Table * * @var array * @access private */ var $m0 = array(0xbcbc3275, 0xecec21f3, 0x202043c6, 0xb3b3c9f4, 0xdada03db, 0x2028b7b, 0xe2e22bfb, 0x9e9efac8, 0xc9c9ec4a, 0xd4d409d3, 0x18186be6, 0x1e1e9f6b, 0x98980e45, 0xb2b2387d, 0xa6a6d2e8, 0x2626b74b, 0x3c3c57d6, 0x93938a32, 0x8282eed8, 0x525298fd, 0x7b7bd437, 0xbbbb3771, 0x5b5b97f1, 0x474783e1, 0x24243c30, 0x5151e20f, 0xbabac6f8, 0x4a4af31b, 0xbfbf4887, 0xd0d70fa, 0xb0b0b306, 0x7575de3f, 0xd2d2fd5e, 0x7d7d20ba, 0x666631ae, 0x3a3aa35b, 0x59591c8a, 0x0, 0xcdcd93bc, 0x1a1ae09d, 0xaeae2c6d, 0x7f7fabc1, 0x2b2bc7b1, 0xbebeb90e, 0xe0e0a080, 0x8a8a105d, 0x3b3b52d2, 0x6464bad5, 0xd8d888a0, 0xe7e7a584, 0x5f5fe807, 0x1b1b1114, 0x2c2cc2b5, 0xfcfcb490, 0x3131272c, 0x808065a3, 0x73732ab2, 0xc0c8173, 0x79795f4c, 0x6b6b4154, 0x4b4b0292, 0x53536974, 0x94948f36, 0x83831f51, 0x2a2a3638, 0xc4c49cb0, 0x2222c8bd, 0xd5d5f85a, 0xbdbdc3fc, 0x48487860, 0xffffce62, 0x4c4c0796, 0x4141776c, 0xc7c7e642, 0xebeb24f7, 0x1c1c1410, 0x5d5d637c, 0x36362228, 0x6767c027, 0xe9e9af8c, 0x4444f913, 0x1414ea95, 0xf5f5bb9c, 0xcfcf18c7, 0x3f3f2d24, 0xc0c0e346, 0x7272db3b, 0x54546c70, 0x29294cca, 0xf0f035e3, 0x808fe85, 0xc6c617cb, 0xf3f34f11, 0x8c8ce4d0, 0xa4a45993, 0xcaca96b8, 0x68683ba6, 0xb8b84d83, 0x38382820, 0xe5e52eff, 0xadad569f, 0xb0b8477, 0xc8c81dc3, 0x9999ffcc, 0x5858ed03, 0x19199a6f, 0xe0e0a08, 0x95957ebf, 0x70705040, 0xf7f730e7, 0x6e6ecf2b, 0x1f1f6ee2, 0xb5b53d79, 0x9090f0c, 0x616134aa, 0x57571682, 0x9f9f0b41, 0x9d9d803a, 0x111164ea, 0x2525cdb9, 0xafafdde4, 0x4545089a, 0xdfdf8da4, 0xa3a35c97, 0xeaead57e, 0x353558da, 0xededd07a, 0x4343fc17, 0xf8f8cb66, 0xfbfbb194, 0x3737d3a1, 0xfafa401d, 0xc2c2683d, 0xb4b4ccf0, 0x32325dde, 0x9c9c71b3, 0x5656e70b, 0xe3e3da72, 0x878760a7, 0x15151b1c, 0xf9f93aef, 0x6363bfd1, 0x3434a953, 0x9a9a853e, 0xb1b1428f, 0x7c7cd133, 0x88889b26, 0x3d3da65f, 0xa1a1d7ec, 0xe4e4df76, 0x8181942a, 0x91910149, 0xf0ffb81, 0xeeeeaa88, 0x161661ee, 0xd7d77321, 0x9797f5c4, 0xa5a5a81a, 0xfefe3feb, 0x6d6db5d9, 0x7878aec5, 0xc5c56d39, 0x1d1de599, 0x7676a4cd, 0x3e3edcad, 0xcbcb6731, 0xb6b6478b, 0xefef5b01, 0x12121e18, 0x6060c523, 0x6a6ab0dd, 0x4d4df61f, 0xcecee94e, 0xdede7c2d, 0x55559df9, 0x7e7e5a48, 0x2121b24f, 0x3037af2, 0xa0a02665, 0x5e5e198e, 0x5a5a6678, 0x65654b5c, 0x62624e58, 0xfdfd4519, 0x606f48d, 0x404086e5, 0xf2f2be98, 0x3333ac57, 0x17179067, 0x5058e7f, 0xe8e85e05, 0x4f4f7d64, 0x89896aaf, 0x10109563, 0x74742fb6, 0xa0a75fe, 0x5c5c92f5, 0x9b9b74b7, 0x2d2d333c, 0x3030d6a5, 0x2e2e49ce, 0x494989e9, 0x46467268, 0x77775544, 0xa8a8d8e0, 0x9696044d, 0x2828bd43, 0xa9a92969, 0xd9d97929, 0x8686912e, 0xd1d187ac, 0xf4f44a15, 0x8d8d1559, 0xd6d682a8, 0xb9b9bc0a, 0x42420d9e, 0xf6f6c16e, 0x2f2fb847, 0xdddd06df, 0x23233934, 0xcccc6235, 0xf1f1c46a, 0xc1c112cf, 0x8585ebdc, 0x8f8f9e22, 0x7171a1c9, 0x9090f0c0, 0xaaaa539b, 0x101f189, 0x8b8be1d4, 0x4e4e8ced, 0x8e8e6fab, 0xababa212, 0x6f6f3ea2, 0xe6e6540d, 0xdbdbf252, 0x92927bbb, 0xb7b7b602, 0x6969ca2f, 0x3939d9a9, 0xd3d30cd7, 0xa7a72361, 0xa2a2ad1e, 0xc3c399b4, 0x6c6c4450, 0x7070504, 0x4047ff6, 0x272746c2, 0xacaca716, 0xd0d07625, 0x50501386, 0xdcdcf756, 0x84841a55, 0xe1e15109, 0x7a7a25be, 0x1313ef91); /** * M-Table * * @var array * @access private */ var $m1 = array(0xa9d93939, 0x67901717, 0xb3719c9c, 0xe8d2a6a6, 0x4050707, 0xfd985252, 0xa3658080, 0x76dfe4e4, 0x9a084545, 0x92024b4b, 0x80a0e0e0, 0x78665a5a, 0xe4ddafaf, 0xddb06a6a, 0xd1bf6363, 0x38362a2a, 0xd54e6e6, 0xc6432020, 0x3562cccc, 0x98bef2f2, 0x181e1212, 0xf724ebeb, 0xecd7a1a1, 0x6c774141, 0x43bd2828, 0x7532bcbc, 0x37d47b7b, 0x269b8888, 0xfa700d0d, 0x13f94444, 0x94b1fbfb, 0x485a7e7e, 0xf27a0303, 0xd0e48c8c, 0x8b47b6b6, 0x303c2424, 0x84a5e7e7, 0x54416b6b, 0xdf06dddd, 0x23c56060, 0x1945fdfd, 0x5ba33a3a, 0x3d68c2c2, 0x59158d8d, 0xf321ecec, 0xae316666, 0xa23e6f6f, 0x82165757, 0x63951010, 0x15befef, 0x834db8b8, 0x2e918686, 0xd9b56d6d, 0x511f8383, 0x9b53aaaa, 0x7c635d5d, 0xa63b6868, 0xeb3ffefe, 0xa5d63030, 0xbe257a7a, 0x16a7acac, 0xc0f0909, 0xe335f0f0, 0x6123a7a7, 0xc0f09090, 0x8cafe9e9, 0x3a809d9d, 0xf5925c5c, 0x73810c0c, 0x2c273131, 0x2576d0d0, 0xbe75656, 0xbb7b9292, 0x4ee9cece, 0x89f10101, 0x6b9f1e1e, 0x53a93434, 0x6ac4f1f1, 0xb499c3c3, 0xf1975b5b, 0xe1834747, 0xe66b1818, 0xbdc82222, 0x450e9898, 0xe26e1f1f, 0xf4c9b3b3, 0xb62f7474, 0x66cbf8f8, 0xccff9999, 0x95ea1414, 0x3ed5858, 0x56f7dcdc, 0xd4e18b8b, 0x1c1b1515, 0x1eada2a2, 0xd70cd3d3, 0xfb2be2e2, 0xc31dc8c8, 0x8e195e5e, 0xb5c22c2c, 0xe9894949, 0xcf12c1c1, 0xbf7e9595, 0xba207d7d, 0xea641111, 0x77840b0b, 0x396dc5c5, 0xaf6a8989, 0x33d17c7c, 0xc9a17171, 0x62ceffff, 0x7137bbbb, 0x81fb0f0f, 0x793db5b5, 0x951e1e1, 0xaddc3e3e, 0x242d3f3f, 0xcda47676, 0xf99d5555, 0xd8ee8282, 0xe5864040, 0xc5ae7878, 0xb9cd2525, 0x4d049696, 0x44557777, 0x80a0e0e, 0x86135050, 0xe730f7f7, 0xa1d33737, 0x1d40fafa, 0xaa346161, 0xed8c4e4e, 0x6b3b0b0, 0x706c5454, 0xb22a7373, 0xd2523b3b, 0x410b9f9f, 0x7b8b0202, 0xa088d8d8, 0x114ff3f3, 0x3167cbcb, 0xc2462727, 0x27c06767, 0x90b4fcfc, 0x20283838, 0xf67f0404, 0x60784848, 0xff2ee5e5, 0x96074c4c, 0x5c4b6565, 0xb1c72b2b, 0xab6f8e8e, 0x9e0d4242, 0x9cbbf5f5, 0x52f2dbdb, 0x1bf34a4a, 0x5fa63d3d, 0x9359a4a4, 0xabcb9b9, 0xef3af9f9, 0x91ef1313, 0x85fe0808, 0x49019191, 0xee611616, 0x2d7cdede, 0x4fb22121, 0x8f42b1b1, 0x3bdb7272, 0x47b82f2f, 0x8748bfbf, 0x6d2caeae, 0x46e3c0c0, 0xd6573c3c, 0x3e859a9a, 0x6929a9a9, 0x647d4f4f, 0x2a948181, 0xce492e2e, 0xcb17c6c6, 0x2fca6969, 0xfcc3bdbd, 0x975ca3a3, 0x55ee8e8, 0x7ad0eded, 0xac87d1d1, 0x7f8e0505, 0xd5ba6464, 0x1aa8a5a5, 0x4bb72626, 0xeb9bebe, 0xa7608787, 0x5af8d5d5, 0x28223636, 0x14111b1b, 0x3fde7575, 0x2979d9d9, 0x88aaeeee, 0x3c332d2d, 0x4c5f7979, 0x2b6b7b7, 0xb896caca, 0xda583535, 0xb09cc4c4, 0x17fc4343, 0x551a8484, 0x1ff64d4d, 0x8a1c5959, 0x7d38b2b2, 0x57ac3333, 0xc718cfcf, 0x8df40606, 0x74695353, 0xb7749b9b, 0xc4f59797, 0x9f56adad, 0x72dae3e3, 0x7ed5eaea, 0x154af4f4, 0x229e8f8f, 0x12a2abab, 0x584e6262, 0x7e85f5f, 0x99e51d1d, 0x34392323, 0x6ec1f6f6, 0x50446c6c, 0xde5d3232, 0x68724646, 0x6526a0a0, 0xbc93cdcd, 0xdb03dada, 0xf8c6baba, 0xc8fa9e9e, 0xa882d6d6, 0x2bcf6e6e, 0x40507070, 0xdceb8585, 0xfe750a0a, 0x328a9393, 0xa48ddfdf, 0xca4c2929, 0x10141c1c, 0x2173d7d7, 0xf0ccb4b4, 0xd309d4d4, 0x5d108a8a, 0xfe25151, 0x0, 0x6f9a1919, 0x9de01a1a, 0x368f9494, 0x42e6c7c7, 0x4aecc9c9, 0x5efdd2d2, 0xc1ab7f7f, 0xe0d8a8a8); /** * M-Table * * @var array * @access private */ var $m2 = array(0xbc75bc32, 0xecf3ec21, 0x20c62043, 0xb3f4b3c9, 0xdadbda03, 0x27b028b, 0xe2fbe22b, 0x9ec89efa, 0xc94ac9ec, 0xd4d3d409, 0x18e6186b, 0x1e6b1e9f, 0x9845980e, 0xb27db238, 0xa6e8a6d2, 0x264b26b7, 0x3cd63c57, 0x9332938a, 0x82d882ee, 0x52fd5298, 0x7b377bd4, 0xbb71bb37, 0x5bf15b97, 0x47e14783, 0x2430243c, 0x510f51e2, 0xbaf8bac6, 0x4a1b4af3, 0xbf87bf48, 0xdfa0d70, 0xb006b0b3, 0x753f75de, 0xd25ed2fd, 0x7dba7d20, 0x66ae6631, 0x3a5b3aa3, 0x598a591c, 0x0, 0xcdbccd93, 0x1a9d1ae0, 0xae6dae2c, 0x7fc17fab, 0x2bb12bc7, 0xbe0ebeb9, 0xe080e0a0, 0x8a5d8a10, 0x3bd23b52, 0x64d564ba, 0xd8a0d888, 0xe784e7a5, 0x5f075fe8, 0x1b141b11, 0x2cb52cc2, 0xfc90fcb4, 0x312c3127, 0x80a38065, 0x73b2732a, 0xc730c81, 0x794c795f, 0x6b546b41, 0x4b924b02, 0x53745369, 0x9436948f, 0x8351831f, 0x2a382a36, 0xc4b0c49c, 0x22bd22c8, 0xd55ad5f8, 0xbdfcbdc3, 0x48604878, 0xff62ffce, 0x4c964c07, 0x416c4177, 0xc742c7e6, 0xebf7eb24, 0x1c101c14, 0x5d7c5d63, 0x36283622, 0x672767c0, 0xe98ce9af, 0x441344f9, 0x149514ea, 0xf59cf5bb, 0xcfc7cf18, 0x3f243f2d, 0xc046c0e3, 0x723b72db, 0x5470546c, 0x29ca294c, 0xf0e3f035, 0x88508fe, 0xc6cbc617, 0xf311f34f, 0x8cd08ce4, 0xa493a459, 0xcab8ca96, 0x68a6683b, 0xb883b84d, 0x38203828, 0xe5ffe52e, 0xad9fad56, 0xb770b84, 0xc8c3c81d, 0x99cc99ff, 0x580358ed, 0x196f199a, 0xe080e0a, 0x95bf957e, 0x70407050, 0xf7e7f730, 0x6e2b6ecf, 0x1fe21f6e, 0xb579b53d, 0x90c090f, 0x61aa6134, 0x57825716, 0x9f419f0b, 0x9d3a9d80, 0x11ea1164, 0x25b925cd, 0xafe4afdd, 0x459a4508, 0xdfa4df8d, 0xa397a35c, 0xea7eead5, 0x35da3558, 0xed7aedd0, 0x431743fc, 0xf866f8cb, 0xfb94fbb1, 0x37a137d3, 0xfa1dfa40, 0xc23dc268, 0xb4f0b4cc, 0x32de325d, 0x9cb39c71, 0x560b56e7, 0xe372e3da, 0x87a78760, 0x151c151b, 0xf9eff93a, 0x63d163bf, 0x345334a9, 0x9a3e9a85, 0xb18fb142, 0x7c337cd1, 0x8826889b, 0x3d5f3da6, 0xa1eca1d7, 0xe476e4df, 0x812a8194, 0x91499101, 0xf810ffb, 0xee88eeaa, 0x16ee1661, 0xd721d773, 0x97c497f5, 0xa51aa5a8, 0xfeebfe3f, 0x6dd96db5, 0x78c578ae, 0xc539c56d, 0x1d991de5, 0x76cd76a4, 0x3ead3edc, 0xcb31cb67, 0xb68bb647, 0xef01ef5b, 0x1218121e, 0x602360c5, 0x6add6ab0, 0x4d1f4df6, 0xce4ecee9, 0xde2dde7c, 0x55f9559d, 0x7e487e5a, 0x214f21b2, 0x3f2037a, 0xa065a026, 0x5e8e5e19, 0x5a785a66, 0x655c654b, 0x6258624e, 0xfd19fd45, 0x68d06f4, 0x40e54086, 0xf298f2be, 0x335733ac, 0x17671790, 0x57f058e, 0xe805e85e, 0x4f644f7d, 0x89af896a, 0x10631095, 0x74b6742f, 0xafe0a75, 0x5cf55c92, 0x9bb79b74, 0x2d3c2d33, 0x30a530d6, 0x2ece2e49, 0x49e94989, 0x46684672, 0x77447755, 0xa8e0a8d8, 0x964d9604, 0x284328bd, 0xa969a929, 0xd929d979, 0x862e8691, 0xd1acd187, 0xf415f44a, 0x8d598d15, 0xd6a8d682, 0xb90ab9bc, 0x429e420d, 0xf66ef6c1, 0x2f472fb8, 0xdddfdd06, 0x23342339, 0xcc35cc62, 0xf16af1c4, 0xc1cfc112, 0x85dc85eb, 0x8f228f9e, 0x71c971a1, 0x90c090f0, 0xaa9baa53, 0x18901f1, 0x8bd48be1, 0x4eed4e8c, 0x8eab8e6f, 0xab12aba2, 0x6fa26f3e, 0xe60de654, 0xdb52dbf2, 0x92bb927b, 0xb702b7b6, 0x692f69ca, 0x39a939d9, 0xd3d7d30c, 0xa761a723, 0xa21ea2ad, 0xc3b4c399, 0x6c506c44, 0x7040705, 0x4f6047f, 0x27c22746, 0xac16aca7, 0xd025d076, 0x50865013, 0xdc56dcf7, 0x8455841a, 0xe109e151, 0x7abe7a25, 0x139113ef); /** * M-Table * * @var array * @access private */ var $m3 = array(0xd939a9d9, 0x90176790, 0x719cb371, 0xd2a6e8d2, 0x5070405, 0x9852fd98, 0x6580a365, 0xdfe476df, 0x8459a08, 0x24b9202, 0xa0e080a0, 0x665a7866, 0xddafe4dd, 0xb06addb0, 0xbf63d1bf, 0x362a3836, 0x54e60d54, 0x4320c643, 0x62cc3562, 0xbef298be, 0x1e12181e, 0x24ebf724, 0xd7a1ecd7, 0x77416c77, 0xbd2843bd, 0x32bc7532, 0xd47b37d4, 0x9b88269b, 0x700dfa70, 0xf94413f9, 0xb1fb94b1, 0x5a7e485a, 0x7a03f27a, 0xe48cd0e4, 0x47b68b47, 0x3c24303c, 0xa5e784a5, 0x416b5441, 0x6dddf06, 0xc56023c5, 0x45fd1945, 0xa33a5ba3, 0x68c23d68, 0x158d5915, 0x21ecf321, 0x3166ae31, 0x3e6fa23e, 0x16578216, 0x95106395, 0x5bef015b, 0x4db8834d, 0x91862e91, 0xb56dd9b5, 0x1f83511f, 0x53aa9b53, 0x635d7c63, 0x3b68a63b, 0x3ffeeb3f, 0xd630a5d6, 0x257abe25, 0xa7ac16a7, 0xf090c0f, 0x35f0e335, 0x23a76123, 0xf090c0f0, 0xafe98caf, 0x809d3a80, 0x925cf592, 0x810c7381, 0x27312c27, 0x76d02576, 0xe7560be7, 0x7b92bb7b, 0xe9ce4ee9, 0xf10189f1, 0x9f1e6b9f, 0xa93453a9, 0xc4f16ac4, 0x99c3b499, 0x975bf197, 0x8347e183, 0x6b18e66b, 0xc822bdc8, 0xe98450e, 0x6e1fe26e, 0xc9b3f4c9, 0x2f74b62f, 0xcbf866cb, 0xff99ccff, 0xea1495ea, 0xed5803ed, 0xf7dc56f7, 0xe18bd4e1, 0x1b151c1b, 0xada21ead, 0xcd3d70c, 0x2be2fb2b, 0x1dc8c31d, 0x195e8e19, 0xc22cb5c2, 0x8949e989, 0x12c1cf12, 0x7e95bf7e, 0x207dba20, 0x6411ea64, 0x840b7784, 0x6dc5396d, 0x6a89af6a, 0xd17c33d1, 0xa171c9a1, 0xceff62ce, 0x37bb7137, 0xfb0f81fb, 0x3db5793d, 0x51e10951, 0xdc3eaddc, 0x2d3f242d, 0xa476cda4, 0x9d55f99d, 0xee82d8ee, 0x8640e586, 0xae78c5ae, 0xcd25b9cd, 0x4964d04, 0x55774455, 0xa0e080a, 0x13508613, 0x30f7e730, 0xd337a1d3, 0x40fa1d40, 0x3461aa34, 0x8c4eed8c, 0xb3b006b3, 0x6c54706c, 0x2a73b22a, 0x523bd252, 0xb9f410b, 0x8b027b8b, 0x88d8a088, 0x4ff3114f, 0x67cb3167, 0x4627c246, 0xc06727c0, 0xb4fc90b4, 0x28382028, 0x7f04f67f, 0x78486078, 0x2ee5ff2e, 0x74c9607, 0x4b655c4b, 0xc72bb1c7, 0x6f8eab6f, 0xd429e0d, 0xbbf59cbb, 0xf2db52f2, 0xf34a1bf3, 0xa63d5fa6, 0x59a49359, 0xbcb90abc, 0x3af9ef3a, 0xef1391ef, 0xfe0885fe, 0x1914901, 0x6116ee61, 0x7cde2d7c, 0xb2214fb2, 0x42b18f42, 0xdb723bdb, 0xb82f47b8, 0x48bf8748, 0x2cae6d2c, 0xe3c046e3, 0x573cd657, 0x859a3e85, 0x29a96929, 0x7d4f647d, 0x94812a94, 0x492ece49, 0x17c6cb17, 0xca692fca, 0xc3bdfcc3, 0x5ca3975c, 0x5ee8055e, 0xd0ed7ad0, 0x87d1ac87, 0x8e057f8e, 0xba64d5ba, 0xa8a51aa8, 0xb7264bb7, 0xb9be0eb9, 0x6087a760, 0xf8d55af8, 0x22362822, 0x111b1411, 0xde753fde, 0x79d92979, 0xaaee88aa, 0x332d3c33, 0x5f794c5f, 0xb6b702b6, 0x96cab896, 0x5835da58, 0x9cc4b09c, 0xfc4317fc, 0x1a84551a, 0xf64d1ff6, 0x1c598a1c, 0x38b27d38, 0xac3357ac, 0x18cfc718, 0xf4068df4, 0x69537469, 0x749bb774, 0xf597c4f5, 0x56ad9f56, 0xdae372da, 0xd5ea7ed5, 0x4af4154a, 0x9e8f229e, 0xa2ab12a2, 0x4e62584e, 0xe85f07e8, 0xe51d99e5, 0x39233439, 0xc1f66ec1, 0x446c5044, 0x5d32de5d, 0x72466872, 0x26a06526, 0x93cdbc93, 0x3dadb03, 0xc6baf8c6, 0xfa9ec8fa, 0x82d6a882, 0xcf6e2bcf, 0x50704050, 0xeb85dceb, 0x750afe75, 0x8a93328a, 0x8ddfa48d, 0x4c29ca4c, 0x141c1014, 0x73d72173, 0xccb4f0cc, 0x9d4d309, 0x108a5d10, 0xe2510fe2, 0x0, 0x9a196f9a, 0xe01a9de0, 0x8f94368f, 0xe6c742e6, 0xecc94aec, 0xfdd25efd, 0xab7fc1ab, 0xd8a8e0d8); /** * The Key Schedule Array * * @var array * @access private */ var $K = array(); /** * The Key depended S-Table 0 * * @var array * @access private */ var $S0 = array(); /** * The Key depended S-Table 1 * * @var array * @access private */ var $S1 = array(); /** * The Key depended S-Table 2 * * @var array * @access private */ var $S2 = array(); /** * The Key depended S-Table 3 * * @var array * @access private */ var $S3 = array(); /** * Holds the last used key * * @var array * @access private */ var $kl; /** * The Key Length (in bytes) * * @see Crypt_Twofish::setKeyLength() * @var int * @access private */ var $key_length = 16; /** * Sets the key length. * * Valid key lengths are 128, 192 or 256 bits * * @access public * @param int $length */ function setKeyLength($length) { } /** * Setup the key (expansion) * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * _mdsrem function using by the twofish cipher algorithm * * @access private * @param string $A * @param string $B * @return array */ function _mdsrem($A, $B) { } /** * Encrypts a block * * @access private * @param string $in * @return string */ function _encryptBlock($in) { } /** * Decrypts a block * * @access private * @param string $in * @return string */ function _decryptBlock($in) { } /** * Setup the performance-optimized function for de/encrypt() * * @see \phpseclib\Crypt\Base::_setupInlineCrypt() * @access private */ function _setupInlineCrypt() { } } /** * Pure-PHP implementation of AES. * * @package AES * @author Jim Wigginton * @access public */ class AES extends \phpseclib\Crypt\Rijndael { /** * Dummy function * * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. * * @see \phpseclib\Crypt\Rijndael::setBlockLength() * @access public * @param int $length */ function setBlockLength($length) { } /** * Sets the key length * * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. * * @see \phpseclib\Crypt\Rijndael:setKeyLength() * @access public * @param int $length */ function setKeyLength($length) { } /** * Sets the key. * * Rijndael supports five different key lengths, AES only supports three. * * @see \phpseclib\Crypt\Rijndael:setKey() * @see setKeyLength() * @access public * @param string $key */ function setKey($key) { } } /** * Pure-PHP implementation of DES. * * @package DES * @author Jim Wigginton * @access public */ class DES extends \phpseclib\Crypt\Base { /**#@+ * @access private * @see \phpseclib\Crypt\DES::_setupKey() * @see \phpseclib\Crypt\DES::_processBlock() */ /** * Contains $keys[self::ENCRYPT] */ const ENCRYPT = 0; /** * Contains $keys[self::DECRYPT] */ const DECRYPT = 1; /**#@-*/ /** * Block Length of the cipher * * @see \phpseclib\Crypt\Base::block_size * @var int * @access private */ var $block_size = 8; /** * Key Length (in bytes) * * @see \phpseclib\Crypt\Base::setKeyLength() * @var int * @access private */ var $key_length = 8; /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'des'; /** * The OpenSSL names of the cipher / modes * * @see \phpseclib\Crypt\Base::openssl_mode_names * @var array * @access private */ var $openssl_mode_names = array(self::MODE_ECB => 'des-ecb', self::MODE_CBC => 'des-cbc', self::MODE_CFB => 'des-cfb', self::MODE_OFB => 'des-ofb'); /** * Optimizing value while CFB-encrypting * * @see \phpseclib\Crypt\Base::cfb_init_len * @var int * @access private */ var $cfb_init_len = 500; /** * Switch for DES/3DES encryption * * Used only if $engine == self::ENGINE_INTERNAL * * @see self::_setupKey() * @see self::_processBlock() * @var int * @access private */ var $des_rounds = 1; /** * max possible size of $key * * @see self::setKey() * @var string * @access private */ var $key_length_max = 8; /** * The Key Schedule * * @see self::_setupKey() * @var array * @access private */ var $keys; /** * Shuffle table. * * For each byte value index, the entry holds an 8-byte string * with each byte containing all bits in the same state as the * corresponding bit in the index value. * * @see self::_processBlock() * @see self::_setupKey() * @var array * @access private */ var $shuffle = array("\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\xff", "\x00\x00\x00\x00\x00\x00\xff\x00", "\x00\x00\x00\x00\x00\x00\xff\xff", "\x00\x00\x00\x00\x00\xff\x00\x00", "\x00\x00\x00\x00\x00\xff\x00\xff", "\x00\x00\x00\x00\x00\xff\xff\x00", "\x00\x00\x00\x00\x00\xff\xff\xff", "\x00\x00\x00\x00\xff\x00\x00\x00", "\x00\x00\x00\x00\xff\x00\x00\xff", "\x00\x00\x00\x00\xff\x00\xff\x00", "\x00\x00\x00\x00\xff\x00\xff\xff", "\x00\x00\x00\x00\xff\xff\x00\x00", "\x00\x00\x00\x00\xff\xff\x00\xff", "\x00\x00\x00\x00\xff\xff\xff\x00", "\x00\x00\x00\x00\xff\xff\xff\xff", "\x00\x00\x00\xff\x00\x00\x00\x00", "\x00\x00\x00\xff\x00\x00\x00\xff", "\x00\x00\x00\xff\x00\x00\xff\x00", "\x00\x00\x00\xff\x00\x00\xff\xff", "\x00\x00\x00\xff\x00\xff\x00\x00", "\x00\x00\x00\xff\x00\xff\x00\xff", "\x00\x00\x00\xff\x00\xff\xff\x00", "\x00\x00\x00\xff\x00\xff\xff\xff", "\x00\x00\x00\xff\xff\x00\x00\x00", "\x00\x00\x00\xff\xff\x00\x00\xff", "\x00\x00\x00\xff\xff\x00\xff\x00", "\x00\x00\x00\xff\xff\x00\xff\xff", "\x00\x00\x00\xff\xff\xff\x00\x00", "\x00\x00\x00\xff\xff\xff\x00\xff", "\x00\x00\x00\xff\xff\xff\xff\x00", "\x00\x00\x00\xff\xff\xff\xff\xff", "\x00\x00\xff\x00\x00\x00\x00\x00", "\x00\x00\xff\x00\x00\x00\x00\xff", "\x00\x00\xff\x00\x00\x00\xff\x00", "\x00\x00\xff\x00\x00\x00\xff\xff", "\x00\x00\xff\x00\x00\xff\x00\x00", "\x00\x00\xff\x00\x00\xff\x00\xff", "\x00\x00\xff\x00\x00\xff\xff\x00", "\x00\x00\xff\x00\x00\xff\xff\xff", "\x00\x00\xff\x00\xff\x00\x00\x00", "\x00\x00\xff\x00\xff\x00\x00\xff", "\x00\x00\xff\x00\xff\x00\xff\x00", "\x00\x00\xff\x00\xff\x00\xff\xff", "\x00\x00\xff\x00\xff\xff\x00\x00", "\x00\x00\xff\x00\xff\xff\x00\xff", "\x00\x00\xff\x00\xff\xff\xff\x00", "\x00\x00\xff\x00\xff\xff\xff\xff", "\x00\x00\xff\xff\x00\x00\x00\x00", "\x00\x00\xff\xff\x00\x00\x00\xff", "\x00\x00\xff\xff\x00\x00\xff\x00", "\x00\x00\xff\xff\x00\x00\xff\xff", "\x00\x00\xff\xff\x00\xff\x00\x00", "\x00\x00\xff\xff\x00\xff\x00\xff", "\x00\x00\xff\xff\x00\xff\xff\x00", "\x00\x00\xff\xff\x00\xff\xff\xff", "\x00\x00\xff\xff\xff\x00\x00\x00", "\x00\x00\xff\xff\xff\x00\x00\xff", "\x00\x00\xff\xff\xff\x00\xff\x00", "\x00\x00\xff\xff\xff\x00\xff\xff", "\x00\x00\xff\xff\xff\xff\x00\x00", "\x00\x00\xff\xff\xff\xff\x00\xff", "\x00\x00\xff\xff\xff\xff\xff\x00", "\x00\x00\xff\xff\xff\xff\xff\xff", "\x00\xff\x00\x00\x00\x00\x00\x00", "\x00\xff\x00\x00\x00\x00\x00\xff", "\x00\xff\x00\x00\x00\x00\xff\x00", "\x00\xff\x00\x00\x00\x00\xff\xff", "\x00\xff\x00\x00\x00\xff\x00\x00", "\x00\xff\x00\x00\x00\xff\x00\xff", "\x00\xff\x00\x00\x00\xff\xff\x00", "\x00\xff\x00\x00\x00\xff\xff\xff", "\x00\xff\x00\x00\xff\x00\x00\x00", "\x00\xff\x00\x00\xff\x00\x00\xff", "\x00\xff\x00\x00\xff\x00\xff\x00", "\x00\xff\x00\x00\xff\x00\xff\xff", "\x00\xff\x00\x00\xff\xff\x00\x00", "\x00\xff\x00\x00\xff\xff\x00\xff", "\x00\xff\x00\x00\xff\xff\xff\x00", "\x00\xff\x00\x00\xff\xff\xff\xff", "\x00\xff\x00\xff\x00\x00\x00\x00", "\x00\xff\x00\xff\x00\x00\x00\xff", "\x00\xff\x00\xff\x00\x00\xff\x00", "\x00\xff\x00\xff\x00\x00\xff\xff", "\x00\xff\x00\xff\x00\xff\x00\x00", "\x00\xff\x00\xff\x00\xff\x00\xff", "\x00\xff\x00\xff\x00\xff\xff\x00", "\x00\xff\x00\xff\x00\xff\xff\xff", "\x00\xff\x00\xff\xff\x00\x00\x00", "\x00\xff\x00\xff\xff\x00\x00\xff", "\x00\xff\x00\xff\xff\x00\xff\x00", "\x00\xff\x00\xff\xff\x00\xff\xff", "\x00\xff\x00\xff\xff\xff\x00\x00", "\x00\xff\x00\xff\xff\xff\x00\xff", "\x00\xff\x00\xff\xff\xff\xff\x00", "\x00\xff\x00\xff\xff\xff\xff\xff", "\x00\xff\xff\x00\x00\x00\x00\x00", "\x00\xff\xff\x00\x00\x00\x00\xff", "\x00\xff\xff\x00\x00\x00\xff\x00", "\x00\xff\xff\x00\x00\x00\xff\xff", "\x00\xff\xff\x00\x00\xff\x00\x00", "\x00\xff\xff\x00\x00\xff\x00\xff", "\x00\xff\xff\x00\x00\xff\xff\x00", "\x00\xff\xff\x00\x00\xff\xff\xff", "\x00\xff\xff\x00\xff\x00\x00\x00", "\x00\xff\xff\x00\xff\x00\x00\xff", "\x00\xff\xff\x00\xff\x00\xff\x00", "\x00\xff\xff\x00\xff\x00\xff\xff", "\x00\xff\xff\x00\xff\xff\x00\x00", "\x00\xff\xff\x00\xff\xff\x00\xff", "\x00\xff\xff\x00\xff\xff\xff\x00", "\x00\xff\xff\x00\xff\xff\xff\xff", "\x00\xff\xff\xff\x00\x00\x00\x00", "\x00\xff\xff\xff\x00\x00\x00\xff", "\x00\xff\xff\xff\x00\x00\xff\x00", "\x00\xff\xff\xff\x00\x00\xff\xff", "\x00\xff\xff\xff\x00\xff\x00\x00", "\x00\xff\xff\xff\x00\xff\x00\xff", "\x00\xff\xff\xff\x00\xff\xff\x00", "\x00\xff\xff\xff\x00\xff\xff\xff", "\x00\xff\xff\xff\xff\x00\x00\x00", "\x00\xff\xff\xff\xff\x00\x00\xff", "\x00\xff\xff\xff\xff\x00\xff\x00", "\x00\xff\xff\xff\xff\x00\xff\xff", "\x00\xff\xff\xff\xff\xff\x00\x00", "\x00\xff\xff\xff\xff\xff\x00\xff", "\x00\xff\xff\xff\xff\xff\xff\x00", "\x00\xff\xff\xff\xff\xff\xff\xff", "\xff\x00\x00\x00\x00\x00\x00\x00", "\xff\x00\x00\x00\x00\x00\x00\xff", "\xff\x00\x00\x00\x00\x00\xff\x00", "\xff\x00\x00\x00\x00\x00\xff\xff", "\xff\x00\x00\x00\x00\xff\x00\x00", "\xff\x00\x00\x00\x00\xff\x00\xff", "\xff\x00\x00\x00\x00\xff\xff\x00", "\xff\x00\x00\x00\x00\xff\xff\xff", "\xff\x00\x00\x00\xff\x00\x00\x00", "\xff\x00\x00\x00\xff\x00\x00\xff", "\xff\x00\x00\x00\xff\x00\xff\x00", "\xff\x00\x00\x00\xff\x00\xff\xff", "\xff\x00\x00\x00\xff\xff\x00\x00", "\xff\x00\x00\x00\xff\xff\x00\xff", "\xff\x00\x00\x00\xff\xff\xff\x00", "\xff\x00\x00\x00\xff\xff\xff\xff", "\xff\x00\x00\xff\x00\x00\x00\x00", "\xff\x00\x00\xff\x00\x00\x00\xff", "\xff\x00\x00\xff\x00\x00\xff\x00", "\xff\x00\x00\xff\x00\x00\xff\xff", "\xff\x00\x00\xff\x00\xff\x00\x00", "\xff\x00\x00\xff\x00\xff\x00\xff", "\xff\x00\x00\xff\x00\xff\xff\x00", "\xff\x00\x00\xff\x00\xff\xff\xff", "\xff\x00\x00\xff\xff\x00\x00\x00", "\xff\x00\x00\xff\xff\x00\x00\xff", "\xff\x00\x00\xff\xff\x00\xff\x00", "\xff\x00\x00\xff\xff\x00\xff\xff", "\xff\x00\x00\xff\xff\xff\x00\x00", "\xff\x00\x00\xff\xff\xff\x00\xff", "\xff\x00\x00\xff\xff\xff\xff\x00", "\xff\x00\x00\xff\xff\xff\xff\xff", "\xff\x00\xff\x00\x00\x00\x00\x00", "\xff\x00\xff\x00\x00\x00\x00\xff", "\xff\x00\xff\x00\x00\x00\xff\x00", "\xff\x00\xff\x00\x00\x00\xff\xff", "\xff\x00\xff\x00\x00\xff\x00\x00", "\xff\x00\xff\x00\x00\xff\x00\xff", "\xff\x00\xff\x00\x00\xff\xff\x00", "\xff\x00\xff\x00\x00\xff\xff\xff", "\xff\x00\xff\x00\xff\x00\x00\x00", "\xff\x00\xff\x00\xff\x00\x00\xff", "\xff\x00\xff\x00\xff\x00\xff\x00", "\xff\x00\xff\x00\xff\x00\xff\xff", "\xff\x00\xff\x00\xff\xff\x00\x00", "\xff\x00\xff\x00\xff\xff\x00\xff", "\xff\x00\xff\x00\xff\xff\xff\x00", "\xff\x00\xff\x00\xff\xff\xff\xff", "\xff\x00\xff\xff\x00\x00\x00\x00", "\xff\x00\xff\xff\x00\x00\x00\xff", "\xff\x00\xff\xff\x00\x00\xff\x00", "\xff\x00\xff\xff\x00\x00\xff\xff", "\xff\x00\xff\xff\x00\xff\x00\x00", "\xff\x00\xff\xff\x00\xff\x00\xff", "\xff\x00\xff\xff\x00\xff\xff\x00", "\xff\x00\xff\xff\x00\xff\xff\xff", "\xff\x00\xff\xff\xff\x00\x00\x00", "\xff\x00\xff\xff\xff\x00\x00\xff", "\xff\x00\xff\xff\xff\x00\xff\x00", "\xff\x00\xff\xff\xff\x00\xff\xff", "\xff\x00\xff\xff\xff\xff\x00\x00", "\xff\x00\xff\xff\xff\xff\x00\xff", "\xff\x00\xff\xff\xff\xff\xff\x00", "\xff\x00\xff\xff\xff\xff\xff\xff", "\xff\xff\x00\x00\x00\x00\x00\x00", "\xff\xff\x00\x00\x00\x00\x00\xff", "\xff\xff\x00\x00\x00\x00\xff\x00", "\xff\xff\x00\x00\x00\x00\xff\xff", "\xff\xff\x00\x00\x00\xff\x00\x00", "\xff\xff\x00\x00\x00\xff\x00\xff", "\xff\xff\x00\x00\x00\xff\xff\x00", "\xff\xff\x00\x00\x00\xff\xff\xff", "\xff\xff\x00\x00\xff\x00\x00\x00", "\xff\xff\x00\x00\xff\x00\x00\xff", "\xff\xff\x00\x00\xff\x00\xff\x00", "\xff\xff\x00\x00\xff\x00\xff\xff", "\xff\xff\x00\x00\xff\xff\x00\x00", "\xff\xff\x00\x00\xff\xff\x00\xff", "\xff\xff\x00\x00\xff\xff\xff\x00", "\xff\xff\x00\x00\xff\xff\xff\xff", "\xff\xff\x00\xff\x00\x00\x00\x00", "\xff\xff\x00\xff\x00\x00\x00\xff", "\xff\xff\x00\xff\x00\x00\xff\x00", "\xff\xff\x00\xff\x00\x00\xff\xff", "\xff\xff\x00\xff\x00\xff\x00\x00", "\xff\xff\x00\xff\x00\xff\x00\xff", "\xff\xff\x00\xff\x00\xff\xff\x00", "\xff\xff\x00\xff\x00\xff\xff\xff", "\xff\xff\x00\xff\xff\x00\x00\x00", "\xff\xff\x00\xff\xff\x00\x00\xff", "\xff\xff\x00\xff\xff\x00\xff\x00", "\xff\xff\x00\xff\xff\x00\xff\xff", "\xff\xff\x00\xff\xff\xff\x00\x00", "\xff\xff\x00\xff\xff\xff\x00\xff", "\xff\xff\x00\xff\xff\xff\xff\x00", "\xff\xff\x00\xff\xff\xff\xff\xff", "\xff\xff\xff\x00\x00\x00\x00\x00", "\xff\xff\xff\x00\x00\x00\x00\xff", "\xff\xff\xff\x00\x00\x00\xff\x00", "\xff\xff\xff\x00\x00\x00\xff\xff", "\xff\xff\xff\x00\x00\xff\x00\x00", "\xff\xff\xff\x00\x00\xff\x00\xff", "\xff\xff\xff\x00\x00\xff\xff\x00", "\xff\xff\xff\x00\x00\xff\xff\xff", "\xff\xff\xff\x00\xff\x00\x00\x00", "\xff\xff\xff\x00\xff\x00\x00\xff", "\xff\xff\xff\x00\xff\x00\xff\x00", "\xff\xff\xff\x00\xff\x00\xff\xff", "\xff\xff\xff\x00\xff\xff\x00\x00", "\xff\xff\xff\x00\xff\xff\x00\xff", "\xff\xff\xff\x00\xff\xff\xff\x00", "\xff\xff\xff\x00\xff\xff\xff\xff", "\xff\xff\xff\xff\x00\x00\x00\x00", "\xff\xff\xff\xff\x00\x00\x00\xff", "\xff\xff\xff\xff\x00\x00\xff\x00", "\xff\xff\xff\xff\x00\x00\xff\xff", "\xff\xff\xff\xff\x00\xff\x00\x00", "\xff\xff\xff\xff\x00\xff\x00\xff", "\xff\xff\xff\xff\x00\xff\xff\x00", "\xff\xff\xff\xff\x00\xff\xff\xff", "\xff\xff\xff\xff\xff\x00\x00\x00", "\xff\xff\xff\xff\xff\x00\x00\xff", "\xff\xff\xff\xff\xff\x00\xff\x00", "\xff\xff\xff\xff\xff\x00\xff\xff", "\xff\xff\xff\xff\xff\xff\x00\x00", "\xff\xff\xff\xff\xff\xff\x00\xff", "\xff\xff\xff\xff\xff\xff\xff\x00", "\xff\xff\xff\xff\xff\xff\xff\xff"); /** * IP mapping helper table. * * Indexing this table with each source byte performs the initial bit permutation. * * @var array * @access private */ var $ipmap = array(0x0, 0x10, 0x1, 0x11, 0x20, 0x30, 0x21, 0x31, 0x2, 0x12, 0x3, 0x13, 0x22, 0x32, 0x23, 0x33, 0x40, 0x50, 0x41, 0x51, 0x60, 0x70, 0x61, 0x71, 0x42, 0x52, 0x43, 0x53, 0x62, 0x72, 0x63, 0x73, 0x4, 0x14, 0x5, 0x15, 0x24, 0x34, 0x25, 0x35, 0x6, 0x16, 0x7, 0x17, 0x26, 0x36, 0x27, 0x37, 0x44, 0x54, 0x45, 0x55, 0x64, 0x74, 0x65, 0x75, 0x46, 0x56, 0x47, 0x57, 0x66, 0x76, 0x67, 0x77, 0x80, 0x90, 0x81, 0x91, 0xa0, 0xb0, 0xa1, 0xb1, 0x82, 0x92, 0x83, 0x93, 0xa2, 0xb2, 0xa3, 0xb3, 0xc0, 0xd0, 0xc1, 0xd1, 0xe0, 0xf0, 0xe1, 0xf1, 0xc2, 0xd2, 0xc3, 0xd3, 0xe2, 0xf2, 0xe3, 0xf3, 0x84, 0x94, 0x85, 0x95, 0xa4, 0xb4, 0xa5, 0xb5, 0x86, 0x96, 0x87, 0x97, 0xa6, 0xb6, 0xa7, 0xb7, 0xc4, 0xd4, 0xc5, 0xd5, 0xe4, 0xf4, 0xe5, 0xf5, 0xc6, 0xd6, 0xc7, 0xd7, 0xe6, 0xf6, 0xe7, 0xf7, 0x8, 0x18, 0x9, 0x19, 0x28, 0x38, 0x29, 0x39, 0xa, 0x1a, 0xb, 0x1b, 0x2a, 0x3a, 0x2b, 0x3b, 0x48, 0x58, 0x49, 0x59, 0x68, 0x78, 0x69, 0x79, 0x4a, 0x5a, 0x4b, 0x5b, 0x6a, 0x7a, 0x6b, 0x7b, 0xc, 0x1c, 0xd, 0x1d, 0x2c, 0x3c, 0x2d, 0x3d, 0xe, 0x1e, 0xf, 0x1f, 0x2e, 0x3e, 0x2f, 0x3f, 0x4c, 0x5c, 0x4d, 0x5d, 0x6c, 0x7c, 0x6d, 0x7d, 0x4e, 0x5e, 0x4f, 0x5f, 0x6e, 0x7e, 0x6f, 0x7f, 0x88, 0x98, 0x89, 0x99, 0xa8, 0xb8, 0xa9, 0xb9, 0x8a, 0x9a, 0x8b, 0x9b, 0xaa, 0xba, 0xab, 0xbb, 0xc8, 0xd8, 0xc9, 0xd9, 0xe8, 0xf8, 0xe9, 0xf9, 0xca, 0xda, 0xcb, 0xdb, 0xea, 0xfa, 0xeb, 0xfb, 0x8c, 0x9c, 0x8d, 0x9d, 0xac, 0xbc, 0xad, 0xbd, 0x8e, 0x9e, 0x8f, 0x9f, 0xae, 0xbe, 0xaf, 0xbf, 0xcc, 0xdc, 0xcd, 0xdd, 0xec, 0xfc, 0xed, 0xfd, 0xce, 0xde, 0xcf, 0xdf, 0xee, 0xfe, 0xef, 0xff); /** * Inverse IP mapping helper table. * Indexing this table with a byte value reverses the bit order. * * @var array * @access private */ var $invipmap = array(0x0, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x8, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x4, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0xc, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x2, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0xa, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x6, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0xe, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x1, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x9, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x5, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0xd, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x3, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0xb, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x7, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0xf, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff); /** * Pre-permuted S-box1 * * Each box ($sbox1-$sbox8) has been vectorized, then each value pre-permuted using the * P table: concatenation can then be replaced by exclusive ORs. * * @var array * @access private */ var $sbox1 = array(0x808200, 0x0, 0x8000, 0x808202, 0x808002, 0x8202, 0x2, 0x8000, 0x200, 0x808200, 0x808202, 0x200, 0x800202, 0x808002, 0x800000, 0x2, 0x202, 0x800200, 0x800200, 0x8200, 0x8200, 0x808000, 0x808000, 0x800202, 0x8002, 0x800002, 0x800002, 0x8002, 0x0, 0x202, 0x8202, 0x800000, 0x8000, 0x808202, 0x2, 0x808000, 0x808200, 0x800000, 0x800000, 0x200, 0x808002, 0x8000, 0x8200, 0x800002, 0x200, 0x2, 0x800202, 0x8202, 0x808202, 0x8002, 0x808000, 0x800202, 0x800002, 0x202, 0x8202, 0x808200, 0x202, 0x800200, 0x800200, 0x0, 0x8002, 0x8200, 0x0, 0x808002); /** * Pre-permuted S-box2 * * @var array * @access private */ var $sbox2 = array(0x40084010, 0x40004000, 0x4000, 0x84010, 0x80000, 0x10, 0x40080010, 0x40004010, 0x40000010, 0x40084010, 0x40084000, 0x40000000, 0x40004000, 0x80000, 0x10, 0x40080010, 0x84000, 0x80010, 0x40004010, 0x0, 0x40000000, 0x4000, 0x84010, 0x40080000, 0x80010, 0x40000010, 0x0, 0x84000, 0x4010, 0x40084000, 0x40080000, 0x4010, 0x0, 0x84010, 0x40080010, 0x80000, 0x40004010, 0x40080000, 0x40084000, 0x4000, 0x40080000, 0x40004000, 0x10, 0x40084010, 0x84010, 0x10, 0x4000, 0x40000000, 0x4010, 0x40084000, 0x80000, 0x40000010, 0x80010, 0x40004010, 0x40000010, 0x80010, 0x84000, 0x0, 0x40004000, 0x4010, 0x40000000, 0x40080010, 0x40084010, 0x84000); /** * Pre-permuted S-box3 * * @var array * @access private */ var $sbox3 = array(0x104, 0x4010100, 0x0, 0x4010004, 0x4000100, 0x0, 0x10104, 0x4000100, 0x10004, 0x4000004, 0x4000004, 0x10000, 0x4010104, 0x10004, 0x4010000, 0x104, 0x4000000, 0x4, 0x4010100, 0x100, 0x10100, 0x4010000, 0x4010004, 0x10104, 0x4000104, 0x10100, 0x10000, 0x4000104, 0x4, 0x4010104, 0x100, 0x4000000, 0x4010100, 0x4000000, 0x10004, 0x104, 0x10000, 0x4010100, 0x4000100, 0x0, 0x100, 0x10004, 0x4010104, 0x4000100, 0x4000004, 0x100, 0x0, 0x4010004, 0x4000104, 0x10000, 0x4000000, 0x4010104, 0x4, 0x10104, 0x10100, 0x4000004, 0x4010000, 0x4000104, 0x104, 0x4010000, 0x10104, 0x4, 0x4010004, 0x10100); /** * Pre-permuted S-box4 * * @var array * @access private */ var $sbox4 = array(0x80401000, 0x80001040, 0x80001040, 0x40, 0x401040, 0x80400040, 0x80400000, 0x80001000, 0x0, 0x401000, 0x401000, 0x80401040, 0x80000040, 0x0, 0x400040, 0x80400000, 0x80000000, 0x1000, 0x400000, 0x80401000, 0x40, 0x400000, 0x80001000, 0x1040, 0x80400040, 0x80000000, 0x1040, 0x400040, 0x1000, 0x401040, 0x80401040, 0x80000040, 0x400040, 0x80400000, 0x401000, 0x80401040, 0x80000040, 0x0, 0x0, 0x401000, 0x1040, 0x400040, 0x80400040, 0x80000000, 0x80401000, 0x80001040, 0x80001040, 0x40, 0x80401040, 0x80000040, 0x80000000, 0x1000, 0x80400000, 0x80001000, 0x401040, 0x80400040, 0x80001000, 0x1040, 0x400000, 0x80401000, 0x40, 0x400000, 0x1000, 0x401040); /** * Pre-permuted S-box5 * * @var array * @access private */ var $sbox5 = array(0x80, 0x1040080, 0x1040000, 0x21000080, 0x40000, 0x80, 0x20000000, 0x1040000, 0x20040080, 0x40000, 0x1000080, 0x20040080, 0x21000080, 0x21040000, 0x40080, 0x20000000, 0x1000000, 0x20040000, 0x20040000, 0x0, 0x20000080, 0x21040080, 0x21040080, 0x1000080, 0x21040000, 0x20000080, 0x0, 0x21000000, 0x1040080, 0x1000000, 0x21000000, 0x40080, 0x40000, 0x21000080, 0x80, 0x1000000, 0x20000000, 0x1040000, 0x21000080, 0x20040080, 0x1000080, 0x20000000, 0x21040000, 0x1040080, 0x20040080, 0x80, 0x1000000, 0x21040000, 0x21040080, 0x40080, 0x21000000, 0x21040080, 0x1040000, 0x0, 0x20040000, 0x21000000, 0x40080, 0x1000080, 0x20000080, 0x40000, 0x0, 0x20040000, 0x1040080, 0x20000080); /** * Pre-permuted S-box6 * * @var array * @access private */ var $sbox6 = array(0x10000008, 0x10200000, 0x2000, 0x10202008, 0x10200000, 0x8, 0x10202008, 0x200000, 0x10002000, 0x202008, 0x200000, 0x10000008, 0x200008, 0x10002000, 0x10000000, 0x2008, 0x0, 0x200008, 0x10002008, 0x2000, 0x202000, 0x10002008, 0x8, 0x10200008, 0x10200008, 0x0, 0x202008, 0x10202000, 0x2008, 0x202000, 0x10202000, 0x10000000, 0x10002000, 0x8, 0x10200008, 0x202000, 0x10202008, 0x200000, 0x2008, 0x10000008, 0x200000, 0x10002000, 0x10000000, 0x2008, 0x10000008, 0x10202008, 0x202000, 0x10200000, 0x202008, 0x10202000, 0x0, 0x10200008, 0x8, 0x2000, 0x10200000, 0x202008, 0x2000, 0x200008, 0x10002008, 0x0, 0x10202000, 0x10000000, 0x200008, 0x10002008); /** * Pre-permuted S-box7 * * @var array * @access private */ var $sbox7 = array(0x100000, 0x2100001, 0x2000401, 0x0, 0x400, 0x2000401, 0x100401, 0x2100400, 0x2100401, 0x100000, 0x0, 0x2000001, 0x1, 0x2000000, 0x2100001, 0x401, 0x2000400, 0x100401, 0x100001, 0x2000400, 0x2000001, 0x2100000, 0x2100400, 0x100001, 0x2100000, 0x400, 0x401, 0x2100401, 0x100400, 0x1, 0x2000000, 0x100400, 0x2000000, 0x100400, 0x100000, 0x2000401, 0x2000401, 0x2100001, 0x2100001, 0x1, 0x100001, 0x2000000, 0x2000400, 0x100000, 0x2100400, 0x401, 0x100401, 0x2100400, 0x401, 0x2000001, 0x2100401, 0x2100000, 0x100400, 0x0, 0x1, 0x2100401, 0x0, 0x100401, 0x2100000, 0x400, 0x2000001, 0x2000400, 0x400, 0x100001); /** * Pre-permuted S-box8 * * @var array * @access private */ var $sbox8 = array(0x8000820, 0x800, 0x20000, 0x8020820, 0x8000000, 0x8000820, 0x20, 0x8000000, 0x20020, 0x8020000, 0x8020820, 0x20800, 0x8020800, 0x20820, 0x800, 0x20, 0x8020000, 0x8000020, 0x8000800, 0x820, 0x20800, 0x20020, 0x8020020, 0x8020800, 0x820, 0x0, 0x0, 0x8020020, 0x8000020, 0x8000800, 0x20820, 0x20000, 0x20820, 0x20000, 0x8020800, 0x800, 0x20, 0x8020020, 0x800, 0x20820, 0x8000800, 0x20, 0x8000020, 0x8020000, 0x8020020, 0x8000000, 0x20000, 0x8000820, 0x0, 0x8020820, 0x20020, 0x8000020, 0x8020000, 0x8000800, 0x8000820, 0x0, 0x8020820, 0x20800, 0x20800, 0x820, 0x820, 0x20020, 0x8000000, 0x8020800); /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::isValidEngine() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Sets the key. * * Keys can be of any length. DES, itself, uses 64-bit keys (eg. strlen($key) == 8), however, we * only use the first eight, if $key has more then eight characters in it, and pad $key with the * null byte if it is less then eight characters long. * * DES also requires that every eighth bit be a parity bit, however, we'll ignore that. * * If the key is not explicitly set, it'll be assumed to be all zero's. * * @see \phpseclib\Crypt\Base::setKey() * @access public * @param string $key */ function setKey($key) { } /** * Encrypts a block * * @see \phpseclib\Crypt\Base::_encryptBlock() * @see \phpseclib\Crypt\Base::encrypt() * @see self::encrypt() * @access private * @param string $in * @return string */ function _encryptBlock($in) { } /** * Decrypts a block * * @see \phpseclib\Crypt\Base::_decryptBlock() * @see \phpseclib\Crypt\Base::decrypt() * @see self::decrypt() * @access private * @param string $in * @return string */ function _decryptBlock($in) { } /** * Encrypts or decrypts a 64-bit block * * $mode should be either self::ENCRYPT or self::DECRYPT. See * {@link http://en.wikipedia.org/wiki/Image:Feistel.png Feistel.png} to get a general * idea of what this function does. * * @see self::_encryptBlock() * @see self::_decryptBlock() * @access private * @param string $block * @param int $mode * @return string */ function _processBlock($block, $mode) { } /** * Creates the key schedule * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Setup the performance-optimized function for de/encrypt() * * @see \phpseclib\Crypt\Base::_setupInlineCrypt() * @access private */ function _setupInlineCrypt() { } } /** * Pure-PHP implementation of Triple DES. * * @package TripleDES * @author Jim Wigginton * @access public */ class TripleDES extends \phpseclib\Crypt\DES { /** * Encrypt / decrypt using inner chaining * * Inner chaining is used by SSH-1 and is generally considered to be less secure then outer chaining (self::MODE_CBC3). */ const MODE_3CBC = -2; /** * Encrypt / decrypt using outer chaining * * Outer chaining is used by SSH-2 and when the mode is set to \phpseclib\Crypt\Base::MODE_CBC. */ const MODE_CBC3 = \phpseclib\Crypt\Base::MODE_CBC; /** * Key Length (in bytes) * * @see \phpseclib\Crypt\TripleDES::setKeyLength() * @var int * @access private */ var $key_length = 24; /** * The default salt used by setPassword() * * @see \phpseclib\Crypt\Base::password_default_salt * @see \phpseclib\Crypt\Base::setPassword() * @var string * @access private */ var $password_default_salt = 'phpseclib'; /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\DES::cipher_name_mcrypt * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'tripledes'; /** * Optimizing value while CFB-encrypting * * @see \phpseclib\Crypt\Base::cfb_init_len * @var int * @access private */ var $cfb_init_len = 750; /** * max possible size of $key * * @see self::setKey() * @see \phpseclib\Crypt\DES::setKey() * @var string * @access private */ var $key_length_max = 24; /** * Internal flag whether using self::MODE_3CBC or not * * @var bool * @access private */ var $mode_3cbc; /** * The \phpseclib\Crypt\DES objects * * Used only if $mode_3cbc === true * * @var array * @access private */ var $des; /** * Default Constructor. * * Determines whether or not the mcrypt extension should be used. * * $mode could be: * * - \phpseclib\Crypt\Base::MODE_ECB * * - \phpseclib\Crypt\Base::MODE_CBC * * - \phpseclib\Crypt\Base::MODE_CTR * * - \phpseclib\Crypt\Base::MODE_CFB * * - \phpseclib\Crypt\Base::MODE_OFB * * - \phpseclib\Crypt\TripleDES::MODE_3CBC * * If not explicitly set, \phpseclib\Crypt\Base::MODE_CBC will be used. * * @see \phpseclib\Crypt\DES::__construct() * @see \phpseclib\Crypt\Base::__construct() * @param int $mode * @access public */ function __construct($mode = \phpseclib\Crypt\Base::MODE_CBC) { } /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::__construct() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Sets the initialization vector. (optional) * * SetIV is not required when \phpseclib\Crypt\Base::MODE_ECB is being used. If not explicitly set, it'll be assumed * to be all zero's. * * @see \phpseclib\Crypt\Base::setIV() * @access public * @param string $iv */ function setIV($iv) { } /** * Sets the key length. * * Valid key lengths are 64, 128 and 192 * * @see \phpseclib\Crypt\Base:setKeyLength() * @access public * @param int $length */ function setKeyLength($length) { } /** * Sets the key. * * Keys can be of any length. Triple DES, itself, can use 128-bit (eg. strlen($key) == 16) or * 192-bit (eg. strlen($key) == 24) keys. This function pads and truncates $key as appropriate. * * DES also requires that every eighth bit be a parity bit, however, we'll ignore that. * * If the key is not explicitly set, it'll be assumed to be all null bytes. * * @access public * @see \phpseclib\Crypt\DES::setKey() * @see \phpseclib\Crypt\Base::setKey() * @param string $key */ function setKey($key) { } /** * Encrypts a message. * * @see \phpseclib\Crypt\Base::encrypt() * @access public * @param string $plaintext * @return string $cipertext */ function encrypt($plaintext) { } /** * Decrypts a message. * * @see \phpseclib\Crypt\Base::decrypt() * @access public * @param string $ciphertext * @return string $plaintext */ function decrypt($ciphertext) { } /** * Treat consecutive "packets" as if they are a continuous buffer. * * Say you have a 16-byte plaintext $plaintext. Using the default behavior, the two following code snippets * will yield different outputs: * * * echo $des->encrypt(substr($plaintext, 0, 8)); * echo $des->encrypt(substr($plaintext, 8, 8)); * * * echo $des->encrypt($plaintext); * * * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates * another, as demonstrated with the following: * * * $des->encrypt(substr($plaintext, 0, 8)); * echo $des->decrypt($des->encrypt(substr($plaintext, 8, 8))); * * * echo $des->decrypt($des->encrypt(substr($plaintext, 8, 8))); * * * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different * outputs. The reason is due to the fact that the initialization vector's change after every encryption / * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. * * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\DES() object changes after each * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), * however, they are also less intuitive and more likely to cause you problems. * * @see \phpseclib\Crypt\Base::enableContinuousBuffer() * @see self::disableContinuousBuffer() * @access public */ function enableContinuousBuffer() { } /** * Treat consecutive packets as if they are a discontinuous buffer. * * The default behavior. * * @see \phpseclib\Crypt\Base::disableContinuousBuffer() * @see self::enableContinuousBuffer() * @access public */ function disableContinuousBuffer() { } /** * Creates the key schedule * * @see \phpseclib\Crypt\DES::_setupKey() * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Sets the internal crypt engine * * @see \phpseclib\Crypt\Base::__construct() * @see \phpseclib\Crypt\Base::setPreferredEngine() * @param int $engine * @access public * @return int */ function setPreferredEngine($engine) { } } /** * Pure-PHP PKCS#1 compliant implementation of RSA. * * @package RSA * @author Jim Wigginton * @access public */ class RSA { /**#@+ * @access public * @see self::encrypt() * @see self::decrypt() */ /** * Use {@link http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding Optimal Asymmetric Encryption Padding} * (OAEP) for encryption / decryption. * * Uses sha1 by default. * * @see self::setHash() * @see self::setMGFHash() */ const ENCRYPTION_OAEP = 1; /** * Use PKCS#1 padding. * * Although self::ENCRYPTION_OAEP offers more security, including PKCS#1 padding is necessary for purposes of backwards * compatibility with protocols (like SSH-1) written before OAEP's introduction. */ const ENCRYPTION_PKCS1 = 2; /** * Do not use any padding * * Although this method is not recommended it can none-the-less sometimes be useful if you're trying to decrypt some legacy * stuff, if you're trying to diagnose why an encrypted message isn't decrypting, etc. */ const ENCRYPTION_NONE = 3; /**#@-*/ /**#@+ * @access public * @see self::sign() * @see self::verify() * @see self::setHash() */ /** * Use the Probabilistic Signature Scheme for signing * * Uses sha1 by default. * * @see self::setSaltLength() * @see self::setMGFHash() */ const SIGNATURE_PSS = 1; /** * Use the PKCS#1 scheme by default. * * Although self::SIGNATURE_PSS offers more security, including PKCS#1 signing is necessary for purposes of backwards * compatibility with protocols (like SSH-2) written before PSS's introduction. */ const SIGNATURE_PKCS1 = 2; /**#@-*/ /**#@+ * @access private * @see \phpseclib\Crypt\RSA::createKey() */ /** * ASN1 Integer */ const ASN1_INTEGER = 2; /** * ASN1 Bit String */ const ASN1_BITSTRING = 3; /** * ASN1 Octet String */ const ASN1_OCTETSTRING = 4; /** * ASN1 Object Identifier */ const ASN1_OBJECT = 6; /** * ASN1 Sequence (with the constucted bit set) */ const ASN1_SEQUENCE = 48; /**#@-*/ /**#@+ * @access private * @see \phpseclib\Crypt\RSA::__construct() */ /** * To use the pure-PHP implementation */ const MODE_INTERNAL = 1; /** * To use the OpenSSL library * * (if enabled; otherwise, the internal implementation will be used) */ const MODE_OPENSSL = 2; /**#@-*/ /**#@+ * @access public * @see \phpseclib\Crypt\RSA::createKey() * @see \phpseclib\Crypt\RSA::setPrivateKeyFormat() */ /** * PKCS#1 formatted private key * * Used by OpenSSH */ const PRIVATE_FORMAT_PKCS1 = 0; /** * PuTTY formatted private key */ const PRIVATE_FORMAT_PUTTY = 1; /** * XML formatted private key */ const PRIVATE_FORMAT_XML = 2; /** * PKCS#8 formatted private key */ const PRIVATE_FORMAT_PKCS8 = 8; /**#@-*/ /**#@+ * @access public * @see \phpseclib\Crypt\RSA::createKey() * @see \phpseclib\Crypt\RSA::setPublicKeyFormat() */ /** * Raw public key * * An array containing two \phpseclib\Math\BigInteger objects. * * The exponent can be indexed with any of the following: * * 0, e, exponent, publicExponent * * The modulus can be indexed with any of the following: * * 1, n, modulo, modulus */ const PUBLIC_FORMAT_RAW = 3; /** * PKCS#1 formatted public key (raw) * * Used by File/X509.php * * Has the following header: * * -----BEGIN RSA PUBLIC KEY----- * * Analogous to ssh-keygen's pem format (as specified by -m) */ const PUBLIC_FORMAT_PKCS1 = 4; const PUBLIC_FORMAT_PKCS1_RAW = 4; /** * XML formatted public key */ const PUBLIC_FORMAT_XML = 5; /** * OpenSSH formatted public key * * Place in $HOME/.ssh/authorized_keys */ const PUBLIC_FORMAT_OPENSSH = 6; /** * PKCS#1 formatted public key (encapsulated) * * Used by PHP's openssl_public_encrypt() and openssl's rsautl (when -pubin is set) * * Has the following header: * * -----BEGIN PUBLIC KEY----- * * Analogous to ssh-keygen's pkcs8 format (as specified by -m). Although PKCS8 * is specific to private keys it's basically creating a DER-encoded wrapper * for keys. This just extends that same concept to public keys (much like ssh-keygen) */ const PUBLIC_FORMAT_PKCS8 = 7; /**#@-*/ /** * Precomputed Zero * * @var \phpseclib\Math\BigInteger * @access private */ var $zero; /** * Precomputed One * * @var \phpseclib\Math\BigInteger * @access private */ var $one; /** * Private Key Format * * @var int * @access private */ var $privateKeyFormat = self::PRIVATE_FORMAT_PKCS1; /** * Public Key Format * * @var int * @access public */ var $publicKeyFormat = self::PUBLIC_FORMAT_PKCS8; /** * Modulus (ie. n) * * @var \phpseclib\Math\BigInteger * @access private */ var $modulus; /** * Modulus length * * @var \phpseclib\Math\BigInteger * @access private */ var $k; /** * Exponent (ie. e or d) * * @var \phpseclib\Math\BigInteger * @access private */ var $exponent; /** * Primes for Chinese Remainder Theorem (ie. p and q) * * @var array * @access private */ var $primes; /** * Exponents for Chinese Remainder Theorem (ie. dP and dQ) * * @var array * @access private */ var $exponents; /** * Coefficients for Chinese Remainder Theorem (ie. qInv) * * @var array * @access private */ var $coefficients; /** * Hash name * * @var string * @access private */ var $hashName; /** * Hash function * * @var \phpseclib\Crypt\Hash * @access private */ var $hash; /** * Length of hash function output * * @var int * @access private */ var $hLen; /** * Length of salt * * @var int * @access private */ var $sLen; /** * Hash function for the Mask Generation Function * * @var \phpseclib\Crypt\Hash * @access private */ var $mgfHash; /** * Length of MGF hash function output * * @var int * @access private */ var $mgfHLen; /** * Encryption mode * * @var int * @access private */ var $encryptionMode = self::ENCRYPTION_OAEP; /** * Signature mode * * @var int * @access private */ var $signatureMode = self::SIGNATURE_PSS; /** * Public Exponent * * @var mixed * @access private */ var $publicExponent = false; /** * Password * * @var string * @access private */ var $password = false; /** * Components * * For use with parsing XML formatted keys. PHP's XML Parser functions use utilized - instead of PHP's DOM functions - * because PHP's XML Parser functions work on PHP4 whereas PHP's DOM functions - although surperior - don't. * * @see self::_start_element_handler() * @var array * @access private */ var $components = array(); /** * Current String * * For use with parsing XML formatted keys. * * @see self::_character_handler() * @see self::_stop_element_handler() * @var mixed * @access private */ var $current; /** * OpenSSL configuration file name. * * Set to null to use system configuration file. * @see self::createKey() * @var mixed * @Access public */ var $configFile; /** * Public key comment field. * * @var string * @access private */ var $comment = 'phpseclib-generated-key'; /** * The constructor * * If you want to make use of the openssl extension, you'll need to set the mode manually, yourself. The reason * \phpseclib\Crypt\RSA doesn't do it is because OpenSSL doesn't fail gracefully. openssl_pkey_new(), in particular, requires * openssl.cnf be present somewhere and, unfortunately, the only real way to find out is too late. * * @return \phpseclib\Crypt\RSA * @access public */ function __construct() { } /** * Create public / private key pair * * Returns an array with the following three elements: * - 'privatekey': The private key. * - 'publickey': The public key. * - 'partialkey': A partially computed key (if the execution time exceeded $timeout). * Will need to be passed back to \phpseclib\Crypt\RSA::createKey() as the third parameter for further processing. * * @access public * @param int $bits * @param int $timeout * @param array $p */ function createKey($bits = 1024, $timeout = false, $partial = array()) { } /** * Convert a private key to the appropriate format. * * @access private * @see self::setPrivateKeyFormat() * @param string $RSAPrivateKey * @return string */ function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients) { } /** * Convert a public key to the appropriate format * * @access private * @see self::setPublicKeyFormat() * @param string $RSAPrivateKey * @return string */ function _convertPublicKey($n, $e) { } /** * Break a public or private key down into its constituant components * * @access private * @see self::_convertPublicKey() * @see self::_convertPrivateKey() * @param string $key * @param int $type * @return array */ function _parseKey($key, $type) { } /** * Returns the key size * * More specifically, this returns the size of the modulo in bits. * * @access public * @return int */ function getSize() { } /** * Start Element Handler * * Called by xml_set_element_handler() * * @access private * @param resource $parser * @param string $name * @param array $attribs */ function _start_element_handler($parser, $name, $attribs) { } /** * Stop Element Handler * * Called by xml_set_element_handler() * * @access private * @param resource $parser * @param string $name */ function _stop_element_handler($parser, $name) { } /** * Data Handler * * Called by xml_set_character_data_handler() * * @access private * @param resource $parser * @param string $data */ function _data_handler($parser, $data) { } /** * Loads a public or private key * * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed) * * @access public * @param string $key * @param int $type optional */ function loadKey($key, $type = false) { } /** * Sets the password * * Private keys can be encrypted with a password. To unset the password, pass in the empty string or false. * Or rather, pass in $password such that empty($password) && !is_string($password) is true. * * @see self::createKey() * @see self::loadKey() * @access public * @param string $password */ function setPassword($password = false) { } /** * Defines the public key * * Some private key formats define the public exponent and some don't. Those that don't define it are problematic when * used in certain contexts. For example, in SSH-2, RSA authentication works by sending the public key along with a * message signed by the private key to the server. The SSH-2 server looks the public key up in an index of public keys * and if it's present then proceeds to verify the signature. Problem is, if your private key doesn't include the public * exponent this won't work unless you manually add the public exponent. phpseclib tries to guess if the key being used * is the public key but in the event that it guesses incorrectly you might still want to explicitly set the key as being * public. * * Do note that when a new key is loaded the index will be cleared. * * Returns true on success, false on failure * * @see self::getPublicKey() * @access public * @param string $key optional * @param int $type optional * @return bool */ function setPublicKey($key = false, $type = false) { } /** * Defines the private key * * If phpseclib guessed a private key was a public key and loaded it as such it might be desirable to force * phpseclib to treat the key as a private key. This function will do that. * * Do note that when a new key is loaded the index will be cleared. * * Returns true on success, false on failure * * @see self::getPublicKey() * @access public * @param string $key optional * @param int $type optional * @return bool */ function setPrivateKey($key = false, $type = false) { } /** * Returns the public key * * The public key is only returned under two circumstances - if the private key had the public key embedded within it * or if the public key was set via setPublicKey(). If the currently loaded key is supposed to be the public key this * function won't return it since this library, for the most part, doesn't distinguish between public and private keys. * * @see self::getPublicKey() * @access public * @param string $key * @param int $type optional */ function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8) { } /** * Returns the public key's fingerprint * * The public key's fingerprint is returned, which is equivalent to running `ssh-keygen -lf rsa.pub`. If there is * no public key currently loaded, false is returned. * Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716) * * @access public * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned * for invalid values. * @return mixed */ function getPublicKeyFingerprint($algorithm = 'md5') { } /** * Returns the private key * * The private key is only returned if the currently loaded key contains the constituent prime numbers. * * @see self::getPublicKey() * @access public * @param string $key * @param int $type optional * @return mixed */ function getPrivateKey($type = self::PUBLIC_FORMAT_PKCS1) { } /** * Returns a minimalistic private key * * Returns the private key without the prime number constituants. Structurally identical to a public key that * hasn't been set as the public key * * @see self::getPrivateKey() * @access private * @param string $key * @param int $type optional */ function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8) { } /** * __toString() magic method * * @access public * @return string */ function __toString() { } /** * __clone() magic method * * @access public * @return Crypt_RSA */ function __clone() { } /** * Generates the smallest and largest numbers requiring $bits bits * * @access private * @param int $bits * @return array */ function _generateMinMax($bits) { } /** * DER-decode the length * * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. * * @access private * @param string $string * @return int */ function _decodeLength(&$string) { } /** * DER-encode the length * * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. * * @access private * @param int $length * @return string */ function _encodeLength($length) { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @return string * @access private */ function _string_shift(&$string, $index = 1) { } /** * Determines the private key format * * @see self::createKey() * @access public * @param int $format */ function setPrivateKeyFormat($format) { } /** * Determines the public key format * * @see self::createKey() * @access public * @param int $format */ function setPublicKeyFormat($format) { } /** * Determines which hashing function should be used * * Used with signature production / verification and (if the encryption mode is self::ENCRYPTION_OAEP) encryption and * decryption. If $hash isn't supported, sha1 is used. * * @access public * @param string $hash */ function setHash($hash) { } /** * Determines which hashing function should be used for the mask generation function * * The mask generation function is used by self::ENCRYPTION_OAEP and self::SIGNATURE_PSS and although it's * best if Hash and MGFHash are set to the same thing this is not a requirement. * * @access public * @param string $hash */ function setMGFHash($hash) { } /** * Determines the salt length * * To quote from {@link http://tools.ietf.org/html/rfc3447#page-38 RFC3447#page-38}: * * Typical salt lengths in octets are hLen (the length of the output * of the hash function Hash) and 0. * * @access public * @param int $format */ function setSaltLength($sLen) { } /** * Integer-to-Octet-String primitive * * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}. * * @access private * @param \phpseclib\Math\BigInteger $x * @param int $xLen * @return string */ function _i2osp($x, $xLen) { } /** * Octet-String-to-Integer primitive * * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}. * * @access private * @param string $x * @return \phpseclib\Math\BigInteger */ function _os2ip($x) { } /** * Exponentiate with or without Chinese Remainder Theorem * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.2}. * * @access private * @param \phpseclib\Math\BigInteger $x * @return \phpseclib\Math\BigInteger */ function _exponentiate($x) { } /** * Performs RSA Blinding * * Protects against timing attacks by employing RSA Blinding. * Returns $x->modPow($this->exponents[$i], $this->primes[$i]) * * @access private * @param \phpseclib\Math\BigInteger $x * @param \phpseclib\Math\BigInteger $r * @param int $i * @return \phpseclib\Math\BigInteger */ function _blind($x, $r, $i) { } /** * Performs blinded RSA equality testing * * Protects against a particular type of timing attack described. * * See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)} * * Thanks for the heads up singpolyma! * * @access private * @param string $x * @param string $y * @return bool */ function _equals($x, $y) { } /** * RSAEP * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}. * * @access private * @param \phpseclib\Math\BigInteger $m * @return \phpseclib\Math\BigInteger */ function _rsaep($m) { } /** * RSADP * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. * * @access private * @param \phpseclib\Math\BigInteger $c * @return \phpseclib\Math\BigInteger */ function _rsadp($c) { } /** * RSASP1 * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. * * @access private * @param \phpseclib\Math\BigInteger $m * @return \phpseclib\Math\BigInteger */ function _rsasp1($m) { } /** * RSAVP1 * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}. * * @access private * @param \phpseclib\Math\BigInteger $s * @return \phpseclib\Math\BigInteger */ function _rsavp1($s) { } /** * MGF1 * * See {@link http://tools.ietf.org/html/rfc3447#appendix-B.2.1 RFC3447#appendix-B.2.1}. * * @access private * @param string $mgfSeed * @param int $mgfLen * @return string */ function _mgf1($mgfSeed, $maskLen) { } /** * RSAES-OAEP-ENCRYPT * * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and * {http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}. * * @access private * @param string $m * @param string $l * @return string */ function _rsaes_oaep_encrypt($m, $l = '') { } /** * RSAES-OAEP-DECRYPT * * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.2 RFC3447#section-7.1.2}. The fact that the error * messages aren't distinguishable from one another hinders debugging, but, to quote from RFC3447#section-7.1.2: * * Note. Care must be taken to ensure that an opponent cannot * distinguish the different error conditions in Step 3.g, whether by * error message or timing, or, more generally, learn partial * information about the encoded message EM. Otherwise an opponent may * be able to obtain useful information about the decryption of the * ciphertext C, leading to a chosen-ciphertext attack such as the one * observed by Manger [36]. * * As for $l... to quote from {@link http://tools.ietf.org/html/rfc3447#page-17 RFC3447#page-17}: * * Both the encryption and the decryption operations of RSAES-OAEP take * the value of a label L as input. In this version of PKCS #1, L is * the empty string; other uses of the label are outside the scope of * this document. * * @access private * @param string $c * @param string $l * @return string */ function _rsaes_oaep_decrypt($c, $l = '') { } /** * Raw Encryption / Decryption * * Doesn't use padding and is not recommended. * * @access private * @param string $m * @return string */ function _raw_encrypt($m) { } /** * RSAES-PKCS1-V1_5-ENCRYPT * * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}. * * @access private * @param string $m * @return string */ function _rsaes_pkcs1_v1_5_encrypt($m) { } /** * RSAES-PKCS1-V1_5-DECRYPT * * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}. * * For compatibility purposes, this function departs slightly from the description given in RFC3447. * The reason being that RFC2313#section-8.1 (PKCS#1 v1.5) states that ciphertext's encrypted by the * private key should have the second byte set to either 0 or 1 and that ciphertext's encrypted by the * public key should have the second byte set to 2. In RFC3447 (PKCS#1 v2.1), the second byte is supposed * to be 2 regardless of which key is used. For compatibility purposes, we'll just check to make sure the * second byte is 2 or less. If it is, we'll accept the decrypted string as valid. * * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib\Crypt\RSA may not decrypt * with a strictly PKCS#1 v1.5 compliant RSA implementation. Public key encrypted ciphertext's should but * not private key encrypted ciphertext's. * * @access private * @param string $c * @return string */ function _rsaes_pkcs1_v1_5_decrypt($c) { } /** * EMSA-PSS-ENCODE * * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}. * * @access private * @param string $m * @param int $emBits */ function _emsa_pss_encode($m, $emBits) { } /** * EMSA-PSS-VERIFY * * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}. * * @access private * @param string $m * @param string $em * @param int $emBits * @return string */ function _emsa_pss_verify($m, $em, $emBits) { } /** * RSASSA-PSS-SIGN * * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}. * * @access private * @param string $m * @return string */ function _rsassa_pss_sign($m) { } /** * RSASSA-PSS-VERIFY * * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}. * * @access private * @param string $m * @param string $s * @return string */ function _rsassa_pss_verify($m, $s) { } /** * EMSA-PKCS1-V1_5-ENCODE * * See {@link http://tools.ietf.org/html/rfc3447#section-9.2 RFC3447#section-9.2}. * * @access private * @param string $m * @param int $emLen * @return string */ function _emsa_pkcs1_v1_5_encode($m, $emLen) { } /** * RSASSA-PKCS1-V1_5-SIGN * * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}. * * @access private * @param string $m * @return string */ function _rsassa_pkcs1_v1_5_sign($m) { } /** * RSASSA-PKCS1-V1_5-VERIFY * * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}. * * @access private * @param string $m * @return string */ function _rsassa_pkcs1_v1_5_verify($m, $s) { } /** * Set Encryption Mode * * Valid values include self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1. * * @access public * @param int $mode */ function setEncryptionMode($mode) { } /** * Set Signature Mode * * Valid values include self::SIGNATURE_PSS and self::SIGNATURE_PKCS1 * * @access public * @param int $mode */ function setSignatureMode($mode) { } /** * Set public key comment. * * @access public * @param string $comment */ function setComment($comment) { } /** * Get public key comment. * * @access public * @return string */ function getComment() { } /** * Encryption * * Both self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1 both place limits on how long $plaintext can be. * If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will * be concatenated together. * * @see self::decrypt() * @access public * @param string $plaintext * @return string */ function encrypt($plaintext) { } /** * Decryption * * @see self::encrypt() * @access public * @param string $plaintext * @return string */ function decrypt($ciphertext) { } /** * Create a signature * * @see self::verify() * @access public * @param string $message * @return string */ function sign($message) { } /** * Verifies a signature * * @see self::sign() * @access public * @param string $message * @param string $signature * @return bool */ function verify($message, $signature) { } /** * Extract raw BER from Base64 encoding * * @access private * @param string $str * @return string */ function _extractBER($str) { } } /** * Pure-PHP implementation of RC4. * * @package RC4 * @author Jim Wigginton * @access public */ class RC4 extends \phpseclib\Crypt\Base { /**#@+ * @access private * @see \phpseclib\Crypt\RC4::_crypt() */ const ENCRYPT = 0; const DECRYPT = 1; /**#@-*/ /** * Block Length of the cipher * * RC4 is a stream cipher * so we the block_size to 0 * * @see \phpseclib\Crypt\Base::block_size * @var int * @access private */ var $block_size = 0; /** * Key Length (in bytes) * * @see \phpseclib\Crypt\RC4::setKeyLength() * @var int * @access private */ var $key_length = 128; // = 1024 bits /** * The mcrypt specific name of the cipher * * @see \phpseclib\Crypt\Base::cipher_name_mcrypt * @var string * @access private */ var $cipher_name_mcrypt = 'arcfour'; /** * Holds whether performance-optimized $inline_crypt() can/should be used. * * @see \phpseclib\Crypt\Base::inline_crypt * @var mixed * @access private */ var $use_inline_crypt = false; // currently not available /** * The Key * * @see self::setKey() * @var string * @access private */ var $key; /** * The Key Stream for decryption and encryption * * @see self::setKey() * @var array * @access private */ var $stream; /** * Default Constructor. * * Determines whether or not the mcrypt extension should be used. * * @see \phpseclib\Crypt\Base::__construct() * @return \phpseclib\Crypt\RC4 * @access public */ function __construct() { } /** * Test for engine validity * * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() * * @see \phpseclib\Crypt\Base::__construct() * @param int $engine * @access public * @return bool */ function isValidEngine($engine) { } /** * Dummy function. * * Some protocols, such as WEP, prepend an "initialization vector" to the key, effectively creating a new key [1]. * If you need to use an initialization vector in this manner, feel free to prepend it to the key, yourself, before * calling setKey(). * * [1] WEP's initialization vectors (IV's) are used in a somewhat insecure way. Since, in that protocol, * the IV's are relatively easy to predict, an attack described by * {@link http://www.drizzle.com/~aboba/IEEE/rc4_ksaproc.pdf Scott Fluhrer, Itsik Mantin, and Adi Shamir} * can be used to quickly guess at the rest of the key. The following links elaborate: * * {@link http://www.rsa.com/rsalabs/node.asp?id=2009 http://www.rsa.com/rsalabs/node.asp?id=2009} * {@link http://en.wikipedia.org/wiki/Related_key_attack http://en.wikipedia.org/wiki/Related_key_attack} * * @param string $iv * @see self::setKey() * @access public */ function setIV($iv) { } /** * Sets the key length * * Keys can be between 1 and 256 bytes long. * * @access public * @param int $length */ function setKeyLength($length) { } /** * Encrypts a message. * * @see \phpseclib\Crypt\Base::decrypt() * @see self::_crypt() * @access public * @param string $plaintext * @return string $ciphertext */ function encrypt($plaintext) { } /** * Decrypts a message. * * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). * At least if the continuous buffer is disabled. * * @see \phpseclib\Crypt\Base::encrypt() * @see self::_crypt() * @access public * @param string $ciphertext * @return string $plaintext */ function decrypt($ciphertext) { } /** * Encrypts a block * * @access private * @param string $in */ function _encryptBlock($in) { } /** * Decrypts a block * * @access private * @param string $in */ function _decryptBlock($in) { } /** * Setup the key (expansion) * * @see \phpseclib\Crypt\Base::_setupKey() * @access private */ function _setupKey() { } /** * Encrypts or decrypts a message. * * @see self::encrypt() * @see self::decrypt() * @access private * @param string $text * @param int $mode * @return string $text */ function _crypt($text, $mode) { } } /** * Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions. * * @package Hash * @author Jim Wigginton * @access public */ class Hash { /**#@+ * @access private * @see \phpseclib\Crypt\Hash::__construct() */ /** * Toggles the internal implementation */ const MODE_INTERNAL = 1; /** * Toggles the mhash() implementation, which has been deprecated on PHP 5.3.0+. */ const MODE_MHASH = 2; /** * Toggles the hash() implementation, which works on PHP 5.1.2+. */ const MODE_HASH = 3; /**#@-*/ /** * Hash Parameter * * @see self::setHash() * @var int * @access private */ var $hashParam; /** * Byte-length of compression blocks / key (Internal HMAC) * * @see self::setAlgorithm() * @var int * @access private */ var $b; /** * Byte-length of hash output (Internal HMAC) * * @see self::setHash() * @var int * @access private */ var $l = false; /** * Hash Algorithm * * @see self::setHash() * @var string * @access private */ var $hash; /** * Key * * @see self::setKey() * @var string * @access private */ var $key = false; /** * Outer XOR (Internal HMAC) * * @see self::setKey() * @var string * @access private */ var $opad; /** * Inner XOR (Internal HMAC) * * @see self::setKey() * @var string * @access private */ var $ipad; /** * Default Constructor. * * @param string $hash * @return \phpseclib\Crypt\Hash * @access public */ function __construct($hash = 'sha1') { } /** * Sets the key for HMACs * * Keys can be of any length. * * @access public * @param string $key */ function setKey($key = false) { } /** * Gets the hash function. * * As set by the constructor or by the setHash() method. * * @access public * @return string */ function getHash() { } /** * Sets the hash function. * * @access public * @param string $hash */ function setHash($hash) { } /** * Compute the HMAC. * * @access public * @param string $text * @return string */ function hash($text) { } /** * Returns the hash length (in bytes) * * @access public * @return int */ function getLength() { } /** * Wrapper for MD5 * * @access private * @param string $m */ function _md5($m) { } /** * Wrapper for SHA1 * * @access private * @param string $m */ function _sha1($m) { } /** * Pure-PHP implementation of MD2 * * See {@link http://tools.ietf.org/html/rfc1319 RFC1319}. * * @access private * @param string $m */ function _md2($m) { } /** * Pure-PHP implementation of SHA256 * * See {@link http://en.wikipedia.org/wiki/SHA_hash_functions#SHA-256_.28a_SHA-2_variant.29_pseudocode SHA-256 (a SHA-2 variant) pseudocode - Wikipedia}. * * @access private * @param string $m */ function _sha256($m) { } /** * Pure-PHP implementation of SHA384 and SHA512 * * @access private * @param string $m */ function _sha512($m) { } /** * Right Rotate * * @access private * @param int $int * @param int $amt * @see self::_sha256() * @return int */ function _rightRotate($int, $amt) { } /** * Right Shift * * @access private * @param int $int * @param int $amt * @see self::_sha256() * @return int */ function _rightShift($int, $amt) { } /** * Not * * @access private * @param int $int * @see self::_sha256() * @return int */ function _not($int) { } /** * Add * * _sha256() adds multiple unsigned 32-bit integers. Since PHP doesn't support unsigned integers and since the * possibility of overflow exists, care has to be taken. BigInteger could be used but this should be faster. * * @param int $... * @return int * @see self::_sha256() * @access private */ function _add() { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @return string * @access private */ function _string_shift(&$string, $index = 1) { } } } namespace phpseclib\File { /** * Pure-PHP X.509 Parser * * @package X509 * @author Jim Wigginton * @access public */ class X509 { /** * Flag to only accept signatures signed by certificate authorities * * Not really used anymore but retained all the same to suppress E_NOTICEs from old installs * * @access public */ const VALIDATE_SIGNATURE_BY_CA = 1; /**#@+ * @access public * @see \phpseclib\File\X509::getDN() */ /** * Return internal array representation */ const DN_ARRAY = 0; /** * Return string */ const DN_STRING = 1; /** * Return ASN.1 name string */ const DN_ASN1 = 2; /** * Return OpenSSL compatible array */ const DN_OPENSSL = 3; /** * Return canonical ASN.1 RDNs string */ const DN_CANON = 4; /** * Return name hash for file indexing */ const DN_HASH = 5; /**#@-*/ /**#@+ * @access public * @see \phpseclib\File\X509::saveX509() * @see \phpseclib\File\X509::saveCSR() * @see \phpseclib\File\X509::saveCRL() */ /** * Save as PEM * * ie. a base64-encoded PEM with a header and a footer */ const FORMAT_PEM = 0; /** * Save as DER */ const FORMAT_DER = 1; /** * Save as a SPKAC * * Only works on CSRs. Not currently supported. */ const FORMAT_SPKAC = 2; /** * Auto-detect the format * * Used only by the load*() functions */ const FORMAT_AUTO_DETECT = 3; /**#@-*/ /** * Attribute value disposition. * If disposition is >= 0, this is the index of the target value. */ const ATTR_ALL = -1; // All attribute values (array). const ATTR_APPEND = -2; // Add a value. const ATTR_REPLACE = -3; // Clear first, then add a value. /** * ASN.1 syntax for X.509 certificates * * @var array * @access private */ var $Certificate; /**#@+ * ASN.1 syntax for various extensions * * @access private */ var $DirectoryString; var $PKCS9String; var $AttributeValue; var $Extensions; var $KeyUsage; var $ExtKeyUsageSyntax; var $BasicConstraints; var $KeyIdentifier; var $CRLDistributionPoints; var $AuthorityKeyIdentifier; var $CertificatePolicies; var $AuthorityInfoAccessSyntax; var $SubjectAltName; var $SubjectDirectoryAttributes; var $PrivateKeyUsagePeriod; var $IssuerAltName; var $PolicyMappings; var $NameConstraints; var $CPSuri; var $UserNotice; var $netscape_cert_type; var $netscape_comment; var $netscape_ca_policy_url; var $Name; var $RelativeDistinguishedName; var $CRLNumber; var $CRLReason; var $IssuingDistributionPoint; var $InvalidityDate; var $CertificateIssuer; var $HoldInstructionCode; var $SignedPublicKeyAndChallenge; /**#@-*/ /**#@+ * ASN.1 syntax for various DN attributes * * @access private */ var $PostalAddress; /**#@-*/ /** * ASN.1 syntax for Certificate Signing Requests (RFC2986) * * @var array * @access private */ var $CertificationRequest; /** * ASN.1 syntax for Certificate Revocation Lists (RFC5280) * * @var array * @access private */ var $CertificateList; /** * Distinguished Name * * @var array * @access private */ var $dn; /** * Public key * * @var string * @access private */ var $publicKey; /** * Private key * * @var string * @access private */ var $privateKey; /** * Object identifiers for X.509 certificates * * @var array * @access private * @link http://en.wikipedia.org/wiki/Object_identifier */ var $oids; /** * The certificate authorities * * @var array * @access private */ var $CAs; /** * The currently loaded certificate * * @var array * @access private */ var $currentCert; /** * The signature subject * * There's no guarantee \phpseclib\File\X509 is going to re-encode an X.509 cert in the same way it was originally * encoded so we take save the portion of the original cert that the signature would have made for. * * @var string * @access private */ var $signatureSubject; /** * Certificate Start Date * * @var string * @access private */ var $startDate; /** * Certificate End Date * * @var string * @access private */ var $endDate; /** * Serial Number * * @var string * @access private */ var $serialNumber; /** * Key Identifier * * See {@link http://tools.ietf.org/html/rfc5280#section-4.2.1.1 RFC5280#section-4.2.1.1} and * {@link http://tools.ietf.org/html/rfc5280#section-4.2.1.2 RFC5280#section-4.2.1.2}. * * @var string * @access private */ var $currentKeyIdentifier; /** * CA Flag * * @var bool * @access private */ var $caFlag = false; /** * SPKAC Challenge * * @var string * @access private */ var $challenge; /** * Default Constructor. * * @return \phpseclib\File\X509 * @access public */ function __construct() { } /** * Load X.509 certificate * * Returns an associative array describing the X.509 cert or a false if the cert failed to load * * @param string $cert * @param int $mode * @access public * @return mixed */ function loadX509($cert, $mode = self::FORMAT_AUTO_DETECT) { } /** * Save X.509 certificate * * @param array $cert * @param int $format optional * @access public * @return string */ function saveX509($cert, $format = self::FORMAT_PEM) { } /** * Map extension values from octet string to extension-specific internal * format. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapInExtensions(&$root, $path, $asn1) { } /** * Map extension values from extension-specific internal format to * octet string. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapOutExtensions(&$root, $path, $asn1) { } /** * Map attribute values from ANY type to attribute-specific internal * format. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapInAttributes(&$root, $path, $asn1) { } /** * Map attribute values from attribute-specific internal format to * ANY type. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapOutAttributes(&$root, $path, $asn1) { } /** * Map DN values from ANY type to DN-specific internal * format. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapInDNs(&$root, $path, $asn1) { } /** * Map DN values from DN-specific internal format to * ANY type. * * @param array ref $root * @param string $path * @param object $asn1 * @access private */ function _mapOutDNs(&$root, $path, $asn1) { } /** * Associate an extension ID to an extension mapping * * @param string $extnId * @access private * @return mixed */ function _getMapping($extnId) { } /** * Load an X.509 certificate as a certificate authority * * @param string $cert * @access public * @return bool */ function loadCA($cert) { } /** * Validate an X.509 certificate against a URL * * From RFC2818 "HTTP over TLS": * * Matching is performed using the matching rules specified by * [RFC2459]. If more than one identity of a given type is present in * the certificate (e.g., more than one dNSName name, a match in any one * of the set is considered acceptable.) Names may contain the wildcard * character * which is considered to match any single domain name * component or component fragment. E.g., *.a.com matches foo.a.com but * not bar.foo.a.com. f*.com matches foo.com but not bar.com. * * @param string $url * @access public * @return bool */ function validateURL($url) { } /** * Validate a date * * If $date isn't defined it is assumed to be the current date. * * @param int $date optional * @access public */ function validateDate($date = null) { } /** * Validate a signature * * Works on X.509 certs, CSR's and CRL's. * Returns true if the signature is verified, false if it is not correct or null on error * * By default returns false for self-signed certs. Call validateSignature(false) to make this support * self-signed. * * The behavior of this function is inspired by {@link http://php.net/openssl-verify openssl_verify}. * * @param bool $caonly optional * @access public * @return mixed */ function validateSignature($caonly = true) { } /** * Validates a signature * * Returns true if the signature is verified, false if it is not correct or null on error * * @param string $publicKeyAlgorithm * @param string $publicKey * @param string $signatureAlgorithm * @param string $signature * @param string $signatureSubject * @access private * @return int */ function _validateSignature($publicKeyAlgorithm, $publicKey, $signatureAlgorithm, $signature, $signatureSubject) { } /** * Reformat public keys * * Reformats a public key to a format supported by phpseclib (if applicable) * * @param string $algorithm * @param string $key * @access private * @return string */ function _reformatKey($algorithm, $key) { } /** * Decodes an IP address * * Takes in a base64 encoded "blob" and returns a human readable IP address * * @param string $ip * @access private * @return string */ function _decodeIP($ip) { } /** * Encodes an IP address * * Takes a human readable IP address into a base64-encoded "blob" * * @param string $ip * @access private * @return string */ function _encodeIP($ip) { } /** * "Normalizes" a Distinguished Name property * * @param string $propName * @access private * @return mixed */ function _translateDNProp($propName) { } /** * Set a Distinguished Name property * * @param string $propName * @param mixed $propValue * @param string $type optional * @access public * @return bool */ function setDNProp($propName, $propValue, $type = 'utf8String') { } /** * Remove Distinguished Name properties * * @param string $propName * @access public */ function removeDNProp($propName) { } /** * Get Distinguished Name properties * * @param string $propName * @param array $dn optional * @param bool $withType optional * @return mixed * @access public */ function getDNProp($propName, $dn = null, $withType = false) { } /** * Set a Distinguished Name * * @param mixed $dn * @param bool $merge optional * @param string $type optional * @access public * @return bool */ function setDN($dn, $merge = false, $type = 'utf8String') { } /** * Get the Distinguished Name for a certificates subject * * @param mixed $format optional * @param array $dn optional * @access public * @return bool */ function getDN($format = self::DN_ARRAY, $dn = null) { } /** * Get the Distinguished Name for a certificate/crl issuer * * @param int $format optional * @access public * @return mixed */ function getIssuerDN($format = self::DN_ARRAY) { } /** * Get the Distinguished Name for a certificate/csr subject * Alias of getDN() * * @param int $format optional * @access public * @return mixed */ function getSubjectDN($format = self::DN_ARRAY) { } /** * Get an individual Distinguished Name property for a certificate/crl issuer * * @param string $propName * @param bool $withType optional * @access public * @return mixed */ function getIssuerDNProp($propName, $withType = false) { } /** * Get an individual Distinguished Name property for a certificate/csr subject * * @param string $propName * @param bool $withType optional * @access public * @return mixed */ function getSubjectDNProp($propName, $withType = false) { } /** * Get the certificate chain for the current cert * * @access public * @return mixed */ function getChain() { } /** * Set public key * * Key needs to be a \phpseclib\Crypt\RSA object * * @param object $key * @access public * @return bool */ function setPublicKey($key) { } /** * Set private key * * Key needs to be a \phpseclib\Crypt\RSA object * * @param object $key * @access public */ function setPrivateKey($key) { } /** * Set challenge * * Used for SPKAC CSR's * * @param string $challenge * @access public */ function setChallenge($challenge) { } /** * Gets the public key * * Returns a \phpseclib\Crypt\RSA object or a false. * * @access public * @return mixed */ function getPublicKey() { } /** * Load a Certificate Signing Request * * @param string $csr * @access public * @return mixed */ function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT) { } /** * Save CSR request * * @param array $csr * @param int $format optional * @access public * @return string */ function saveCSR($csr, $format = self::FORMAT_PEM) { } /** * Load a SPKAC CSR * * SPKAC's are produced by the HTML5 keygen element: * * https://developer.mozilla.org/en-US/docs/HTML/Element/keygen * * @param string $csr * @access public * @return mixed */ function loadSPKAC($spkac) { } /** * Save a SPKAC CSR request * * @param array $csr * @param int $format optional * @access public * @return string */ function saveSPKAC($spkac, $format = self::FORMAT_PEM) { } /** * Load a Certificate Revocation List * * @param string $crl * @access public * @return mixed */ function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT) { } /** * Save Certificate Revocation List. * * @param array $crl * @param int $format optional * @access public * @return string */ function saveCRL($crl, $format = self::FORMAT_PEM) { } /** * Helper function to build a time field according to RFC 3280 section * - 4.1.2.5 Validity * - 5.1.2.4 This Update * - 5.1.2.5 Next Update * - 5.1.2.6 Revoked Certificates * by choosing utcTime iff year of date given is before 2050 and generalTime else. * * @param string $date in format date('D, d M Y H:i:s O') * @access private * @return array */ function _timeField($date) { } /** * Sign an X.509 certificate * * $issuer's private key needs to be loaded. * $subject can be either an existing X.509 cert (if you want to resign it), * a CSR or something with the DN and public key explicitly set. * * @param \phpseclib\File\X509 $issuer * @param \phpseclib\File\X509 $subject * @param string $signatureAlgorithm optional * @access public * @return mixed */ function sign($issuer, $subject, $signatureAlgorithm = 'sha1WithRSAEncryption') { } /** * Sign a CSR * * @access public * @return mixed */ function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption') { } /** * Sign a SPKAC * * @access public * @return mixed */ function signSPKAC($signatureAlgorithm = 'sha1WithRSAEncryption') { } /** * Sign a CRL * * $issuer's private key needs to be loaded. * * @param \phpseclib\File\X509 $issuer * @param \phpseclib\File\X509 $crl * @param string $signatureAlgorithm optional * @access public * @return mixed */ function signCRL($issuer, $crl, $signatureAlgorithm = 'sha1WithRSAEncryption') { } /** * X.509 certificate signing helper function. * * @param object $key * @param \phpseclib\File\X509 $subject * @param string $signatureAlgorithm * @access public * @return mixed */ function _sign($key, $signatureAlgorithm) { } /** * Set certificate start date * * @param string $date * @access public */ function setStartDate($date) { } /** * Set certificate end date * * @param string $date * @access public */ function setEndDate($date) { } /** * Set Serial Number * * @param string $serial * @param $base optional * @access public */ function setSerialNumber($serial, $base = -256) { } /** * Turns the certificate into a certificate authority * * @access public */ function makeCA() { } /** * Check for validity of subarray * * This is intended for use in conjunction with _subArrayUnchecked(), * implementing the checks included in _subArray() but without copying * a potentially large array by passing its reference by-value to is_array(). * * @param array $root * @param string $path * @return boolean * @access private */ function _isSubArrayValid($root, $path) { } /** * Get a reference to a subarray * * This variant of _subArray() does no is_array() checking, * so $root should be checked with _isSubArrayValid() first. * * This is here for performance reasons: * Passing a reference (i.e. $root) by-value (i.e. to is_array()) * creates a copy. If $root is an especially large array, this is expensive. * * @param array $root * @param string $path absolute path with / as component separator * @param bool $create optional * @access private * @return array|false */ function &_subArrayUnchecked(&$root, $path, $create = false) { } /** * Get a reference to a subarray * * @param array $root * @param string $path absolute path with / as component separator * @param bool $create optional * @access private * @return array|false */ function &_subArray(&$root, $path, $create = false) { } /** * Get a reference to an extension subarray * * @param array $root * @param string $path optional absolute path with / as component separator * @param bool $create optional * @access private * @return array|false */ function &_extensions(&$root, $path = null, $create = false) { } /** * Remove an Extension * * @param string $id * @param string $path optional * @access private * @return bool */ function _removeExtension($id, $path = null) { } /** * Get an Extension * * Returns the extension if it exists and false if not * * @param string $id * @param array $cert optional * @param string $path optional * @access private * @return mixed */ function _getExtension($id, $cert = null, $path = null) { } /** * Returns a list of all extensions in use * * @param array $cert optional * @param string $path optional * @access private * @return array */ function _getExtensions($cert = null, $path = null) { } /** * Set an Extension * * @param string $id * @param mixed $value * @param bool $critical optional * @param bool $replace optional * @param string $path optional * @access private * @return bool */ function _setExtension($id, $value, $critical = false, $replace = true, $path = null) { } /** * Remove a certificate, CSR or CRL Extension * * @param string $id * @access public * @return bool */ function removeExtension($id) { } /** * Get a certificate, CSR or CRL Extension * * Returns the extension if it exists and false if not * * @param string $id * @param array $cert optional * @access public * @return mixed */ function getExtension($id, $cert = null) { } /** * Returns a list of all extensions in use in certificate, CSR or CRL * * @param array $cert optional * @access public * @return array */ function getExtensions($cert = null) { } /** * Set a certificate, CSR or CRL Extension * * @param string $id * @param mixed $value * @param bool $critical optional * @param bool $replace optional * @access public * @return bool */ function setExtension($id, $value, $critical = false, $replace = true) { } /** * Remove a CSR attribute. * * @param string $id * @param int $disposition optional * @access public * @return bool */ function removeAttribute($id, $disposition = self::ATTR_ALL) { } /** * Get a CSR attribute * * Returns the attribute if it exists and false if not * * @param string $id * @param int $disposition optional * @param array $csr optional * @access public * @return mixed */ function getAttribute($id, $disposition = self::ATTR_ALL, $csr = null) { } /** * Returns a list of all CSR attributes in use * * @param array $csr optional * @access public * @return array */ function getAttributes($csr = null) { } /** * Set a CSR attribute * * @param string $id * @param mixed $value * @param bool $disposition optional * @access public * @return bool */ function setAttribute($id, $value, $disposition = self::ATTR_ALL) { } /** * Sets the subject key identifier * * This is used by the id-ce-authorityKeyIdentifier and the id-ce-subjectKeyIdentifier extensions. * * @param string $value * @access public */ function setKeyIdentifier($value) { } /** * Compute a public key identifier. * * Although key identifiers may be set to any unique value, this function * computes key identifiers from public key according to the two * recommended methods (4.2.1.2 RFC 3280). * Highly polymorphic: try to accept all possible forms of key: * - Key object * - \phpseclib\File\X509 object with public or private key defined * - Certificate or CSR array * - \phpseclib\File\ASN1\Element object * - PEM or DER string * * @param mixed $key optional * @param int $method optional * @access public * @return string binary key identifier */ function computeKeyIdentifier($key = null, $method = 1) { } /** * Format a public key as appropriate * * @access private * @return array */ function _formatSubjectPublicKey() { } /** * Set the domain name's which the cert is to be valid for * * @access public * @return array */ function setDomain() { } /** * Set the IP Addresses's which the cert is to be valid for * * @access public * @param string $ipAddress optional */ function setIPAddress() { } /** * Helper function to build domain array * * @access private * @param string $domain * @return array */ function _dnsName($domain) { } /** * Helper function to build IP Address array * * (IPv6 is not currently supported) * * @access private * @param string $address * @return array */ function _iPAddress($address) { } /** * Get the index of a revoked certificate. * * @param array $rclist * @param string $serial * @param bool $create optional * @access private * @return int|false */ function _revokedCertificate(&$rclist, $serial, $create = false) { } /** * Revoke a certificate. * * @param string $serial * @param string $date optional * @access public * @return bool */ function revoke($serial, $date = null) { } /** * Unrevoke a certificate. * * @param string $serial * @access public * @return bool */ function unrevoke($serial) { } /** * Get a revoked certificate. * * @param string $serial * @access public * @return mixed */ function getRevoked($serial) { } /** * List revoked certificates * * @param array $crl optional * @access public * @return array */ function listRevoked($crl = null) { } /** * Remove a Revoked Certificate Extension * * @param string $serial * @param string $id * @access public * @return bool */ function removeRevokedCertificateExtension($serial, $id) { } /** * Get a Revoked Certificate Extension * * Returns the extension if it exists and false if not * * @param string $serial * @param string $id * @param array $crl optional * @access public * @return mixed */ function getRevokedCertificateExtension($serial, $id, $crl = null) { } /** * Returns a list of all extensions in use for a given revoked certificate * * @param string $serial * @param array $crl optional * @access public * @return array */ function getRevokedCertificateExtensions($serial, $crl = null) { } /** * Set a Revoked Certificate Extension * * @param string $serial * @param string $id * @param mixed $value * @param bool $critical optional * @param bool $replace optional * @access public * @return bool */ function setRevokedCertificateExtension($serial, $id, $value, $critical = false, $replace = true) { } /** * Extract raw BER from Base64 encoding * * @access private * @param string $str * @return string */ function _extractBER($str) { } /** * Returns the OID corresponding to a name * * What's returned in the associative array returned by loadX509() (or load*()) is either a name or an OID if * no OID to name mapping is available. The problem with this is that what may be an unmapped OID in one version * of phpseclib may not be unmapped in the next version, so apps that are looking at this OID may not be able * to work from version to version. * * This method will return the OID if a name is passed to it and if no mapping is avialable it'll assume that * what's being passed to it already is an OID and return that instead. A few examples. * * getOID('2.16.840.1.101.3.4.2.1') == '2.16.840.1.101.3.4.2.1' * getOID('id-sha256') == '2.16.840.1.101.3.4.2.1' * getOID('zzz') == 'zzz' * * @access public * @return string */ function getOID($name) { } } /** * Pure-PHP ANSI Decoder * * @package ANSI * @author Jim Wigginton * @access public */ class ANSI { /** * Max Width * * @var int * @access private */ var $max_x; /** * Max Height * * @var int * @access private */ var $max_y; /** * Max History * * @var int * @access private */ var $max_history; /** * History * * @var array * @access private */ var $history; /** * History Attributes * * @var array * @access private */ var $history_attrs; /** * Current Column * * @var int * @access private */ var $x; /** * Current Row * * @var int * @access private */ var $y; /** * Old Column * * @var int * @access private */ var $old_x; /** * Old Row * * @var int * @access private */ var $old_y; /** * An empty attribute cell * * @var object * @access private */ var $base_attr_cell; /** * The current attribute cell * * @var object * @access private */ var $attr_cell; /** * An empty attribute row * * @var array * @access private */ var $attr_row; /** * The current screen text * * @var array * @access private */ var $screen; /** * The current screen attributes * * @var array * @access private */ var $attrs; /** * Current ANSI code * * @var string * @access private */ var $ansi; /** * Tokenization * * @var array * @access private */ var $tokenization; /** * Default Constructor. * * @return \phpseclib\File\ANSI * @access public */ function __construct() { } /** * Set terminal width and height * * Resets the screen as well * * @param int $x * @param int $y * @access public */ function setDimensions($x, $y) { } /** * Set the number of lines that should be logged past the terminal height * * @param int $x * @param int $y * @access public */ function setHistory($history) { } /** * Load a string * * @param string $source * @access public */ function loadString($source) { } /** * Appdend a string * * @param string $source * @access public */ function appendString($source) { } /** * Add a new line * * Also update the $this->screen and $this->history buffers * * @access private */ function _newLine() { } /** * Returns the current coordinate without preformating * * @access private * @return string */ function _processCoordinate($last_attr, $cur_attr, $char) { } /** * Returns the current screen without preformating * * @access private * @return string */ function _getScreen() { } /** * Returns the current screen * * @access public * @return string */ function getScreen() { } /** * Returns the current screen and the x previous lines * * @access public * @return string */ function getHistory() { } } } namespace phpseclib\File\ASN1 { /** * ASN.1 Element * * Bypass normal encoding rules in phpseclib\File\ASN1::encodeDER() * * @package ASN1 * @author Jim Wigginton * @access public */ class Element { /** * Raw element value * * @var string * @access private */ var $element; /** * Constructor * * @param string $encoded * @return \phpseclib\File\ASN1\Element * @access public */ function __construct($encoded) { } } } namespace phpseclib\File { /** * Pure-PHP ASN.1 Parser * * @package ASN1 * @author Jim Wigginton * @access public */ class ASN1 { /**#@+ * Tag Classes * * @access private * @link http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#page=12 */ const CLASS_UNIVERSAL = 0; const CLASS_APPLICATION = 1; const CLASS_CONTEXT_SPECIFIC = 2; const CLASS_PRIVATE = 3; /**#@-*/ /**#@+ * Tag Classes * * @access private * @link http://www.obj-sys.com/asn1tutorial/node124.html */ const TYPE_BOOLEAN = 1; const TYPE_INTEGER = 2; const TYPE_BIT_STRING = 3; const TYPE_OCTET_STRING = 4; const TYPE_NULL = 5; const TYPE_OBJECT_IDENTIFIER = 6; //const TYPE_OBJECT_DESCRIPTOR = 7; //const TYPE_INSTANCE_OF = 8; // EXTERNAL const TYPE_REAL = 9; const TYPE_ENUMERATED = 10; //const TYPE_EMBEDDED = 11; const TYPE_UTF8_STRING = 12; //const TYPE_RELATIVE_OID = 13; const TYPE_SEQUENCE = 16; // SEQUENCE OF const TYPE_SET = 17; // SET OF /**#@-*/ /**#@+ * More Tag Classes * * @access private * @link http://www.obj-sys.com/asn1tutorial/node10.html */ const TYPE_NUMERIC_STRING = 18; const TYPE_PRINTABLE_STRING = 19; const TYPE_TELETEX_STRING = 20; // T61String const TYPE_VIDEOTEX_STRING = 21; const TYPE_IA5_STRING = 22; const TYPE_UTC_TIME = 23; const TYPE_GENERALIZED_TIME = 24; const TYPE_GRAPHIC_STRING = 25; const TYPE_VISIBLE_STRING = 26; // ISO646String const TYPE_GENERAL_STRING = 27; const TYPE_UNIVERSAL_STRING = 28; //const TYPE_CHARACTER_STRING = 29; const TYPE_BMP_STRING = 30; /**#@-*/ /**#@+ * Tag Aliases * * These tags are kinda place holders for other tags. * * @access private */ const TYPE_CHOICE = -1; const TYPE_ANY = -2; /**#@-*/ /** * ASN.1 object identifier * * @var array * @access private * @link http://en.wikipedia.org/wiki/Object_identifier */ var $oids = array(); /** * Default date format * * @var string * @access private * @link http://php.net/class.datetime */ var $format = 'D, d M Y H:i:s O'; /** * Default date format * * @var array * @access private * @see self::setTimeFormat() * @see self::asn1map() * @link http://php.net/class.datetime */ var $encoded; /** * Filters * * If the mapping type is self::TYPE_ANY what do we actually encode it as? * * @var array * @access private * @see self::_encode_der() */ var $filters; /** * Type mapping table for the ANY type. * * Structured or unknown types are mapped to a \phpseclib\File\ASN1\Element. * Unambiguous types get the direct mapping (int/real/bool). * Others are mapped as a choice, with an extra indexing level. * * @var array * @access public */ var $ANYmap = array( self::TYPE_BOOLEAN => true, self::TYPE_INTEGER => true, self::TYPE_BIT_STRING => 'bitString', self::TYPE_OCTET_STRING => 'octetString', self::TYPE_NULL => 'null', self::TYPE_OBJECT_IDENTIFIER => 'objectIdentifier', self::TYPE_REAL => true, self::TYPE_ENUMERATED => 'enumerated', self::TYPE_UTF8_STRING => 'utf8String', self::TYPE_NUMERIC_STRING => 'numericString', self::TYPE_PRINTABLE_STRING => 'printableString', self::TYPE_TELETEX_STRING => 'teletexString', self::TYPE_VIDEOTEX_STRING => 'videotexString', self::TYPE_IA5_STRING => 'ia5String', self::TYPE_UTC_TIME => 'utcTime', self::TYPE_GENERALIZED_TIME => 'generalTime', self::TYPE_GRAPHIC_STRING => 'graphicString', self::TYPE_VISIBLE_STRING => 'visibleString', self::TYPE_GENERAL_STRING => 'generalString', self::TYPE_UNIVERSAL_STRING => 'universalString', //self::TYPE_CHARACTER_STRING => 'characterString', self::TYPE_BMP_STRING => 'bmpString', ); /** * String type to character size mapping table. * * Non-convertable types are absent from this table. * size == 0 indicates variable length encoding. * * @var array * @access public */ var $stringTypeSize = array(self::TYPE_UTF8_STRING => 0, self::TYPE_BMP_STRING => 2, self::TYPE_UNIVERSAL_STRING => 4, self::TYPE_PRINTABLE_STRING => 1, self::TYPE_TELETEX_STRING => 1, self::TYPE_IA5_STRING => 1, self::TYPE_VISIBLE_STRING => 1); /** * Parse BER-encoding * * Serves a similar purpose to openssl's asn1parse * * @param string $encoded * @return array * @access public */ function decodeBER($encoded) { } /** * Parse BER-encoding (Helper function) * * Sometimes we want to get the BER encoding of a particular tag. $start lets us do that without having to reencode. * $encoded is passed by reference for the recursive calls done for self::TYPE_BIT_STRING and * self::TYPE_OCTET_STRING. In those cases, the indefinite length is used. * * @param string $encoded * @param int $start * @param int $encoded_pos * @return array * @access private */ function _decode_ber($encoded, $start = 0, $encoded_pos = 0) { } /** * ASN.1 Map * * Provides an ASN.1 semantic mapping ($mapping) from a parsed BER-encoding to a human readable format. * * "Special" mappings may be applied on a per tag-name basis via $special. * * @param array $decoded * @param array $mapping * @param array $special * @return array * @access public */ function asn1map($decoded, $mapping, $special = array()) { } /** * ASN.1 Encode * * DER-encodes an ASN.1 semantic mapping ($mapping). Some libraries would probably call this function * an ASN.1 compiler. * * "Special" mappings can be applied via $special. * * @param string $source * @param string $mapping * @param int $idx * @return string * @access public */ function encodeDER($source, $mapping, $special = array()) { } /** * ASN.1 Encode (Helper function) * * @param string $source * @param string $mapping * @param int $idx * @return string * @access private */ function _encode_der($source, $mapping, $idx = null, $special = array()) { } /** * DER-encode the length * * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information. * * @access private * @param int $length * @return string */ function _encodeLength($length) { } /** * BER-decode the time * * Called by _decode_ber() and in the case of implicit tags asn1map(). * * @access private * @param string $content * @param int $tag * @return string */ function _decodeTime($content, $tag) { } /** * Set the time format * * Sets the time / date format for asn1map(). * * @access public * @param string $format */ function setTimeFormat($format) { } /** * Load OIDs * * Load the relevant OIDs for a particular ASN.1 semantic mapping. * * @access public * @param array $oids */ function loadOIDs($oids) { } /** * Load filters * * See \phpseclib\File\X509, etc, for an example. * * @access public * @param array $filters */ function loadFilters($filters) { } /** * String Shift * * Inspired by array_shift * * @param string $string * @param int $index * @return string * @access private */ function _string_shift(&$string, $index = 1) { } /** * String type conversion * * This is a lazy conversion, dealing only with character size. * No real conversion table is used. * * @param string $in * @param int $from * @param int $to * @return string * @access public */ function convert($in, $from = self::TYPE_UTF8_STRING, $to = self::TYPE_UTF8_STRING) { } } } namespace phpseclib\System\SSH { /** * Pure-PHP ssh-agent client identity factory * * requestIdentities() method pumps out \phpseclib\System\SSH\Agent\Identity objects * * @package SSH\Agent * @author Jim Wigginton * @access internal */ class Agent { /**#@+ * Message numbers * * @access private */ // to request SSH1 keys you have to use SSH_AGENTC_REQUEST_RSA_IDENTITIES (1) const SSH_AGENTC_REQUEST_IDENTITIES = 11; // this is the SSH2 response; the SSH1 response is SSH_AGENT_RSA_IDENTITIES_ANSWER (2). const SSH_AGENT_IDENTITIES_ANSWER = 12; // the SSH1 request is SSH_AGENTC_RSA_CHALLENGE (3) const SSH_AGENTC_SIGN_REQUEST = 13; // the SSH1 response is SSH_AGENT_RSA_RESPONSE (4) const SSH_AGENT_SIGN_RESPONSE = 14; /**#@-*/ /**@+ * Agent forwarding status * * @access private */ // no forwarding requested and not active const FORWARD_NONE = 0; // request agent forwarding when opportune const FORWARD_REQUEST = 1; // forwarding has been request and is active const FORWARD_ACTIVE = 2; /**#@-*/ /** * Unused */ const SSH_AGENT_FAILURE = 5; /** * Socket Resource * * @var resource * @access private */ var $fsock; /** * Agent forwarding status * * @access private */ var $forward_status = self::FORWARD_NONE; /** * Buffer for accumulating forwarded authentication * agent data arriving on SSH data channel destined * for agent unix socket * * @access private */ var $socket_buffer = ''; /** * Tracking the number of bytes we are expecting * to arrive for the agent socket on the SSH data * channel */ var $expected_bytes = 0; /** * Default Constructor * * @return \phpseclib\System\SSH\Agent * @access public */ function __construct() { } /** * Request Identities * * See "2.5.2 Requesting a list of protocol 2 keys" * Returns an array containing zero or more \phpseclib\System\SSH\Agent\Identity objects * * @return array * @access public */ function requestIdentities() { } /** * Signal that agent forwarding should * be requested when a channel is opened * * @param Net_SSH2 $ssh * @return bool * @access public */ function startSSHForwarding($ssh) { } /** * Request agent forwarding of remote server * * @param Net_SSH2 $ssh * @return bool * @access private */ function _request_forwarding($ssh) { } /** * On successful channel open * * This method is called upon successful channel * open to give the SSH Agent an opportunity * to take further action. i.e. request agent forwarding * * @param Net_SSH2 $ssh * @access private */ function _on_channel_open($ssh) { } /** * Forward data to SSH Agent and return data reply * * @param string $data * @return data from SSH Agent * @access private */ function _forward_data($data) { } } } namespace phpseclib\System\SSH\Agent { /** * Pure-PHP ssh-agent client identity object * * Instantiation should only be performed by \phpseclib\System\SSH\Agent class. * This could be thought of as implementing an interface that phpseclib\Crypt\RSA * implements. ie. maybe a Net_SSH_Auth_PublicKey interface or something. * The methods in this interface would be getPublicKey and sign since those are the * methods phpseclib looks for to perform public key authentication. * * @package SSH\Agent * @author Jim Wigginton * @access internal */ class Identity { /** * Key Object * * @var \phpseclib\Crypt\RSA * @access private * @see self::getPublicKey() */ var $key; /** * Key Blob * * @var string * @access private * @see self::sign() */ var $key_blob; /** * Socket Resource * * @var resource * @access private * @see self::sign() */ var $fsock; /** * Default Constructor. * * @param resource $fsock * @return \phpseclib\System\SSH\Agent\Identity * @access private */ function __construct($fsock) { } /** * Set Public Key * * Called by \phpseclib\System\SSH\Agent::requestIdentities() * * @param \phpseclib\Crypt\RSA $key * @access private */ function setPublicKey($key) { } /** * Set Public Key * * Called by \phpseclib\System\SSH\Agent::requestIdentities(). The key blob could be extracted from $this->key * but this saves a small amount of computation. * * @param string $key_blob * @access private */ function setPublicKeyBlob($key_blob) { } /** * Get Public Key * * Wrapper for $this->key->getPublicKey() * * @param int $format optional * @return mixed * @access public */ function getPublicKey($format = null) { } /** * Set Signature Mode * * Doesn't do anything as ssh-agent doesn't let you pick and choose the signature mode. ie. * ssh-agent's only supported mode is \phpseclib\Crypt\RSA::SIGNATURE_PKCS1 * * @param int $mode * @access public */ function setSignatureMode($mode) { } /** * Create a signature * * See "2.6.2 Protocol 2 private key signature request" * * @param string $message * @return string * @access public */ function sign($message) { } } } namespace { /** * mcrypt_compat stream filter * * @author Jim Wigginton * @access public */ class phpseclib_mcrypt_filter extends \php_user_filter { /** * Called when applying the filter * * This method is called whenever data is read from or written to the attached stream * (such as with fread() or fwrite()). * * @param resource $in * @param resource $out * @param int $consumed * @param bool $closing * @link http://php.net/manual/en/php-user-filter.filter.php * @return int * @access public */ public function filter($in, $out, &$consumed, $closing) { } /** * Called when creating the filter * * This method is called during instantiation of the filter class object. * If your filter allocates or initializes any other resources (such as a buffer), * this is the place to do it. * * @link http://php.net/manual/en/php-user-filter.oncreate.php * @return bool * @access public */ public function onCreate() { } } } namespace Interop\Http\ServerMiddleware { interface MiddlewareInterface { /** * Process an incoming server request and return a response, optionally delegating * to the next middleware component to create the response. * * @param ServerRequestInterface $request * @param DelegateInterface $delegate * * @return ResponseInterface */ public function process(\Psr\Http\Message\ServerRequestInterface $request, \Interop\Http\ServerMiddleware\DelegateInterface $delegate); } interface DelegateInterface { /** * Dispatch the next available middleware and return the response. * * @param ServerRequestInterface $request * * @return ResponseInterface */ public function process(\Psr\Http\Message\ServerRequestInterface $request); } } namespace Interop\Http\Factory { interface RequestFactoryInterface { /** * Create a new request. * * @param string $method * @param UriInterface|string $uri * * @return RequestInterface */ public function createRequest($method, $uri); } interface ServerRequestFactoryInterface { /** * Create a new server request. * * The method and URI of the request SHOULD be derived from the given * server parameters. * * If the method or URI parameter is passed, these values MUST be used * instead of the server parameters. * * @param array $server * @param string|null $method * @param UriInterface|string|null $uri * * @throws \InvalidArgumentException * If no valid method or URI can be determined. * * @return ServerRequestInterface */ public function createServerRequest(array $server, $method = null, $uri = null); } interface ResponseFactoryInterface { /** * Create a new response. * * @param integer $code HTTP status code * * @return ResponseInterface */ public function createResponse($code = 200); } interface UploadedFileFactoryInterface { /** * Create a new uploaded file. * * If a string is used to create the file, a temporary resource will be * created with the content of the string. * * If a size is not provided it will be determined by checking the size of * the file. * * @see http://php.net/manual/features.file-upload.post-method.php * @see http://php.net/manual/features.file-upload.errors.php * * @param string|resource $file * @param integer $size in bytes * @param integer $error PHP file upload error * @param string $clientFilename * @param string $clientMediaType * * @return UploadedFileInterface * * @throws \InvalidArgumentException * If the file resource is not readable. */ public function createUploadedFile($file, $size = null, $error = \UPLOAD_ERR_OK, $clientFilename = null, $clientMediaType = null); } interface UriFactoryInterface { /** * Create a new URI. * * @param string $uri * * @return UriInterface * * @throws \InvalidArgumentException * If the given URI cannot be parsed. */ public function createUri($uri = ''); } interface StreamFactoryInterface { /** * Create a new stream from a string. * * The stream SHOULD be created with a temporary resource. * * @param string $content * * @return StreamInterface */ public function createStream($content = ''); /** * Create a stream from an existing file. * * The file MUST be opened using the given mode, which may be any mode * supported by the `fopen` function. * * @param string $file * @param string $mode * * @return StreamInterface */ public function createStreamFromFile($file, $mode = 'r'); /** * Create a new stream from an existing resource. * * The stream MUST be readable and may be writable. * * @param resource $resource * * @return StreamInterface */ public function createStreamFromResource($resource); } } namespace League\Flysystem { class RootViolationException extends \LogicException { // } } namespace League\Flysystem\Plugin { trait PluggableTrait { /** * @var array */ protected $plugins = []; /** * Register a plugin. * * @param PluginInterface $plugin * * @throws LogicException * * @return $this */ public function addPlugin(\League\Flysystem\PluginInterface $plugin) { } /** * Find a specific plugin. * * @param string $method * * @throws PluginNotFoundException * * @return PluginInterface */ protected function findPlugin($method) { } /** * Invoke a plugin by method name. * * @param string $method * @param array $arguments * @param FilesystemInterface $filesystem * * @throws PluginNotFoundException * * @return mixed */ protected function invokePlugin($method, array $arguments, \League\Flysystem\FilesystemInterface $filesystem) { } /** * Plugins pass-through. * * @param string $method * @param array $arguments * * @throws BadMethodCallException * * @return mixed */ public function __call($method, array $arguments) { } } } namespace League\Flysystem { /** * Class MountManager. * * Proxies methods to Filesystem (@see __call): * * @method AdapterInterface getAdapter($prefix) * @method Config getConfig($prefix) * @method bool has($path) * @method bool write($path, $contents, array $config = []) * @method bool writeStream($path, $resource, array $config = []) * @method bool put($path, $contents, $config = []) * @method bool putStream($path, $contents, $config = []) * @method string readAndDelete($path) * @method bool update($path, $contents, $config = []) * @method bool updateStream($path, $resource, $config = []) * @method string|false read($path) * @method resource|false readStream($path) * @method bool rename($path, $newpath) * @method bool delete($path) * @method bool deleteDir($dirname) * @method bool createDir($dirname, $config = []) * @method array listFiles($directory = '', $recursive = false) * @method array listPaths($directory = '', $recursive = false) * @method array getWithMetadata($path, array $metadata) * @method string|false getMimetype($path) * @method int|false getTimestamp($path) * @method string|false getVisibility($path) * @method int|false getSize($path); * @method bool setVisibility($path, $visibility) * @method array|false getMetadata($path) * @method Handler get($path, Handler $handler = null) * @method Filesystem flushCache() * @method void assertPresent($path) * @method void assertAbsent($path) * @method Filesystem addPlugin(PluginInterface $plugin) */ class MountManager { use \League\Flysystem\Plugin\PluggableTrait; /** * @var FilesystemInterface[] */ protected $filesystems = []; /** * Constructor. * * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] * * @throws InvalidArgumentException */ public function __construct(array $filesystems = []) { } /** * Mount filesystems. * * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] * * @throws InvalidArgumentException * * @return $this */ public function mountFilesystems(array $filesystems) { } /** * Mount filesystems. * * @param string $prefix * @param FilesystemInterface $filesystem * * @throws InvalidArgumentException * * @return $this */ public function mountFilesystem($prefix, \League\Flysystem\FilesystemInterface $filesystem) { } /** * Get the filesystem with the corresponding prefix. * * @param string $prefix * * @throws FilesystemNotFoundException * * @return FilesystemInterface */ public function getFilesystem($prefix) { } /** * Retrieve the prefix from an arguments array. * * @param array $arguments * * @throws InvalidArgumentException * * @return array [:prefix, :arguments] */ public function filterPrefix(array $arguments) { } /** * @param string $directory * @param bool $recursive * * @throws InvalidArgumentException * @throws FilesystemNotFoundException * * @return array */ public function listContents($directory = '', $recursive = false) { } /** * Call forwarder. * * @param string $method * @param array $arguments * * @throws InvalidArgumentException * @throws FilesystemNotFoundException * * @return mixed */ public function __call($method, $arguments) { } /** * @param string $from * @param string $to * @param array $config * * @throws InvalidArgumentException * @throws FilesystemNotFoundException * * @return bool */ public function copy($from, $to, array $config = []) { } /** * List with plugin adapter. * * @param array $keys * @param string $directory * @param bool $recursive * * @throws InvalidArgumentException * @throws FilesystemNotFoundException * * @return array */ public function listWith(array $keys = [], $directory = '', $recursive = false) { } /** * Move a file. * * @param string $from * @param string $to * @param array $config * * @throws InvalidArgumentException * @throws FilesystemNotFoundException * * @return bool */ public function move($from, $to, array $config = []) { } /** * Invoke a plugin on a filesystem mounted on a given prefix. * * @param string $method * @param array $arguments * @param string $prefix * * @throws FilesystemNotFoundException * * @return mixed */ public function invokePluginOnFilesystem($method, $arguments, $prefix) { } /** * @param string $path * * @throws InvalidArgumentException * * @return string[] [:prefix, :path] */ protected function getPrefixAndPath($path) { } } /** * @deprecated */ abstract class Handler { /** * @var string */ protected $path; /** * @var FilesystemInterface */ protected $filesystem; /** * Constructor. * * @param FilesystemInterface $filesystem * @param string $path */ public function __construct(\League\Flysystem\FilesystemInterface $filesystem = null, $path = null) { } /** * Check whether the entree is a directory. * * @return bool */ public function isDir() { } /** * Check whether the entree is a file. * * @return bool */ public function isFile() { } /** * Retrieve the entree type (file|dir). * * @return string file or dir */ public function getType() { } /** * Set the Filesystem object. * * @param FilesystemInterface $filesystem * * @return $this */ public function setFilesystem(\League\Flysystem\FilesystemInterface $filesystem) { } /** * Retrieve the Filesystem object. * * @return FilesystemInterface */ public function getFilesystem() { } /** * Set the entree path. * * @param string $path * * @return $this */ public function setPath($path) { } /** * Retrieve the entree path. * * @return string path */ public function getPath() { } /** * Plugins pass-through. * * @param string $method * @param array $arguments * * @return mixed */ public function __call($method, array $arguments) { } } /** * @deprecated */ class Directory extends \League\Flysystem\Handler { /** * Delete the directory. * * @return bool */ public function delete() { } /** * List the directory contents. * * @param bool $recursive * * @return array|bool directory contents or false */ public function getContents($recursive = false) { } } class Exception extends \Exception { // } class FileNotFoundException extends \League\Flysystem\Exception { /** * @var string */ protected $path; /** * Constructor. * * @param string $path * @param int $code * @param \Exception $previous */ public function __construct($path, $code = 0, \Exception $previous = null) { } /** * Get the path which was not found. * * @return string */ public function getPath() { } } /** * @internal */ trait ConfigAwareTrait { /** * @var Config */ protected $config; /** * Set the config. * * @param Config|array|null $config */ protected function setConfig($config) { } /** * Get the Config. * * @return Config config object */ public function getConfig() { } /** * Convert a config array to a Config object with the correct fallback. * * @param array $config * * @return Config */ protected function prepareConfig(array $config) { } } class FileExistsException extends \League\Flysystem\Exception { /** * @var string */ protected $path; /** * Constructor. * * @param string $path * @param int $code * @param BaseException $previous */ public function __construct($path, $code = 0, \Exception $previous = null) { } /** * Get the path which was found. * * @return string */ public function getPath() { } } class Config { /** * @var array */ protected $settings = []; /** * @var Config */ protected $fallback; /** * Constructor. * * @param array $settings */ public function __construct(array $settings = []) { } /** * Get a setting. * * @param string $key * @param mixed $default * * @return mixed config setting or default when not found */ public function get($key, $default = null) { } /** * Check if an item exists by key. * * @param string $key * * @return bool */ public function has($key) { } /** * Try to retrieve a default setting from a config fallback. * * @param string $key * @param mixed $default * * @return mixed config setting or default when not found */ protected function getDefault($key, $default) { } /** * Set a setting. * * @param string $key * @param mixed $value * * @return $this */ public function set($key, $value) { } /** * Set the fallback. * * @param Config $fallback * * @return $this */ public function setFallback(\League\Flysystem\Config $fallback) { } } interface FilesystemInterface { /** * Check whether a file exists. * * @param string $path * * @return bool */ public function has($path); /** * Read a file. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return string|false The file contents or false on failure. */ public function read($path); /** * Retrieves a read-stream for a path. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return resource|false The path resource or false on failure. */ public function readStream($path); /** * List contents of a directory. * * @param string $directory The directory to list. * @param bool $recursive Whether to list recursively. * * @return array A list of file metadata. */ public function listContents($directory = '', $recursive = false); /** * Get a file's metadata. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return array|false The file metadata or false on failure. */ public function getMetadata($path); /** * Get a file's size. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return int|false The file size or false on failure. */ public function getSize($path); /** * Get a file's mime-type. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return string|false The file mime-type or false on failure. */ public function getMimetype($path); /** * Get a file's timestamp. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return string|false The timestamp or false on failure. */ public function getTimestamp($path); /** * Get a file's visibility. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return string|false The visibility (public|private) or false on failure. */ public function getVisibility($path); /** * Write a new file. * * @param string $path The path of the new file. * @param string $contents The file contents. * @param array $config An optional configuration array. * * @throws FileExistsException * * @return bool True on success, false on failure. */ public function write($path, $contents, array $config = []); /** * Write a new file using a stream. * * @param string $path The path of the new file. * @param resource $resource The file handle. * @param array $config An optional configuration array. * * @throws InvalidArgumentException If $resource is not a file handle. * @throws FileExistsException * * @return bool True on success, false on failure. */ public function writeStream($path, $resource, array $config = []); /** * Update an existing file. * * @param string $path The path of the existing file. * @param string $contents The file contents. * @param array $config An optional configuration array. * * @throws FileNotFoundException * * @return bool True on success, false on failure. */ public function update($path, $contents, array $config = []); /** * Update an existing file using a stream. * * @param string $path The path of the existing file. * @param resource $resource The file handle. * @param array $config An optional configuration array. * * @throws InvalidArgumentException If $resource is not a file handle. * @throws FileNotFoundException * * @return bool True on success, false on failure. */ public function updateStream($path, $resource, array $config = []); /** * Rename a file. * * @param string $path Path to the existing file. * @param string $newpath The new path of the file. * * @throws FileExistsException Thrown if $newpath exists. * @throws FileNotFoundException Thrown if $path does not exist. * * @return bool True on success, false on failure. */ public function rename($path, $newpath); /** * Copy a file. * * @param string $path Path to the existing file. * @param string $newpath The new path of the file. * * @throws FileExistsException Thrown if $newpath exists. * @throws FileNotFoundException Thrown if $path does not exist. * * @return bool True on success, false on failure. */ public function copy($path, $newpath); /** * Delete a file. * * @param string $path * * @throws FileNotFoundException * * @return bool True on success, false on failure. */ public function delete($path); /** * Delete a directory. * * @param string $dirname * * @throws RootViolationException Thrown if $dirname is empty. * * @return bool True on success, false on failure. */ public function deleteDir($dirname); /** * Create a directory. * * @param string $dirname The name of the new directory. * @param array $config An optional configuration array. * * @return bool True on success, false on failure. */ public function createDir($dirname, array $config = []); /** * Set the visibility for a file. * * @param string $path The path to the file. * @param string $visibility One of 'public' or 'private'. * * @throws FileNotFoundException * * @return bool True on success, false on failure. */ public function setVisibility($path, $visibility); /** * Create a file or update if exists. * * @param string $path The path to the file. * @param string $contents The file contents. * @param array $config An optional configuration array. * * @return bool True on success, false on failure. */ public function put($path, $contents, array $config = []); /** * Create a file or update if exists. * * @param string $path The path to the file. * @param resource $resource The file handle. * @param array $config An optional configuration array. * * @throws InvalidArgumentException Thrown if $resource is not a resource. * * @return bool True on success, false on failure. */ public function putStream($path, $resource, array $config = []); /** * Read and delete a file. * * @param string $path The path to the file. * * @throws FileNotFoundException * * @return string|false The file contents, or false on failure. */ public function readAndDelete($path); /** * Get a file/directory handler. * * @deprecated * * @param string $path The path to the file. * @param Handler $handler An optional existing handler to populate. * * @return Handler Either a file or directory handler. */ public function get($path, \League\Flysystem\Handler $handler = null); /** * Register a plugin. * * @param PluginInterface $plugin The plugin to register. * * @return $this */ public function addPlugin(\League\Flysystem\PluginInterface $plugin); } interface ReadInterface { /** * Check whether a file exists. * * @param string $path * * @return array|bool|null */ public function has($path); /** * Read a file. * * @param string $path * * @return array|false */ public function read($path); /** * Read a file as a stream. * * @param string $path * * @return array|false */ public function readStream($path); /** * List contents of a directory. * * @param string $directory * @param bool $recursive * * @return array */ public function listContents($directory = '', $recursive = false); /** * Get all the meta data of a file or directory. * * @param string $path * * @return array|false */ public function getMetadata($path); /** * Get the size of a file. * * @param string $path * * @return array|false */ public function getSize($path); /** * Get the mimetype of a file. * * @param string $path * * @return array|false */ public function getMimetype($path); /** * Get the last modified time of a file as a timestamp. * * @param string $path * * @return array|false */ public function getTimestamp($path); /** * Get the visibility of a file. * * @param string $path * * @return array|false */ public function getVisibility($path); } interface AdapterInterface extends \League\Flysystem\ReadInterface { /** * @const VISIBILITY_PUBLIC public visibility */ const VISIBILITY_PUBLIC = 'public'; /** * @const VISIBILITY_PRIVATE private visibility */ const VISIBILITY_PRIVATE = 'private'; /** * Write a new file. * * @param string $path * @param string $contents * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function write($path, $contents, \League\Flysystem\Config $config); /** * Write a new file using a stream. * * @param string $path * @param resource $resource * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function writeStream($path, $resource, \League\Flysystem\Config $config); /** * Update a file. * * @param string $path * @param string $contents * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function update($path, $contents, \League\Flysystem\Config $config); /** * Update a file using a stream. * * @param string $path * @param resource $resource * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function updateStream($path, $resource, \League\Flysystem\Config $config); /** * Rename a file. * * @param string $path * @param string $newpath * * @return bool */ public function rename($path, $newpath); /** * Copy a file. * * @param string $path * @param string $newpath * * @return bool */ public function copy($path, $newpath); /** * Delete a file. * * @param string $path * * @return bool */ public function delete($path); /** * Delete a directory. * * @param string $dirname * * @return bool */ public function deleteDir($dirname); /** * Create a directory. * * @param string $dirname directory name * @param Config $config * * @return array|false */ public function createDir($dirname, \League\Flysystem\Config $config); /** * Set the visibility for a file. * * @param string $path * @param string $visibility * * @return array|false file meta data */ public function setVisibility($path, $visibility); } interface PluginInterface { /** * Get the method name. * * @return string */ public function getMethod(); /** * Set the Filesystem object. * * @param FilesystemInterface $filesystem */ public function setFilesystem(\League\Flysystem\FilesystemInterface $filesystem); } class Util { /** * Get normalized pathinfo. * * @param string $path * * @return array pathinfo */ public static function pathinfo($path) { } /** * Normalize a dirname return value. * * @param string $dirname * * @return string normalized dirname */ public static function normalizeDirname($dirname) { } /** * Get a normalized dirname from a path. * * @param string $path * * @return string dirname */ public static function dirname($path) { } /** * Map result arrays. * * @param array $object * @param array $map * * @return array mapped result */ public static function map(array $object, array $map) { } /** * Normalize path. * * @param string $path * * @throws LogicException * * @return string */ public static function normalizePath($path) { } /** * Normalize relative directories in a path. * * @param string $path * * @throws LogicException * * @return string */ public static function normalizeRelativePath($path) { } /** * Removes unprintable characters and invalid unicode characters. * * @param string $path * * @return string $path */ protected static function removeFunkyWhiteSpace($path) { } /** * Normalize prefix. * * @param string $prefix * @param string $separator * * @return string normalized path */ public static function normalizePrefix($prefix, $separator) { } /** * Get content size. * * @param string $contents * * @return int content size */ public static function contentSize($contents) { } /** * Guess MIME Type based on the path of the file and it's content. * * @param string $path * @param string|resource $content * * @return string|null MIME Type or NULL if no extension detected */ public static function guessMimeType($path, $content) { } /** * Emulate directories. * * @param array $listing * * @return array listing with emulated directories */ public static function emulateDirectories(array $listing) { } /** * Ensure a Config instance. * * @param null|array|Config $config * * @return Config config instance * * @throw LogicException */ public static function ensureConfig($config) { } /** * Rewind a stream. * * @param resource $resource */ public static function rewindStream($resource) { } public static function isSeekableStream($resource) { } /** * Get the size of a stream. * * @param resource $resource * * @return int stream size */ public static function getStreamSize($resource) { } /** * Emulate the directories of a single object. * * @param array $object * @param array $directories * @param array $listedDirectories * * @return array */ protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) { } } } namespace League\Flysystem\Util { /** * @internal */ class ContentListingFormatter { /** * @param string $directory * @param bool $recursive */ public function __construct($directory, $recursive) { } /** * Format contents listing. * * @param array $listing * * @return array */ public function formatListing(array $listing) { } } class StreamHasher { /** * StreamHasher constructor. * * @param string $algo */ public function __construct($algo) { } /** * @param resource $resource * * @return string */ public function hash($resource) { } } /** * @internal */ class MimeType { /** * Detects MIME Type based on given content. * * @param mixed $content * * @return string|null MIME Type or NULL if no mime type detected */ public static function detectByContent($content) { } // @codeCoverageIgnoreEnd /** * Detects MIME Type based on file extension. * * @param string $extension * * @return string|null MIME Type or NULL if no extension detected */ public static function detectByFileExtension($extension) { } /** * @param string $filename * * @return string|null MIME Type or NULL if no extension detected */ public static function detectByFilename($filename) { } /** * @return array Map of file extension to MIME Type */ public static function getExtensionToMimeTypeMap() { } } } namespace League\Flysystem { class NotSupportedException extends \RuntimeException { /** * Create a new exception for a link. * * @param SplFileInfo $file * * @return static */ public static function forLink(\SplFileInfo $file) { } /** * Create a new exception for a link. * * @param string $systemType * * @return static */ public static function forFtpSystemType($systemType) { } } class UnreadableFileException extends \League\Flysystem\Exception { public static function forFileInfo(\SplFileInfo $fileInfo) { } } /** * @method array getWithMetadata(string $path, array $metadata) * @method bool forceCopy(string $path, string $newpath) * @method bool forceRename(string $path, string $newpath) * @method array listFiles(string $path = '', boolean $recursive = false) * @method array listPaths(string $path = '', boolean $recursive = false) * @method array listWith(array $keys = [], $directory = '', $recursive = false) */ class Filesystem implements \League\Flysystem\FilesystemInterface { use \League\Flysystem\Plugin\PluggableTrait; use \League\Flysystem\ConfigAwareTrait; /** * @var AdapterInterface */ protected $adapter; /** * Constructor. * * @param AdapterInterface $adapter * @param Config|array $config */ public function __construct(\League\Flysystem\AdapterInterface $adapter, $config = null) { } /** * Get the Adapter. * * @return AdapterInterface adapter */ public function getAdapter() { } /** * @inheritdoc */ public function has($path) { } /** * @inheritdoc */ public function write($path, $contents, array $config = []) { } /** * @inheritdoc */ public function writeStream($path, $resource, array $config = []) { } /** * @inheritdoc */ public function put($path, $contents, array $config = []) { } /** * @inheritdoc */ public function putStream($path, $resource, array $config = []) { } /** * @inheritdoc */ public function readAndDelete($path) { } /** * @inheritdoc */ public function update($path, $contents, array $config = []) { } /** * @inheritdoc */ public function updateStream($path, $resource, array $config = []) { } /** * @inheritdoc */ public function read($path) { } /** * @inheritdoc */ public function readStream($path) { } /** * @inheritdoc */ public function rename($path, $newpath) { } /** * @inheritdoc */ public function copy($path, $newpath) { } /** * @inheritdoc */ public function delete($path) { } /** * @inheritdoc */ public function deleteDir($dirname) { } /** * @inheritdoc */ public function createDir($dirname, array $config = []) { } /** * @inheritdoc */ public function listContents($directory = '', $recursive = false) { } /** * @inheritdoc */ public function getMimetype($path) { } /** * @inheritdoc */ public function getTimestamp($path) { } /** * @inheritdoc */ public function getVisibility($path) { } /** * @inheritdoc */ public function getSize($path) { } /** * @inheritdoc */ public function setVisibility($path, $visibility) { } /** * @inheritdoc */ public function getMetadata($path) { } /** * @inheritdoc */ public function get($path, \League\Flysystem\Handler $handler = null) { } /** * Assert a file is present. * * @param string $path path to file * * @throws FileNotFoundException * * @return void */ public function assertPresent($path) { } /** * Assert a file is absent. * * @param string $path path to file * * @throws FileExistsException * * @return void */ public function assertAbsent($path) { } } } namespace League\Flysystem\Adapter { abstract class AbstractAdapter implements \League\Flysystem\AdapterInterface { /** * @var string|null path prefix */ protected $pathPrefix; /** * @var string */ protected $pathSeparator = '/'; /** * Set the path prefix. * * @param string $prefix * * @return void */ public function setPathPrefix($prefix) { } /** * Get the path prefix. * * @return string|null path prefix or null if pathPrefix is empty */ public function getPathPrefix() { } /** * Prefix a path. * * @param string $path * * @return string prefixed path */ public function applyPathPrefix($path) { } /** * Remove a path prefix. * * @param string $path * * @return string path without the prefix */ public function removePathPrefix($path) { } } } namespace League\Flysystem\Adapter\Polyfill { /** * A helper for adapters that only handle strings to provide read streams. */ trait StreamedReadingTrait { /** * Reads a file as a stream. * * @param string $path * * @return array|false * * @see League\Flysystem\ReadInterface::readStream() */ public function readStream($path) { } /** * Reads a file. * * @param string $path * * @return array|false * * @see League\Flysystem\ReadInterface::read() */ public abstract function read($path); } trait StreamedWritingTrait { /** * Stream fallback delegator. * * @param string $path * @param resource $resource * @param Config $config * @param string $fallback * * @return mixed fallback result */ protected function stream($path, $resource, \League\Flysystem\Config $config, $fallback) { } /** * Write using a stream. * * @param string $path * @param resource $resource * @param Config $config * * @return mixed false or file metadata */ public function writeStream($path, $resource, \League\Flysystem\Config $config) { } /** * Update a file using a stream. * * @param string $path * @param resource $resource * @param Config $config Config object or visibility setting * * @return mixed false of file metadata */ public function updateStream($path, $resource, \League\Flysystem\Config $config) { } // Required abstract methods public abstract function write($pash, $contents, \League\Flysystem\Config $config); public abstract function update($pash, $contents, \League\Flysystem\Config $config); } trait StreamedTrait { use \League\Flysystem\Adapter\Polyfill\StreamedReadingTrait; use \League\Flysystem\Adapter\Polyfill\StreamedWritingTrait; } trait StreamedCopyTrait { /** * Copy a file. * * @param string $path * @param string $newpath * * @return bool */ public function copy($path, $newpath) { } // Required abstract method /** * @param string $path * @return resource */ public abstract function readStream($path); /** * @param string $path * @param resource $resource * @param Config $config * @return resource */ public abstract function writeStream($path, $resource, \League\Flysystem\Config $config); } } namespace League\Flysystem\Adapter { class NullAdapter extends \League\Flysystem\Adapter\AbstractAdapter { use \League\Flysystem\Adapter\Polyfill\StreamedTrait; use \League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; /** * Check whether a file is present. * * @param string $path * * @return bool */ public function has($path) { } /** * @inheritdoc */ public function write($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function update($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function read($path) { } /** * @inheritdoc */ public function rename($path, $newpath) { } /** * @inheritdoc */ public function delete($path) { } /** * @inheritdoc */ public function listContents($directory = '', $recursive = false) { } /** * @inheritdoc */ public function getMetadata($path) { } /** * @inheritdoc */ public function getSize($path) { } /** * @inheritdoc */ public function getMimetype($path) { } /** * @inheritdoc */ public function getTimestamp($path) { } /** * @inheritdoc */ public function getVisibility($path) { } /** * @inheritdoc */ public function setVisibility($path, $visibility) { } /** * @inheritdoc */ public function createDir($dirname, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function deleteDir($dirname) { } } /** * Adapters that implement this interface let the Filesystem know that it files can be overwritten using the write * functions and don't need the update function to be called. This can help improve performance when asserts are disabled. */ interface CanOverwriteFiles { } abstract class AbstractFtpAdapter extends \League\Flysystem\Adapter\AbstractAdapter { /** * @var mixed */ protected $connection; /** * @var string */ protected $host; /** * @var int */ protected $port = 21; /** * @var bool */ protected $ssl = false; /** * @var int */ protected $timeout = 90; /** * @var bool */ protected $passive = true; /** * @var string */ protected $separator = '/'; /** * @var string|null */ protected $root; /** * @var int */ protected $permPublic = 0744; /** * @var int */ protected $permPrivate = 0700; /** * @var array */ protected $configurable = []; /** * @var string */ protected $systemType; /** * @var bool */ protected $alternativeRecursion = false; /** * @var SafeStorage */ protected $safeStorage; /** * Constructor. * * @param array $config */ public function __construct(array $config) { } /** * Set the config. * * @param array $config * * @return $this */ public function setConfig(array $config) { } /** * Returns the host. * * @return string */ public function getHost() { } /** * Set the host. * * @param string $host * * @return $this */ public function setHost($host) { } /** * Set the public permission value. * * @param int $permPublic * * @return $this */ public function setPermPublic($permPublic) { } /** * Set the private permission value. * * @param int $permPrivate * * @return $this */ public function setPermPrivate($permPrivate) { } /** * Returns the ftp port. * * @return int */ public function getPort() { } /** * Returns the root folder to work from. * * @return string */ public function getRoot() { } /** * Set the ftp port. * * @param int|string $port * * @return $this */ public function setPort($port) { } /** * Set the root folder to work from. * * @param string $root * * @return $this */ public function setRoot($root) { } /** * Returns the ftp username. * * @return string username */ public function getUsername() { } /** * Set ftp username. * * @param string $username * * @return $this */ public function setUsername($username) { } /** * Returns the password. * * @return string password */ public function getPassword() { } /** * Set the ftp password. * * @param string $password * * @return $this */ public function setPassword($password) { } /** * Returns the amount of seconds before the connection will timeout. * * @return int */ public function getTimeout() { } /** * Set the amount of seconds before the connection should timeout. * * @param int $timeout * * @return $this */ public function setTimeout($timeout) { } /** * Return the FTP system type. * * @return string */ public function getSystemType() { } /** * Set the FTP system type (windows or unix). * * @param string $systemType * * @return $this */ public function setSystemType($systemType) { } /** * @inheritdoc */ public function listContents($directory = '', $recursive = false) { } protected abstract function listDirectoryContents($directory, $recursive = false); /** * Normalize a directory listing. * * @param array $listing * @param string $prefix * * @return array directory listing */ protected function normalizeListing(array $listing, $prefix = '') { } /** * Sort a directory listing. * * @param array $result * * @return array sorted listing */ protected function sortListing(array $result) { } /** * Normalize a file entry. * * @param string $item * @param string $base * * @return array normalized file array * * @throws NotSupportedException */ protected function normalizeObject($item, $base) { } /** * Normalize a Unix file entry. * * @param string $item * @param string $base * * @return array normalized file array */ protected function normalizeUnixObject($item, $base) { } /** * Normalize a Windows/DOS file entry. * * @param string $item * @param string $base * * @return array normalized file array */ protected function normalizeWindowsObject($item, $base) { } /** * Get the system type from a listing item. * * @param string $item * * @return string the system type */ protected function detectSystemType($item) { } /** * Get the file type from the permissions. * * @param string $permissions * * @return string file type */ protected function detectType($permissions) { } /** * Normalize a permissions string. * * @param string $permissions * * @return int */ protected function normalizePermissions($permissions) { } /** * Filter out dot-directories. * * @param array $list * * @return array */ public function removeDotDirectories(array $list) { } /** * @inheritdoc */ public function has($path) { } /** * @inheritdoc */ public function getSize($path) { } /** * @inheritdoc */ public function getVisibility($path) { } /** * Ensure a directory exists. * * @param string $dirname */ public function ensureDirectory($dirname) { } /** * @return mixed */ public function getConnection() { } /** * Get the public permission value. * * @return int */ public function getPermPublic() { } /** * Get the private permission value. * * @return int */ public function getPermPrivate() { } /** * Disconnect on destruction. */ public function __destruct() { } /** * Establish a connection. */ public abstract function connect(); /** * Close the connection. */ public abstract function disconnect(); /** * Check if a connection is active. * * @return bool */ public abstract function isConnected(); } class Ftp extends \League\Flysystem\Adapter\AbstractFtpAdapter { use \League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; /** * @var int */ protected $transferMode = FTP_BINARY; /** * @var null|bool */ protected $ignorePassiveAddress = null; /** * @var bool */ protected $recurseManually = false; /** * @var bool */ protected $utf8 = false; /** * @var array */ protected $configurable = ['host', 'port', 'username', 'password', 'ssl', 'timeout', 'root', 'permPrivate', 'permPublic', 'passive', 'transferMode', 'systemType', 'ignorePassiveAddress', 'recurseManually', 'utf8']; /** * @var bool */ protected $isPureFtpd; /** * Set the transfer mode. * * @param int $mode * * @return $this */ public function setTransferMode($mode) { } /** * Set if Ssl is enabled. * * @param bool $ssl * * @return $this */ public function setSsl($ssl) { } /** * Set if passive mode should be used. * * @param bool $passive */ public function setPassive($passive = true) { } /** * @param bool $ignorePassiveAddress */ public function setIgnorePassiveAddress($ignorePassiveAddress) { } /** * @param bool $recurseManually */ public function setRecurseManually($recurseManually) { } /** * @param bool $utf8 */ public function setUtf8($utf8) { } /** * Connect to the FTP server. */ public function connect() { } /** * Set the connection to UTF-8 mode. */ protected function setUtf8Mode() { } /** * Set the connections to passive mode. * * @throws RuntimeException */ protected function setConnectionPassiveMode() { } /** * Set the connection root. */ protected function setConnectionRoot() { } /** * Login. * * @throws RuntimeException */ protected function login() { } /** * Disconnect from the FTP server. */ public function disconnect() { } /** * @inheritdoc */ public function write($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function writeStream($path, $resource, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function update($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function updateStream($path, $resource, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function rename($path, $newpath) { } /** * @inheritdoc */ public function delete($path) { } /** * @inheritdoc */ public function deleteDir($dirname) { } /** * @inheritdoc */ public function createDir($dirname, \League\Flysystem\Config $config) { } /** * Create a directory. * * @param string $directory * @param resource $connection * * @return bool */ protected function createActualDirectory($directory, $connection) { } /** * @inheritdoc */ public function getMetadata($path) { } /** * @inheritdoc */ public function getMimetype($path) { } /** * @inheritdoc */ public function getTimestamp($path) { } /** * @inheritdoc */ public function read($path) { } /** * @inheritdoc */ public function readStream($path) { } /** * @inheritdoc */ public function setVisibility($path, $visibility) { } /** * @inheritdoc * * @param string $directory */ protected function listDirectoryContents($directory, $recursive = true) { } /** * @inheritdoc * * @param string $directory */ protected function listDirectoryContentsRecursive($directory) { } /** * Check if the connection is open. * * @return bool * @throws ErrorException */ public function isConnected() { } /** * @return bool */ protected function isPureFtpdServer() { } /** * The ftp_rawlist function with optional escaping. * * @param string $options * @param string $path * * @return array */ protected function ftpRawlist($options, $path) { } } class Ftpd extends \League\Flysystem\Adapter\Ftp { /** * @inheritdoc */ public function getMetadata($path) { } /** * @inheritdoc */ protected function listDirectoryContents($directory, $recursive = true) { } } class SynologyFtp extends \League\Flysystem\Adapter\Ftpd { // This class merely exists because of BC. } } namespace League\Flysystem\Adapter\Polyfill { trait NotSupportingVisibilityTrait { /** * Get the visibility of a file. * * @param string $path * * @throws LogicException */ public function getVisibility($path) { } /** * Set the visibility for a file. * * @param string $path * @param string $visibility * * @throws LogicException */ public function setVisibility($path, $visibility) { } } } namespace League\Flysystem\Adapter { class Local extends \League\Flysystem\Adapter\AbstractAdapter { /** * @var int */ const SKIP_LINKS = 01; /** * @var int */ const DISALLOW_LINKS = 02; /** * @var array */ protected static $permissions = ['file' => ['public' => 0644, 'private' => 0600], 'dir' => ['public' => 0755, 'private' => 0700]]; /** * @var string */ protected $pathSeparator = DIRECTORY_SEPARATOR; /** * @var array */ protected $permissionMap; /** * @var int */ protected $writeFlags; /** * Constructor. * * @param string $root * @param int $writeFlags * @param int $linkHandling * @param array $permissions * * @throws LogicException */ public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) { } /** * Ensure the root directory exists. * * @param string $root root directory path * * @return void * * @throws Exception in case the root directory can not be created */ protected function ensureDirectory($root) { } /** * @inheritdoc */ public function has($path) { } /** * @inheritdoc */ public function write($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function writeStream($path, $resource, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function readStream($path) { } /** * @inheritdoc */ public function updateStream($path, $resource, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function update($path, $contents, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function read($path) { } /** * @inheritdoc */ public function rename($path, $newpath) { } /** * @inheritdoc */ public function copy($path, $newpath) { } /** * @inheritdoc */ public function delete($path) { } /** * @inheritdoc */ public function listContents($directory = '', $recursive = false) { } /** * @inheritdoc */ public function getMetadata($path) { } /** * @inheritdoc */ public function getSize($path) { } /** * @inheritdoc */ public function getMimetype($path) { } /** * @inheritdoc */ public function getTimestamp($path) { } /** * @inheritdoc */ public function getVisibility($path) { } /** * @inheritdoc */ public function setVisibility($path, $visibility) { } /** * @inheritdoc */ public function createDir($dirname, \League\Flysystem\Config $config) { } /** * @inheritdoc */ public function deleteDir($dirname) { } /** * @param SplFileInfo $file */ protected function deleteFileInfoObject(\SplFileInfo $file) { } /** * Normalize the file info. * * @param SplFileInfo $file * * @return array|void * * @throws NotSupportedException */ protected function normalizeFileInfo(\SplFileInfo $file) { } /** * Get the normalized path from a SplFileInfo object. * * @param SplFileInfo $file * * @return string */ protected function getFilePath(\SplFileInfo $file) { } /** * @param string $path * @param int $mode * * @return RecursiveIteratorIterator */ protected function getRecursiveDirectoryIterator($path, $mode = \RecursiveIteratorIterator::SELF_FIRST) { } /** * @param string $path * * @return DirectoryIterator */ protected function getDirectoryIterator($path) { } /** * @param SplFileInfo $file * * @return array */ protected function mapFileInfo(\SplFileInfo $file) { } /** * @param SplFileInfo $file * * @throws UnreadableFileException */ protected function guardAgainstUnreadableFileInfo(\SplFileInfo $file) { } } } namespace League\Flysystem { final class SafeStorage { public function __construct() { } public function storeSafely($key, $value) { } public function retrieveSafely($key) { } public function __destruct() { } } } namespace League\Flysystem\Plugin { abstract class AbstractPlugin implements \League\Flysystem\PluginInterface { /** * @var FilesystemInterface */ protected $filesystem; /** * Set the Filesystem object. * * @param FilesystemInterface $filesystem */ public function setFilesystem(\League\Flysystem\FilesystemInterface $filesystem) { } } class ForcedCopy extends \League\Flysystem\Plugin\AbstractPlugin { /** * @inheritdoc */ public function getMethod() { } /** * Copies a file, overwriting any existing files. * * @param string $path Path to the existing file. * @param string $newpath The new path of the file. * * @throws FileExistsException * @throws FileNotFoundException Thrown if $path does not exist. * * @return bool True on success, false on failure. */ public function handle($path, $newpath) { } } class EmptyDir extends \League\Flysystem\Plugin\AbstractPlugin { /** * Get the method name. * * @return string */ public function getMethod() { } /** * Empty a directory's contents. * * @param string $dirname */ public function handle($dirname) { } } class ListWith extends \League\Flysystem\Plugin\AbstractPlugin { /** * Get the method name. * * @return string */ public function getMethod() { } /** * List contents with metadata. * * @param array $keys * @param string $directory * @param bool $recursive * * @return array listing with metadata */ public function handle(array $keys = [], $directory = '', $recursive = false) { } /** * Get a meta-data value by key name. * * @param array $object * @param string $key * * @return array */ protected function getMetadataByName(array $object, $key) { } } class ForcedRename extends \League\Flysystem\Plugin\AbstractPlugin { /** * @inheritdoc */ public function getMethod() { } /** * Renames a file, overwriting the destination if it exists. * * @param string $path Path to the existing file. * @param string $newpath The new path of the file. * * @throws FileNotFoundException Thrown if $path does not exist. * @throws FileExistsException * * @return bool True on success, false on failure. */ public function handle($path, $newpath) { } } class ListPaths extends \League\Flysystem\Plugin\AbstractPlugin { /** * Get the method name. * * @return string */ public function getMethod() { } /** * List all paths. * * @param string $directory * @param bool $recursive * * @return array paths */ public function handle($directory = '', $recursive = false) { } } class ListFiles extends \League\Flysystem\Plugin\AbstractPlugin { /** * Get the method name. * * @return string */ public function getMethod() { } /** * List all files in the directory. * * @param string $directory * @param bool $recursive * * @return array */ public function handle($directory = '', $recursive = false) { } } class GetWithMetadata extends \League\Flysystem\Plugin\AbstractPlugin { /** * Get the method name. * * @return string */ public function getMethod() { } /** * Get metadata for an object with required metadata. * * @param string $path path to file * @param array $metadata metadata keys * * @throws InvalidArgumentException * @throws FileNotFoundException * * @return array|false metadata */ public function handle($path, array $metadata) { } } class PluginNotFoundException extends \LogicException { // This exception doesn't require additional information. } } namespace League\Flysystem { /** * @deprecated */ class File extends \League\Flysystem\Handler { /** * Check whether the file exists. * * @return bool */ public function exists() { } /** * Read the file. * * @return string|false file contents */ public function read() { } /** * Read the file as a stream. * * @return resource|false file stream */ public function readStream() { } /** * Write the new file. * * @param string $content * * @return bool success boolean */ public function write($content) { } /** * Write the new file using a stream. * * @param resource $resource * * @return bool success boolean */ public function writeStream($resource) { } /** * Update the file contents. * * @param string $content * * @return bool success boolean */ public function update($content) { } /** * Update the file contents with a stream. * * @param resource $resource * * @return bool success boolean */ public function updateStream($resource) { } /** * Create the file or update if exists. * * @param string $content * * @return bool success boolean */ public function put($content) { } /** * Create the file or update if exists using a stream. * * @param resource $resource * * @return bool success boolean */ public function putStream($resource) { } /** * Rename the file. * * @param string $newpath * * @return bool success boolean */ public function rename($newpath) { } /** * Copy the file. * * @param string $newpath * * @return File|false new file or false */ public function copy($newpath) { } /** * Get the file's timestamp. * * @return string|false The timestamp or false on failure. */ public function getTimestamp() { } /** * Get the file's mimetype. * * @return string|false The file mime-type or false on failure. */ public function getMimetype() { } /** * Get the file's visibility. * * @return string|false The visibility (public|private) or false on failure. */ public function getVisibility() { } /** * Get the file's metadata. * * @return array|false The file metadata or false on failure. */ public function getMetadata() { } /** * Get the file size. * * @return int|false The file size or false on failure. */ public function getSize() { } /** * Delete the file. * * @return bool success boolean */ public function delete() { } } /** * Thrown when the MountManager cannot find a filesystem. */ class FilesystemNotFoundException extends \LogicException { } } namespace League\Flysystem\AwsS3v3 { class AwsS3Adapter extends \League\Flysystem\Adapter\AbstractAdapter implements \League\Flysystem\Adapter\CanOverwriteFiles { const PUBLIC_GRANT_URI = 'http://acs.amazonaws.com/groups/global/AllUsers'; /** * @var array */ protected static $resultMap = ['Body' => 'contents', 'ContentLength' => 'size', 'ContentType' => 'mimetype', 'Size' => 'size', 'Metadata' => 'metadata', 'StorageClass' => 'storageclass', 'ETag' => 'etag', 'VersionId' => 'versionid']; /** * @var array */ protected static $metaOptions = ['ACL', 'CacheControl', 'ContentDisposition', 'ContentEncoding', 'ContentLength', 'ContentType', 'Expires', 'GrantFullControl', 'GrantRead', 'GrantReadACP', 'GrantWriteACP', 'Metadata', 'RequestPayer', 'SSECustomerAlgorithm', 'SSECustomerKey', 'SSECustomerKeyMD5', 'SSEKMSKeyId', 'ServerSideEncryption', 'StorageClass', 'Tagging', 'WebsiteRedirectLocation']; /** * @var S3Client */ protected $s3Client; /** * @var string */ protected $bucket; /** * @var array */ protected $options = []; /** * Constructor. * * @param S3Client $client * @param string $bucket * @param string $prefix * @param array $options */ public function __construct(\Aws\S3\S3Client $client, $bucket, $prefix = '', array $options = []) { } /** * Get the S3Client bucket. * * @return string */ public function getBucket() { } /** * Set the S3Client bucket. * * @return string */ public function setBucket($bucket) { } /** * Get the S3Client instance. * * @return S3Client */ public function getClient() { } /** * Write a new file. * * @param string $path * @param string $contents * @param Config $config Config object * * @return false|array false on failure file meta data on success */ public function write($path, $contents, \League\Flysystem\Config $config) { } /** * Update a file. * * @param string $path * @param string $contents * @param Config $config Config object * * @return false|array false on failure file meta data on success */ public function update($path, $contents, \League\Flysystem\Config $config) { } /** * Rename a file. * * @param string $path * @param string $newpath * * @return bool */ public function rename($path, $newpath) { } /** * Delete a file. * * @param string $path * * @return bool */ public function delete($path) { } /** * Delete a directory. * * @param string $dirname * * @return bool */ public function deleteDir($dirname) { } /** * Create a directory. * * @param string $dirname directory name * @param Config $config * * @return bool|array */ public function createDir($dirname, \League\Flysystem\Config $config) { } /** * Check whether a file exists. * * @param string $path * * @return bool */ public function has($path) { } /** * Read a file. * * @param string $path * * @return false|array */ public function read($path) { } /** * List contents of a directory. * * @param string $directory * @param bool $recursive * * @return array */ public function listContents($directory = '', $recursive = false) { } /** * @param array $options * * @return array */ protected function retrievePaginatedListing(array $options) { } /** * Get all the meta data of a file or directory. * * @param string $path * * @return false|array */ public function getMetadata($path) { } /** * Get all the meta data of a file or directory. * * @param string $path * * @return false|array */ public function getSize($path) { } /** * Get the mimetype of a file. * * @param string $path * * @return false|array */ public function getMimetype($path) { } /** * Get the timestamp of a file. * * @param string $path * * @return false|array */ public function getTimestamp($path) { } /** * Write a new file using a stream. * * @param string $path * @param resource $resource * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function writeStream($path, $resource, \League\Flysystem\Config $config) { } /** * Update a file using a stream. * * @param string $path * @param resource $resource * @param Config $config Config object * * @return array|false false on failure file meta data on success */ public function updateStream($path, $resource, \League\Flysystem\Config $config) { } /** * Copy a file. * * @param string $path * @param string $newpath * * @return bool */ public function copy($path, $newpath) { } /** * Read a file as a stream. * * @param string $path * * @return array|false */ public function readStream($path) { } /** * Read an object and normalize the response. * * @param $path * * @return array|bool */ protected function readObject($path) { } /** * Set the visibility for a file. * * @param string $path * @param string $visibility * * @return array|false file meta data */ public function setVisibility($path, $visibility) { } /** * Get the visibility of a file. * * @param string $path * * @return array|false */ public function getVisibility($path) { } /** * {@inheritdoc} */ public function applyPathPrefix($path) { } /** * {@inheritdoc} */ public function setPathPrefix($prefix) { } /** * Get the object acl presented as a visibility. * * @param string $path * * @return string */ protected function getRawVisibility($path) { } /** * Upload an object. * * @param $path * @param $body * @param Config $config * * @return array|bool */ protected function upload($path, $body, \League\Flysystem\Config $config) { } /** * Get options from the config. * * @param Config $config * * @return array */ protected function getOptionsFromConfig(\League\Flysystem\Config $config) { } /** * Normalize the object result array. * * @param array $response * @param string $path * * @return array */ protected function normalizeResponse(array $response, $path = null) { } /** * @param $location * * @return bool */ protected function doesDirectoryExist($location) { } } } namespace League\CLImate { /** * @method mixed black(string $str = null) * @method mixed red(string $str = null) * @method mixed green(string $str = null) * @method mixed yellow(string $str = null) * @method mixed blue(string $str = null) * @method mixed magenta(string $str = null) * @method mixed cyan(string $str = null) * @method mixed lightGray(string $str = null) * @method mixed darkGray(string $str = null) * @method mixed lightRed(string $str = null) * @method mixed lightGreen(string $str = null) * @method mixed lightYellow(string $str = null) * @method mixed lightBlue(string $str = null) * @method mixed lightMagenta(string $str = null) * @method mixed lightCyan(string $str = null) * @method mixed white(string $str = null) * * @method mixed backgroundBlack(string $str = null) * @method mixed backgroundRed(string $str = null) * @method mixed backgroundGreen(string $str = null) * @method mixed backgroundYellow(string $str = null) * @method mixed backgroundBlue(string $str = null) * @method mixed backgroundMagenta(string $str = null) * @method mixed backgroundCyan(string $str = null) * @method mixed backgroundLightGray(string $str = null) * @method mixed backgroundDarkGray(string $str = null) * @method mixed backgroundLightRed(string $str = null) * @method mixed backgroundLightGreen(string $str = null) * @method mixed backgroundLightYellow(string $str = null) * @method mixed backgroundLightBlue(string $str = null) * @method mixed backgroundLightMagenta(string $str = null) * @method mixed backgroundLightCyan(string $str = null) * @method mixed backgroundWhite(string $str = null) * * @method mixed bold(string $str = null) * @method mixed dim(string $str = null) * @method mixed underline(string $str = null) * @method mixed blink(string $str = null) * @method mixed invert(string $str = null) * @method mixed hidden(string $str = null) * * @method mixed info(string $str = null) * @method mixed comment(string $str = null) * @method mixed whisper(string $str = null) * @method mixed shout(string $str = null) * @method mixed error(string $str = null) * * @method mixed out(string $str) * @method mixed inline(string $str) * @method mixed table(array $data) * @method mixed json(mixed $var) * @method mixed br($count = 1) * @method mixed tab($count = 1) * @method mixed draw(string $art) * @method mixed border(string $char = null, integer $length = null) * @method mixed dump(mixed $var) * @method mixed flank(string $output, string $char = null, integer $length = null) * @method mixed progress(integer $total = null) * @method mixed padding(integer $length = 0, string $char = '.') * @method mixed input(string $prompt, Util\Reader\ReaderInterface $reader = null) * @method mixed confirm(string $prompt, Util\Reader\ReaderInterface $reader = null) * @method mixed password(string $prompt, Util\Reader\ReaderInterface $reader = null) * @method mixed checkboxes(string $prompt, array $options, Util\Reader\ReaderInterface $reader = null) * @method mixed radio(string $prompt, array $options, Util\Reader\ReaderInterface $reader = null) * @method mixed animation(string $art, TerminalObject\Helper\Sleeper $sleeper = null) * @method mixed columns(array $data, $column_count = null) * @method mixed clear() * * @method CLImate addArt(string $dir) */ class CLImate { /** * An instance of the Style class * * @var \League\CLImate\Decorator\Style $style */ public $style; /** * An instance of the Terminal Object Router class * * @var \League\CLImate\TerminalObject\Router\Router $router */ protected $router; /** * An instance of the Settings Manager class * * @var \League\CLImate\Settings\Manager $settings */ protected $settings; /** * An instance of the Argument Manager class * * @var \League\CLImate\Argument\Manager $arguments */ public $arguments; /** * An instance of the Output class * * @var \League\CLImate\Util\Output $output */ public $output; /** * An instance of the Util Factory * * @var \League\CLImate\Util\UtilFactory $util */ protected $util; public function __construct() { } /** * Set the style property * * @param \League\CLImate\Decorator\Style $style */ public function setStyle(\League\CLImate\Decorator\Style $style) { } /** * Set the router property * * @param \League\CLImate\TerminalObject\Router\Router $router */ public function setRouter(\League\CLImate\TerminalObject\Router\Router $router) { } /** * Set the settings property * * @param \League\CLImate\Settings\Manager $manager */ public function setSettingsManager(\League\CLImate\Settings\Manager $manager) { } /** * Set the arguments property * * @param \League\CLImate\Argument\Manager $manager */ public function setArgumentManager(\League\CLImate\Argument\Manager $manager) { } /** * Set the output property * * @param \League\CLImate\Util\Output $output */ public function setOutput(\League\CLImate\Util\Output $output) { } /** * Set the util property * * @param \League\CLImate\Util\UtilFactory $util */ public function setUtil(\League\CLImate\Util\UtilFactory $util) { } /** * Extend CLImate with custom methods * * @param string|object|array $class * @param string $key Optional custom key instead of class name * * @return \League\CLImate\CLImate */ public function extend($class, $key = null) { } /** * Force ansi support on * * @return \League\CLImate\CLImate */ public function forceAnsiOn() { } /** * Force ansi support off * * @return \League\CLImate\CLImate */ public function forceAnsiOff() { } /** * Write line to writer once * * @param string|array $writer * * @return \League\CLImate\CLImate */ public function to($writer) { } /** * Output the program's usage statement * * @param array $argv */ public function usage(array $argv = null) { } /** * Set the program's description * * @param string $description * * @return \League\CLImate\CLImate */ public function description($description) { } /** * Check if we have valid output * * @param mixed $output * * @return boolean */ protected function hasOutput($output) { } /** * Search for the method within the string * and route it if we find one. * * @param string $method * @param string $name * * @return string The new string without the executed method. */ protected function parseStyleMethod($method, $name) { } /** * Search for any style methods within the name and apply them * * @param string $name * @param array $method_search * * @return string Anything left over after applying styles */ protected function applyStyleMethods($name, $method_search = null) { } /** * Search for style methods in the current name * * @param string $name * @param array $search * @return string */ protected function searchForStyleMethods($name, $search) { } /** * Build up the terminal object and return it * * @param string $name * @param array $arguments * * @return object|null */ protected function buildTerminalObject($name, $arguments) { } /** * Route anything leftover after styles were applied * * @param string $name * @param array $arguments * * @return object|null */ protected function routeRemainingMethod($name, array $arguments) { } /** * Magic method for anything called that doesn't exist * * @param string $requested_method * @param array $arguments * * @return \League\CLImate\CLImate|\League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject * * List of many of the possible method being called here * documented at the top of this class. */ public function __call($requested_method, $arguments) { } } } namespace League\CLImate\TerminalObject\Helper { interface SleeperInterface { /** * @param int|float $percentage */ public function speed($percentage); public function sleep(); } class Sleeper implements \League\CLImate\TerminalObject\Helper\SleeperInterface { /** * The default length of the sleep * * @var int|float $speed */ protected $speed = 50000; /** * Set the speed based on a percentage (50% slower, 200% faster, etc) * * @param int|float $percentage * * @return float */ public function speed($percentage) { } /** * Sleep for the specified amount of time */ public function sleep() { } } trait Art { /** * The directories we should be looking for art in * * @var array $art_dirs */ protected $art_dirs = []; /** * The default art if we can't find what the user requested * * @var string $default_art */ protected $default_art = '404'; /** * The art requested by the user * * @var string $art */ protected $art = ''; /** * Specify which settings Draw needs to import * * @return array */ public function settings() { } /** * Import the Art setting (any directories the user added) * * @param \League\CLImate\Settings\Art $setting */ public function importSettingArt($setting) { } /** * Add a directory to search for art in * * @param string $dir */ protected function addDir($dir) { } /** * Find a valid art path * * @param string $art * * @return array */ protected function artDir($art) { } /** * Find a valid art path * * @param string $art * * @return string */ protected function artFile($art) { } /** * Find a set of files in the current art directories * based on a pattern * * @param string $art * @param string $pattern * * @return array */ protected function fileSearch($art, $pattern) { } /** * Parse the contents of the file and return each line * * @param string $path * * @return array */ protected function parse($path) { } } trait StringLength { /** * Tags the should not be ultimately considered * when calculating any string lengths * * @var array $ignore_tags */ protected $ignore_tags = []; /** * Set the ignore tags property */ protected function setIgnoreTags() { } /** * Determine the length of the string without any tags * * @param string $str * * @return integer */ protected function lengthWithoutTags($str) { } /** * Get the string without the tags that are to be ignored * * @param string $str * * @return string */ protected function withoutTags($str) { } /** * Apply padding to a string * * @param string $str * @param string $final_length * @param string $padding_side * * @return string */ protected function pad($str, $final_length, $padding_side = 'right') { } /** * Apply padding to an array of strings * * @param array $arr * @param integer $final_length * @param string $padding_side * * @return array */ protected function padArray($arr, $final_length, $padding_side = 'right') { } /** * Find the max string length in an array * * @param array $arr * @return int */ protected function maxStrLen(array $arr) { } /** * Get an array of the string lengths from an array of strings * * @param array $arr * @return array */ protected function arrayOfStrLens(array $arr) { } } } namespace League\CLImate\TerminalObject\Dynamic { interface DynamicTerminalObjectInterface { public function settings(); /** * @param $setting * @return void */ public function importSetting($setting); /** * @param \League\CLImate\Decorator\Parser\Parser $parser */ public function parser(\League\CLImate\Decorator\Parser\Parser $parser); /** * @param UtilFactory $util */ public function util(\League\CLImate\Util\UtilFactory $util); } } namespace League\CLImate\Settings { trait SettingsImporter { /** * Dictates any settings that a class may need access to * * @return array */ public function settings() { } /** * Import the setting into the class * * @param \League\CLImate\Settings\SettingsInterface $setting */ public function importSetting($setting) { } } } namespace League\CLImate\Decorator\Parser { trait ParserImporter { /** * An instance of the Parser class * * @var \League\CLImate\Decorator\Parser\Parser $parser */ protected $parser; /** * Import the parser and set the property * * @param \League\CLImate\Decorator\Parser\Parser $parser */ public function parser(\League\CLImate\Decorator\Parser\Parser $parser) { } } } namespace League\CLImate\Util { trait OutputImporter { /** * An instance of the OutputFactory * * @var \League\CLImate\Util\Output $output */ protected $output; /** * Sets the $output property * * @param Output $output */ public function output(\League\CLImate\Util\Output $output) { } } trait UtilImporter { /** * An instance of the UtilFactory * * @var \League\CLImate\Util\UtilFactory $util */ protected $util; /** * Sets the $util property * * @param UtilFactory $util */ public function util(\League\CLImate\Util\UtilFactory $util) { } } } namespace League\CLImate\TerminalObject\Dynamic { /** * The dynamic terminal object doesn't adhere to the basic terminal object * contract, which is why it gets its own base class */ abstract class DynamicTerminalObject implements \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObjectInterface { use \League\CLImate\Settings\SettingsImporter, \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Util\OutputImporter, \League\CLImate\Util\UtilImporter; } abstract class InputAbstract extends \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject { /** * The prompt text * * @var string $prompt */ protected $prompt; /** * An instance of ReaderInterface * * @var \League\CLImate\Util\Reader\ReaderInterface $reader */ protected $reader; /** * Do it! Prompt the user for information! * * @return string */ public abstract function prompt(); /** * Format the prompt incorporating spacing and any acceptable options * * @return string */ protected abstract function promptFormatted(); } class Input extends \League\CLImate\TerminalObject\Dynamic\InputAbstract { /** * An array of acceptable responses * * @var array|object $acceptable */ protected $acceptable; /** * Whether we should be strict about the response given * * @var boolean $strict */ protected $strict = false; /** * Whether to accept multiple lines of input * * Terminated by ^D * * @var boolean $multiLine */ protected $multiLine = false; /** * Whether we should display the acceptable responses to the user * * @var boolean $show_acceptable */ protected $show_acceptable = false; /** * A default answer in the case of no user response, * prevents re-prompting * * @var string */ protected $default = ''; public function __construct($prompt, \League\CLImate\Util\Reader\ReaderInterface $reader = null) { } /** * Do it! Prompt the user for information! * * @return string */ public function prompt() { } /** * Define the acceptable responses and whether or not to * display them to the user * * @param array|object $acceptable * @param boolean $show * * @return \League\CLImate\TerminalObject\Dynamic\Input */ public function accept($acceptable, $show = false) { } /** * Define whether we should be strict about exact responses * * @return \League\CLImate\TerminalObject\Dynamic\Input */ public function strict() { } /** * Set a default response * * @param string $default * * @return \League\CLImate\TerminalObject\Dynamic\Input */ public function defaultTo($default) { } /** * Set multiline input to true * * @return \League\CLImate\TerminalObject\Dynamic\Input */ public function multiLine() { } /** * @return string */ protected function getUserInput() { } /** * Write out the formatted prompt */ protected function writePrompt() { } /** * If no response was given and there is a default, return it, * otherwise return response * * @param string $response * * @return string */ protected function valueOrDefault($response) { } /** * Format the acceptable responses as options * * @return string */ protected function acceptableFormatted() { } /** * Format the acceptable item depending on whether it is the default or not * * @param string $item * * @return string */ protected function acceptableItemFormatted($item) { } /** * Format the prompt incorporating spacing and any acceptable options * * @return string */ protected function promptFormatted() { } /** * Apply some string manipulation functions for normalization * * @param string|array $var * @return array */ protected function levelPlayingField($var) { } /** * Determine whether or not the acceptable property is of type closure * * @return boolean */ protected function acceptableIsClosure() { } /** * Determine if the user's response is in the acceptable responses array * * @param string $response * * @return boolean $response */ protected function isAcceptableResponse($response) { } /** * Determine if the user's response is valid based on the current settings * * @param string $response * * @return boolean $response */ protected function isValidResponse($response) { } } class Password extends \League\CLImate\TerminalObject\Dynamic\Input { public function prompt() { } } class Checkboxes extends \League\CLImate\TerminalObject\Dynamic\InputAbstract { /** * The options to choose from * * @var Checkbox\CheckboxGroup $checkboxes */ protected $checkboxes; public function __construct($prompt, array $options, \League\CLImate\Util\Reader\ReaderInterface $reader = null) { } /** * Do it! Prompt the user for information! * * @return string */ public function prompt() { } /** * Build out the checkboxes * * @param array $options * * @return Checkbox\CheckboxGroup */ protected function buildCheckboxes(array $options) { } /** * Format the prompt string * * @return string */ protected function promptFormatted() { } /** * Output the checkboxes and listen for any keystrokes */ protected function writeCheckboxes() { } /** * Listen for input and act on it */ protected function listenForInput() { } /** * Take the appropriate action based on the input character, * returns whether to stop listening or not * * @param string $char * * @return bool */ protected function handleCharacter($char) { } /** * Move the cursor to the top of the option list */ protected function moveCursorToTop() { } /** * Handle any ANSI characters */ protected function handleAnsi() { } /** * Re-write the checkboxes based on the current objects */ protected function updateCheckboxView() { } } class Radio extends \League\CLImate\TerminalObject\Dynamic\Checkboxes { /** * Build out the checkboxes * * @param array $options * * @return Checkbox\RadioGroup */ protected function buildCheckboxes(array $options) { } } class Confirm extends \League\CLImate\TerminalObject\Dynamic\Input { /** * Let us know if the user confirmed * * @return boolean */ public function confirmed() { } } class Animation extends \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject { use \League\CLImate\TerminalObject\Helper\Art; /** * @var \League\CLImate\TerminalObject\Helper\Sleeper $sleeper */ protected $sleeper; /** * @var \League\CLImate\TerminalObject\Dynamic\Animation\Keyframe $keyframes */ protected $keyframes; public function __construct($art, \League\CLImate\TerminalObject\Helper\Sleeper $sleeper = null, \League\CLImate\TerminalObject\Dynamic\Animation\Keyframe $keyframes = null) { } /** * Run a basic animation */ public function run() { } /** * Set the speed of the animation based on a percentage * (50% slower, 200% faster, etc) * * @param int|float $percentage * * @return \League\CLImate\TerminalObject\Dynamic\Animation */ public function speed($percentage) { } /** * Scroll the art * * @param string $direction * @return bool */ public function scroll($direction = 'right') { } /** * Animate the art exiting the screen * * @param string $direction top|bottom|right|left */ public function exitTo($direction) { } /** * Animate the art entering the screen * * @param string $direction top|bottom|right|left */ public function enterFrom($direction) { } protected function getScrollDirectionMapping() { } protected function getLines() { } /** * @param \League\CLImate\TerminalObject\Helper\Sleeper $sleeper */ protected function setSleeper($sleeper = null) { } /** * @param League\CLImate\TerminalObject\Dynamic\Animation\Keyframe $keyframes */ protected function setKeyFrames($keyframes) { } /** * Set up the necessary properties on the Keyframe class */ protected function setupKeyframes() { } /** * Animate the given keyframes * * @param array $keyframes Array of arrays */ protected function animate(array $keyframes) { } /** * Write the current keyframe to the terminal, line by line * * @param array $lines * @param integer $count */ protected function writeKeyFrame(array $lines, $count) { } /** * Format the line to re-write previous lines, if necessary * * @param string $line * @param integer $key * @param integer $last_frame_count * * @return string */ protected function getLineFormatted($line, $key, $last_frame_count) { } } } namespace League\CLImate\TerminalObject\Dynamic\Animation { class Keyframe { use \League\CLImate\TerminalObject\Helper\StringLength, \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Util\UtilImporter; /** * Get the enter keyframes for the desired direction * * @param array $lines * @param string $direction * * @return array */ public function enterFrom($lines, $direction) { } /** * Get the exit keyframes for the desired direction * * @param array $lines * @param string $direction * * @return array */ public function exitTo($lines, $direction) { } /** * Get scroll keyframes * * @param array $lines * @param string $enter_from * @param string $exit_to * * @return array */ public function scroll($lines, $enter_from, $exit_to) { } /** * Get the line parser for the direction * * @param string $direction * @return string */ protected function getLineMethod($direction) { } /** * Adjust the array of lines if necessary * * @param array $lines * @param string $direction * * @return array */ protected function adjustLines(array $lines, $direction) { } /** * Pad the array of lines for "right" animation * * @param array $lines * @return array */ protected function adjustRightLines(array $lines) { } /** * Pad the array of lines for "left" animation * * @param array $lines * @return array */ protected function adjustLeftLines(array $lines) { } /** * Get the keyframes appropriate for the animation direction * * @param string $direction * @param array $lines * @param string $line_method * * @return array */ protected function getDirectionFrames($direction, array $lines, $line_method) { } /** * Create horizontal exit animation keyframes for the art * * @param array $lines * @param string $line_method * * @return array */ protected function exitHorizontalFrames(array $lines, $line_method) { } /** * Get the keyframe for a horizontal animation * * @param array $lines * @param int $frame_number * @param string $line_method * @param int $length * * @return array */ protected function getHorizontalKeyframe(array $lines, $frame_number, $line_method, $length) { } /** * Create vertical exit animation keyframes for the art * * @param array $lines * @param string $line_method * * @return array */ protected function exitVerticalFrames(array $lines, $line_method) { } /** * Get the current line as it is exiting left * * @param string $line * @param int $frame_number * * @return string */ protected function currentLeftLine($line, $frame_number) { } /** * Get the current line as it is exiting right * * @param string $line * @param int $frame_number * @param int $length * * @return string */ protected function currentRightLine($line, $frame_number, $length) { } /** * Slice off X number of lines from the bottom and fill the rest with empty strings * * @param array $lines * @param integer $total_lines * @param integer $current * * @return array */ protected function currentTopLine($lines, $total_lines, $current) { } /** * Slice off X number of lines from the top and fill the rest with empty strings * * @param array $lines * @param integer $total_lines * @param integer $current * * @return array */ protected function currentBottomLine($lines, $total_lines, $current) { } } } namespace League\CLImate\TerminalObject\Dynamic\Checkbox { class CheckboxGroup { use \League\CLImate\Util\OutputImporter, \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Util\UtilImporter; protected $checkboxes = []; protected $count; public function __construct(array $options) { } public function write() { } /** * Retrieve the checked option values * * @return array */ public function getCheckedValues() { } /** * Set the newly selected option based on the direction * * @param string $direction 'previous' or 'next' */ public function setCurrent($direction) { } /** * Toggle the current option's checked status */ public function toggleCurrent() { } /** * Get the number of checkboxes * * @return int */ public function count() { } /** * Retrieve the checked options * * @return array */ protected function getChecked() { } /** * Determine whether the option is checked * * @param Checkbox $option * * @return bool */ protected function isChecked($option) { } /** * Retrieve the option's value * * @param Checkbox $option * * @return mixed */ protected function getValue($option) { } /** * Get the currently selected option * * @return array */ protected function getCurrent() { } /** * Retrieve the correct current key * * @param string $direction 'previous' or 'next' * @param Checkbox $option * @param int $key * * @return int */ protected function getCurrentKey($direction, $option, $key) { } /** * @param Checkbox $option * @param int $key * * @return int */ protected function getPreviousKey($option, $key) { } /** * @param Checkbox $option * @param int $key * * @return int */ protected function getNextKey($option, $key) { } /** * @param Checkbox $checkbox */ protected function writeCheckbox($checkbox) { } } class RadioGroup extends \League\CLImate\TerminalObject\Dynamic\Checkbox\CheckboxGroup { /** * Toggle the currently selected option, uncheck all of the others */ public function toggleCurrent() { } /** * Get the checked option * * @return string|bool|int */ public function getCheckedValues() { } } class Checkbox { use \League\CLImate\TerminalObject\Helper\StringLength, \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Util\UtilImporter; /** * The value of the checkbox * * @var string|int|bool $value */ protected $value; /** * The label for the checkbox * * @var string|int $label */ protected $label; /** * Whether the checkbox is checked * * @var bool $checked */ protected $checked = false; /** * Whether pointer is currently pointing at the checkbox * * @var bool $current */ protected $current = false; /** * Whether the checkbox is the first in the group * * @var bool $first */ protected $first = false; /** * Whether the checkbox is the last in the group * * @var bool $last */ protected $last = false; public function __construct($label, $value) { } /** * @return bool */ public function isCurrent() { } /** * @return bool */ public function isChecked() { } /** * @return bool */ public function isFirst() { } /** * @return bool */ public function isLast() { } /** * Set whether the pointer is currently pointing at this checkbox * * @param bool $current * * @return Checkbox */ public function setCurrent($current = true) { } /** * Set whether the checkbox is currently checked * * @param bool $checked * * @return Checkbox */ public function setChecked($checked = true) { } /** * @return Checkbox */ public function setFirst() { } /** * @return Checkbox */ public function setLast() { } /** * @return string|int|bool */ public function getValue() { } /** * Build out basic checkbox string based on current options * * @return string */ protected function buildCheckboxString() { } /** * Get the padding string based on the length of the terminal/line * * @param string $line * * @return string */ protected function getPaddingString($line) { } /** * Get the checkbox symbol * * @param bool $checked * * @return string */ protected function checkbox($checked) { } /** * Get the pointer symbol * * @return string */ protected function pointer() { } public function __toString() { } } } namespace League\CLImate\TerminalObject\Dynamic { class Padding extends \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject { /** * The length that lines should be padded to * * @var integer $length */ protected $length = 0; /** * The character(s) that should be used to pad * * @var string $char */ protected $char = '.'; /** * If they pass in a padding character, set the char * * @param int $length * @param string $char */ public function __construct($length = null, $char = null) { } /** * Set the character(s) that should be used to pad * * @param string $char * * @return \League\CLImate\TerminalObject\Dynamic\Padding */ public function char($char) { } /** * Set the length of the line that should be generated * * @param integer $length * * @return \League\CLImate\TerminalObject\Dynamic\Padding */ public function length($length) { } /** * Get the length of the line based on the width of the terminal window * * @return integer */ protected function getLength() { } /** * Pad the content with the characters * * @param string $content * * @return string */ protected function padContent($content) { } /** * Output the content and pad to the previously defined length * * @param string $content * * @return \League\CLImate\TerminalObject\Dynamic\Padding */ public function label($content) { } /** * Output result * * @param string $content */ public function result($content) { } } class Progress extends \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject { /** * The total number of items involved * * @var integer $total */ protected $total = 0; /** * The current item that the progress bar represents * * @var integer $current */ protected $current = 0; /** * The current percentage displayed * * @var string $current_percentage */ protected $current_percentage = ''; /** * The string length of the bar when at 100% * * @var integer $bar_str_len */ protected $bar_str_len; /** * Flag indicating whether we are writing the bar for the first time * * @var boolean $first_line */ protected $first_line = true; /** * Current status bar label * * @var string $label */ protected $label; /** * Force a redraw every time * * @var boolean $force_redraw */ protected $force_redraw = false; /** * If they pass in a total, set the total * * @param integer $total */ public function __construct($total = null) { } /** * Set the total property * * @param integer $total * * @return Progress */ public function total($total) { } /** * Determines the current percentage we are at and re-writes the progress bar * * @param integer $current * @param mixed $label * @throws \Exception */ public function current($current, $label = null) { } /** * Increments the current position we are at and re-writes the progress bar * * @param integer $increment The number of items to increment by * @param string $label */ public function advance($increment = 1, $label = null) { } /** * Force the progress bar to redraw every time regardless of whether it has changed or not * * @param boolean $force * @return Progress */ public function forceRedraw($force = true) { } /** * Draw the progress bar, if necessary * * @param string $current * @param string $label */ protected function drawProgressBar($current, $label) { } /** * Build the progress bar str and return it * * @param integer $current * @param string $label * * @return string */ protected function getProgressBar($current, $label) { } /** * Get the progress bar string, basically: * =============> 50% label * * @param integer $current * @param string $label * * @return string */ protected function getProgressBarStr($current, $label) { } /** * Get the string for the actual bar based on the current length * * @param integer $length * * @return string */ protected function getBar($length) { } /** * Get the length of the bar string based on the width of the terminal window * * @return integer */ protected function getBarStrLen() { } /** * Format the percentage so it looks pretty * * @param integer $percentage * @return float */ protected function percentageFormatted($percentage) { } /** * Format the label so it is positioned correctly * * @param string $label * @return string */ protected function labelFormatted($label) { } /** * Determine whether the progress bar has changed and we need to redrew * * @param string $percentage * @param string $label * * @return boolean */ protected function shouldRedraw($percentage, $label) { } } } namespace League\CLImate\TerminalObject\Router { interface RouterInterface { /** * @param $class * @return string */ public function path($class); /** * @param $class * @return boolean */ public function exists($class); /** * @param $obj * @return null|\League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject */ public function execute($obj); /** * @return string */ public function pathPrefix(); } abstract class BaseRouter implements \League\CLImate\TerminalObject\Router\RouterInterface { protected $extensions = []; /** * Add a custom extension to CLImate * * @param string $key * @param string $class */ public function addExtension($key, $class) { } /** * Get the full path for the class based on the key * * @param string $class * * @return string */ public function path($class) { } /** * Determines if the requested class is a * valid terminal object class * * @param string $class * * @return boolean */ public function exists($class) { } /** * Get the full path for the terminal object class * * @param string $class * * @return string */ protected function getPath($class) { } /** * Get an extension by its key * * @param string $key * * @return string|false Full class path to extension */ protected function getExtension($key) { } /** * Get the class short name * * @param string $name * * @return string */ protected function shortName($name) { } } class DynamicRouter extends \League\CLImate\TerminalObject\Router\BaseRouter { use \League\CLImate\Util\OutputImporter; /** * @return string */ public function pathPrefix() { } /** * Execute a dynamic terminal object using given arguments * * @param \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject $obj * * @return \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObject */ public function execute($obj) { } } class Router { use \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Settings\SettingsImporter, \League\CLImate\Util\OutputImporter, \League\CLImate\Util\UtilImporter; /** * An instance of the Settings Manager class * * @var \League\CLImate\Settings\Manager $settings; */ protected $settings; /** * An instance of the Dynamic Router class * * @var \League\CLImate\TerminalObject\Router\DynamicRouter $dynamic; */ protected $dynamic; /** * An instance of the Basic Router class * * @var \League\CLImate\TerminalObject\Router\BasicRouter $basic; */ protected $basic; public function __construct(\League\CLImate\TerminalObject\Router\DynamicRouter $dynamic = null, \League\CLImate\TerminalObject\Router\BasicRouter $basic = null) { } /** * Register a custom class with the router * * @param string $key * @param string $class */ public function addExtension($key, $class) { } /** * Check if the name matches an existing terminal object * * @param string $name * * @return boolean */ public function exists($name) { } /** * Execute a terminal object using given arguments * * @param string $name * @param mixed $arguments * * @return null|\League\CLImate\TerminalObject\Basic\BasicTerminalObjectInterface */ public function execute($name, $arguments) { } /** * Get the object whether it's a string or already instantiated * * @param \League\CLImate\TerminalObject\Router\RouterInterface $router * @param string $name * @param array $arguments * * @return \League\CLImate\TerminalObject\Dynamic\DynamicTerminalObjectInterface|\League\CLImate\TerminalObject\Basic\BasicTerminalObjectInterface */ protected function getObject($router, $name, $arguments) { } /** * Determine which type of router we are using and return it * * @param string $name * * @return \League\CLImate\TerminalObject\Router\RouterInterface|null */ protected function getRouter($name) { } /** * Set the settings property * * @param \League\CLImate\Settings\Manager $settings * * @return Router */ public function settings(\League\CLImate\Settings\Manager $settings) { } } class ExtensionCollection { /** * @var array collection */ protected $collection = ['basic' => [], 'dynamic' => []]; /** * @var string $basic_interface */ protected $basic_interface = 'League\\CLImate\\TerminalObject\\Basic\\BasicTerminalObjectInterface'; /** * @var string $dynamic_interface */ protected $dynamic_interface = 'League\\CLImate\\TerminalObject\\Dynamic\\DynamicTerminalObjectInterface'; public function __construct($key, $class) { } public function collection() { } /** * Create the collection from the key/class * * @param string $original_key * @param string|object|array $original_class * * @return type */ protected function createCollection($original_key, $original_class) { } /** * Convert the given class and key to an array of classes * * @param string|object|array $class * @param string $key Optional custom key instead of class name * * @return array */ protected function convertToArray($key, $class) { } /** * Ensure that the extension is valid * * @param string|object|array $class */ protected function validateExtension($class) { } /** * @param string|object $class * * @throws \Exception if extension class does not exist */ protected function validateClassExists($class) { } /** * @param string|object $class * * @throws \Exception if extension class does not implement either Dynamic or Basic interface */ protected function validateClassImplementation($class) { } /** * Determine the extension key based on the class * * @param string|null $key * @param string|object $class * * @return string */ protected function getKey($key, $class) { } /** * Get the type of class the extension implements * * @param string|object $class * * @return string 'basic' or 'dynamic' */ protected function getType($class) { } } class BasicRouter extends \League\CLImate\TerminalObject\Router\BaseRouter { use \League\CLImate\Util\OutputImporter; /** * @return string */ public function pathPrefix() { } /** * Execute a basic terminal object * * @param \League\CLImate\TerminalObject\Basic\BasicTerminalObject $obj * @return void */ public function execute($obj) { } } } namespace League\CLImate\TerminalObject\Basic { interface BasicTerminalObjectInterface { public function result(); public function settings(); /** * @param $setting * @return void */ public function importSetting($setting); /** * @return boolean */ public function sameLine(); /** * @param \League\CLImate\Decorator\Parser\Parser $parser */ public function parser(\League\CLImate\Decorator\Parser\Parser $parser); /** * @param UtilFactory $util */ public function util(\League\CLImate\Util\UtilFactory $util); } abstract class BasicTerminalObject implements \League\CLImate\TerminalObject\Basic\BasicTerminalObjectInterface { use \League\CLImate\Settings\SettingsImporter, \League\CLImate\Decorator\Parser\ParserImporter, \League\CLImate\Util\UtilImporter; /** * Set the property if there is a valid value * * @param string $key * @param string $value */ protected function set($key, $value) { } /** * Get the parser for the current object * * @return \League\CLImate\Decorator\Parser\Parser */ public function getParser() { } /** * Check if this object requires a new line to be added after the output * * @return boolean */ public function sameLine() { } } class Out extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * The content to output * * @var string $content */ protected $content; public function __construct($content) { } /** * Return the content to output * * @return string */ public function result() { } } class Inline extends \League\CLImate\TerminalObject\Basic\Out { /** * Check if this object requires a new line should be added after the output * * @return boolean */ public function sameLine() { } } class Columns extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { use \League\CLImate\TerminalObject\Helper\StringLength; /** * Number of columns * * @var integer $column_count */ protected $column_count; /** * Data to columnize * * @var array $data */ protected $data; public function __construct($data, $column_count = null) { } /** * Calculate the number of columns organize data * * @return array */ public function result() { } /** * Get columns for a regular array * * @return array */ protected function columns() { } /** * Re-configure the data into it's final form */ protected function setData() { } /** * Re-configure an array of arrays into column arrays */ protected function setArrayOfArraysData() { } /** * Get columns for an associative array * * @return array */ protected function associativeColumns() { } /** * Get the row of data * * @param integer $key * @param array $column_widths * * @return string */ protected function getRow($key, $column_widths) { } /** * Get the standard column width * * @param array $data * * @return integer */ protected function getColumnWidth($data) { } /** * Get an array of each column's width * * @return array */ protected function getColumnWidths() { } /** * Set the count property * * @param integer $column_width */ protected function setColumnCount($column_width) { } /** * Set the count property via an array * * @param array $items */ protected function setColumnCountViaArray($items) { } /** * Get the number of rows per column * * @param integer $column_width * * @return integer */ protected function getMaxRows($column_width) { } } class Table extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { use \League\CLImate\TerminalObject\Helper\StringLength; /** * The data for the table, an array of (arrays|objects) * * @var array $data */ protected $data = []; /** * An array of the widths of each column in the table * * @var array $column_widths */ protected $column_widths = []; /** * The width of the table * * @var integer $table_width */ protected $table_width = 0; /** * The divider between table cells * * @var string $column_divider */ protected $column_divider = ' | '; /** * The border to divide each row of the table * * @var string $border */ protected $border; /** * The array of rows that will ultimately be returned * * @var array $rows */ protected $rows = []; public function __construct(array $data) { } /** * Return the built rows * * @return array */ public function result() { } /** * Determine the width of the table * * @return integer */ protected function getWidth() { } /** * Get the border for each row based on the table width */ protected function getBorder() { } /** * Check for a header row (if it's an array of associative arrays or objects), * if there is one, tack it onto the front of the rows array */ protected function buildHeaderRow() { } /** * Get table row * * @param mixed $columns * * @return string */ protected function buildRow($columns) { } /** * Build the string for this particular table cell * * @param mixed $key * @param string $column * * @return string */ protected function buildCell($key, $column) { } /** * Get the header row for the table if it's an associative array or object * * @return mixed */ protected function getHeaderRow() { } /** * Determine the width of each column * * @return array */ protected function getColumnWidths() { } /** * Set up an array of default column widths * * @param array $columns * * @return array */ protected function getDefaultColumnWidths(array $columns) { } /** * Determine the width of the columns without tags * * @param array $current_width * @param string $str * * @return integer */ protected function getCellWidth($current_width, $str) { } } class Flank extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * The string that will be flanked * * @var string $str */ protected $str; /** * The character(s) to repeat on either side of the string * * @var string $char */ protected $char = '#'; /** * How many times the character(s) should be repeated on either side * * @var integer $repeat */ protected $repeat = 3; public function __construct($str, $char = null, $repeat = null) { } /** * Set the character(s) to repeat on either side * * @param string $char * * @return Flank */ public function char($char) { } /** * Set the repeat of the flank character(s) * * @param integer $repeat * * @return Flank */ public function repeat($repeat) { } /** * Return the flanked string * * @return string */ public function result() { } } class Dump extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * The data to convert to JSON * * @var mixed $data */ protected $data; public function __construct($data) { } /** * Return the data as JSON * * @return string */ public function result() { } } abstract class Repeatable extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * How many times the element should be repeated * * @var integer */ protected $count; public function __construct($count = 1) { } } /** * Tab class to enable tabs to be output without using the escape character. */ class Tab extends \League\CLImate\TerminalObject\Basic\Repeatable { /** * Check if this object requires a new line should be added after the output. * * @return boolean */ public function sameLine() { } /** * Return the relevant number of tab characters. * * @return string */ public function result() { } } class Br extends \League\CLImate\TerminalObject\Basic\Repeatable { /** * Return an empty string * * @return string */ public function result() { } } class Json extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * The data to convert to JSON * * @var mixed $data */ protected $data; public function __construct($data) { } /** * Return the data as JSON * * @return string */ public function result() { } } class Clear extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * Clear the terminal * * @return string */ public function result() { } public function sameLine() { } } class Draw extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { use \League\CLImate\TerminalObject\Helper\Art; public function __construct($art) { } /** * Return the art * * @return array */ public function result() { } } class Border extends \League\CLImate\TerminalObject\Basic\BasicTerminalObject { /** * The character to repeat for the border * * @var string $char */ protected $char = '-'; /** * The length of the border * * @var integer $length */ protected $length; public function __construct($char = null, $length = null) { } /** * Set the character to repeat for the border * * @param string $char * * @return Border */ public function char($char) { } /** * Set the length of the border * * @param integer $length * * @return Border */ public function length($length) { } /** * Return the border * * @return string */ public function result() { } } } namespace League\CLImate\Util\Reader { interface ReaderInterface { /** * @return string */ public function line(); /** * @return string */ public function multiLine(); } class Stdin implements \League\CLImate\Util\Reader\ReaderInterface { protected $stdIn = false; /** * Read the line typed in by the user * * @return string */ public function line() { } /** * Read from STDIN until EOF (^D) is reached * * @return string */ public function multiLine() { } /** * Read one character * * @param int $count * * @return string */ public function char($count = 1) { } /** * Read the line, but hide what the user is typing * * @return string */ public function hidden() { } /** * Return a valid STDIN, even if it previously EOF'ed * * Lazily re-opens STDIN after hitting an EOF * * @return resource * @throws \Exception */ protected function getStdIn() { } /** * Attempt to set the stdin property * * @throws \Exception */ protected function setStdIn() { } } } namespace League\CLImate\Util { class Helper { /** * @param string|array $var * * @return array */ public static function toArray($var) { } /** * Flatten a multi-dimensional array * * @param array $arr * * @return array */ public static function flatten(array $arr) { } /** * Convert a string to snake case * * @param string $str * * @return string */ public static function snakeCase($str) { } } class Output { /** * The content to be output * * @var string $content */ protected $content; /** * Whether or not to add a new line after the output * * @var boolean $new_line */ protected $new_line = true; /** * The array of available writers * * @var array[] $writers */ protected $writers = []; /** * Default writers when one isn't specifed * * @var WriterInterface[] $default */ protected $default = []; /** * Writers to be used just once * * @var null|array $once */ protected $once; protected $persist = false; public function __construct() { } /** * Dictate that a new line should not be added after the output */ public function sameLine() { } /** * Add a writer to the available writers * * @param string $key * @param WriterInterface|array $writer * * @return \League\CLImate\Util\Output */ public function add($key, $writer) { } /** * Set the default writer * * @param string|array $keys */ public function defaultTo($keys) { } /** * Add a default writer * * @param string|array $keys */ public function addDefault($keys) { } /** * Register a writer to be used just once * * @param string|array $keys * * @return \League\CLImate\Util\Output */ public function once($keys) { } /** * Persist or un-persist one time writers (for multi-line output) * * @param bool $persist * * @return \League\CLImate\Util\Output */ public function persist($persist = true) { } /** * Get a specific writer * * @throws \Exception if writer key doesn't exist * @param string $writer * * @return WriterInterface|array */ public function get($writer) { } /** * Get the currently available writers * * @return array */ public function getAvailable() { } /** * Write the content using the provided writer * * @param string $content */ public function write($content) { } /** * Resolve the writer(s) down to an array of WriterInterface classes * * @param WriterInterface|array|string $writer * * @return array */ protected function resolve($writer) { } /** * @param array $writer * * @return array */ protected function resolveArrayWriter($writer) { } /** * @param object $writer * * @return WriterInterface|false */ protected function resolveObjectWriter($writer) { } /** * @param string $writer * * @return array|false */ protected function resolveStringWriter($writer) { } /** * @param mixed $writer * @throws \Exception For non-valid writer */ protected function handleUnknownWriter($writer) { } /** * Get the readable version of the writer(s) * * @param array $writer * * @return string|array */ protected function getReadable(array $writer) { } /** * Get the writers based on their keys * * @param string|array $keys * * @return array */ protected function getWriters($keys) { } /** * @return WriterInterface[] */ protected function getCurrentWriters() { } /** * Reset anything only used for the current content being written */ protected function resetOneTimers() { } } } namespace League\CLImate\Util\Writer { interface WriterInterface { /** * @param string $content * * @return void */ public function write($content); } class StdOut implements \League\CLImate\Util\Writer\WriterInterface { /** * Write the content to the stream * * @param string $content */ public function write($content) { } } class StdErr implements \League\CLImate\Util\Writer\WriterInterface { /** * Write the content to the stream * * @param string $content */ public function write($content) { } } class File implements \League\CLImate\Util\Writer\WriterInterface { /** @var resource|string */ protected $resource; /** @var boolean $close_locally */ protected $close_locally = false; /** @var boolean $use_locking */ protected $use_locking = false; /** @var boolean $gzip_file */ protected $gzip_file = false; /** * @param string|resource $resource * @param bool $use_locking * @param bool $gzip_file */ public function __construct($resource, $use_locking = false, $gzip_file = false) { } public function lock() { } public function gzipped() { } /** * Write the content to the stream * * @param string $content */ public function write($content) { } protected function getResource() { } protected function openResource() { } public function _destruct() { } } class Buffer implements \League\CLImate\Util\Writer\WriterInterface { /** * @var string $contents The buffered data. */ protected $contents = ""; /** * Write the content to the buffer. * * @param string $content * * @return void */ public function write($content) { } /** * Get the buffered data. * * @return string */ public function get() { } /** * Clean the buffer and throw away any data. * * @return void */ public function clean() { } } } namespace League\CLImate\Util\System { class SystemFactory { /** * @var \League\CLImate\Util\System\System $instance */ protected static $instance; /** * Get an instance of the appropriate System class * * @return \League\CLImate\Util\System\System */ public static function getInstance() { } /** * Set the $instance property to the appropriate system * * @return \League\CLImate\Util\System\System */ protected static function getSystem() { } } abstract class System { protected $force_ansi; /** * Force ansi on or off * * @param bool $force */ public function forceAnsi($force = true) { } /** * @return integer|null */ public abstract function width(); /** * @return integer|null */ public abstract function height(); /** * Check if the stream supports ansi escape characters. * * @return bool */ protected abstract function systemHasAnsiSupport(); /** * Check if we are forcing ansi, fallback to system support * * @return bool */ public function hasAnsiSupport() { } /** * Wraps exec function, allowing the dimension methods to decouple * * @param string $command * @param boolean $full * * @return string|array */ public function exec($command, $full = false) { } } class Linux extends \League\CLImate\Util\System\System { /** * Get the width of the terminal * * @return integer|null */ public function width() { } /** * Get the height of the terminal * * @return integer|null */ public function height() { } /** * Determine if system has access to bash commands * * @return bool */ public function canAccessBash() { } /** * Display a hidden response prompt and return the response * * @param string $prompt * * @return string */ public function hiddenResponsePrompt($prompt) { } /** * Determine if dimension is numeric and return it * * @param integer|string|null $dimension * * @return integer|null */ protected function getDimension($dimension) { } /** * Check if the stream supports ansi escape characters. * * Based on https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/StreamOutput.php * * @return bool */ protected function systemHasAnsiSupport() { } } class Windows extends \League\CLImate\Util\System\System { /** * Get the width of the terminal * * @return integer|null */ public function width() { } /** * Get the height of the terminal * * @return integer|null */ public function height() { } /** * Get specified terminal dimension * * @param string $key * * @return integer|null */ protected function getDimension($key) { } /** * Get information about the dimensions of the terminal * * @return array */ protected function getDimensions() { } /** * Check if the stream supports ansi escape characters. * * Based on https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/StreamOutput.php * * @return bool */ protected function systemHasAnsiSupport() { } } } namespace League\CLImate\Util { class UtilFactory { /** * A instance of the appropriate System class * * @var \League\CLImate\Util\System\System */ public $system; /** * A instance of the Cursor class * * @var \League\CLImate\Util\Cursor */ public $cursor; public function __construct(\League\CLImate\Util\System\System $system = null, \League\CLImate\Util\Cursor $cursor = null) { } /** * Get the width of the terminal * * @return integer */ public function width() { } /** * Get the height of the terminal * * @return integer */ public function height() { } /** * Determine if the value is numeric, fallback to a default if not * * @param integer|null $dimension * @param integer $default * * @return integer */ protected function getDimension($dimension, $default) { } } class Cursor { /** * Move the cursor up in the terminal x number of lines. * * @param int $lines * * @return string */ public function up($lines = 1) { } /** * Move the cursor left in the terminal x number of columns. * * @param int $cols * * @return string */ public function left($cols = 1) { } /** * Move cursor to the beginning of the current line. * * @return string */ public function startOfCurrentLine() { } /** * Delete the current line to the end. * * @return string */ public function deleteCurrentLine() { } /** * Get the style for hiding the cursor * * @return string */ public function hide() { } /** * Get the style for returning the cursor to its default * * @return string */ public function defaultStyle() { } } } namespace League\CLImate\Argument { class Manager { /** * An array of arguments passed to the program. * * @var Argument[] $arguments */ protected $arguments = []; /** * A program's description. * * @var string $description */ protected $description; /** * Filter class to find various types of arguments * * @var \League\CLImate\Argument\Filter $filter */ protected $filter; /** * Summary builder class * * @var \League\CLImate\Argument\Summary $summary */ protected $summary; /** * Argument parser class * * @var \League\CLImate\Argument\Parser $parser */ protected $parser; public function __construct() { } /** * Add an argument. * * @throws \Exception if $argument isn't an array or Argument object. * @param Argument|string|array $argument * @param $options */ public function add($argument, array $options = []) { } /** * Add multiple arguments to a CLImate script. * * @param array $arguments */ protected function addMany(array $arguments = []) { } /** * Determine if an argument exists. * * @param string $name * @return bool */ public function exists($name) { } /** * Retrieve an argument's value. * * @param string $name * @return string|int|float|bool|null */ public function get($name) { } /** * Retrieve all arguments. * * @return Argument[] */ public function all() { } /** * Determine if an argument has been defined on the command line. * * This can be useful for making sure an argument is present on the command * line before parse()'ing them into argument objects. * * @param string $name * @param array $argv * * @return bool */ public function defined($name, array $argv = null) { } /** * Check if the defined argument matches the command argument. * * @param Argument $argument * @param string $command_argument * * @return bool */ protected function isArgument($argument, $command_argument) { } /** * Retrieve all arguments as key/value pairs. * * @return array */ public function toArray() { } /** * Set a program's description. * * @param string $description */ public function description($description) { } /** * Output a script's usage statement. * * @param CLImate $climate * @param array $argv */ public function usage(\League\CLImate\CLImate $climate, array $argv = null) { } /** * Parse command line arguments into CLImate arguments. * * @throws \Exception if required arguments aren't defined. * @param array $argv */ public function parse(array $argv = null) { } /** * Get the trailing arguments * * @return string|null */ public function trailing() { } } class Summary { /** * @var \League\CLImate\CLImate $climate */ protected $climate; /** * @var string $description */ protected $description; /** * @var string $command */ protected $command; /** * @var Filter $filter */ protected $filter; /** * @param \League\CLImate\CLImate $climate * * @return \League\CLImate\Argument\Summary */ public function setClimate(\League\CLImate\CLImate $climate) { } /** * @param string $description * * @return \League\CLImate\Argument\Summary */ public function setDescription($description) { } /** * @param string $command * * @return \League\CLImate\Argument\Summary */ public function setCommand($command) { } /** * @param Filter $filter * @param Argument[] $arguments * * @return \League\CLImate\Argument\Summary */ public function setFilter($filter, $arguments) { } /** * Output the full summary for the program */ public function output() { } /** * Build a short summary of a list of arguments. * * @param Argument[] $arguments * * @return string */ public function short($arguments) { } /** * Build an argument's summary for use in a usage statement. * * For example, "-u username, --user username", "--force", or * "-c count (default: 7)". * * @param Argument $argument * * @return string */ public function argument(\League\CLImate\Argument\Argument $argument) { } /** * Build argument summary surrounded by brackets * * @param Argument $argument * * @return string */ protected function argumentBracketed(\League\CLImate\Argument\Argument $argument) { } /** * Get the arguments ordered by whether or not they have a prefix * * @return Argument[] */ protected function getOrderedArguments() { } /** * Print out the argument list * * @param array $arguments * @param string $type */ protected function outputArguments($arguments, $type) { } /** * Builds the summary for any prefixed arguments * * @param Argument $argument * * @return string */ protected function prefixedArguments(\League\CLImate\Argument\Argument $argument) { } } class Filter { protected $arguments = []; /** * Set the available arguments * * @param array $arguments */ public function setArguments(array $arguments) { } /** * Retrieve optional arguments * * @return Argument[] */ public function optional() { } /** * Retrieve required arguments * * @return Argument[] */ public function required() { } /** * Retrieve arguments with prefix * * @return Argument[] */ public function withPrefix() { } /** * Retrieve arguments without prefix * * @return Argument[] */ public function withoutPrefix() { } /** * Find all required arguments that don't have values after parsing. * * These arguments weren't defined on the command line. * * @return Argument[] */ public function missing() { } /** * Filter defined arguments as to whether they are required or not * * @param string[] $filters * * @return Argument[] */ protected function filterArguments($filters = []) { } /** * Determine whether an argument as a prefix * * @param Argument $argument * * @return bool */ protected function noPrefix($argument) { } /** * Determine whether an argument as a prefix * * @param Argument $argument * * @return bool */ protected function hasPrefix($argument) { } /** * Determine whether an argument is required * * @param Argument $argument * * @return bool */ protected function isRequired($argument) { } /** * Determine whether an argument is optional * * @param Argument $argument * * @return bool */ protected function isOptional($argument) { } /** * Determine whether an argument is optional * * @param Argument $argument * * @return bool */ protected function noValue($argument) { } /** * Compare two arguments by their short and long prefixes. * * @see usort() * * @param Argument $a * @param Argument $b * * @return int */ public function compareByPrefix(\League\CLImate\Argument\Argument $a, \League\CLImate\Argument\Argument $b) { } /** * Prep the prefix string for comparison * * @param Argument $argument * * @return string */ protected function prefixCompareString(\League\CLImate\Argument\Argument $argument) { } } class Argument { /** * An argument's name. * * Use this name when internally referring to the argument. * * @var string */ protected $name; /** * An argument's short representation. * * @var string */ protected $prefix; /** * An argument's long representation. * * @var string */ protected $longPrefix; /** * An argument's description. * * @var string */ protected $description; /** * Whether or not an argument is required. * * @var bool */ protected $required = false; /** * Whether or not an argument only needs to be defined to have a value. * * These arguments have the value true when they are defined on the command * line. * * @var bool */ protected $noValue = false; /** * Which data type to cast an argument's value to. * * Valid data types are "string", "int", "float", and "bool". * * @var string */ protected $castTo = 'string'; /** * An argument's default value. * * @var string */ protected $defaultValue; /** * An argument's value, after type casting. * * @var string|int|float|bool */ protected $value; /** * Build a new command argument. * * @param string $name */ public function __construct($name) { } /** * Build a new command argument from an array. * * @param string $name * @param array $params * * @return Argument */ public static function createFromArray($name, array $params) { } /** * Get argument params based on settable properties * * @param array $params * * @return array */ protected static function getSettableArgumentParams(array $params) { } /** * Retrieve an argument's name. * * Use this name when internally referring to the argument. * * @return string */ public function name() { } /** * Set an argument's name. * * Use this name when internally referring to the argument. * * @param string $name */ protected function setName($name) { } /** * Retrieve an argument's short form. * * @return string */ public function prefix() { } /** * Set an argument's short form. * * @param string $prefix */ protected function setPrefix($prefix) { } /** * Retrieve an argument's long form. * * @return string */ public function longPrefix() { } /** * Set an argument's short form. * * @param string $longPrefix */ protected function setLongPrefix($longPrefix) { } /** * Determine if an argument has a prefix. * * @return bool */ public function hasPrefix() { } /** * Retrieve an argument's description. * * @return string */ public function description() { } /** * Set an argument's description. * * @param string $description */ protected function setDescription($description) { } /** * Determine whether or not an argument is required. * * @return bool */ public function isRequired() { } /** * Set whether an argument is required or not. * * @param bool $required */ protected function setRequired($required) { } /** * Determine whether or not an argument only needs to be defined to have a * value. * * @return bool */ public function noValue() { } /** * Set whether or not an argument only needs to be defined to have a value. * * @param bool $noValue */ protected function setNoValue($noValue) { } /** * Retrieve the data type to cast an argument's value to. * * @return string */ public function castTo() { } /** * Set the data type to cast an argument's value to. * * Valid data types are "string", "int", "float", and "bool". * * @throws \Exception if $castTo is not a valid data type. * @param string $castTo */ protected function setCastTo($castTo) { } /** * Retrieve an argument's default value. * * @return string */ public function defaultValue() { } /** * Set an argument's default value. * * @param string $defaultValue */ public function setDefaultValue($defaultValue) { } /** * Retrieve an argument's value. * * Argument values are type cast based on the value of $castTo. * * @return string|int|float|bool */ public function value() { } /** * Set an argument's value based on its command line entry. * * Argument values are type cast based on the value of $castTo. * * @param string|bool $value */ public function setValue($value) { } /** * @param string $value * * @return string */ protected function castToString($value) { } /** * @param string $value * * @return int */ protected function castToInt($value) { } /** * @param string $value * * @return float */ protected function castToFloat($value) { } /** * @param string $value * * @return bool */ protected function castToBool($value) { } } class Parser { /** * Filter class to find various types of arguments * * @var \League\CLImate\Argument\Filter $filter */ protected $filter; /** * Summary builder class * * @var \League\CLImate\Argument\Summary $summary */ protected $summary; protected $trailing; public function __construct() { } /** * @param Filter $filter * @param Argument[] $arguments * * @return \League\CLImate\Argument\Parser */ public function setFilter($filter, $arguments) { } /** * Parse command line arguments into CLImate arguments. * * @throws \Exception if required arguments aren't defined. * @param array $argv */ public function parse(array $argv = null) { } /** * Get the command name. * * @param array $argv * * @return string */ public function command(array $argv = null) { } /** * Get the passed arguments. * * @param array $argv * * @return array */ public function arguments(array $argv = null) { } /** * Get the trailing arguments * * @return string|null */ public function trailing() { } /** * Remove the trailing arguments from the parser and set them aside * * @param array $arguments * * @return array */ protected function removeTrailingArguments(array $arguments) { } /** * Parse command line options into prefixed CLImate arguments. * * Prefixed arguments are arguments with a prefix (-) or a long prefix (--) * on the command line. * * Return the arguments passed on the command line that didn't match up with * prefixed arguments so they can be assigned to non-prefixed arguments. * * @param array $argv * @return array */ protected function prefixedArguments(array $argv = []) { } /** * Parse unset command line options into non-prefixed CLImate arguments. * * Non-prefixed arguments are parsed after the prefixed arguments on the * command line, in the order that they're defined in the script. * * @param array $unParsedArguments */ protected function nonPrefixedArguments(array $unParsedArguments = []) { } /** * Parse the name and value of the argument passed in * * @param string $cliArgument * @return string[] [$name, $value] */ protected function getNameAndValue($cliArgument) { } /** * Attempt to set the an argument's value and remove applicable * arguments from array * * @param array $argv * @param int $key * @param string $passed_argument * * @return array The new $argv */ protected function trySettingArgumentValue($argv, $key, $passed_argument) { } /** * Set the argument's value * * @param array $argv * @param Argument $argument * @param int $key * @param string|null $value * * @return array The new $argv */ protected function setArgumentValue($argv, $argument, $key, $value) { } /** * Search for argument in defined prefix arguments * * @param string $name * * @return Argument|false */ protected function findPrefixedArgument($name) { } /** * Pull a command name and arguments from $argv. * * @param array $argv * @return array */ protected function getCommandAndArguments(array $argv = null) { } } } namespace League\CLImate\Decorator\Component { interface DecoratorInterface { public function add($key, $value); /** * @return void */ public function defaults(); public function get($val); public function set($val); public function all(); public function current(); /** * @return void */ public function reset(); } abstract class BaseDecorator implements \League\CLImate\Decorator\Component\DecoratorInterface { /** * An array of defaults for the decorator * * @var array $defaults; */ protected $defaults = []; /** * An array of currently set codes for the decorator * * @var array $current; */ protected $current = []; public function __construct() { } /** * Load up the defaults for this decorator */ public function defaults() { } /** * Reset the currently set decorator */ public function reset() { } /** * Retrieve the currently set codes for the decorator * * @return array */ public function current() { } } class Format extends \League\CLImate\Decorator\Component\BaseDecorator { /** * The available formatting options * * @var array */ protected $formats = []; /** * An array of default formats * * @var array $defaults */ protected $defaults = ['bold' => 1, 'dim' => 2, 'underline' => 4, 'blink' => 5, 'invert' => 7, 'hidden' => 8]; /** * Add a format into the mix * * @param string $key * @param mixed $value */ public function add($key, $value) { } /** * Retrieve all of the available formats * * @return array */ public function all() { } /** * Get the code for the format * * @param string $val * * @return string */ public function get($val) { } /** * Set the current format * * @param string $val * * @return boolean */ public function set($val) { } } class Color extends \League\CLImate\Decorator\Component\BaseDecorator { /** * The available colors * * @var array */ protected $colors = []; /** * An array of default colors * * @var array $defaults */ protected $defaults = ['default' => 39, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'light_gray' => 37, 'dark_gray' => 90, 'light_red' => 91, 'light_green' => 92, 'light_yellow' => 93, 'light_blue' => 94, 'light_magenta' => 95, 'light_cyan' => 96, 'white' => 97]; /** * Add a color into the mix * * @param string $key * @param integer $value */ public function add($key, $value) { } /** * Retrieve all of available colors * * @return array */ public function all() { } /** * Get the code for the color * * @param string $val * * @return string */ public function get($val) { } /** * Set the current color * * @param string $val * * @return boolean */ public function set($val) { } } class BackgroundColor extends \League\CLImate\Decorator\Component\Color { /** * The difference to add to a foreground color code * to get a background color code * * @const integer ADD */ const ADD = 10; /** * Get the code for the requested color * * @param mixed $val * * @return mixed */ public function get($val) { } /** * Set the current background color * * @param mixed $val * * @return boolean */ public function set($val) { } /** * Get all of the available background colors * * @return array */ public function all() { } /** * Strip the color of any prefixes * * @param string $val * * @return string */ protected function strip($val) { } } class Command extends \League\CLImate\Decorator\Component\BaseDecorator { /** * Commands that correspond to a color in the $colors property * * @var array */ public $commands = []; /** * The default commands available * * @var array $defaults */ protected $defaults = ['info' => 'green', 'comment' => 'yellow', 'whisper' => 'light_gray', 'shout' => 'red', 'error' => 'light_red']; /** * Add a command into the mix * * @param string $key * @param mixed $value */ public function add($key, $value) { } /** * Retrieve all of the available commands * * @return array */ public function all() { } /** * Get the style that corresponds to the command * * @param string $val * * @return string */ public function get($val) { } /** * Set the currently used command * * @param string $val * * @return string|false */ public function set($val) { } } } namespace League\CLImate\Decorator\Parser { abstract class Parser { /** * An array of the currently applied codes * * @var array $current; */ protected $current = []; /** * An array of the tags that should be searched for * and their corresponding replacements * * @var \League\CLImate\Decorator\Tags $tags */ public $tags; public function __construct(array $current, \League\CLImate\Decorator\Tags $tags) { } /** * Wrap the string in the current style * * @param string $str * * @return string */ public abstract function apply($str); } class Ansi extends \League\CLImate\Decorator\Parser\Parser { /** * Wrap the string in the current style * * @param string $str * * @return string */ public function apply($str) { } /** * Get the string that begins the style * * @param string $codes * @return string */ protected function start($codes = null) { } /** * Get the string that ends the style * * @param string|array $codes * @return string */ protected function end($codes = null) { } /** * Wrap the code string in the full escaped sequence * * @param string $codes * * @return string */ protected function wrapCodes($codes) { } /** * Parse the string for tags and replace them with their codes * * @param string $str * * @return string */ protected function parse($str) { } /** * Parse the given string for the tags and replace them with the appropriate codes * * @param string $str * @param array $tags * * @return string */ protected function parseTags($str, $tags) { } /** * Replace the tag in the str * * @param string $str * @param string $tag * @param array $history * * @return string */ protected function replaceTag($str, $tag, &$history) { } /** * Stringify the codes * * @param mixed $codes * * @return string */ protected function codeStr($codes) { } /** * Retrieve the current style code * * @return string */ protected function currentCode() { } } class ParserFactory { /** * Get an instance of the appropriate Parser class * * @param System $system * @param array $current * @param Tags $tags * @return Parser */ public static function getInstance(\League\CLImate\Util\System\System $system, array $current, \League\CLImate\Decorator\Tags $tags) { } } class NonAnsi extends \League\CLImate\Decorator\Parser\Parser { /** * Strip the string of any tags * * @param string $str * * @return string */ public function apply($str) { } } } namespace League\CLImate\Decorator { class Tags { /** * Original keys passed in to build tags * * @var array $tags */ protected $keys = []; /** * Available tags and their values * * @var array $tags */ protected $tags = []; public function __construct(array $keys) { } /** * Get all available tags * * @return array */ public function all() { } /** * Get the value of the requested tag * * @param string $key * * @return string|null */ public function value($key) { } /** * Get the regular expression that can be used to parse the string for tags * * @return string */ public function regex() { } /** * Build the search and replace for all of the various style tags */ protected function build() { } } /** * @method void addColor(string $color, integer $code) * @method void addFormat(string $format, integer $code) * @method void addCommand(string $command, mixed $style) */ class Style { /** * An array of Decorator objects * * @var Component\DecoratorInterface[] $style */ protected $style = []; /** * An array of the available Decorators * and their corresponding class names * * @var array $available */ protected $available = ['format' => 'Format', 'color' => 'Color', 'background' => 'BackgroundColor', 'command' => 'Command']; protected $parser; /** * An array of the current styles applied * * @var array $current */ protected $current = []; public function __construct() { } /** * Get all of the styles available * * @return array */ public function all() { } /** * Attempt to get the corresponding code for the style * * @param mixed $key * * @return mixed */ public function get($key) { } /** * Attempt to set some aspect of the styling, * return true if attempt was successful * * @param string $key * * @return boolean */ public function set($key) { } /** * Reset the current styles applied * */ public function reset() { } /** * Get a new instance of the Parser class based on the current settings * * @param \League\CLImate\Util\System\System $system * * @return \League\CLImate\Decorator\Parser\Parser */ public function parser(\League\CLImate\Util\System\System $system) { } /** * Compile an array of the current codes * * @return array */ public function current() { } /** * Make sure that the code is an integer, if not let's try and get it there * * @param mixed $code * * @return boolean */ protected function validateCode($code) { } /** * Validate an array of codes * * @param array $codes * * @return boolean */ protected function validateCodeArray(array $codes) { } /** * Convert the array of codes to integers * * @param array $codes * @return array */ protected function convertToCodes(array $codes) { } /** * Retrieve the integers from the mixed code input * * @param string|array $code * * @return integer|array */ protected function getCode($code) { } /** * Retrieve an array of integers from the array of codes * * @param array $codes * * @return array */ protected function getCodeArray(array $codes) { } /** * Parse the add method for the style they are trying to add * * @param string $method * * @return string */ protected function parseAddMethod($method) { } /** * Add a custom style * * @param string $style * @param string $key * @param string $value */ protected function add($style, $key, $value) { } /** * Magic Methods * * List of possible magic methods are at the top of this class * * @param string $requested_method * @param array $arguments */ public function __call($requested_method, $arguments) { } } } namespace League\CLImate\Settings { class Manager { /** * An array of settings that have been... set * * @var array $settings */ protected $settings = []; /** * Check and see if the requested setting is a valid, registered setting * * @param string $name * * @return boolean */ public function exists($name) { } /** * Add a setting * * @param string $name * @param mixed $value */ public function add($name, $value) { } /** * Get the value of the requested setting if it exists * * @param string $key * * @return mixed */ public function get($key) { } /** * Get the short name for the requested settings class * * @param string $name * * @return string */ protected function getPath($name) { } /** * Get the short class name for the setting * * @param string $name * * @return string */ protected function getClassName($name) { } } interface SettingsInterface { /** * @return void */ public function add(); } class Art implements \League\CLImate\Settings\SettingsInterface { /** * An array of valid art directories * @var array[] $dirs */ public $dirs = []; /** * Add directories of art */ public function add() { } } } namespace League\Plates { /** * Template API and environment settings storage. */ class Engine { /** * Default template directory. * @var Directory */ protected $directory; /** * Template file extension. * @var FileExtension */ protected $fileExtension; /** * Collection of template folders. * @var Folders */ protected $folders; /** * Collection of template functions. * @var Functions */ protected $functions; /** * Collection of preassigned template data. * @var Data */ protected $data; /** * Create new Engine instance. * @param string $directory * @param string $fileExtension */ public function __construct($directory = null, $fileExtension = 'php') { } /** * Set path to templates directory. * @param string|null $directory Pass null to disable the default directory. * @return Engine */ public function setDirectory($directory) { } /** * Get path to templates directory. * @return string */ public function getDirectory() { } /** * Set the template file extension. * @param string|null $fileExtension Pass null to manually set it. * @return Engine */ public function setFileExtension($fileExtension) { } /** * Get the template file extension. * @return string */ public function getFileExtension() { } /** * Add a new template folder for grouping templates under different namespaces. * @param string $name * @param string $directory * @param boolean $fallback * @return Engine */ public function addFolder($name, $directory, $fallback = false) { } /** * Remove a template folder. * @param string $name * @return Engine */ public function removeFolder($name) { } /** * Get collection of all template folders. * @return Folders */ public function getFolders() { } /** * Add preassigned template data. * @param array $data; * @param null|string|array $templates; * @return Engine */ public function addData(array $data, $templates = null) { } /** * Get all preassigned template data. * @param null|string $template; * @return array */ public function getData($template = null) { } /** * Register a new template function. * @param string $name; * @param callback $callback; * @return Engine */ public function registerFunction($name, $callback) { } /** * Remove a template function. * @param string $name; * @return Engine */ public function dropFunction($name) { } /** * Get a template function. * @param string $name * @return Func */ public function getFunction($name) { } /** * Check if a template function exists. * @param string $name * @return boolean */ public function doesFunctionExist($name) { } /** * Load an extension. * @param ExtensionInterface $extension * @return Engine */ public function loadExtension(\League\Plates\Extension\ExtensionInterface $extension) { } /** * Load multiple extensions. * @param array $extensions * @return Engine */ public function loadExtensions(array $extensions = array()) { } /** * Get a template path. * @param string $name * @return string */ public function path($name) { } /** * Check if a template exists. * @param string $name * @return boolean */ public function exists($name) { } /** * Create a new template. * @param string $name * @return Template */ public function make($name) { } /** * Create a new template and render it. * @param string $name * @param array $data * @return string */ public function render($name, array $data = array()) { } } } namespace League\Plates\Extension { /** * A common interface for extensions. */ interface ExtensionInterface { public function register(\League\Plates\Engine $engine); } /** * Extension that adds a number of URI checks. */ class URI implements \League\Plates\Extension\ExtensionInterface { /** * Instance of the current template. * @var Template */ public $template; /** * The request URI. * @var string */ protected $uri; /** * The request URI as an array. * @var array */ protected $parts; /** * Create new URI instance. * @param string $uri */ public function __construct($uri) { } /** * Register extension functions. * @param Engine $engine * @return null */ public function register(\League\Plates\Engine $engine) { } /** * Perform URI check. * @param null|integer|string $var1 * @param mixed $var2 * @param mixed $var3 * @param mixed $var4 * @return mixed */ public function runUri($var1 = null, $var2 = null, $var3 = null, $var4 = null) { } /** * Perform a URI segment match. * @param integer $key * @param string $string * @param mixed $returnOnTrue * @param mixed $returnOnFalse * @return mixed */ protected function checkUriSegmentMatch($key, $string, $returnOnTrue = null, $returnOnFalse = null) { } /** * Perform a regular express match. * @param string $regex * @param mixed $returnOnTrue * @param mixed $returnOnFalse * @return mixed */ protected function checkUriRegexMatch($regex, $returnOnTrue = null, $returnOnFalse = null) { } } /** * Extension that adds the ability to create "cache busted" asset URLs. */ class Asset implements \League\Plates\Extension\ExtensionInterface { /** * Instance of the current template. * @var Template */ public $template; /** * Path to asset directory. * @var string */ public $path; /** * Enables the filename method. * @var boolean */ public $filenameMethod; /** * Create new Asset instance. * @param string $path * @param boolean $filenameMethod */ public function __construct($path, $filenameMethod = false) { } /** * Register extension function. * @param Engine $engine * @return null */ public function register(\League\Plates\Engine $engine) { } /** * Create "cache busted" asset URL. * @param string $url * @return string */ public function cachedAssetUrl($url) { } } } namespace League\Plates\Template { /** * Default template directory. */ class Directory { /** * Template directory path. * @var string */ protected $path; /** * Create new Directory instance. * @param string $path */ public function __construct($path = null) { } /** * Set path to templates directory. * @param string|null $path Pass null to disable the default directory. * @return Directory */ public function set($path) { } /** * Get path to templates directory. * @return string */ public function get() { } } /** * A collection of template functions. */ class Functions { /** * Array of template functions. * @var array */ protected $functions = array(); /** * Add a new template function. * @param string $name; * @param callback $callback; * @return Functions */ public function add($name, $callback) { } /** * Remove a template function. * @param string $name; * @return Functions */ public function remove($name) { } /** * Get a template function. * @param string $name * @return Func */ public function get($name) { } /** * Check if a template function exists. * @param string $name * @return boolean */ public function exists($name) { } } /** * A template function. */ class Func { /** * The function name. * @var string */ protected $name; /** * The function callback. * @var callable */ protected $callback; /** * Create new Func instance. * @param string $name * @param callable $callback */ public function __construct($name, $callback) { } /** * Set the function name. * @param string $name * @return Func */ public function setName($name) { } /** * Get the function name. * @return string */ public function getName() { } /** * Set the function callback * @param callable $callback * @return Func */ public function setCallback($callback) { } /** * Get the function callback. * @return callable */ public function getCallback() { } /** * Call the function. * @param Template $template * @param array $arguments * @return mixed */ public function call(\League\Plates\Template\Template $template = null, $arguments = array()) { } } /** * A template name. */ class Name { /** * Instance of the template engine. * @var Engine */ protected $engine; /** * The original name. * @var string */ protected $name; /** * The parsed template folder. * @var Folder */ protected $folder; /** * The parsed template filename. * @var string */ protected $file; /** * Create a new Name instance. * @param Engine $engine * @param string $name */ public function __construct(\League\Plates\Engine $engine, $name) { } /** * Set the engine. * @param Engine $engine * @return Name */ public function setEngine(\League\Plates\Engine $engine) { } /** * Get the engine. * @return Engine */ public function getEngine() { } /** * Set the original name and parse it. * @param string $name * @return Name */ public function setName($name) { } /** * Get the original name. * @return string */ public function getName() { } /** * Set the parsed template folder. * @param string $folder * @return Name */ public function setFolder($folder) { } /** * Get the parsed template folder. * @return string */ public function getFolder() { } /** * Set the parsed template file. * @param string $file * @return Name */ public function setFile($file) { } /** * Get the parsed template file. * @return string */ public function getFile() { } /** * Resolve template path. * @return string */ public function getPath() { } /** * Check if template path exists. * @return boolean */ public function doesPathExist() { } /** * Get the default templates directory. * @return string */ protected function getDefaultDirectory() { } } /** * Container which holds template data and provides access to template functions. */ class Template { /** * Instance of the template engine. * @var Engine */ protected $engine; /** * The name of the template. * @var Name */ protected $name; /** * The data assigned to the template. * @var array */ protected $data = array(); /** * An array of section content. * @var array */ protected $sections = array(); /** * The name of the section currently being rendered. * @var string */ protected $sectionName; /** * Whether the section should be appended or not. * @var boolean */ protected $appendSection; /** * The name of the template layout. * @var string */ protected $layoutName; /** * The data assigned to the template layout. * @var array */ protected $layoutData; /** * Create new Template instance. * @param Engine $engine * @param string $name */ public function __construct(\League\Plates\Engine $engine, $name) { } /** * Magic method used to call extension functions. * @param string $name * @param array $arguments * @return mixed */ public function __call($name, $arguments) { } /** * Alias for render() method. * @throws \Throwable * @throws \Exception * @return string */ public function __toString() { } /** * Assign or get template data. * @param array $data * @return mixed */ public function data(array $data = null) { } /** * Check if the template exists. * @return boolean */ public function exists() { } /** * Get the template path. * @return string */ public function path() { } /** * Render the template and layout. * @param array $data * @throws \Throwable * @throws \Exception * @return string */ public function render(array $data = array()) { } /** * Set the template's layout. * @param string $name * @param array $data * @return null */ public function layout($name, array $data = array()) { } /** * Start a new section block. * @param string $name * @return null */ public function start($name) { } /** * Start a new append section block. * @param string $name * @return null */ public function push($name) { } /** * Stop the current section block. * @return null */ public function stop() { } /** * Alias of stop(). * @return null */ public function end() { } /** * Returns the content for a section block. * @param string $name Section name * @param string $default Default section content * @return string|null */ public function section($name, $default = null) { } /** * Fetch a rendered template. * @param string $name * @param array $data * @return string */ public function fetch($name, array $data = array()) { } /** * Output a rendered template. * @param string $name * @param array $data * @return null */ public function insert($name, array $data = array()) { } /** * Apply multiple functions to variable. * @param mixed $var * @param string $functions * @return mixed */ public function batch($var, $functions) { } /** * Escape string. * @param string $string * @param null|string $functions * @return string */ public function escape($string, $functions = null) { } /** * Alias to escape function. * @param string $string * @param null|string $functions * @return string */ public function e($string, $functions = null) { } } /** * Preassigned template data. */ class Data { /** * Variables shared by all templates. * @var array */ protected $sharedVariables = array(); /** * Specific template variables. * @var array */ protected $templateVariables = array(); /** * Add template data. * @param array $data; * @param null|string|array $templates; * @return Data */ public function add(array $data, $templates = null) { } /** * Add data shared with all templates. * @param array $data; * @return Data */ public function shareWithAll($data) { } /** * Add data shared with some templates. * @param array $data; * @param array $templates; * @return Data */ public function shareWithSome($data, array $templates) { } /** * Get template data. * @param null|string $template; * @return array */ public function get($template = null) { } } /** * Template file extension. */ class FileExtension { /** * Template file extension. * @var string */ protected $fileExtension; /** * Create new FileExtension instance. * @param null|string $fileExtension */ public function __construct($fileExtension = 'php') { } /** * Set the template file extension. * @param null|string $fileExtension * @return FileExtension */ public function set($fileExtension) { } /** * Get the template file extension. * @return string */ public function get() { } } /** * A template folder. */ class Folder { /** * The folder name. * @var string */ protected $name; /** * The folder path. * @var string */ protected $path; /** * The folder fallback status. * @var boolean */ protected $fallback; /** * Create a new Folder instance. * @param string $name * @param string $path * @param boolean $fallback */ public function __construct($name, $path, $fallback = false) { } /** * Set the folder name. * @param string $name * @return Folder */ public function setName($name) { } /** * Get the folder name. * @return string */ public function getName() { } /** * Set the folder path. * @param string $path * @return Folder */ public function setPath($path) { } /** * Get the folder path. * @return string */ public function getPath() { } /** * Set the folder fallback status. * @param boolean $fallback * @return Folder */ public function setFallback($fallback) { } /** * Get the folder fallback status. * @return boolean */ public function getFallback() { } } /** * A collection of template folders. */ class Folders { /** * Array of template folders. * @var array */ protected $folders = array(); /** * Add a template folder. * @param string $name * @param string $path * @param boolean $fallback * @return Folders */ public function add($name, $path, $fallback = false) { } /** * Remove a template folder. * @param string $name * @return Folders */ public function remove($name) { } /** * Get a template folder. * @param string $name * @return Folder */ public function get($name) { } /** * Check if a template folder exists. * @param string $name * @return boolean */ public function exists($name) { } } } namespace mindplay { /** * Pseudo-namespace for functions that generate human-readable string representations * of most types of PHP values. */ abstract class readable { /** * @var int strings longer than this number of characters will be truncated when formatting string-values */ public static $max_string_length = 120; /** * @var string[] map where PHP error severity code => constant name */ public static $severity_names = [E_ERROR => "E_ERROR", E_USER_ERROR => "E_USER_ERROR", E_CORE_ERROR => "E_CORE_ERROR", E_COMPILE_ERROR => "E_COMPILE_ERROR", E_PARSE => "E_PARSE", E_WARNING => "E_WARNING", E_USER_WARNING => "E_USER_WARNING", E_CORE_WARNING => "E_CORE_WARNING", E_COMPILE_WARNING => "E_COMPILE_WARNING", E_NOTICE => "E_NOTICE", E_USER_NOTICE => "E_USER_NOTICE", E_STRICT => "E_STRICT", E_RECOVERABLE_ERROR => "E_RECOVERABLE_ERROR", E_DEPRECATED => "E_DEPRECATED", E_USER_DEPRECATED => "E_USER_DEPRECATED"]; /** * @param mixed $value any type of PHP value * * @return string readable representation of the given value */ public static function value($value) { } /** * @param array $array array containing any type of PHP values * * @return string comma-separated human-readable representation of the given values */ public static function values(array $array) { } /** * @param mixed $value any type of PHP value * * @return string human-readable type-name */ public static function typeof($value) { } /** * @param mixed $callable * * @return string human-readable description of callback */ public static function callback($callable) { } /** * @param Exception|Error|Throwable|int $error an Exception, Error (or one of the E_* error severity constants) * * @return string */ public static function error($error) { } /** * @param int $severity one of the E_* error severity constants * * @return string */ public static function severity($severity) { } /** * @param array|Exception|Error|Throwable $source Exception, Error or stack-trace data as provided * by Exception::getTrace() or by debug_backtrace() * @param bool $with_params if TRUE, calls will be formatted with parameters * * @return string */ public static function trace($source, $with_params = true) { } } } namespace mindplay\middleman { /** * PSR-7 / PSR-15 middleware dispatcher */ class Dispatcher implements \Interop\Http\ServerMiddleware\MiddlewareInterface { /** * @param (callable|MiddlewareInterface|mixed)[] $stack middleware stack (with at least one middleware component) * @param callable|null $resolver optional middleware resolver: * function (string $name): MiddlewareInterface * * @throws InvalidArgumentException if an empty middleware stack was given */ public function __construct($stack, callable $resolver = null) { } /** * Dispatches the middleware stack and returns the resulting `ResponseInterface`. * * @param ServerRequestInterface $request * * @return ResponseInterface * * @throws LogicException on unexpected result from any middleware on the stack */ public function dispatch(\Psr\Http\Message\ServerRequestInterface $request) { } /** * @inheritdoc */ public function process(\Psr\Http\Message\ServerRequestInterface $request, \Interop\Http\ServerMiddleware\DelegateInterface $delegate) { } } /** * PSR-15 delegate wrapper for internal callbacks generated by {@see Dispatcher} during dispatch. * * @internal */ class Delegate implements \Interop\Http\ServerMiddleware\DelegateInterface { /** * @param callable $callback function (RequestInterface $request) : ResponseInterface */ public function __construct(callable $callback) { } /** * Dispatch the next available middleware and return the response. * * @param ServerRequestInterface $request * @return ResponseInterface */ public function process(\Psr\Http\Message\ServerRequestInterface $request) { } /** * Dispatch the next available middleware and return the response. * * This method duplicates `next()` to provide backwards compatibility with non-PSR 15 middleware. * * @param ServerRequestInterface $request * * @return ResponseInterface */ public function __invoke(\Psr\Http\Message\ServerRequestInterface $request) { } } /** * Optionally, pass this as `$resolver` to {@see Dispatcher::__construct()} to provide * integration with a dependency injection container - for example: * * $dispatcher = new Dispatcher( * [ * RouterMiddleware::class, * ErrorMiddleware::class, * ], * new InteropResolver($container) * ); * * Note that this resolver will ignore any middleware component that is not a string - so you * can mix component names with regular middleware closures, callable objects, and so on. * * You can use class-names or other component names, depending on what your container supports. * * @link https://github.com/container-interop/container-interop */ class ContainerResolver { /** * @param ContainerInterface $container */ public function __construct(\Interop\Container\ContainerInterface $container) { } public function __invoke($name) { } } } namespace React\Promise { interface PromiseInterface { /** * @return PromiseInterface */ public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); } interface CancellablePromiseInterface extends \React\Promise\PromiseInterface { /** * @return void */ public function cancel(); } class CancellationQueue { public function __invoke() { } public function enqueue($cancellable) { } } interface ExtendedPromiseInterface extends \React\Promise\PromiseInterface { /** * @return void */ public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); /** * @return ExtendedPromiseInterface */ public function otherwise(callable $onRejected); /** * @return ExtendedPromiseInterface */ public function always(callable $onFulfilledOrRejected); /** * @return ExtendedPromiseInterface */ public function progress(callable $onProgress); } class Promise implements \React\Promise\ExtendedPromiseInterface, \React\Promise\CancellablePromiseInterface { public function __construct(callable $resolver, callable $canceller = null) { } public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function otherwise(callable $onRejected) { } public function always(callable $onFulfilledOrRejected) { } public function progress(callable $onProgress) { } public function cancel() { } } class UnhandledRejectionException extends \RuntimeException { public static function resolve($reason) { } public function __construct($reason) { } public function getReason() { } } class RejectedPromise implements \React\Promise\ExtendedPromiseInterface, \React\Promise\CancellablePromiseInterface { public function __construct($reason = null) { } public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function otherwise(callable $onRejected) { } public function always(callable $onFulfilledOrRejected) { } public function progress(callable $onProgress) { } public function cancel() { } } class FulfilledPromise implements \React\Promise\ExtendedPromiseInterface, \React\Promise\CancellablePromiseInterface { public function __construct($value = null) { } public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function otherwise(callable $onRejected) { } public function always(callable $onFulfilledOrRejected) { } public function progress(callable $onProgress) { } public function cancel() { } } interface PromisorInterface { /** * @return PromiseInterface */ public function promise(); } class Deferred implements \React\Promise\PromisorInterface { public function __construct(callable $canceller = null) { } public function promise() { } public function resolve($value = null) { } public function reject($reason = null) { } public function notify($update = null) { } /** * @deprecated 2.2.0 * @see Deferred::notify() */ public function progress($update = null) { } } } namespace React\Promise\Exception { class LengthException extends \LengthException { } } namespace React\Promise { class LazyPromise implements \React\Promise\ExtendedPromiseInterface, \React\Promise\CancellablePromiseInterface { public function __construct(callable $factory) { } public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) { } public function otherwise(callable $onRejected) { } public function always(callable $onFulfilledOrRejected) { } public function progress(callable $onProgress) { } public function cancel() { } /** * @internal * @see Promise::settle() */ public function promise() { } } } namespace Abraham\TwitterOAuth { /** * Handle setting and storing config for TwitterOAuth. * * @author Abraham Williams */ class Config { /** @var int How long to wait for a response from the API */ protected $timeout = 5; /** @var int how long to wait while connecting to the API */ protected $connectionTimeout = 5; /** * Decode JSON Response as associative Array * * @see http://php.net/manual/en/function.json-decode.php * * @var bool */ protected $decodeJsonAsArray = false; /** @var string User-Agent header */ protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)'; /** @var array Store proxy connection details */ protected $proxy = []; /** @var bool Whether to encode the curl requests with gzip or not */ protected $gzipEncoding = true; /** @var integer Size for Chunked Uploads */ protected $chunkSize = 250000; // 0.25 MegaByte /** * Set the connection and response timeouts. * * @param int $connectionTimeout * @param int $timeout */ public function setTimeouts($connectionTimeout, $timeout) { } /** * @param bool $value */ public function setDecodeJsonAsArray($value) { } /** * @param string $userAgent */ public function setUserAgent($userAgent) { } /** * @param array $proxy */ public function setProxy(array $proxy) { } /** * Whether to encode the curl requests with gzip or not. * * @param boolean $gzipEncoding */ public function setGzipEncoding($gzipEncoding) { } /** * Set the size of each part of file for chunked media upload. * * @param int $value */ public function setChunkSize($value) { } } /** * A class for implementing a Signature Method * See section 9 ("Signing Requests") in the spec */ abstract class SignatureMethod { /** * Needs to return the name of the Signature Method (ie HMAC-SHA1) * * @return string */ public abstract function getName(); /** * Build up the signature * NOTE: The output of this function MUST NOT be urlencoded. * the encoding is handled in OAuthRequest when the final * request is serialized * * @param Request $request * @param Consumer $consumer * @param Token $token * * @return string */ public abstract function buildSignature(\Abraham\TwitterOAuth\Request $request, \Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token = null); /** * Verifies that a given signature is correct * * @param Request $request * @param Consumer $consumer * @param Token $token * @param string $signature * * @return bool */ public function checkSignature(\Abraham\TwitterOAuth\Request $request, \Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token, $signature) { } } class Util { /** * @param $input * * @return array|mixed|string */ public static function urlencodeRfc3986($input) { } /** * @param string $string * * @return string */ public static function urldecodeRfc3986($string) { } /** * This function takes a input like a=b&a=c&d=e and returns the parsed * parameters like this * array('a' => array('b','c'), 'd' => 'e') * * @param string $input * * @return array */ public static function parseParameters($input) { } /** * @param array $params * * @return string */ public static function buildHttpQuery(array $params) { } } class Request { protected $parameters; protected $httpMethod; protected $httpUrl; public static $version = '1.0'; /** * Constructor * * @param string $httpMethod * @param string $httpUrl * @param array|null $parameters */ public function __construct($httpMethod, $httpUrl, array $parameters = []) { } /** * pretty much a helper function to set up the request * * @param Consumer $consumer * @param Token $token * @param string $httpMethod * @param string $httpUrl * @param array $parameters * * @return Request */ public static function fromConsumerAndToken(\Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token = null, $httpMethod, $httpUrl, array $parameters = []) { } /** * @param string $name * @param string $value */ public function setParameter($name, $value) { } /** * @param $name * * @return string|null */ public function getParameter($name) { } /** * @return array */ public function getParameters() { } /** * @param $name */ public function removeParameter($name) { } /** * The request parameters, sorted and concatenated into a normalized string. * * @return string */ public function getSignableParameters() { } /** * Returns the base string of this request * * The base string defined as the method, the url * and the parameters (normalized), each urlencoded * and the concated with &. * * @return string */ public function getSignatureBaseString() { } /** * Returns the HTTP Method in uppercase * * @return string */ public function getNormalizedHttpMethod() { } /** * parses the url and rebuilds it to be * scheme://host/path * * @return string */ public function getNormalizedHttpUrl() { } /** * Builds a url usable for a GET request * * @return string */ public function toUrl() { } /** * Builds the data one would send in a POST request * * @return string */ public function toPostdata() { } /** * Builds the Authorization: header * * @return string * @throws TwitterOAuthException */ public function toHeader() { } /** * @return string */ public function __toString() { } /** * @param SignatureMethod $signatureMethod * @param Consumer $consumer * @param Token $token */ public function signRequest(\Abraham\TwitterOAuth\SignatureMethod $signatureMethod, \Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token = null) { } /** * @param SignatureMethod $signatureMethod * @param Consumer $consumer * @param Token $token * * @return string */ public function buildSignature(\Abraham\TwitterOAuth\SignatureMethod $signatureMethod, \Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token = null) { } /** * @return string */ public static function generateNonce() { } } class Consumer { /** @var string */ public $key; /** @var string */ public $secret; /** @var string|null */ public $callbackUrl; /** * @param string $key * @param string $secret * @param null $callbackUrl */ public function __construct($key, $secret, $callbackUrl = null) { } /** * @return string */ public function __toString() { } } } namespace Abraham\TwitterOAuth\Util { /** * @author louis */ class JsonDecoder { /** * Decodes a JSON string to stdObject or associative array * * @param string $string * @param bool $asArray * * @return array|object */ public static function decode($string, $asArray) { } } } namespace Abraham\TwitterOAuth { /** * TwitterOAuth class for interacting with the Twitter API. * * @author Abraham Williams */ class TwitterOAuth extends \Abraham\TwitterOAuth\Config { const API_VERSION = '1.1'; const API_HOST = 'https://api.twitter.com'; const UPLOAD_HOST = 'https://upload.twitter.com'; /** * Constructor * * @param string $consumerKey The Application Consumer Key * @param string $consumerSecret The Application Consumer Secret * @param string|null $oauthToken The Client Token (optional) * @param string|null $oauthTokenSecret The Client Token Secret (optional) */ public function __construct($consumerKey, $consumerSecret, $oauthToken = null, $oauthTokenSecret = null) { } /** * @param string $oauthToken * @param string $oauthTokenSecret */ public function setOauthToken($oauthToken, $oauthTokenSecret) { } /** * @return string|null */ public function getLastApiPath() { } /** * @return int */ public function getLastHttpCode() { } /** * @return array */ public function getLastXHeaders() { } /** * @return array|object|null */ public function getLastBody() { } /** * Resets the last response cache. */ public function resetLastResponse() { } /** * Make URLs for user browser navigation. * * @param string $path * @param array $parameters * * @return string */ public function url($path, array $parameters) { } /** * Make /oauth/* requests to the API. * * @param string $path * @param array $parameters * * @return array * @throws TwitterOAuthException */ public function oauth($path, array $parameters = []) { } /** * Make /oauth2/* requests to the API. * * @param string $path * @param array $parameters * * @return array|object */ public function oauth2($path, array $parameters = []) { } /** * Make GET requests to the API. * * @param string $path * @param array $parameters * * @return array|object */ public function get($path, array $parameters = []) { } /** * Make POST requests to the API. * * @param string $path * @param array $parameters * * @return array|object */ public function post($path, array $parameters = []) { } /** * Make DELETE requests to the API. * * @param string $path * @param array $parameters * * @return array|object */ public function delete($path, array $parameters = []) { } /** * Make PUT requests to the API. * * @param string $path * @param array $parameters * * @return array|object */ public function put($path, array $parameters = []) { } /** * Upload media to upload.twitter.com. * * @param string $path * @param array $parameters * @param boolean $chunked * * @return array|object */ public function upload($path, array $parameters = [], $chunked = false) { } } /** * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] * where the Signature Base String is the text and the key is the concatenated values (each first * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' * character (ASCII code 38) even if empty. * - Chapter 9.2 ("HMAC-SHA1") */ class HmacSha1 extends \Abraham\TwitterOAuth\SignatureMethod { /** * {@inheritDoc} */ public function getName() { } /** * {@inheritDoc} */ public function buildSignature(\Abraham\TwitterOAuth\Request $request, \Abraham\TwitterOAuth\Consumer $consumer, \Abraham\TwitterOAuth\Token $token = null) { } } /** * @author Abraham Williams */ class TwitterOAuthException extends \Exception { } class Token { /** @var string */ public $key; /** @var string */ public $secret; /** * @param string $key The OAuth Token * @param string $secret The OAuth Token Secret */ public function __construct($key, $secret) { } /** * Generates the basic string serialization of a token that a server * would respond to request_token and access_token calls with * * @return string */ public function __toString() { } } /** * The result of the most recent API request. * * @author Abraham Williams */ class Response { /** * @param string $apiPath */ public function setApiPath($apiPath) { } /** * @return string|null */ public function getApiPath() { } /** * @param array|object $body */ public function setBody($body) { } /** * @return array|object|string */ public function getBody() { } /** * @param int $httpCode */ public function setHttpCode($httpCode) { } /** * @return int */ public function getHttpCode() { } /** * @param array $headers */ public function setHeaders(array $headers) { } /** * @return array */ public function getsHeaders() { } /** * @param array $xHeaders */ public function setXHeaders(array $xHeaders = []) { } /** * @return array */ public function getXHeaders() { } } } namespace Bitpay { /** * Item that was sold * * @package Bitpay */ interface ItemInterface { /** * Used to display an item SKU code or part number to the buyer. Maximum string * length is 100 characters. * * @return string */ public function getCode(); /** * Used to display an item description to the buyer. Maximum string length is 100 * characters. * * @return string */ public function getDescription(); /** * @return float */ public function getPrice(); /** * @return integer */ public function getQuantity(); /** * default value: false * ● true: Indicates a physical item will be shipped (or picked up) * ● false: Indicates that nothing is to be shipped for this order * * @return boolean */ public function isPhysical(); } /** * Interface for an access token for the given client * * @package Bitpay */ interface AccessTokenInterface { /** * @return string */ public function getId(); /** * @return string */ public function getEmail(); /** * @return string */ public function getLabel(); } /** * @package Bitpay */ class AccessToken implements \Bitpay\AccessTokenInterface { /** * @var string */ protected $id; /** * @var string */ protected $email; /** * @var string */ protected $label; /** * Set various defaults for this object. */ public function __construct($id = null, $email = null, $label = null) { } /** * Setter for the id. * * @param string $id * @return AccessToken */ public function setId($id) { } /** * @inheritdoc */ public function getId() { } /** * Setter for the email address. * * @param string $email * @return AccessToken */ public function setEmail($email) { } /** * @inheritdoc */ public function getEmail() { } /** * Setter for the label. * * @param string $label * @return AccessToken */ public function setLabel($label) { } /** * @inheritdoc */ public function getLabel() { } } /** * @package Bitpay */ interface InvoiceInterface { /** * An invoice starts in this state.  When in this state and only in this state, payments * to the associated bitcoin address are credited to the invoice.  If an invoice has * received a partial payment, it will still reflect a status of new to the merchant * (from a merchant system perspective, an invoice is either paid or not paid, partial * payments and over payments are handled by bitpay.com by either refunding the * customer or applying the funds to a new invoice. */ const STATUS_NEW = 'new'; /** * As soon as full payment (or over payment) is received, an invoice goes into the * paid status. */ const STATUS_PAID = 'paid'; /** * The transaction speed preference of an invoice determines when an invoice is * confirmed.  For the high speed setting, it will be confirmed as soon as full * payment is received on the bitcoin network (note, the invoice will go from a status * of new to confirmed, bypassing the paid status).  For the medium speed setting, * the invoice is confirmed after the payment transaction(s) have been confirmed by * 1 block on the bitcoin network.  For the low speed setting, 6 blocks on the bitcoin * network are required.  Invoices are considered complete after 6 blocks on the * bitcoin network, therefore an invoice will go from a paid status directly to a * complete status if the transaction speed is set to low. */ const STATUS_CONFIRMED = 'confirmed'; /** * When an invoice is complete, it means that BitPay.com has credited the * merchant’s account for the invoice.  Currently, 6 confirmation blocks on the * bitcoin network are required for an invoice to be complete.  Note, in the future (for * qualified payers), invoices may move to a complete status immediately upon * payment, in which case the invoice will move directly from a new status to a * complete status. */ const STATUS_COMPLETE = 'complete'; /** * An expired invoice is one where payment was not received and the 15 minute * payment window has elapsed. */ const STATUS_EXPIRED = 'expired'; /** * An invoice is considered invalid when it was paid, but payment was not confirmed * within 1 hour after receipt.  It is possible that some transactions on the bitcoin * network can take longer than 1 hour to be included in a block.  In such * circumstances, once payment is confirmed, BitPay.com will make arrangements * with the merchant regarding the funds (which can either be credited to the * merchant account on another invoice, or returned to the buyer). */ const STATUS_INVALID = 'invalid'; /** * Code comment for each transaction speed */ const TRANSACTION_SPEED_HIGH = 'high'; const TRANSACTION_SPEED_MEDIUM = 'medium'; const TRANSACTION_SPEED_LOW = 'low'; /** * This is the amount that is required to be collected from the buyer. Note, if this is * specified in a currency other than BTC, the price will be converted into BTC at * market exchange rates to determine the amount collected from the buyer. * * @return float */ public function getPrice(); /** * This is the currency code set for the price setting.  The pricing currencies * currently supported are USD, EUR, BTC, and all of the codes listed on this page: * https://bitpay.com/bitcoin­exchange­rates * * @return CurrencyInterface */ public function getCurrency(); /** * If there is not an item already set, we need to use a default item * so that some methods do not throw errors about methods and * non-objects. * * @return ItemInterface */ public function getItem(); /** * @return BuyerInterface */ public function getBuyer(); /** * default value: set in your https://bitpay.com/order­settings, the default value set in * your merchant dashboard is “medium”. * * ● “high”: An invoice is considered to be "confirmed" immediately upon * receipt of payment. * ● “medium”: An invoice is considered to be "confirmed" after 1 block * confirmation (~10 minutes). * ● “low”: An invoice is considered to be "confirmed" after 6 block * confirmations (~1 hour). * * NOTE: Orders are posted to your Account Summary after 6 block confirmations * regardless of this setting. * * @return string */ public function getTransactionSpeed(); /** * Bitpay.com will send an email to this email address when the invoice status * changes. * * @return string */ public function getNotificationEmail(); /** * A URL to send status update messages to your server (this must be an https * URL, unencrypted http URLs or any other type of URL is not supported). * Bitpay.com will send a POST request with a JSON encoding of the invoice to * this URL when the invoice status changes. * * @return string */ public function getNotificationUrl(); /** * This is the URL for a return link that is displayed on the receipt, to return the * shopper back to your website after a successful purchase. This could be a page * specific to the order, or to their account. * * @return string */ public function getRedirectUrl(); /** * A passthru variable provided by the merchant and designed to be used by the * merchant to correlate the invoice with an order or other object in their system. * Maximum string length is 100 characters. * * @return array|object */ public function getPosData(); /** * The current invoice status. The possible states are described earlier in this * document. * * @return string */ public function getStatus(); /** * default value: false * ● true: Notifications will be sent on every status change. * ● false: Notifications are only sent when an invoice is confirmed (according * to the “transactionSpeed” setting). * * @return boolean */ public function isFullNotifications(); /** * The unique id of the invoice assigned by bitpay.com * * @return string */ public function getId(); /** * An https URL where the invoice can be viewed. * * @return string */ public function getUrl(); /** * The amount of bitcoins being requested for payment of this invoice (same as the * price if the merchant set the price in BTC). * * @return float */ public function getBtcPrice(); /** * The time the invoice was created in milliseconds since midnight January 1, * 1970. Time format is “2014­01­01T19:01:01.123Z”. * * @return DateTime */ public function getInvoiceTime(); /** * The time at which the invoice expires and no further payment will be accepted (in * milliseconds since midnight January 1, 1970). Currently, all invoices are valid for * 15 minutes. Time format is “2014­01­01T19:01:01.123Z”. * * @return DateTime */ public function getExpirationTime(); /** * The current time on the BitPay.com system (by subtracting the current time from * the expiration time, the amount of time remaining for payment can be * determined). Time format is “2014­01­01T19:01:01.123Z”. * * @return DateTime */ public function getCurrentTime(); /** * Used to display your public order number to the buyer on the BitPay invoice. In * the merchant Account Summary page, this value is used to identify the ledger * entry. Maximum string length is 100 characters. * * @return string */ public function getOrderId(); /** * Used to display an item description to the buyer. Maximum string length is 100 * characters. * * @deprecated * @return string */ public function getItemDesc(); /** * Used to display an item SKU code or part number to the buyer. Maximum string * length is 100 characters. * * @deprecated * @return string */ public function getItemCode(); /** * default value: false * ● true: Indicates a physical item will be shipped (or picked up) * ● false: Indicates that nothing is to be shipped for this order * * @deprecated * @return boolean */ public function isPhysical(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerName(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerAddress1(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerAddress2(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerCity(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerState(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerZip(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerCountry(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerEmail(); /** * These fields are used for display purposes only and will be shown on the invoice * if provided. Maximum string length of each field is 100 characters. * * @deprecated * @return string */ public function getBuyerPhone(); /** * Returns exception status. */ public function getExceptionStatus(); /** * Returns the amount of BTC paid. */ public function getBtcPaid(); /** * Returns the exchange rate. */ public function getRate(); /** * Returns the token for this resource. */ public function getToken(); /** * Returns a set of payment urls. * * @return PaymentUrlInterface */ public function getPaymentUrls(); } /** * @package Bitpay */ class Invoice implements \Bitpay\InvoiceInterface { /** * @var CurrencyInterface */ protected $currency = null; /** * @var string */ protected $orderId = ''; /** * @var ItemInterface */ protected $item = null; /** * @var string */ protected $transactionSpeed = ''; /** * @var string */ protected $notificationEmail = ''; /** * @var string */ protected $notificationUrl = ''; /** * @var string */ protected $redirectUrl = ''; /** * @var string */ protected $posData = ''; /** * @var string */ protected $status = ''; /** * @var boolean */ protected $fullNotifications = false; /** * @var string */ protected $id = ''; /** * @var string */ protected $url = ''; /** * @var float */ protected $btcPrice = 0.0; /** * @var \DateTime */ protected $invoiceTime = null; /** * @var \DateTime */ protected $expirationTime = null; /** * @var \DateTime */ protected $currentTime = null; /** * @var BuyerInterface */ protected $buyer = null; /** * @var string */ protected $exceptionStatus = ''; /** * @var float */ protected $btcPaid = 0.0; /** * @var float */ protected $rate = 0.0; /** * @var Token */ protected $token = null; /** * @var PaymentUrlInterface */ protected $paymentUrls = null; public function __construct($transactionSpeed = self::TRANSACTION_SPEED_LOW, $fullNotifications = false, $item = null, $currency = null, $orderId = '', $posData = '') { } /** * @inheritdoc */ public function getPrice() { } /** * @param float $price * @return Invoice */ public function setPrice($price) { } /** * @inheritdoc */ public function getCurrency() { } /** * @param CurrencyInterface $currency * @return Invoice */ public function setCurrency(\Bitpay\CurrencyInterface $currency) { } /** * @inheritdoc */ public function getItem() { } /** * @param ItemInterface $item * @return Invoice */ public function setItem(\Bitpay\ItemInterface $item) { } /** * @inheritdoc */ public function getBuyer() { } /** * @param BuyerInterface $buyer * @return Invoice */ public function setBuyer(\Bitpay\BuyerInterface $buyer) { } /** * @inheritdoc */ public function getTransactionSpeed() { } /** * @param string $transactionSpeed * @return Invoice */ public function setTransactionSpeed($transactionSpeed) { } /** * @inheritdoc */ public function getNotificationEmail() { } /** * @param string $notificationEmail * @return Invoice */ public function setNotificationEmail($notificationEmail) { } /** * @inheritdoc */ public function getNotificationUrl() { } /** * @param string $notificationUrl * @return Invoice */ public function setNotificationUrl($notificationUrl) { } /** * @inheritdoc */ public function getRedirectUrl() { } /** * @param string $redirectUrl * @return Invoice */ public function setRedirectUrl($redirectUrl) { } /** * @inheritdoc */ public function getPosData() { } /** * @param string $posData * @return Invoice */ public function setPosData($posData) { } /** * @inheritdoc */ public function getStatus() { } /** * @param string $status * @return Invoice */ public function setStatus($status) { } /** * @inheritdoc */ public function isFullNotifications() { } public function setFullNotifications($notifications) { } /** * @inheritdoc */ public function getId() { } /** * @param string $id * @return Invoice */ public function setId($id) { } /** * @inheritdoc */ public function getUrl() { } /** * @param string $url * @return Invoice */ public function setUrl($url) { } /** * @inheritdoc */ public function getBtcPrice() { } /** * @param float $btcPrice * @return Invoice */ public function setBtcPrice($btcPrice) { } /** * @inheritdoc */ public function getInvoiceTime() { } /** * @param \DateTime $invoiceTime * @return Invoice */ public function setInvoiceTime($invoiceTime) { } /** * @inheritdoc */ public function getExpirationTime() { } /** * @param \DateTime $expirationTime * return Invoice */ public function setExpirationTime($expirationTime) { } /** * @inheritdoc */ public function getCurrentTime() { } /** * @param \DateTime $currentTime * @return Invoice */ public function setCurrentTime($currentTime) { } /** * @inheritdoc */ public function getOrderId() { } /** * @param string $orderId * @return Invoice */ public function setOrderId($orderId) { } /** * @inheritdoc */ public function getItemDesc() { } /** * @inheritdoc */ public function getItemCode() { } /** * @inheritdoc */ public function isPhysical() { } /** * @inheritdoc */ public function getBuyerName() { } /** * @inheritdoc */ public function getBuyerAddress1() { } /** * @inheritdoc */ public function getBuyerAddress2() { } /** * @inheritdoc */ public function getBuyerCity() { } /** * @inheritdoc */ public function getBuyerState() { } /** * @inheritdoc */ public function getBuyerZip() { } /** * @inheritdoc */ public function getBuyerCountry() { } /** * @inheritdoc */ public function getBuyerEmail() { } /** * @inheritdoc */ public function getBuyerPhone() { } /** * @inheritdoc */ public function getExceptionStatus() { } /** * @param * @return Invoice */ public function setExceptionStatus($exceptionStatus) { } /** * @param void * @return */ public function getBtcPaid() { } /** * @param * @return Invoice */ public function setBtcPaid($btcPaid) { } /** * @param void * @return Invoice */ public function getRate() { } /** * @param * @return */ public function setRate($rate) { } /** * @return TokenInterface */ public function getToken() { } /** * @param TokenInterface $token * @return Invoice */ public function setToken(\Bitpay\TokenInterface $token) { } /** * @return PaymentUrlInterface */ public function getPaymentUrls() { } /** * @param PaymentUrlInterface $paymentUrls * @return Invoice */ public function setPaymentUrls(\Bitpay\PaymentUrlInterface $paymentUrls) { } /** * @param string $paymentUrlType * @return string */ public function getPaymentUrl($paymentUrlType) { } } /** * Interface PaymentUrlInterface * @package Bitpay */ interface PaymentUrlInterface { /** * This is a list of returned payment url types * */ const BIP_21 = 'BIP21'; const BIP_72 = 'BIP72'; const BIP_72B = 'BIP72b'; const BIP_73 = 'BIP73'; /** * Return the account parameter given by Bitpay. * * @return string */ public function getUrl($urlType); } /** * @package Bitpay */ class PaymentUrlSet implements \Bitpay\PaymentUrlInterface { /** * @var array */ protected $paymentUrls; public function __construct(array $paymentUrls = array()) { } /** * Return the account parameter given by Bitpay. * * @return string */ public function getUrl($urlType) { } /** * Return the account parameter given by Bitpay. * * @return PaymentUrlInterface */ public function setUrls(array $paymentUrls) { } } } namespace Bitpay\Client { /** * @package Bitpay */ class ConnectionException extends \Exception { } /** * @package Bitpay */ interface ResponseInterface { /** * @return string */ public function getBody(); /** * Returns the status code of the response * * @return integer */ public function getStatusCode(); /** * Returns a $key => $value array of http headers * * @return array */ public function getHeaders(); } /** * @package Bitpay */ interface RequestInterface { const METHOD_POST = 'POST'; const METHOD_GET = 'GET'; const METHOD_PUT = 'PUT'; const METHOD_DELETE = 'DELETE'; /** * Returns the method for this request * * @return string */ public function getMethod(); /** * Should always return https * * @return string */ public function getSchema(); /** * Returns the host to send the request to. The host would be something * such as `test.bitpay.com` or `bitpay.com` * * @return string */ public function getHost(); /** * Returns port to send request on * * @return integer */ public function getPort(); /** * example of path is `api/invoice` as this is appended to $host * * @return string */ public function getPath(); /** * Returns $schema://$host:$port/$path * * @return string */ public function getUri(); /** * Checks the request to see if the method matches a known value * * @param string $method * * @return boolean */ public function isMethod($method); /** * Returns the request body * * @return string */ public function getBody(); /** * Returns a $key => $value array of http headers * * @return array */ public function getHeaders(); } /** * Generic Request object used to send requests to servers * * @package Bitpay */ class Request implements \Bitpay\Client\RequestInterface { /** * @var array */ protected $headers; /** * @var string */ protected $body; /** * $schema://$hostname/$path * * @var string */ protected $uri; /** * See the RequestInterface for all the valid methods * * @var string */ protected $method; /** * This should be something such as `test.bitpay.com` or just `bitpay.com` * * @var string */ protected $host; /** * The path is added to the end of the host * * @var string */ protected $path; /** * Default is 443 but should be changed by whatever is passed in through the Adapter. * * @var integer */ protected $port; public function __construct() { } /** * Converts this request into a standard HTTP/1.1 message to be sent over * the wire. * * @return string */ public function __toString() { } /** * @inheritdoc */ public function isMethod($method) { } /** * @inheritdoc */ public function getPort() { } /** * @inheritdoc */ public function setPort($port) { } /** * @inheritdoc */ public function getMethod() { } /** * Set the method of the request, for known methods see the * RequestInterface. * * @param string $method */ public function setMethod($method) { } /** * @inheritdoc */ public function getSchema() { } /** * @inheritdoc */ public function getUri() { } /** * @inheritdoc */ public function getUriWithPort() { } /** * @inheritdoc */ public function getHost() { } /** * Sets the host for the request. * * @param string $host * @return Request */ public function setHost($host) { } /** * @inheritdoc */ public function getHeaders() { } /** * @return array */ public function getHeaderFields() { } /** * @return string */ public function getHeadersAsString() { } /** * Set a http header for the request. * * @param string $header * @param string $value * @throws \Exception */ public function setHeader($header, $value) { } /** * @inheritdoc */ public function getBody() { } /** * Sets the body of the request. * * @param string $body * @return Request */ public function setBody($body) { } /** * @inheritdoc */ public function getPath() { } /** * @param string $host * @return Request */ public function setPath($path) { } } } namespace Bitpay\Client\Adapter { /** * A client can be configured to use a specific adapter to make requests, by * default the CurlAdapter is what is used. * * @package Bitpay */ interface AdapterInterface { /** * Send a request to BitPay. * * @param \Bitpay\Client\Request $request * @return \Bitpay\Client\Response */ public function sendRequest(\Bitpay\Client\Request $request); } /** * Adapter class that sends Request objects using cURL. * * @package Bitpay */ class CurlAdapter implements \Bitpay\Client\Adapter\AdapterInterface { /** * @var array */ protected $curlOptions; /** * @param array $curlOptions */ public function __construct(array $curlOptions = array()) { } /** * Returns an array of cURL settings to use * * @return array */ public function getCurlOptions() { } /** * @inheritdoc */ public function sendRequest(\Bitpay\Client\Request $request) { } } } namespace Bitpay\Client { /** * @package Bitpay */ class BitpayException extends \Exception { } /** * @package Bitpay */ class ArgumentException extends \Exception { } /** * Generic Response class used to parse a response from a server. * * @package Bitpay */ class Response implements \Bitpay\Client\ResponseInterface { /** * @var string */ protected $raw; /** * @var array */ protected $headers; /** * @var string */ protected $body; /** * @var integer */ protected $statusCode; public function __construct($raw = null) { } /** * Returns the raw http response * * @return string */ public function __toString() { } /** * @param Response */ public static function createFromRawResponse($rawResponse) { } /** * @inheritdoc */ public function getStatusCode() { } /** * @param integer * @return Response */ public function setStatusCode($statusCode) { } /** * @inheritdoc */ public function getBody() { } /** * Set the body of the response * * @param string $body * @return Response */ public function setBody($body) { } /** * @inheritdoc */ public function getHeaders() { } /** * @param string $header * @param string $value * @return Response */ public function setHeader($header, $value) { } } } namespace Bitpay { /** * @package Bitpay */ interface UserInterface { /** * @return string */ public function getPhone(); /** * @return string */ public function getEmail(); /** * @return string */ public function getFirstName(); /** * @return string */ public function getLastName(); /** * $address = array($lineOne, $lineTwo); * * @return array */ public function getAddress(); /** * @return string */ public function getCity(); /** * @return string */ public function getState(); /** * @return string */ public function getZip(); /** * @return string */ public function getCountry(); } /** * @package Bitpay */ interface BuyerInterface extends \Bitpay\UserInterface { } /** * @package Bitpay */ class User implements \Bitpay\UserInterface { /** * @var string */ protected $phone; /** * @var string */ protected $email; /** * @var string */ protected $firstName; /** * @var string */ protected $lastName; /** * @var array */ protected $address; /** * @var string */ protected $city; /** * @var string */ protected $state; /** * @var string */ protected $zip; /** * @var string */ protected $country; /** * @var bool */ protected $agreedToTOSandPP; /** * @inheritdoc */ public function getPhone() { } /** * @param string $phone * @return User */ public function setPhone($phone) { } /** * @inheritdoc */ public function getEmail() { } /** * @param string $email * @return User */ public function setEmail($email) { } /** * @inheritdoc */ public function getFirstName() { } /** * @param string $firstName * @return User */ public function setFirstName($firstName) { } /** * @inheritdoc */ public function getLastName() { } /** * @param string $lastName * @return User */ public function setLastName($lastName) { } /** * @inheritdoc */ public function getAddress() { } /** * @param array $address * @return User */ public function setAddress(array $address) { } /** * @inheritdoc */ public function getCity() { } /** * @param string $city * @return User */ public function setCity($city) { } /** * @inheritdoc */ public function getState() { } /** * @param string $state * @return User */ public function setState($state) { } /** * @inheritdoc */ public function getZip() { } /** * @param string $zip * @return User */ public function setZip($zip) { } /** * @inheritdoc */ public function getCountry() { } /** * @param string $country * @return User */ public function setCountry($country) { } /** * @param bool $boolvalue * @return User */ public function setAgreedToTOSandPP($boolvalue) { } /** * @return bool */ public function getAgreedToTOSandPP() { } } /** * * @package Bitpay */ class Buyer extends \Bitpay\User implements \Bitpay\BuyerInterface { } } namespace Bitpay\Storage { /** * @package Bitpay */ interface StorageInterface { /** * @param KeyInterface $key */ public function persist(\Bitpay\KeyInterface $key); /** * @param string $id * @return KeyInterface */ public function load($id); } /** * @codeCoverageIgnore * @package Bitpay */ class MockStorage implements \Bitpay\Storage\StorageInterface { /** * @param Key $key */ public function persist(\Bitpay\KeyInterface $key) { } /** * @param string $id * @return void */ public function load($id) { } } /** * @package Bitpay */ class EncryptedFilesystemStorage implements \Bitpay\Storage\StorageInterface { /** * Initialization Vector */ const IV = '0000000000000000'; /** * @var string */ const METHOD = 'AES-128-CBC'; /** * @var int */ const OPENSSL_RAW_DATA = 1; /** * @param string $password */ public function __construct($password) { } /** * @inheritdoc */ public function persist(\Bitpay\KeyInterface $key) { } /** * @inheritdoc */ public function load($id) { } } /** * Used to persist keys to the filesystem. * * @package Bitpay */ class FilesystemStorage implements \Bitpay\Storage\StorageInterface { /** * @inheritdoc */ public function persist(\Bitpay\KeyInterface $key) { } /** * @inheritdoc */ public function load($id) { } } } namespace Bitpay { /** * Creates a bill for the calling merchant. * * @package Bitpay */ interface BillInterface { /** * @return array */ public function getItems(); /** * @return Currency */ public function getCurrency(); /** * @return string */ public function getName(); /** * $address = array($lineOne, $lineTwo); * * @return array */ public function getAddress(); /** * @return string */ public function getCity(); /** * @return string */ public function getState(); /** * @return string */ public function getZip(); /** * @return string */ public function getCountry(); /** * @return string */ public function getEmail(); /** * @return string */ public function getPhone(); /** * @return string */ public function getStatus(); /** * @return string */ public function getShowRate(); /** * @return boolean */ public function getArchived(); } /** * * @package Bitpay */ class Bill implements \Bitpay\BillInterface { /** * @var array */ protected $items; /** * @var Currency */ protected $currency; /** * @var string */ protected $name; /** * @var array */ protected $address; /** * @var string */ protected $city; /** * @var string */ protected $state; /** * @var string */ protected $zip; /** * @var string */ protected $country; /** * @var string */ protected $email; /** * @var string */ protected $phone; /** * @var string */ protected $status; /** * @var string */ protected $showRate; /** * @var boolean */ protected $archived; public function __construct() { } /** * @inheritdoc */ public function getItems() { } /** * @param Item $item * @return Bill */ public function addItem(\Bitpay\Item $item) { } /** * @inheritdoc */ public function getCurrency() { } /** * @param Currency $currency * @return Bill */ public function setCurrency(\Bitpay\Currency $currency) { } /** * @inheritdoc */ public function getName() { } /** * @param string $name * @return Bill */ public function setName($name) { } /** * @inheritdoc */ public function getAddress() { } /** * @param array $address * @return Bill */ public function setAddress($address) { } /** * @inheritdoc */ public function getCity() { } /** * @param string $city * @return Bill */ public function setCity($city) { } /** * @inheritdoc */ public function getState() { } /** * @param string $state * @return Bill */ public function setState($state) { } /** * @inheritdoc */ public function getZip() { } /** * @param string $zip * @return Bill */ public function setZip($zip) { } /** * @inheritdoc */ public function getCountry() { } /** * @param string $country * @return Bill */ public function setCountry($country) { } /** * @inheritdoc */ public function getEmail() { } /** * @param string $email * @return Bill */ public function setEmail($email) { } /** * @inheritdoc */ public function getPhone() { } /** * @param string $phone * @return Bill */ public function setPhone($phone) { } /** * @inheritdoc */ public function getStatus() { } /** * @param string $status * @return Bill */ public function setStatus($status) { } /** * @inheritdoc */ public function getShowRate() { } /** * @param string $showRate * @return Bill */ public function setShowRate($showRate) { } /** * @inheritdoc */ public function getArchived() { } /** * @param boolean $archived * @return Bill */ public function setArchived($archived) { } } /** * Sets up container and prepares for dependency injection. * * @package Bitpay */ class Bitpay { /** * @var ContainerBuilder */ protected $container; /** * First argument can either be a string or fullpath to a yaml file that * contains configuration parameters. For a list of configuration values * see \Bitpay\Config\Configuration class * * The second argument is the container if you want to build one by hand. * * @param array|string $config * @param null|ContainerBuilder $container */ public function __construct($config = array(), \Symfony\Component\DependencyInjection\ContainerBuilder $container = null) { } /** * Initialize the container * * @param array|string $config */ protected function initializeContainer($config) { } /** * Build the container of services and parameters. * * @param array|string $config * @return ContainerBuilder */ protected function buildContainer($config) { } /** * @return array */ protected function getParameters() { } /** * @return ContainerBuilder */ public function getContainer() { } /** * @return object|null */ public function get($service) { } } } namespace Bitpay\Network { /** * * @package Bitcore */ interface NetworkInterface { /** * Name of network, currently on livenet and testnet * * @return string */ public function getName(); /** * @return string */ public function getAddressVersion(); /** * The host that is used to interact with this network * * @see https://github.com/bitpay/insight * @see https://github.com/bitpay/insight-api * * @return string */ public function getApiHost(); /** * The port of the host * * @return integer */ public function getApiPort(); } /** * * @package Bitcore */ class Customnet implements \Bitpay\Network\NetworkInterface { protected $host_url; protected $host_port; public $isPortRequiredInUrl; public function __construct($url, $port, $isPortRequiredInUrl = false) { } public function getName() { } public function getAddressVersion() { } public function getApiHost() { } public function getApiPort() { } } /** * * @package Bitcore */ interface NetworkAwareInterface { /** * Set the network the object will work with * * @param NetworkInterface $network */ public function setNetwork(\Bitpay\Network\NetworkInterface $network = null); } /** * @package Bitpay */ class Testnet implements \Bitpay\Network\NetworkInterface { public function getName() { } public function getAddressVersion() { } public function getApiHost() { } public function getApiPort() { } } /** * * @package Bitcore */ abstract class NetworkAware implements \Bitpay\Network\NetworkAwareInterface { /** * @var NetworkInterface */ protected $network; /** * @inheritdoc */ public function setNetwork(\Bitpay\Network\NetworkInterface $network = null) { } } /** * * @package Bitcore */ class Livenet implements \Bitpay\Network\NetworkInterface { public function getName() { } public function getAddressVersion() { } public function getApiHost() { } public function getApiPort() { } } } namespace Bitpay { /** * Class PayoutTransaction * @package Bitpay */ interface PayoutTransactionInterface { /** * Get bitcoin blockchain transaction ID for the payout transaction. * @return mixed */ public function getTransactionID(); /** * The amount of bitcoin paid. * @return float */ public function getAmount(); /** * The date and time when the payment was sent. * @return string */ public function getDate(); } /** * Class PayoutTransaction * @package Bitpay */ class PayoutTransaction implements \Bitpay\PayoutTransactionInterface { /** * @var string */ protected $txid; /** * @var float */ protected $amount; /** * @var string */ protected $date; /** * @inheritdoc */ public function getTransactionId() { } /** * Set transaction ID for payout. * @param $txid * @return $this */ public function setTransactionId($txid) { } /** * @inheritdoc */ public function getAmount() { } /** * Set the amount of bitcoin paid in the paout. * @param $amount * @return $this */ public function setAmount($amount) { } /** * @inheritdoc */ public function getDate() { } /** * Set the date and time of when the payment was sent. * @param $date * @return $this */ public function setDate($date) { } } } namespace Bitpay\Util { interface CurveParameterInterface { public function aHex(); public function bHex(); public function gHex(); public function gxHex(); public function gyHex(); public function hHex(); public function nHex(); public function pHex(); } /** * Elliptic curve parameters for secp256k1, see: * http://www.secg.org/collateral/sec2_final.pdf * also: * * @see https://en.bitcoin.it/wiki/Secp256k1 * @package Bitpay */ class Secp256k1 implements \Bitpay\Util\CurveParameterInterface { const A = '00'; const B = '07'; const G = '0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8'; const H = '01'; const N = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141'; const P = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F'; public function aHex() { } public function bHex() { } public function gHex() { } public function gxHex() { } public function gyHex() { } public function hHex() { } public function nHex() { } public function pHex() { } } /** * Utility class used by string and arbitrary integer methods. * * @package Bitpay */ class Util { /** * @var string */ const HEX_CHARS = '0123456789abcdef'; /** * Computes a digest hash value for the given data using * the given method, and returns a raw or binhex encoded * string. Uses the OpenSSL extension. * * @see http://us1.php.net/manual/en/function.openssl-digest.php * @param string $data * @param boolean $binary * @return string */ public static function sha256($data, $binary = false) { } /** * Computes a digest hash value for the given data using * the given method, and returns a raw or binhex encoded * string. Uses the OpenSSL extension. * * @see http://us1.php.net/manual/en/function.openssl-digest.php * @param string $data * @return string */ public static function sha512($data) { } /** * Generate a keyed hash value using the HMAC method. * * @see http://us1.php.net/manual/en/function.hash-hmac.php * @param string $data * @param string $key * @return string */ public static function sha512hmac($data, $key) { } /** * Uses the OpenSSL extention to calculate the RIPDEMD160 * hash of a value. * * @see http://php.net/manual/en/function.openssl-digest.php * @param string $data * @param boolean $binary * @return string */ public static function ripe160($data, $binary = false) { } /** * Returns a SHA256 hash of a RIPEMD160 hash of a value. * * @param string $data * @return string */ public static function sha256ripe160($data) { } /** * Returns a double SHA256 hash of a value. * * @param string $data * @param boolean $binary * @return string */ public static function twoSha256($data, $binary = false) { } /** * Returns a GUID for use in REST calls. * * @see http://en.wikipedia.org/wiki/Globally_unique_identifier * @return string */ public static function guid() { } /** * Encodes a decimal value into hexadecimal. * * @param string $dec * @return string * @throws \Exception */ public static function encodeHex($dec) { } /** * Decodes a hexadecimal value into decimal. * * @param string $hex * @return string * @throws \Exception */ public static function decodeHex($hex) { } /** * Calculates a new EC curve point. * * @param string $hex * @param PointInterface $point * @param CurveParameterInterface $parameters * @return Point */ public static function doubleAndAdd($hex, \Bitpay\PointInterface $point, \Bitpay\Util\CurveParameterInterface $parameters = null) { } /** * This method returns a binary string representation of * the decimal number. Used for the doubleAndAdd() method. * * @see http://php.net/manual/en/function.decbin.php (but for large numbers) * @param string $dec * @return string $bin */ public static function decToBin($dec) { } /** * Point multiplication method 2P = R where * s = (3xP2 + a)/(2yP) mod p * xR = s2 - 2xP mod p * yR = -yP + s(xP - xR) mod p * * @param PointInterface $point * @param CurveParameterInterface $parameters * @return PointInterface * @throws \Exception */ public static function pointDouble(\Bitpay\PointInterface $point, \Bitpay\Util\CurveParameterInterface $parameters = null) { } /** * Point addition method P + Q = R where: * s = (yP - yQ)/(xP - xQ) mod p * xR = s2 - xP - xQ mod p * yR = -yP + s(xP - xR) mod p * * @param PointInterface $P * @param PointInterface $Q * @return PointInterface */ public static function pointAdd(\Bitpay\PointInterface $P, \Bitpay\PointInterface $Q) { } /** * Converts hex value into octet (byte) string. * * @param string $hex * @return string $byte */ public static function binConv($hex) { } /** * Checks dependencies for the library. * * @return array list of each requirement, boolean true if met, string error message if not as value */ public static function checkRequirements() { } } /** * Utility class for encoding/decoding BASE-58 data * * @package Bitpay */ final class Base58 { /** * @var string */ const BASE58_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; /** * Encodes a numeric string into BASE-58 format. * * @param string $data * @return string $output_string * @throws \Exception */ public static function encode($data) { } /** * Decodes a numeric string from BASE-58 format. * * @param string $data * @return string $return */ public static function decode($data) { } } /** * Utility class for generating an operating system & enivironment fingerprint. * * @package Bitpay */ class Fingerprint { protected static $sigData; protected static $finHash; /** * Generates a string of environment information and * takes the hash of that value to use as the env * fingerprint. * * @return string */ public static final function generate() { } } /** * General error class. * * @package Bitpay */ class Error { /** * Generates a backtrace and returns an array of associative * arrays or prints to stdout. The possible returned elements * are as follows: function, line, file, class, object, type * and args. * (PHP 4 >= 4.3.0, PHP 5) * * @param bool * @param bool * @param int * @return array|void */ public final function backtrace($print = false, $options = false, $limit = 0) { } /** * Get the last occurred error and returns an associative * array describing the last error with keys "type", "message", * "file" and "line". If the error has been caused by a PHP * internal function then the "message" begins with its name. * Returns NULL if there hasn't been an error yet. * (PHP 5 >= 5.2.0) * * @param void * @return array */ public final function last() { } /** * Send an error message to the defined error handling * routines. Returns true on success or false on failure. * The possible values for $message_type are: 0 = system log, * 1 = email to $destination, 2 = depricated, 3 = appended * to file $destination, 4 = sent to SAPI log handler. * (PHP 4, PHP 5) * * @param string * @param int * @param string * @param string */ public final function log($message, $message_type = 0, $destination = '', $extra_headers = '') { } /** * Sets which PHP errors are reported or returns the old * error_reporting level or the current level if no level * parameter is given. * (PHP 4, PHP 5) * * @param bool * @return int */ public final function reporting($level = false) { } /** * Sets or restores either the error or exception handler * based on the $type and $action parameters. * (PHP 4 >= 4.0.1, PHP 5) * * @param string * @param string * @param mixed * @param int * return mixed */ public final function handler($type = 'error', $action = 'restore', $callable_handler = false, $error_types = null) { } /** * Generates a user-level error/warning/notice message. * This function returns FALSE if wrong $error_type is * specified, TRUE otherwise. The $error_msg param is * limited to 1024 bytes. * (PHP 4 >= 4.0.1, PHP 5) * * @param string * @param int * @return bool */ public final function raise($error_msg, $error_type = E_USER_NOTICE) { } } /** * Generates cryptographically-secure random numbers using the OpenSSL extension. * * @package Bitpay */ class SecureRandom { /** * @var boolean */ protected static $hasOpenSSL; /** * Generates 32 bytes of random data using the OpenSSL extension. * * @see http://php.net/manual/en/function.openssl-random-pseudo-bytes.php * @param integer $bytes * @return string $random * @throws \Exception */ public static function generateRandom($bytes = 32) { } /** * Returns true/false if the OpenSSL extension is installed & enabled. * * @return boolean */ public static function hasOpenSSL() { } } } namespace Bitpay\Math { class Math { public static function setEngine($engine) { } public static function getEngine() { } public static function __callStatic($name, $arguments) { } } /** * @package Bitcore */ interface EngineInterface { /** * @param String $a Numeric String * @param String $b Numeric String */ public function add($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function cmp($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function div($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function invertm($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function mod($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function mul($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function pow($a, $b); /** * @param String $a Numeric String * @param String $b Numeric String */ public function sub($a, $b); } class GmpEngine implements \Bitpay\Math\EngineInterface { /** * @param String $a Numeric String * @param String $b Numeric String */ public function add($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function cmp($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function div($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function invertm($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function mod($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function mul($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function pow($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function sub($a, $b) { } } class BcEngine implements \Bitpay\Math\EngineInterface { const HEX_CHARS = '0123456789abcdef'; /** * @param String $a Numeric String * @param String $b Numeric String */ public function __construct() { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function add($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function cmp($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function div($a, $b) { } /** * Finds inverse number $inv for $num by modulus $mod, such as: * $inv * $num = 1 (mod $mod) * * @param string $num * @param string $mod * @return string * @access public */ public function invertm($num, $mod) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function mod($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function mul($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function pow($a, $b) { } /** * @param String $a Numeric String * @param String $b Numeric String */ public function sub($a, $b) { } public function input($x) { } /** * Function to determine if two numbers are * co-prime according to the Euclidean algo. * * @param string $a First param to check. * @param string $b Second param to check. * @return bool Whether the params are cp. */ public function coprime($a, $b) { } } } namespace Bitpay { /** * @package Bitpay */ class Item implements \Bitpay\ItemInterface { /** * @var string */ protected $code; /** * @var string */ protected $description; /** * @var float */ protected $price; /** * @var integer */ protected $quantity; /** * @var boolean */ protected $physical; public function __construct() { } /** * @inheritdoc */ public function getCode() { } /** * @param string $code * @return ItemInterface */ public function setCode($code) { } /** * @inheritdoc */ public function getDescription() { } /** * @param string $description * @return ItemInterface */ public function setDescription($description) { } /** * @inheritdoc */ public function getPrice() { } /** * @param mixed $price A float, integer, or en_US formatted numeric string * @return Item */ public function setPrice($price) { } /** * @inheritdoc */ public function getQuantity() { } /** * @param integer $quantity * @return Item */ public function setQuantity($quantity) { } /** * @inheritdoc */ public function isPhysical() { } /** * @param boolean $physical * @return Item */ public function setPhysical($physical) { } /** * Checks the new price to include BTC * values with more than 6 decimals. * * @param string $price The price value to check * @throws \Exception */ protected function checkPriceFormat($price) { } } /** * @package Bitpay */ class PublicKey extends \Bitpay\Key { /** * @var SinKey */ protected $sin; /** * @var PrivateKey */ protected $privateKey; /** * Returns the compressed public key value * * @return string */ public function __toString() { } /** * @param PrivateKey * @return PublicKey */ public static function createFromPrivateKey(\Bitpay\PrivateKey $private) { } /** * @param PrivateKey * @return PublicKey */ public function setPrivateKey(\Bitpay\PrivateKey $privateKey) { } /** * Generates an uncompressed and compressed EC public key. * * @param \Bitpay\PrivateKey $privateKey * @return \Bitpay\PublicKey * @throws \Exception */ public function generate(\Bitpay\PrivateKey $privateKey = null) { } /** * Checks to see if the public key is not blank and contains * valid decimal and hex valules for this->hex & this->dec * * @return boolean */ public function isValid() { } /** * @return SinKey */ public function getSin() { } } /** * Interface PayoutInstructionInterface * @package Bitpay */ interface PayoutInstructionInterface { /** * Get Bitpay ID for this instruction. * @return string */ public function getId(); /** * Get Label for instruction payout. * @return string */ public function getLabel(); /** * Get the bitcoin address for the recipient. * @return string */ public function getAddress(); /** * Return the amount to pay the recipient. * @return string */ public function getAmount(); /** * Get the BTC array (once rates are set) * @return array */ public function getBtc(); /** * Return the status of this payout instruction * @return string */ public function getStatus(); /** * Return the transactions for this payout * @return array */ public function getTransactions(); } /** * @package BitPay */ class SinKey extends \Bitpay\Key { /** * Type 2 (ephemeral) */ const SIN_TYPE = '02'; /** * Always the prefix! * (well, right now) */ const SIN_VERSION = '0F'; /** * @var string */ protected $value; /** * @var PublicKey */ protected $publicKey; /** * @return string */ public function __toString() { } /** * @param PublicKey * @return SinKey */ public function setPublicKey(\Bitpay\PublicKey $publicKey) { } /** * Generates a Service Identification Number (SIN), see: * https://en.bitcoin.it/wiki/Identity_protocol_v1 * * @return SinKey * @throws \Exception */ public function generate() { } /** * Checks to make sure that this SIN is a valid object. * * @return boolean */ public function isValid() { } } /** * Creates an application for a new merchant account. * * @package Bitpay */ interface ApplicationInterface { /** * @return array */ public function getUsers(); /** * @return array */ public function getOrgs(); } /** * @package Bitpay */ class Application implements \Bitpay\ApplicationInterface { /** * @var array */ protected $users; /** * @var array */ protected $orgs; public function __construct() { } /** * @inheritdoc */ public function getUsers() { } /** * @inheritdoc */ public function getOrgs() { } /** * Add user to stack * * @param User $user * @return Application */ public function addUser(\Bitpay\User $user) { } /** * Add org to stack * * @param Org $org * @return Application */ public function addOrg(\Bitpay\Org $org) { } } /** * @package Bitpay */ class Autoloader { /** * Register the autoloader, by default this will put the BitPay autoloader * first on the stack, to append the autoloader, pass `false` as an argument. * * Some applications will throw exceptions if the class isn't found and * some are not compatible with PSR standards. * * @param boolean $prepend * @throws \Exception */ public static function register($prepend = true) { } /** * Unregister this autoloader. * * @param boolean $ignoreFailures * @throws \Exception */ public static function unregister($ignoreFailures = true) { } /** * Give a class name and it will require the file. * * @param string $class * @return bool|null * @throws \Exception */ public static function autoload($class) { } } /** * Interface PayoutInterface * @package Bitpay */ interface PayoutInterface { /** * The payroll flow begins with the payroll provider creating a payout request, * using the payroll facade. */ const STATUS_NEW = 'new'; /** * Once Bitpay receives a corresponding ACH transfer from the payroll provider, * the finance group marks the payout as 'funded'. */ const STATUS_FUNDED = 'funded'; /** * A payout is marked as processing when it has begun to be processed, but * is not yet complete. */ const STATUS_PROCESSING = 'processing'; /** * A batch is marked as complete when all payments have been delivered to the * destinations. */ const STATUS_COMPLETE = 'complete'; /** * A payout can be cancelled by making a request on the API with a payout specific * token (returned when payout was requested) */ const STATUS_CANCELLED = 'cancelled'; /** * The batch ID of the payout assigned by Bitpay.com * * @return string */ public function getId(); /** * Return the account parameter given by Bitpay. * * @return string */ public function getAccountId(); /** * This is the total amount of the batch. Note, this amount must equal the sum of * the amounts paid to the individual addresses. Adding an instruction to a payout * will automatically increase this value. * * @return float */ public function getAmount(); /** * This will return the Bitcoin amount for this transaction. This * should only be called once the payout is funded * * @return float */ public function getBtcAmount(); /** * This is the currency code set for the batch amount. The pricing currencies * currently supported are USD and EUR. * * @return \Bitpay\CurrencyInterface */ public function getCurrency(); /** * The date and time when the batch should be sent. The time is in milliseconds * since midnight January 1, 1970. * * @return \DateTime */ public function getEffectiveDate(); /** * The date and time when the batch was created by the payee. The time is in milliseconds * since midnight January 1, 1970. * * @return \DateTime */ public function getRequestDate(); /** * This is an array containing the details of the batch. Each payment instruction * entry specifies the details for a single payout. There is no specific upper * limit on the number of payment instruction entries in the batch instructions * * @return array */ public function getInstructions(); /** * Status updates for the batch will be sent to this email address. If no value is * specified, the Merchant email will be used as a notification. * * @return string */ public function getNotificationEmail(); /** * A URL to send status update messages to your server (this must be an https * URL, unencrypted http URLs or any other type of URL is not supported). * Bitpay.com will send a POST request with a JSON encoding of the batch to this * URL when the batch status changes. * * @return string */ public function getNotificationUrl(); /** * The method you select determines the exchange rate used to compute the * payouts for the entire batch. * * @return string */ public function getPricingMethod(); /** * This is your reference label for this batch. It will be passed­through on each * response for you to identify the batch in your system. Maximum string length is * 100 characters. * This passthrough variable can be a JSON­encoded string, for example * { "ref":711454, "company":"Johns Data Center" } * * @return string */ public function getReference(); /** * Get the status for this payout. * * @return $string; */ public function getStatus(); /** * Get the payroll token * * @return mixed */ public function getToken(); /** * Get the response token, for cancelling payout requests later. * * @return string */ public function getResponseToken(); } } namespace Bitpay\DependencyInjection { /** * @package Bitpay */ class BitpayExtension implements \Symfony\Component\DependencyInjection\Extension\ExtensionInterface { public function load(array $configs, \Symfony\Component\DependencyInjection\ContainerBuilder $container) { } /** * @codeCoverageIgnore */ public function getAlias() { } /** * @codeCoverageIgnore */ public function getNamespace() { } /** * @codeCoverageIgnore */ public function getXsdValidationBasePath() { } } } namespace Bitpay\DependencyInjection\Loader { /** * Used to load a configuration that is passed in as an array * * @package Bitpay */ class ArrayLoader extends \Symfony\Component\Config\Loader\Loader { protected $container; public function __construct(\Symfony\Component\DependencyInjection\ContainerBuilder $container) { } public function load($resource, $type = null) { } public function supports($resource, $type = null) { } } } namespace Bitpay { /** * @package Bitpay */ interface TokenInterface { /** * @return string */ public function getToken(); /** * @return string */ public function getResource(); /** * @return string */ public function getFacade(); /** * @return \DateTime */ public function getCreatedAt(); /** * @return array */ public function getPolicies(); /** * @return string */ public function getPairingCode(); /** * @return \DateTime */ public function getPairingExpiration(); } /** * @package Bitpay */ class Token implements \Bitpay\TokenInterface { /** * @var string */ protected $token; /** * @var string */ protected $resource; /** * @var string */ protected $facade; /** * @var \DateTime */ protected $createdAt; /** * @var array */ protected $policies; /** * @var string */ protected $pairingCode; /** * @var \DateTime */ protected $pairingExpiration; public function __construct() { } /** * @return string */ public function __toString() { } /** * @return string */ public function getToken() { } /** * @param string * @return Token */ public function setToken($token) { } /** * @return string */ public function getResource() { } /** * @param string * @return Token */ public function setResource($resource) { } /** * @return string */ public function getFacade() { } /** * @param string * @return Token */ public function setFacade($facade) { } /** * @return \DateTime */ public function getCreatedAt() { } /** * @param \DateTime * @return Token */ public function setCreatedAt(\DateTime $createdAt) { } /** * @return array */ public function getPolicies() { } /** * @param string * @return Token */ public function setPolicies($policies) { } /** * @return string */ public function getPairingCode() { } /** * @param string * @return Token */ public function setPairingCode($pairingCode) { } /** * @return \DateTime */ public function getPairingExpiration() { } /** * @param \DateTime * @return Token */ public function setPairingExpiration(\DateTime $pairingExpiration) { } } /** * Class Payout * @package Bitpay */ class Payout implements \Bitpay\PayoutInterface { /** * @var string */ protected $id; /** * @var string */ protected $account_id; /** * @var string */ protected $status; /** * @var float */ protected $amount; /** * @var float */ protected $btc; /** * @var CurrencyInterface */ protected $currency; /** * @var string */ protected $effectiveDate; /** * @var string */ protected $requestDate; /** * @var array */ protected $instructions = array(); /** * @var string */ protected $notificationEmail; /** * @var string */ protected $notificationUrl; /** * @var string */ protected $pricingMethod; /** * @var string */ protected $rate; /** * @var string */ protected $reference; /** * @var string */ protected $responseToken; /** * @var TokenInterface */ protected $token; /** * @inheritdoc */ public function getId() { } /** * Set the batch ID as assigned from bitpay. * * @param $id * @return $this */ public function setId($id) { } /** * @inheritdoc */ public function getAccountId() { } /** * Set Account Id - Bitpays account ID for the payout. * * @param $id * @return $this */ public function setAccountId($id) { } /** * @inheritdoc */ public function getAmount() { } /** * Sets the amount for this payout. * @param $amount * @return $this */ public function setAmount($amount) { } /** * @interitdoc */ public function getCurrency() { } /** * Set Currency * @param CurrencyInterface $currency * @return $this */ public function setCurrency(\Bitpay\CurrencyInterface $currency) { } /** * @inheritdoc */ public function getEffectiveDate() { } /** * Set Effective date - date payout should be given to employees. * @param $effectiveDate * @return $this */ public function setEffectiveDate($effectiveDate) { } /** * Get rate assigned to payout at effectiveDate */ public function getRate() { } /** * Set the rate in bitcoin for the payouts of this transaction. * @param $rate * @return $this */ public function setRate($rate) { } /** * @inheritdoc */ public function getBtcAmount() { } /** * Set the Bitcoin amount for this payout, once set by Bitpay. * @param $amount * @return $this */ public function setBtcAmount($amount) { } /** * @inheritdoc */ public function getRequestDate() { } /** * Set */ public function setRequestDate($requestDate) { } /** * @inheritdoc */ public function getInstructions() { } /** * Add Instruction of PayoutInstructionInterface type * Increases $this->amount by value. * * @param PayoutInstructionInterface $instruction * @return $this */ public function addInstruction(\Bitpay\PayoutInstructionInterface $instruction) { } /** * Update Instruction - Supply an index of the instruction to update, * plus the function and single argument, to do something to an instruction. * * @param $index * @param $function * @param $argument * @return $this */ public function updateInstruction($index, $function, $argument) { } /** * @inheritdoc */ public function getStatus() { } /** * Sets the status for the current payout request * @param $status * @return $this */ public function setStatus($status) { } /** * @inheritdoc */ public function getToken() { } /** * Set the token to authorize this request. * @param TokenInterface $token * @return $this */ public function setToken(\Bitpay\TokenInterface $token) { } /** * @inheritdoc */ public function getResponseToken() { } /** * Set Response Token - returned by Bitpay when payout request is created * * @param $responseToken * @return $this */ public function setResponseToken($responseToken) { } /** * @inheritdoc */ public function getPricingMethod() { } /** * Set the pricing method for this payout request * @param $pricingMethod * @return $this */ public function setPricingMethod($pricingMethod) { } /** * @inheritdoc */ public function getReference() { } /** * Set the payroll providers reference for this payout * * @param $reference * @return $this */ public function setReference($reference) { } /** * @inheritdoc */ public function getNotificationEmail() { } /** * Set an email address where updates to payout status should be sent. * * @param $notificationEmail * @return $this */ public function setNotificationEmail($notificationEmail) { } /** * @inheritdoc */ public function getNotificationUrl() { } /** * Set a notification url - where updated Payout objects will be sent * * @param $notificationUrl * @return $this */ public function setNotificationUrl($notificationUrl) { } } /** * Used to manage keys * * @package Bitcore */ class KeyManager { /** * @var Bitpay\Storage\StorageInterface */ protected $storage; /** * @param StorageInterface $storage */ public function __construct(\Bitpay\Storage\StorageInterface $storage) { } /** * @param KeyInterface $key */ public function persist(\Bitpay\KeyInterface $key) { } /** * @return KeyInterface */ public function load($id) { } } } namespace Bitpay\Config { /** * This class contains all the valid configuration settings that can be used. * If you update this file to add new settings, please make sure you update the * documentation as well. * * @see http://symfony.com/doc/current/components/config/definition.html * @package Bitpay */ class Configuration implements \Symfony\Component\Config\Definition\ConfigurationInterface { /** * @return TreeBuilder */ public function getConfigTreeBuilder() { } /** * Adds the key_storage node with validation rules. * key_storage MUST: * * implement Bitpay\Storage\StorageInterface * * be a class that can be loaded * * @return \Symfony\Component\Config\Definition\Builder\NodeDefinition * @throws \Exception */ protected function addKeyStorageNode() { } } } namespace Bitpay { /** * This is the currency code set for the price setting. The currencies supported are any * of the codes listed on this page: https://bitpay.com/bitcoin-exchange-rates * * @package Bitpay */ interface CurrencyInterface { /** * @return string */ public function getCode(); /** * @return string */ public function getSymbol(); /** * @return string */ public function getPrecision(); /** * @return string */ public function getExchangePctFee(); /** * @return boolean */ public function isPayoutEnabled(); /** * @return string */ public function getName(); /** * @return string */ public function getPluralName(); /** * @return array */ public function getAlts(); /** * @return array */ public function getPayoutFields(); } /** * For the most part this should conform to ISO 4217 * * @see http://en.wikipedia.org/wiki/ISO_4217 * @package Bitpay */ class Currency implements \Bitpay\CurrencyInterface { /** * @see https://bitpay.com/currencies * @var array */ protected static $availableCurrencies = array('BTC', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CAD', 'CDF', 'CHF', 'CLF', 'CLP', 'CNY', 'COP', 'CRC', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'ISK', 'JEP', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'STD', 'SVC', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'USD', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XAG', 'XAU', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW', 'ZWL'); /** * @var string */ protected $code; /** * @var string */ protected $symbol; /** * @var integer */ protected $precision; /** * @var string */ protected $exchangePercentageFee; /** * @var boolean */ protected $payoutEnabled; /** * @var string */ protected $name; /** * @var string */ protected $pluralName; /** * @var array */ protected $alts; /** * @var array */ protected $payoutFields; /** * @param string $code The Currency Code to use, ie USD * @throws Exception Throws an exception if the Currency Code is not supported */ public function __construct($code = null) { } /** * @inheritdoc */ public function getCode() { } /** * This will change the $code to all uppercase * * @param string $code The Currency Code to use, ie USD * @throws Exception Throws an exception if the Currency Code is not supported * @return CurrencyInterface */ public function setCode($code) { } /** * @inheritdoc */ public function getSymbol() { } /** * @param string $symbol * * @return CurrencyInterface */ public function setSymbol($symbol) { } /** * @inheritdoc */ public function getPrecision() { } /** * @param integer $precision * * @return CurrencyInterface */ public function setPrecision($precision) { } /** * @inheritdoc */ public function getExchangePctFee() { } /** * @param string $fee * * @return CurrencyInterface */ public function setExchangePctFee($fee) { } /** * @inheritdoc */ public function isPayoutEnabled() { } /** * @param boolean $enabled * * @return CurrencyInterface */ public function setPayoutEnabled($enabled) { } /** * @inheritdoc */ public function getName() { } /** * @param string $name * * @return CurrencyInterface */ public function setName($name) { } /** * @inheritdoc */ public function getPluralName() { } /** * @param string $pluralName * * @return CurrencyInterface */ public function setPluralName($pluralName) { } /** * @inheritdoc */ public function getAlts() { } /** * @param array $alts * * @return CurrencyInterface */ public function setAlts($alts) { } /** * @inheritdoc */ public function getPayoutFields() { } /** * @param array $payoutFields * * @return CurrencyInterface */ public function setPayoutFields(array $payoutFields) { } } } namespace Bitpay\Crypto { /** * All crypto extensions MUST support this interface */ interface CryptoInterface { /** * If the users system supports the cryto extension, this should return * true, otherwise it should return false. * * @return boolean */ public static function hasSupport(); /** * @return array */ public function getAlgos(); } /** * Wrapper around the HASH Message Digest Framework for PHP * * @see http://php.net/manual/en/book.hash.php */ class HashExtension implements \Bitpay\Crypto\CryptoInterface { /** * @inheritdoc */ public static function hasSupport() { } /** * Return a list of registered hashing algorithms. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @return array */ public function getAlgos() { } /** * Copy a hashing context. * (PHP 5 >= 5.3.0) * * @param resource * @return resource */ public final function copy($context) { } /** * Compares two strings using the same time * whether they're equal or not. This function * should be used to mitigate timing attacks; * for instance, when testing crypt() password * hashes. * (PHP 5 >= 5.6.0) * * @param string * @param string */ public function equals($string1, $string2) { } /** * Generate a hash value using the contents of * a given file. Returns a string containing * the calculated message digest as lowercase * hexits unless raw_output is set to true in * which case the raw binary representation of * the message digest is returned. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param string * @param string * @param bool * @return string */ public function file($algorithm, $filename, $raw_output = false) { } /** * Finalize an incremental hash and return * resulting digest. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param resource * @param bool * @return string */ public function finalize($context, $raw_output = false) { } /** * Generate a keyed hash value using the HMAC * method and the contents of a given file. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param string * @param string * @param string * @param bool * @return string */ public function hmacFile($algorithm, $filename, $key, $raw_output = false) { } /** * Generate a keyed hash value using the HMAC * method and the message passed via $data. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param string * @param string * @param string * @param bool * @return string */ public function hmac($algo, $data, $key, $raw_output = false) { } /** * Initialize an incremental hashing context and * returns a Hashing Context resource for use with * hash_update(), hash_update_stream(), hash_update_file(), * and hash_final(). Note: the only option possible * for $options at this time is HASH_HMAC. When * this is specified, the key *must* be used as well. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param string * @param int * @param string * @return resource */ public function init($algorithm, $options = 0, $key = null) { } /** * Generate a PBKDF2 key derivation of a supplied * password. An E_WARNING will be raised if the * algorithm is unknown, the iterations parameter * is less than or equal to 0, the length is less * than 0 or the salt is too long (greater than * INT_MAX - 4). The salt should be generated * randomly with openssl_ramdom_pseudo_bytes(). * (PHP 5 >= 5.5.0) * * @param string * @param string * @param string * @param int * @param int * @param bool * @return string */ public function pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = false) { } /** * Pump data into an active hashing context * from a file. Returns TRUE on success or * FALSE on failure. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param resource * @param string * @param resource * @return bool */ public function updateFile($hcontext, $filename, $scontext = null) { } /** * Pump data into an active hashing context * from an open stream. Returns the actual * number of bytes added to the hashing * context from handle. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param resource * @param resource * @param int * @return int */ public function updateStream($context, $handle, $length = -1) { } /** * Pump data into an active hashing context. * The PHP function itself only returns true. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param resource * @param string * @return bool */ public function update($context, $data) { } /** * Generate a hash value (message digest) * based on the request algorithm and the * provided data. Outputs hex unless the * $raw_output param is set to true. * (PHP 5 >= 5.1.2, PECL hash >= 1.1) * * @param string * @param string * @param bool * @return string */ public function generate($algo, $data, $raw_output = false) { } } /** * Wrapper around the OpenSSL PHP Extension * * @see http://php.net/manual/en/book.openssl.php */ class OpenSSLExtension implements \Bitpay\Crypto\CryptoInterface { /** * @inheritdoc */ public static function hasSupport() { } /** * @inheritdoc */ public function getAlgos() { } /** * Function to generate a new RSA keypair. This is not * used for point derivation or for generating signatures. * Only used for assymetric data encryption, as needed. * * @param int * @param string * @return array|boolean array of keys on success, boolean false on failure */ public final function generateKeypair($keybits = 512, $digest_alg = 'sha512') { } /** * Generates a high-quality random number suitable for * use in cryptographic functions and returns hex value. * * @param int * @return string|bool */ public final function randomNumber($bytes = 32) { } /** * Returns the cipher length on success, or FALSE * on failure. (PHP 5 >= PHP 5.3.3) * * @param string * @return int|bool */ public final function cypherIVLength($cypher = '') { } /** * Takes the Certificate Signing Request represented * by $csr and saves it as ascii-armoured text into * the file named by $outfilename. * (PHP 4 >= 4.2.0, PHP 5) * * @param resource * @param string * @param bool * @return bool */ public final function saveCSRtoFile($csr, $outfilename, $notext = true) { } /** * Takes the Certificate Signing Request represented * by $csr and stores it as ascii-armoured text into * $out, which is passed by reference. * (PHP 4 >= 4.2.0, PHP 5) * * @param resource * @param string * @param bool * @return bool */ public final function saveCSRtoString($csr, $out, $notext = true) { } } } namespace Bitpay { /** * Class PayoutInstruction * @package Bitpay */ class PayoutInstruction implements \Bitpay\PayoutInstructionInterface { /** * A transaction is unpaid when the payout in bitcoin has not yet occured. */ const STATUS_UNPAID = 'unpaid'; /** * A transaction is marked as paid once the payroll is complete and bitcoins are * sent to the recipient */ const STATUS_PAID = 'paid'; /** * @var string */ protected $id; /** * @var array */ protected $btc; /** * @var string */ protected $label; /** * @var string */ protected $address; /** * @var float */ protected $amount; /** * @var string */ protected $status; /** * @var array */ protected $transactions = array(); public function __construct() { } /** * @inheritdoc */ public function getId() { } /** * Set the Bitpay ID for this payout instruction * * @param $id * @return $this */ public function setId($id) { } /** * @inheritdoc */ public function getLabel() { } /** * Set the employers label for this instruction. * @param $label * @return $this */ public function setLabel($label) { } /** * @inheritdoc */ public function getAddress() { } /** * Set the bitcoin address for this instruction. * @param $address * @return $this */ public function setAddress($address) { } /** * @inheritdoc */ public function getAmount() { } /** * Set the amount for this instruction. * @param $amount * @return $this */ public function setAmount($amount) { } /** * @inheritdoc */ public function getBtc() { } /** * Set BTC array (available once rates are set) * @param $btc * @return $this */ public function setBtc($btc) { } /** * @inheritdoc */ public function getStatus() { } /** * Set the status for this instruction * @param $status * @return $this */ public function setStatus($status) { } /** * @inheritdoc */ public function getTransactions() { } /** * Add payout transaction to the * @param PayoutTransactionInterface $transaction * @return $this */ public function addTransaction(\Bitpay\PayoutTransactionInterface $transaction) { } } } namespace { /** * Filesystem tools not provided by default; can recursively create, copy * and delete folders. Some template methods are provided for extensibility. * * @note This class must be instantiated to be used, although it does * not maintain state. */ class FSTools { /** * Returns a global instance of FSTools */ public static function singleton() { } /** * Sets our global singleton to something else; useful for overloading * functions. */ public static function setSingleton($singleton) { } /** * Recursively creates a directory * @param string $folder Name of folder to create * @note Adapted from the PHP manual comment 76612 */ public function mkdirr($folder) { } /** * Copy a file, or recursively copy a folder and its contents; modified * so that copied files, if PHP, have includes removed * @note Adapted from http://aidanlister.com/repos/v/function.copyr.php */ public function copyr($source, $dest) { } /** * Overloadable function that tests a filename for copyability. By * default, everything should be copied; you can restrict things to * ignore hidden files, unreadable files, etc. This function * applies to copyr(). */ public function copyable($file) { } /** * Delete a file, or a folder and its contents * @note Adapted from http://aidanlister.com/repos/v/function.rmdirr.php */ public function rmdirr($dirname) { } /** * Recursively globs a directory. */ public function globr($dir, $pattern, $flags = \NULL) { } /** * Allows for PHP functions to be called and be stubbed. * @warning This function will not work for functions that need * to pass references; manually define a stub function for those. */ public function __call($name, $args) { } } /** * Custom FSTools for this script that overloads some behavior * @warning The overloading of copy() is not necessarily global for * this script. Watch out! */ class MergeLibraryFSTools extends \FSTools { public function copyable($entry) { } public function copy($source, $dest) { } } class HTML5 { const PCDATA = 0; const RCDATA = 1; const CDATA = 2; const PLAINTEXT = 3; const DOCTYPE = 0; const STARTTAG = 1; const ENDTAG = 2; const COMMENT = 3; const CHARACTR = 4; const EOF = 5; public function __construct($data) { } public function save() { } } class HTML5TreeConstructer { public $stack = array(); // The different phases. const INIT_PHASE = 0; const ROOT_PHASE = 1; const MAIN_PHASE = 2; const END_PHASE = 3; // The different insertion modes for the main phase. const BEFOR_HEAD = 0; const IN_HEAD = 1; const AFTER_HEAD = 2; const IN_BODY = 3; const IN_TABLE = 4; const IN_CAPTION = 5; const IN_CGROUP = 6; const IN_TBODY = 7; const IN_ROW = 8; const IN_CELL = 9; const IN_SELECT = 10; const AFTER_BODY = 11; const IN_FRAME = 12; const AFTR_FRAME = 13; // The different types of elements. const SPECIAL = 0; const SCOPING = 1; const FORMATTING = 2; const PHRASING = 3; const MARKER = 0; public function __construct() { } // Process tag tokens public function emitToken($token) { } public function save() { } } /** * Meta-class for HTML Purifier's extra class hierarchies, similar to * HTMLPurifier_Bootstrap. */ class HTMLPurifierExtras { public static function autoload($class) { } public static function getPath($class) { } } /** * Represents a file in the filesystem * * @warning Be sure to distinguish between get() and write() versus * read() and put(), the former operates on the entire file, while * the latter operates on a handle. */ class FSTools_File { /** Filename of file this object represents */ protected $name; /** Handle for the file */ protected $handle = \false; /** Instance of FSTools for interfacing with filesystem */ protected $fs; /** * Filename of file you wish to instantiate. * @note This file need not exist */ public function __construct($name, $fs = \false) { } /** Returns the filename of the file. */ public function getName() { } /** Returns directory of the file without trailing slash */ public function getDirectory() { } /** * Retrieves the contents of a file * @todo Throw an exception if file doesn't exist */ public function get() { } /** Writes contents to a file, creates new file if necessary */ public function write($contents) { } /** Deletes the file */ public function delete() { } /** Returns true if file exists and is a file. */ public function exists() { } /** Returns last file modification time */ public function getMTime() { } /** * Chmod a file * @note We ignore errors because of some weird owner trickery due * to SVN duality */ public function chmod($octal_code) { } /** Opens file's handle */ public function open($mode) { } /** Closes file's handle */ public function close() { } /** Retrieves a line from an open file, with optional max length $length */ public function getLine($length = \null) { } /** Retrieves a character from an open file */ public function getChar() { } /** Retrieves an $length bytes of data from an open data */ public function read($length) { } /** Writes to an open file */ public function put($string) { } /** Returns TRUE if the end of the file has been reached */ public function eof() { } public function __destruct() { } } /** * Decorator/extender XSLT processor specifically for HTML documents. */ class ConfigDoc_HTMLXSLTProcessor { /** * Instance of XSLTProcessor */ protected $xsltProcessor; public function __construct($proc = \false) { } /** * @note Allows a string $xsl filename to be passed */ public function importStylesheet($xsl) { } /** * Transforms an XML file into compatible XHTML based on the stylesheet * @param $xml XML DOM tree, or string filename * @return string HTML output * @todo Rename to transformToXHTML, as transformToHTML is misleading */ public function transformToHTML($xml) { } /** * Bulk sets parameters for the XSL stylesheet * @param array $options Associative array of options to set */ public function setParameters($options) { } /** * Forward any other calls to the XSLT processor */ public function __call($name, $arguments) { } } // custom class to aid unit testing class RowTimer extends \Benchmark_Timer { public $name; public function __construct($name, $auto = \false) { } public function getOutput() { } } /*! @mainpage * * HTML Purifier is an HTML filter that will take an arbitrary snippet of * HTML and rigorously test, validate and filter it into a version that * is safe for output onto webpages. It achieves this by: * * -# Lexing (parsing into tokens) the document, * -# Executing various strategies on the tokens: * -# Removing all elements not in the whitelist, * -# Making the tokens well-formed, * -# Fixing the nesting of the nodes, and * -# Validating attributes of the nodes; and * -# Generating HTML from the purified tokens. * * However, most users will only need to interface with the HTMLPurifier * and HTMLPurifier_Config. */ /* HTML Purifier 4.9.2 - Standards Compliant HTML Filtering Copyright (C) 2006-2008 Edward Z. Yang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * Facade that coordinates HTML Purifier's subsystems in order to purify HTML. * * @note There are several points in which configuration can be specified * for HTML Purifier. The precedence of these (from lowest to * highest) is as follows: * -# Instance: new HTMLPurifier($config) * -# Invocation: purify($html, $config) * These configurations are entirely independent of each other and * are *not* merged (this behavior may change in the future). * * @todo We need an easier way to inject strategies using the configuration * object. */ class HTMLPurifier { /** * Version of HTML Purifier. * @type string */ public $version = '4.9.2'; /** * Constant with version of HTML Purifier. */ const VERSION = '4.9.2'; /** * Global configuration object. * @type HTMLPurifier_Config */ public $config; /** * @type HTMLPurifier_Strategy_Core */ protected $strategy; /** * @type HTMLPurifier_Generator */ protected $generator; /** * Resultant context of last run purification. * Is an array of contexts if the last called method was purifyArray(). * @type HTMLPurifier_Context */ public $context; /** * Initializes the purifier. * * @param HTMLPurifier_Config|mixed $config Optional HTMLPurifier_Config object * for all instances of the purifier, if omitted, a default * configuration is supplied (which can be overridden on a * per-use basis). * The parameter can also be any type that * HTMLPurifier_Config::create() supports. */ public function __construct($config = \null) { } /** * Adds a filter to process the output. First come first serve * * @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object */ public function addFilter($filter) { } /** * Filters an HTML snippet/document to be XSS-free and standards-compliant. * * @param string $html String of HTML to purify * @param HTMLPurifier_Config $config Config object for this operation, * if omitted, defaults to the config object specified during this * object's construction. The parameter can also be any type * that HTMLPurifier_Config::create() supports. * * @return string Purified HTML */ public function purify($html, $config = \null) { } /** * Filters an array of HTML snippets * * @param string[] $array_of_html Array of html snippets * @param HTMLPurifier_Config $config Optional config object for this operation. * See HTMLPurifier::purify() for more details. * * @return string[] Array of purified HTML */ public function purifyArray($array_of_html, $config = \null) { } /** * Singleton for enforcing just one HTML Purifier in your system * * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype * HTMLPurifier instance to overload singleton with, * or HTMLPurifier_Config instance to configure the * generated version with. * * @return HTMLPurifier */ public static function instance($prototype = \null) { } /** * Singleton for enforcing just one HTML Purifier in your system * * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype * HTMLPurifier instance to overload singleton with, * or HTMLPurifier_Config instance to configure the * generated version with. * * @return HTMLPurifier * @note Backwards compatibility, see instance() */ public static function getInstance($prototype = \null) { } } /** * Class for converting between different unit-lengths as specified by * CSS. */ class HTMLPurifier_UnitConverter { const ENGLISH = 1; const METRIC = 2; const DIGITAL = 3; /** * Units information array. Units are grouped into measuring systems * (English, Metric), and are assigned an integer representing * the conversion factor between that unit and the smallest unit in * the system. Numeric indexes are actually magical constants that * encode conversion data from one system to the next, with a O(n^2) * constraint on memory (this is generally not a problem, since * the number of measuring systems is small.) */ protected static $units = array(self::ENGLISH => array( 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary 'pt' => 4, 'pc' => 48, 'in' => 288, self::METRIC => array('pt', '0.352777778', 'mm'), ), self::METRIC => array('mm' => 1, 'cm' => 10, self::ENGLISH => array('mm', '2.83464567', 'pt'))); /** * Minimum bcmath precision for output. * @type int */ protected $outputPrecision; /** * Bcmath precision for internal calculations. * @type int */ protected $internalPrecision; public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = \false) { } /** * Converts a length object of one unit into another unit. * @param HTMLPurifier_Length $length * Instance of HTMLPurifier_Length to convert. You must validate() * it before passing it here! * @param string $to_unit * Unit to convert to. * @return HTMLPurifier_Length|bool * @note * About precision: This conversion function pays very special * attention to the incoming precision of values and attempts * to maintain a number of significant figure. Results are * fairly accurate up to nine digits. Some caveats: * - If a number is zero-padded as a result of this significant * figure tracking, the zeroes will be eliminated. * - If a number contains less than four sigfigs ($outputPrecision) * and this causes some decimals to be excluded, those * decimals will be added on. */ public function convert($length, $to_unit) { } /** * Returns the number of significant figures in a string number. * @param string $n Decimal number * @return int number of sigfigs */ public function getSigFigs($n) { } } /** * Object that provides entity lookup table from entity name to character */ class HTMLPurifier_EntityLookup { /** * Assoc array of entity name to character represented. * @type array */ public $table; /** * Sets up the entity lookup table from the serialized file contents. * @param bool $file * @note The serialized contents are versioned, but were generated * using the maintenance script generate_entity_file.php * @warning This is not in constructor to help enforce the Singleton */ public function setup($file = \false) { } /** * Retrieves sole instance of the object. * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. * @return HTMLPurifier_EntityLookup */ public static function instance($prototype = \false) { } } /** * Defines common attribute collections that modules reference */ class HTMLPurifier_AttrCollections { /** * Associative array of attribute collections, indexed by name. * @type array */ public $info = array(); /** * Performs all expansions on internal data for use by other inclusions * It also collects all attribute collection extensions from * modules * @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance * @param HTMLPurifier_HTMLModule[] $modules Hash array of HTMLPurifier_HTMLModule members */ public function __construct($attr_types, $modules) { } public function doConstruct($attr_types, $modules) { } /** * Takes a reference to an attribute associative array and performs * all inclusions specified by the zero index. * @param array &$attr Reference to attribute array */ public function performInclusions(&$attr) { } /** * Expands all string identifiers in an attribute array by replacing * them with the appropriate values inside HTMLPurifier_AttrTypes * @param array &$attr Reference to attribute array * @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance */ public function expandIdentifiers(&$attr, $attr_types) { } } /** * Represents an XHTML 1.1 module, with information on elements, tags * and attributes. * @note Even though this is technically XHTML 1.1, it is also used for * regular HTML parsing. We are using modulization as a convenient * way to represent the internals of HTMLDefinition, and our * implementation is by no means conforming and does not directly * use the normative DTDs or XML schemas. * @note The public variables in a module should almost directly * correspond to the variables in HTMLPurifier_HTMLDefinition. * However, the prefix info carries no special meaning in these * objects (include it anyway if that's the correspondence though). * @todo Consider making some member functions protected */ class HTMLPurifier_HTMLModule { // -- Overloadable ---------------------------------------------------- /** * Short unique string identifier of the module. * @type string */ public $name; /** * Informally, a list of elements this module changes. * Not used in any significant way. * @type array */ public $elements = array(); /** * Associative array of element names to element definitions. * Some definitions may be incomplete, to be merged in later * with the full definition. * @type array */ public $info = array(); /** * Associative array of content set names to content set additions. * This is commonly used to, say, add an A element to the Inline * content set. This corresponds to an internal variable $content_sets * and NOT info_content_sets member variable of HTMLDefinition. * @type array */ public $content_sets = array(); /** * Associative array of attribute collection names to attribute * collection additions. More rarely used for adding attributes to * the global collections. Example is the StyleAttribute module adding * the style attribute to the Core. Corresponds to HTMLDefinition's * attr_collections->info, since the object's data is only info, * with extra behavior associated with it. * @type array */ public $attr_collections = array(); /** * Associative array of deprecated tag name to HTMLPurifier_TagTransform. * @type array */ public $info_tag_transform = array(); /** * List of HTMLPurifier_AttrTransform to be performed before validation. * @type array */ public $info_attr_transform_pre = array(); /** * List of HTMLPurifier_AttrTransform to be performed after validation. * @type array */ public $info_attr_transform_post = array(); /** * List of HTMLPurifier_Injector to be performed during well-formedness fixing. * An injector will only be invoked if all of it's pre-requisites are met; * if an injector fails setup, there will be no error; it will simply be * silently disabled. * @type array */ public $info_injector = array(); /** * Boolean flag that indicates whether or not getChildDef is implemented. * For optimization reasons: may save a call to a function. Be sure * to set it if you do implement getChildDef(), otherwise it will have * no effect! * @type bool */ public $defines_child_def = \false; /** * Boolean flag whether or not this module is safe. If it is not safe, all * of its members are unsafe. Modules are safe by default (this might be * slightly dangerous, but it doesn't make much sense to force HTML Purifier, * which is based off of safe HTML, to explicitly say, "This is safe," even * though there are modules which are "unsafe") * * @type bool * @note Previously, safety could be applied at an element level granularity. * We've removed this ability, so in order to add "unsafe" elements * or attributes, a dedicated module with this property set to false * must be used. */ public $safe = \true; /** * Retrieves a proper HTMLPurifier_ChildDef subclass based on * content_model and content_model_type member variables of * the HTMLPurifier_ElementDef class. There is a similar function * in HTMLPurifier_HTMLDefinition. * @param HTMLPurifier_ElementDef $def * @return HTMLPurifier_ChildDef subclass */ public function getChildDef($def) { } // -- Convenience ----------------------------------------------------- /** * Convenience function that sets up a new element * @param string $element Name of element to add * @param string|bool $type What content set should element be registered to? * Set as false to skip this step. * @param string $contents Allowed children in form of: * "$content_model_type: $content_model" * @param array $attr_includes What attribute collections to register to * element? * @param array $attr What unique attributes does the element define? * @see HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters. * @return HTMLPurifier_ElementDef Created element definition object, so you * can set advanced parameters */ public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) { } /** * Convenience function that creates a totally blank, non-standalone * element. * @param string $element Name of element to create * @return HTMLPurifier_ElementDef Created element */ public function addBlankElement($element) { } /** * Convenience function that registers an element to a content set * @param string $element Element to register * @param string $type Name content set (warning: case sensitive, usually upper-case * first letter) */ public function addElementToContentSet($element, $type) { } /** * Convenience function that transforms single-string contents * into separate content model and content model type * @param string $contents Allowed children in form of: * "$content_model_type: $content_model" * @return array * @note If contents is an object, an array of two nulls will be * returned, and the callee needs to take the original $contents * and use it directly. */ public function parseContents($contents) { } /** * Convenience function that merges a list of attribute includes into * an attribute array. * @param array $attr Reference to attr array to modify * @param array $attr_includes Array of includes / string include to merge in */ public function mergeInAttrIncludes(&$attr, $attr_includes) { } /** * Convenience function that generates a lookup table with boolean * true as value. * @param string $list List of values to turn into a lookup * @note You can also pass an arbitrary number of arguments in * place of the regular argument * @return array array equivalent of list */ public function makeLookup($list) { } /** * Lazy load construction of the module after determining whether * or not it's needed, and also when a finalized configuration object * is available. * @param HTMLPurifier_Config $config */ public function setup($config) { } } /** * Super-class for definition datatype objects, implements serialization * functions for the class. */ abstract class HTMLPurifier_Definition { /** * Has setup() been called yet? * @type bool */ public $setup = \false; /** * If true, write out the final definition object to the cache after * setup. This will be true only if all invocations to get a raw * definition object are also optimized. This does not cause file * system thrashing because on subsequent calls the cached object * is used and any writes to the raw definition object are short * circuited. See enduser-customize.html for the high-level * picture. * @type bool */ public $optimized = \null; /** * What type of definition is it? * @type string */ public $type; /** * Sets up the definition object into the final form, something * not done by the constructor * @param HTMLPurifier_Config $config */ protected abstract function doSetup($config); /** * Setup function that aborts if already setup * @param HTMLPurifier_Config $config */ public function setup($config) { } } /** * Definition of the purified HTML that describes allowed children, * attributes, and many other things. * * Conventions: * * All member variables that are prefixed with info * (including the main $info array) are used by HTML Purifier internals * and should not be directly edited when customizing the HTMLDefinition. * They can usually be set via configuration directives or custom * modules. * * On the other hand, member variables without the info prefix are used * internally by the HTMLDefinition and MUST NOT be used by other HTML * Purifier internals. Many of them, however, are public, and may be * edited by userspace code to tweak the behavior of HTMLDefinition. * * @note This class is inspected by Printer_HTMLDefinition; please * update that class if things here change. * * @warning Directives that change this object's structure must be in * the HTML or Attr namespace! */ class HTMLPurifier_HTMLDefinition extends \HTMLPurifier_Definition { // FULLY-PUBLIC VARIABLES --------------------------------------------- /** * Associative array of element names to HTMLPurifier_ElementDef. * @type HTMLPurifier_ElementDef[] */ public $info = array(); /** * Associative array of global attribute name to attribute definition. * @type array */ public $info_global_attr = array(); /** * String name of parent element HTML will be going into. * @type string */ public $info_parent = 'div'; /** * Definition for parent element, allows parent element to be a * tag that's not allowed inside the HTML fragment. * @type HTMLPurifier_ElementDef */ public $info_parent_def; /** * String name of element used to wrap inline elements in block context. * @type string * @note This is rarely used except for BLOCKQUOTEs in strict mode */ public $info_block_wrapper = 'p'; /** * Associative array of deprecated tag name to HTMLPurifier_TagTransform. * @type array */ public $info_tag_transform = array(); /** * Indexed list of HTMLPurifier_AttrTransform to be performed before validation. * @type HTMLPurifier_AttrTransform[] */ public $info_attr_transform_pre = array(); /** * Indexed list of HTMLPurifier_AttrTransform to be performed after validation. * @type HTMLPurifier_AttrTransform[] */ public $info_attr_transform_post = array(); /** * Nested lookup array of content set name (Block, Inline) to * element name to whether or not it belongs in that content set. * @type array */ public $info_content_sets = array(); /** * Indexed list of HTMLPurifier_Injector to be used. * @type HTMLPurifier_Injector[] */ public $info_injector = array(); /** * Doctype object * @type HTMLPurifier_Doctype */ public $doctype; // RAW CUSTOMIZATION STUFF -------------------------------------------- /** * Adds a custom attribute to a pre-existing element * @note This is strictly convenience, and does not have a corresponding * method in HTMLPurifier_HTMLModule * @param string $element_name Element name to add attribute to * @param string $attr_name Name of attribute * @param mixed $def Attribute definition, can be string or object, see * HTMLPurifier_AttrTypes for details */ public function addAttribute($element_name, $attr_name, $def) { } /** * Adds a custom element to your HTML definition * @see HTMLPurifier_HTMLModule::addElement() for detailed * parameter and return value descriptions. */ public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) { } /** * Adds a blank element to your HTML definition, for overriding * existing behavior * @param string $element_name * @return HTMLPurifier_ElementDef * @see HTMLPurifier_HTMLModule::addBlankElement() for detailed * parameter and return value descriptions. */ public function addBlankElement($element_name) { } /** * Retrieves a reference to the anonymous module, so you can * bust out advanced features without having to make your own * module. * @return HTMLPurifier_HTMLModule */ public function getAnonymousModule() { } // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- /** * @type string */ public $type = 'HTML'; /** * @type HTMLPurifier_HTMLModuleManager */ public $manager; /** * Performs low-cost, preliminary initialization. */ public function __construct() { } /** * @param HTMLPurifier_Config $config */ protected function doSetup($config) { } /** * Extract out the information from the manager * @param HTMLPurifier_Config $config */ protected function processModules($config) { } /** * Sets up stuff based on config. We need a better way of doing this. * @param HTMLPurifier_Config $config */ protected function setupConfigStuff($config) { } /** * Parses a TinyMCE-flavored Allowed Elements and Attributes list into * separate lists for processing. Format is element[attr1|attr2],element2... * @warning Although it's largely drawn from TinyMCE's implementation, * it is different, and you'll probably have to modify your lists * @param array $list String list to parse * @return array * @todo Give this its own class, probably static interface */ public function parseTinyMCEAllowedList($list) { } } /** * Responsible for creating definition caches. */ class HTMLPurifier_DefinitionCacheFactory { /** * @type array */ protected $caches = array('Serializer' => array()); /** * @type array */ protected $implementations = array(); /** * @type HTMLPurifier_DefinitionCache_Decorator[] */ protected $decorators = array(); /** * Initialize default decorators */ public function setup() { } /** * Retrieves an instance of global definition cache factory. * @param HTMLPurifier_DefinitionCacheFactory $prototype * @return HTMLPurifier_DefinitionCacheFactory */ public static function instance($prototype = \null) { } /** * Registers a new definition cache object * @param string $short Short name of cache object, for reference * @param string $long Full class name of cache object, for construction */ public function register($short, $long) { } /** * Factory method that creates a cache object based on configuration * @param string $type Name of definitions handled by cache * @param HTMLPurifier_Config $config Config instance * @return mixed */ public function create($type, $config) { } /** * Registers a decorator to add to all new cache objects * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator */ public function addDecorator($decorator) { } } /** * Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes * @note In Slashdot-speak, dupe means duplicate. * @note The default constructor does not accept $config or $context objects: * use must use the static build() factory method to perform initialization. */ class HTMLPurifier_IDAccumulator { /** * Lookup table of IDs we've accumulated. * @public */ public $ids = array(); /** * Builds an IDAccumulator, also initializing the default blacklist * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config * @param HTMLPurifier_Context $context Instance of HTMLPurifier_Context * @return HTMLPurifier_IDAccumulator Fully initialized HTMLPurifier_IDAccumulator */ public static function build($config, $context) { } /** * Add an ID to the lookup table. * @param string $id ID to be added. * @return bool status, true if success, false if there's a dupe */ public function add($id) { } /** * Load a list of IDs into the lookup table * @param $array_of_ids Array of IDs to load * @note This function doesn't care about duplicates */ public function load($array_of_ids) { } } // if want to implement error collecting here, we'll need to use some sort // of global data (probably trigger_error) because it's impossible to pass // $config or $context to the callback functions. /** * Handles referencing and derefencing character entities */ class HTMLPurifier_EntityParser { /** * Reference to entity lookup table. * @type HTMLPurifier_EntityLookup */ protected $_entity_lookup; /** * Callback regex string for entities in text. * @type string */ protected $_textEntitiesRegex; /** * Callback regex string for entities in attributes. * @type string */ protected $_attrEntitiesRegex; /** * Tests if the beginning of a string is a semi-optional regex */ protected $_semiOptionalPrefixRegex; public function __construct() { } /** * Substitute entities with the parsed equivalents. Use this on * textual data in an HTML document (as opposed to attributes.) * * @param string $string String to have entities parsed. * @return string Parsed string. */ public function substituteTextEntities($string) { } /** * Substitute entities with the parsed equivalents. Use this on * attribute contents in documents. * * @param string $string String to have entities parsed. * @return string Parsed string. */ public function substituteAttrEntities($string) { } /** * Callback function for substituteNonSpecialEntities() that does the work. * * @param array $matches PCRE matches array, with 0 the entire match, and * either index 1, 2 or 3 set with a hex value, dec value, * or string (respectively). * @return string Replacement string. */ protected function entityCallback($matches) { } // LEGACY CODE BELOW /** * Callback regex string for parsing entities. * @type string */ protected $_substituteEntitiesRegex = '/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\\d+)|([A-Za-z_:][A-Za-z0-9.\\-_:]*));?/'; // 1. hex 2. dec 3. string (XML style) /** * Decimal to parsed string conversion table for special entities. * @type array */ protected $_special_dec2str = array(34 => '"', 38 => '&', 39 => "'", 60 => '<', 62 => '>'); /** * Stripped entity names to decimal conversion table for special entities. * @type array */ protected $_special_ent2dec = array('quot' => 34, 'amp' => 38, 'lt' => 60, 'gt' => 62); /** * Substitutes non-special entities with their parsed equivalents. Since * running this whenever you have parsed character is t3h 5uck, we run * it before everything else. * * @param string $string String to have non-special entities parsed. * @return string Parsed string. */ public function substituteNonSpecialEntities($string) { } /** * Callback function for substituteNonSpecialEntities() that does the work. * * @param array $matches PCRE matches array, with 0 the entire match, and * either index 1, 2 or 3 set with a hex value, dec value, * or string (respectively). * @return string Replacement string. */ protected function nonSpecialEntityCallback($matches) { } /** * Substitutes only special entities with their parsed equivalents. * * @notice We try to avoid calling this function because otherwise, it * would have to be called a lot (for every parsed section). * * @param string $string String to have non-special entities parsed. * @return string Parsed string. */ public function substituteSpecialEntities($string) { } /** * Callback function for substituteSpecialEntities() that does the work. * * This callback has same syntax as nonSpecialEntityCallback(). * * @param array $matches PCRE-style matches array, with 0 the entire match, and * either index 1, 2 or 3 set with a hex value, dec value, * or string (respectively). * @return string Replacement string. */ protected function specialEntityCallback($matches) { } } /** * Structure that stores an HTML element definition. Used by * HTMLPurifier_HTMLDefinition and HTMLPurifier_HTMLModule. * @note This class is inspected by HTMLPurifier_Printer_HTMLDefinition. * Please update that class too. * @warning If you add new properties to this class, you MUST update * the mergeIn() method. */ class HTMLPurifier_ElementDef { /** * Does the definition work by itself, or is it created solely * for the purpose of merging into another definition? * @type bool */ public $standalone = \true; /** * Associative array of attribute name to HTMLPurifier_AttrDef. * @type array * @note Before being processed by HTMLPurifier_AttrCollections * when modules are finalized during * HTMLPurifier_HTMLDefinition->setup(), this array may also * contain an array at index 0 that indicates which attribute * collections to load into the full array. It may also * contain string indentifiers in lieu of HTMLPurifier_AttrDef, * see HTMLPurifier_AttrTypes on how they are expanded during * HTMLPurifier_HTMLDefinition->setup() processing. */ public $attr = array(); // XXX: Design note: currently, it's not possible to override // previously defined AttrTransforms without messing around with // the final generated config. This is by design; a previous version // used an associated list of attr_transform, but it was extremely // easy to accidentally override other attribute transforms by // forgetting to specify an index (and just using 0.) While we // could check this by checking the index number and complaining, // there is a second problem which is that it is not at all easy to // tell when something is getting overridden. Combine this with a // codebase where this isn't really being used, and it's perfect for // nuking. /** * List of tags HTMLPurifier_AttrTransform to be done before validation. * @type array */ public $attr_transform_pre = array(); /** * List of tags HTMLPurifier_AttrTransform to be done after validation. * @type array */ public $attr_transform_post = array(); /** * HTMLPurifier_ChildDef of this tag. * @type HTMLPurifier_ChildDef */ public $child; /** * Abstract string representation of internal ChildDef rules. * @see HTMLPurifier_ContentSets for how this is parsed and then transformed * into an HTMLPurifier_ChildDef. * @warning This is a temporary variable that is not available after * being processed by HTMLDefinition * @type string */ public $content_model; /** * Value of $child->type, used to determine which ChildDef to use, * used in combination with $content_model. * @warning This must be lowercase * @warning This is a temporary variable that is not available after * being processed by HTMLDefinition * @type string */ public $content_model_type; /** * Does the element have a content model (#PCDATA | Inline)*? This * is important for chameleon ins and del processing in * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't * have to worry about this one. * @type bool */ public $descendants_are_inline = \false; /** * List of the names of required attributes this element has. * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() * @type array */ public $required_attr = array(); /** * Lookup table of tags excluded from all descendants of this tag. * @type array * @note SGML permits exclusions for all descendants, but this is * not possible with DTDs or XML Schemas. W3C has elected to * use complicated compositions of content_models to simulate * exclusion for children, but we go the simpler, SGML-style * route of flat-out exclusions, which correctly apply to * all descendants and not just children. Note that the XHTML * Modularization Abstract Modules are blithely unaware of such * distinctions. */ public $excludes = array(); /** * This tag is explicitly auto-closed by the following tags. * @type array */ public $autoclose = array(); /** * If a foreign element is found in this element, test if it is * allowed by this sub-element; if it is, instead of closing the * current element, place it inside this element. * @type string */ public $wrap; /** * Whether or not this is a formatting element affected by the * "Active Formatting Elements" algorithm. * @type bool */ public $formatting; /** * Low-level factory constructor for creating new standalone element defs */ public static function create($content_model, $content_model_type, $attr) { } /** * Merges the values of another element definition into this one. * Values from the new element def take precedence if a value is * not mergeable. * @param HTMLPurifier_ElementDef $def */ public function mergeIn($def) { } } /** * Injects tokens into the document while parsing for well-formedness. * This enables "formatter-like" functionality such as auto-paragraphing, * smiley-ification and linkification to take place. * * A note on how handlers create changes; this is done by assigning a new * value to the $token reference. These values can take a variety of forms and * are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() * documentation. * * @todo Allow injectors to request a re-run on their output. This * would help if an operation is recursive. */ abstract class HTMLPurifier_Injector { /** * Advisory name of injector, this is for friendly error messages. * @type string */ public $name; /** * @type HTMLPurifier_HTMLDefinition */ protected $htmlDefinition; /** * Reference to CurrentNesting variable in Context. This is an array * list of tokens that we are currently "inside" * @type array */ protected $currentNesting; /** * Reference to current token. * @type HTMLPurifier_Token */ protected $currentToken; /** * Reference to InputZipper variable in Context. * @type HTMLPurifier_Zipper */ protected $inputZipper; /** * Array of elements and attributes this injector creates and therefore * need to be allowed by the definition. Takes form of * array('element' => array('attr', 'attr2'), 'element2') * @type array */ public $needed = array(); /** * Number of elements to rewind backwards (relative). * @type bool|int */ protected $rewindOffset = \false; /** * Rewind to a spot to re-perform processing. This is useful if you * deleted a node, and now need to see if this change affected any * earlier nodes. Rewinding does not affect other injectors, and can * result in infinite loops if not used carefully. * @param bool|int $offset * @warning HTML Purifier will prevent you from fast-forwarding with this * function. */ public function rewindOffset($offset) { } /** * Retrieves rewind offset, and then unsets it. * @return bool|int */ public function getRewindOffset() { } /** * Prepares the injector by giving it the config and context objects: * this allows references to important variables to be made within * the injector. This function also checks if the HTML environment * will work with the Injector (see checkNeeded()). * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return bool|string Boolean false if success, string of missing needed element/attribute if failure */ public function prepare($config, $context) { } /** * This function checks if the HTML environment * will work with the Injector: if p tags are not allowed, the * Auto-Paragraphing injector should not be enabled. * @param HTMLPurifier_Config $config * @return bool|string Boolean false if success, string of missing needed element/attribute if failure */ public function checkNeeded($config) { } /** * Tests if the context node allows a certain element * @param string $name Name of element to test for * @return bool True if element is allowed, false if it is not */ public function allowsElement($name) { } /** * Iterator function, which starts with the next token and continues until * you reach the end of the input tokens. * @warning Please prevent previous references from interfering with this * functions by setting $i = null beforehand! * @param int $i Current integer index variable for inputTokens * @param HTMLPurifier_Token $current Current token variable. * Do NOT use $token, as that variable is also a reference * @return bool */ protected function forward(&$i, &$current) { } /** * Similar to _forward, but accepts a third parameter $nesting (which * should be initialized at 0) and stops when we hit the end tag * for the node $this->inputIndex starts in. * @param int $i Current integer index variable for inputTokens * @param HTMLPurifier_Token $current Current token variable. * Do NOT use $token, as that variable is also a reference * @param int $nesting * @return bool */ protected function forwardUntilEndToken(&$i, &$current, &$nesting) { } /** * Iterator function, starts with the previous token and continues until * you reach the beginning of input tokens. * @warning Please prevent previous references from interfering with this * functions by setting $i = null beforehand! * @param int $i Current integer index variable for inputTokens * @param HTMLPurifier_Token $current Current token variable. * Do NOT use $token, as that variable is also a reference * @return bool */ protected function backward(&$i, &$current) { } /** * Handler that is called when a text token is processed */ public function handleText(&$token) { } /** * Handler that is called when a start or empty token is processed */ public function handleElement(&$token) { } /** * Handler that is called when an end token is processed */ public function handleEnd(&$token) { } /** * Notifier that is called when an end token is processed * @param HTMLPurifier_Token $token Current token variable. * @note This differs from handlers in that the token is read-only * @deprecated */ public function notifyEnd($token) { } } /** * Injector that removes spans with no attributes */ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'RemoveSpansWithoutAttributes'; /** * @type array */ public $needed = array('span'); public function prepare($config, $context) { } /** * @param HTMLPurifier_Token $token */ public function handleElement(&$token) { } /** * @param HTMLPurifier_Token $token */ public function handleEnd(&$token) { } } /** * Injector that displays the URL of an anchor instead of linking to it, in addition to showing the text of the link. */ class HTMLPurifier_Injector_DisplayLinkURI extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'DisplayLinkURI'; /** * @type array */ public $needed = array('a'); /** * @param $token */ public function handleElement(&$token) { } /** * @param HTMLPurifier_Token $token */ public function handleEnd(&$token) { } } class HTMLPurifier_Injector_RemoveEmpty extends \HTMLPurifier_Injector { /** * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return void */ public function prepare($config, $context) { } /** * @param HTMLPurifier_Token $token */ public function handleElement(&$token) { } } /** * Injector that auto paragraphs text in the root node based on * double-spacing. * @todo Ensure all states are unit tested, including variations as well. * @todo Make a graph of the flow control for this Injector. */ class HTMLPurifier_Injector_AutoParagraph extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'AutoParagraph'; /** * @type array */ public $needed = array('p'); /** * @param HTMLPurifier_Token_Text $token */ public function handleText(&$token) { } /** * @param HTMLPurifier_Token $token */ public function handleElement(&$token) { } } /** * Injector that converts http, https and ftp text URLs to actual links. */ class HTMLPurifier_Injector_Linkify extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'Linkify'; /** * @type array */ public $needed = array('a' => array('href')); /** * @param HTMLPurifier_Token $token */ public function handleText(&$token) { } } /** * Adds important param elements to inside of object in order to make * things safe. */ class HTMLPurifier_Injector_SafeObject extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'SafeObject'; /** * @type array */ public $needed = array('object', 'param'); /** * @type array */ protected $objectStack = array(); /** * @type array */ protected $paramStack = array(); /** * Keep this synchronized with AttrTransform/SafeParam.php. * @type array */ protected $addParam = array('allowScriptAccess' => 'never', 'allowNetworking' => 'internal'); /** * These are all lower-case keys. * @type array */ protected $allowedParam = array('wmode' => \true, 'movie' => \true, 'flashvars' => \true, 'src' => \true, 'allowfullscreen' => \true); /** * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return void */ public function prepare($config, $context) { } /** * @param HTMLPurifier_Token $token */ public function handleElement(&$token) { } public function handleEnd(&$token) { } } /** * Injector that converts configuration directive syntax %Namespace.Directive * to links */ class HTMLPurifier_Injector_PurifierLinkify extends \HTMLPurifier_Injector { /** * @type string */ public $name = 'PurifierLinkify'; /** * @type string */ public $docURL; /** * @type array */ public $needed = array('a' => array('href')); /** * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return string */ public function prepare($config, $context) { } /** * @param HTMLPurifier_Token $token */ public function handleText(&$token) { } } /** * Validates the attributes of a token. Doesn't manage required attributes * very well. The only reason we factored this out was because RemoveForeignElements * also needed it besides ValidateAttributes. */ class HTMLPurifier_AttrValidator { /** * Validates the attributes of a token, mutating it as necessary. * that has valid tokens * @param HTMLPurifier_Token $token Token to validate. * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config * @param HTMLPurifier_Context $context Instance of HTMLPurifier_Context */ public function validateToken($token, $config, $context) { } } // OUT OF DATE, NEEDS UPDATING! // USE XMLWRITER! class HTMLPurifier_Printer { /** * For HTML generation convenience funcs. * @type HTMLPurifier_Generator */ protected $generator; /** * For easy access. * @type HTMLPurifier_Config */ protected $config; /** * Initialize $generator. */ public function __construct() { } /** * Give generator necessary configuration if possible * @param HTMLPurifier_Config $config */ public function prepareGenerator($config) { } /** * Main function that renders object or aspect of that object * @note Parameters vary depending on printer */ // function render() {} /** * Returns a start tag * @param string $tag Tag name * @param array $attr Attribute array * @return string */ protected function start($tag, $attr = array()) { } /** * Returns an end tag * @param string $tag Tag name * @return string */ protected function end($tag) { } /** * Prints a complete element with content inside * @param string $tag Tag name * @param string $contents Element contents * @param array $attr Tag attributes * @param bool $escape whether or not to escape contents * @return string */ protected function element($tag, $contents, $attr = array(), $escape = \true) { } /** * @param string $tag * @param array $attr * @return string */ protected function elementEmpty($tag, $attr = array()) { } /** * @param string $text * @return string */ protected function text($text) { } /** * Prints a simple key/value row in a table. * @param string $name Key * @param mixed $value Value * @return string */ protected function row($name, $value) { } /** * Escapes a string for HTML output. * @param string $string String to escape * @return string */ protected function escape($string) { } /** * Takes a list of strings and turns them into a single list * @param string[] $array List of strings * @param bool $polite Bool whether or not to add an end before the last * @return string */ protected function listify($array, $polite = \false) { } /** * Retrieves the class of an object without prefixes, as well as metadata * @param object $obj Object to determine class of * @param string $sec_prefix Further prefix to remove * @return string */ protected function getClass($obj, $sec_prefix = '') { } } class HTMLPurifier_Printer_HTMLDefinition extends \HTMLPurifier_Printer { /** * @type HTMLPurifier_HTMLDefinition, for easy access */ protected $def; /** * @param HTMLPurifier_Config $config * @return string */ public function render($config) { } /** * Renders the Doctype table * @return string */ protected function renderDoctype() { } /** * Renders environment table, which is miscellaneous info * @return string */ protected function renderEnvironment() { } /** * Renders the Content Sets table * @return string */ protected function renderContentSets() { } /** * Renders the Elements ($info) table * @return string */ protected function renderInfo() { } /** * Renders a row describing the allowed children of an element * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element * @return string */ protected function renderChildren($def) { } /** * Listifies a tag lookup table. * @param array $array Tag lookup array in form of array('tagname' => true) * @return string */ protected function listifyTagLookup($array) { } /** * Listifies a list of objects by retrieving class names and internal state * @param array $array List of objects * @return string * @todo Also add information about internal state */ protected function listifyObjectList($array) { } /** * Listifies a hash of attributes to AttrDef classes * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) * @return string */ protected function listifyAttr($array) { } /** * Creates a heavy header row * @param string $text * @param int $num * @return string */ protected function heavyHeader($text, $num = 1) { } } class HTMLPurifier_Printer_CSSDefinition extends \HTMLPurifier_Printer { /** * @type HTMLPurifier_CSSDefinition */ protected $def; /** * @param HTMLPurifier_Config $config * @return string */ public function render($config) { } } /** * @todo Rewrite to use Interchange objects */ class HTMLPurifier_Printer_ConfigForm extends \HTMLPurifier_Printer { /** * Printers for specific fields. * @type HTMLPurifier_Printer[] */ protected $fields = array(); /** * Documentation URL, can have fragment tagged on end. * @type string */ protected $docURL; /** * Name of form element to stuff config in. * @type string */ protected $name; /** * Whether or not to compress directive names, clipping them off * after a certain amount of letters. False to disable or integer letters * before clipping. * @type bool */ protected $compress = \false; /** * @param string $name Form element name for directives to be stuffed into * @param string $doc_url String documentation URL, will have fragment tagged on * @param bool $compress Integer max length before compressing a directive name, set to false to turn off */ public function __construct($name, $doc_url = \null, $compress = \false) { } /** * Sets default column and row size for textareas in sub-printers * @param $cols Integer columns of textarea, null to use default * @param $rows Integer rows of textarea, null to use default */ public function setTextareaDimensions($cols = \null, $rows = \null) { } /** * Retrieves styling, in case it is not accessible by webserver */ public static function getCSS() { } /** * Retrieves JavaScript, in case it is not accessible by webserver */ public static function getJavaScript() { } /** * Returns HTML output for a configuration form * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array * where [0] has an HTML namespace and [1] is being rendered. * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. * @param bool $render_controls * @return string */ public function render($config, $allowed = \true, $render_controls = \true) { } /** * Renders a single namespace * @param $ns String namespace name * @param array $directives array of directives to values * @return string */ protected function renderNamespace($ns, $directives) { } } /** * Printer decorator for directives that accept null */ class HTMLPurifier_Printer_ConfigForm_NullDecorator extends \HTMLPurifier_Printer { /** * Printer being decorated * @type HTMLPurifier_Printer */ protected $obj; /** * @param HTMLPurifier_Printer $obj Printer to decorate */ public function __construct($obj) { } /** * @param string $ns * @param string $directive * @param string $value * @param string $name * @param HTMLPurifier_Config|array $config * @return string */ public function render($ns, $directive, $value, $name, $config) { } } /** * Swiss-army knife configuration form field printer */ class HTMLPurifier_Printer_ConfigForm_default extends \HTMLPurifier_Printer { /** * @type int */ public $cols = 18; /** * @type int */ public $rows = 5; /** * @param string $ns * @param string $directive * @param string $value * @param string $name * @param HTMLPurifier_Config|array $config * @return string */ public function render($ns, $directive, $value, $name, $config) { } } /** * Bool form field printer */ class HTMLPurifier_Printer_ConfigForm_bool extends \HTMLPurifier_Printer { /** * @param string $ns * @param string $directive * @param string $value * @param string $name * @param HTMLPurifier_Config|array $config * @return string */ public function render($ns, $directive, $value, $name, $config) { } } /** * Forgivingly lexes HTML (SGML-style) markup into tokens. * * A lexer parses a string of SGML-style markup and converts them into * corresponding tokens. It doesn't check for well-formedness, although its * internal mechanism may make this automatic (such as the case of * HTMLPurifier_Lexer_DOMLex). There are several implementations to choose * from. * * A lexer is HTML-oriented: it might work with XML, but it's not * recommended, as we adhere to a subset of the specification for optimization * reasons. This might change in the future. Also, most tokenizers are not * expected to handle DTDs or PIs. * * This class should not be directly instantiated, but you may use create() to * retrieve a default copy of the lexer. Being a supertype, this class * does not actually define any implementation, but offers commonly used * convenience functions for subclasses. * * @note The unit tests will instantiate this class for testing purposes, as * many of the utility functions require a class to be instantiated. * This means that, even though this class is not runnable, it will * not be declared abstract. * * @par * * @note * We use tokens rather than create a DOM representation because DOM would: * * @par * -# Require more processing and memory to create, * -# Is not streamable, and * -# Has the entire document structure (html and body not needed). * * @par * However, DOM is helpful in that it makes it easy to move around nodes * without a lot of lookaheads to see when a tag is closed. This is a * limitation of the token system and some workarounds would be nice. */ class HTMLPurifier_Lexer { /** * Whether or not this lexer implements line-number/column-number tracking. * If it does, set to true. */ public $tracksLineNumbers = \false; // -- STATIC ---------------------------------------------------------- /** * Retrieves or sets the default Lexer as a Prototype Factory. * * By default HTMLPurifier_Lexer_DOMLex will be returned. There are * a few exceptions involving special features that only DirectLex * implements. * * @note The behavior of this class has changed, rather than accepting * a prototype object, it now accepts a configuration object. * To specify your own prototype, set %Core.LexerImpl to it. * This change in behavior de-singletonizes the lexer object. * * @param HTMLPurifier_Config $config * @return HTMLPurifier_Lexer * @throws HTMLPurifier_Exception */ public static function create($config) { } // -- CONVENIENCE MEMBERS --------------------------------------------- public function __construct() { } /** * Most common entity to raw value conversion table for special entities. * @type array */ protected $_special_entity2str = array('"' => '"', '&' => '&', '<' => '<', '>' => '>', ''' => "'", ''' => "'", ''' => "'"); public function parseText($string, $config) { } public function parseAttr($string, $config) { } /** * Parses special entities into the proper characters. * * This string will translate escaped versions of the special characters * into the correct ones. * * @param string $string String character data to be parsed. * @return string Parsed character data. */ public function parseData($string, $is_attr, $config) { } /** * Lexes an HTML string into tokens. * @param $string String HTML. * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return HTMLPurifier_Token[] array representation of HTML. */ public function tokenizeHTML($string, $config, $context) { } /** * Translates CDATA sections into regular sections (through escaping). * @param string $string HTML string to process. * @return string HTML with CDATA sections escaped. */ protected static function escapeCDATA($string) { } /** * Special CDATA case that is especially convoluted for