{@inheritdoc}

@since 1.0.0
@api
15515
public function getName()
  {
    return isset(self::$ourNames[$this->getCode()]) ? self::$ourNames[$this->getCode()] : 'Error';
  }
1306500
public function get(
        $page = 1,
        $pageSize = 1000,
        $subscribed = null,
        $onlyGuest = false,
        $websiteId = null,
        $storeId = null
    ) {

        $this
            ->initCollection()
            ->joinWebsite()
            ->filterWebsite($websiteId)
            ->filterStore($storeId)
            ->filterSubscribed($subscribed)
            ->filterCustomers($onlyGuest)
            ->setPage($page, $pageSize);

        return $this->subscriptionsResponseFactory->create()
            ->setCurrentPage($this->subscriptionCollection->getCurPage())
            ->setLastPage($this->subscriptionCollection->getLastPageNumber())
            ->setPageSize($this->subscriptionCollection->getPageSize())
            ->setTotalCount($this->subscriptionCollection->getSize())
            ->setSubscriptions($this->handleSubscriptions());
    }
641723
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var BusinessTemplate $pagePattern */
        $pagePattern = $em->getRepository('VictoireBusinessPageBundle:BusinessTemplate')->find($id);

        if (!$pagePattern) {
            throw $this->createNotFoundException('Unable to find BusinessTemplate entity.');
        }

        $editForm = $this->createEditForm($pagePattern);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            //redirect to the page of the template
            $completeUrl = $this->generateUrl('victoire_business_template_show', ['id' => $pagePattern->getId()]);
            $message = $this->get('translator')->trans('victoire.business_template.edit.success', [], 'victoire');

            $success = true;
        } else {
            $success = false;
            $completeUrl = null;
            $message = $this->get('translator')->trans('victoire.business_template.edit.error', [], 'victoire');
        }

        return new JsonResponse([
            'success' => $success,
            'url'     => $completeUrl,
            'message' => $message,
        ]);
    }
936248
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        parent::execute($request);

        /** @var OrderPaymentInterface $payment */
        $payment = $request->getSource();
        /** @var array $model */
        $model = $request->getResult();

        $model['NOSHIPPING'] = 1;
        $model['LANDINGPAGE'] = 'Billing';
        $model['SOLUTIONTYPE'] = 'Sole';

        $order = $payment->getOrder();
        $orderTotal = $this->calculator->calculateOrderTotal($order, true);
        $paymentAmount = $payment->getAmount();

        // Add item details only if this is a full order payement.
        if (0 == bccomp($orderTotal, $paymentAmount, 2)) {
            $m = 0;
            foreach($order->getItems() as $item) {
                $model['L_PAYMENTREQUEST_0_NAME'.$m] = $item->getDesignation();
                $model['L_PAYMENTREQUEST_0_AMT'.$m] = round($item->getPrice(), 2);
                $model['L_PAYMENTREQUEST_0_QTY'.$m] = $item->getQuantity();
                $m++;
            }
            $model['PAYMENTREQUEST_0_ITEMAMT'] = round($this->calculator->calculateOrderItemsTotal($order), 2);

            $model['PAYMENTREQUEST_0_SHIPPINGAMT'] = round($this->calculator->calculateOrderShipmentTotal($order), 2);

            $taxes = $this->calculator->calculateOrderTaxesAmounts($order);
            $model['PAYMENTREQUEST_0_TAXAMT'] = round($taxes->getTotal(), 2);
        }

        $request->setResult((array) $model);
    }
103440
public function getPost($name = null, $filters = null, $defaultValue = null, $notAllowEmpty = false, $noRecursive = false)
    {
        // perform parent function
        $request = parent::getPost($name, $filters, $defaultValue);

        // special handling for array requests, for individual inputs return what is request
        if (is_array($request) and $this->defaultCaseFormat != false) {
            if ($this->getJsonRawBody() == null) {
                return $this->convertCase($request);
            } else {
                return $this->getJsonRawBody();
            }
        } else {
            return $request;
        }
    }
508757
public function execute()
    {
        //valid endpoints are /_bulk, /{index}/_bulk, and {index}/{type}/_bulk
        if ($this->index === null && $this->type === null) {
            $endpoint = ['_bulk'];
        } elseif ($this->index !== null && $this->type === null) {
            $endpoint = [$this->index, '_bulk'];
        } elseif ($this->index !== null && $this->type !== null) {
            $endpoint = [$this->index, $this->type, '_bulk'];
        } else {
            throw new InvalidCallException('Invalid endpoint: if type is defined, index must be defined too.');
        }

        if (empty($this->actions)) {
            $body = '{}';
        } elseif (is_array($this->actions)) {
            $body = '';
            foreach ($this->actions as $action) {
                $body .= Json::encode($action) . "\n";
            }
        } else {
            $body = $this->actions;
        }

        return $this->db->post($endpoint, $this->options, $body);
    }
780025
public function verify($id)
    {
        if (!$this->request->is(['get', 'post', 'put'])) {
            throw new MethodNotAllowedException();
        }

        /** @var User $user */
        $user = $this->Users->get($id);

        if ($this->request->is(['post', 'put'])) {
            if ($user->verified) {
                $this->Flash->warning(__d('wasabi_core', 'The email address of user <strong>{0}</strong> is already verified.', $user->username));
                $this->redirect($this->Filter->getBacklink(['action' => 'index'], $this->request));
                return;
            }
            if ($this->Users->verify($user, true)) {
                $this->getMailer('Wasabi/Core.User')->send('verifiedByAdminEmail', [$user]);
                $this->Flash->success(__d('wasabi_core', 'The email address of user <strong>{0}</strong> has been verified.', $user->username));
                $this->redirect($this->Filter->getBacklink(['action' => 'index'], $this->request));
                return;
            } else {
                $this->Flash->error($this->dbErrorMessage);
            }
        }

        $this->set([
            'user' => $user
        ]);
    }
1222136
public function execute()
    {
        try
        {
            if (!$this->_prepared) {
                // includes generated template PHP code
                $this->prepare();
            }
            $this->_context->echoDeclarations(false);

            $templateFunction = $this->getFunctionName();

            try {
                ob_start();
                $templateFunction($this, $this->_context);
                $res = ob_get_clean();
            }
            catch (Exception $e)
            {
                ob_end_clean();
                throw $e;
            }

            // unshift doctype
            if ($this->_context->_docType) {
                $res = $this->_context->_docType . $res;
            }

            // unshift xml declaration
            if ($this->_context->_xmlDeclaration) {
                $res = $this->_context->_xmlDeclaration . "\n" . $res;
            }

            if ($this->_postfilter) {
                return $this->_postfilter->filter($res);
            }
        }
        catch (Exception $e)
        {
            PHPTAL_ExceptionHandler::handleException($e, $this->getEncoding());
        }

        return $res;
    }
321251
public function execute()
    {
        $request       = $this->_request;
        $iTotalRecords = $this->_queryBuilder->getTotalRecords();
        list($data, $objects) = $this->_queryBuilder->getData();
        $id_index      = array_search('_identifier_', array_keys($this->getFields()));
        $ids           = array();
        array_walk($data, function($val, $key) use ($id_index, &$ids) {
            $ids[$key] = $val[$id_index];
        });
        if (!is_null($this->_fixed_data))
        {
            $this->_fixed_data = array_reverse($this->_fixed_data);
            foreach ($this->_fixed_data as $item)
            {
                array_unshift($data, $item);
            }
        }
        if (!is_null($this->_renderer))
        {
            array_walk($data, $this->_renderer);
        }
        if (!is_null($this->_renderer_obj))
        {
            $this->_renderer_obj->applyTo($data, $objects);
        }
        if (!empty($this->_multiple))
        {
            array_walk($data, function($val, $key) use(&$data, $ids) {
                array_unshift($val, "<input type='checkbox' name='dataTables[actions][]' value='{$ids[$key]}' />");
                $data[$key] = $val;
            });
        }
        $output = array(
            "sEcho"                => intval($request->get('sEcho')),
            "iTotalRecords"        => $iTotalRecords,
            "iTotalDisplayRecords" => $iTotalRecords,
            "aaData"               => $data
        );
        return new JsonResponse($output);
    }
445953
public static function get($ID = 'latest', $offset = 0)
    {
        if ($ID === 'latest') {
            if ($offset > 0) {
                $offset = $offset*-1;
            }
            if (Config::get('store') == 'global') {
                $k = array_splice(@array_keys(self::$_tagStore), -1+$offset, 1);
                return self::$_tagStore[$k[0]];
            } elseif (Config::get('store') == 'internal') {
                $Store = Config::getHTMLInstance()->tagStore;
                $k = array_splice(@array_keys($Store), -1+$offset, 1);
                return $Store[$k[0]];
            }
        } elseif (is_int($ID)) {
            if (Config::get('store') == 'global' && isset(self::$_tagStore[$ID])) {
                return self::$_tagStore[$ID];
            } elseif (Config::get('store') == 'internal'
                && isset(Config::getHTMLInstance()->tagStore[$ID])
            ) {
                return Config::getHTMLInstance()->tagStore[$ID];
            }
        }

        return false;
    }
107062
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
    {
        $dom = $namedParameters['dom'];
        if ( $dom instanceof eZContentObjectAttribute )
        {
            $this->ObjectAttributeId = $dom->attribute( 'id' );
            $content = $dom->attribute( 'content' );
            $xmlData = $content->attribute( 'xml_data' );

            $domTree = new DOMDocument( '1.0', 'utf-8' );
            $domTree->preserveWhiteSpace = false;
            $success = $domTree->loadXML( $xmlData );

            $tocText = '';
            if ( $success )
            {
                $this->HeaderCounter = array();
                $this->LastHeaderLevel = 0;

                $rootNode = $domTree->documentElement;
                $tocText .= $this->handleSection( $rootNode );

                while ( $this->LastHeaderLevel > 0 )
                {
                    $tocText .= "</li>\n</ul>\n";
                    $this->LastHeaderLevel--;
                }
            }
        }
        $operatorValue = $tocText;
    }
127960
public function execute(InputInterface $input, OutputInterface $output)
	{
		parent::execute($input, $output);

		$log = $this->changeLog->parse();
		$this->changeLog->write($log);
	}
898114
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getModel();

        if (in_array($payment->getState(), array(PaymentInterface::STATE_APPROVED, PaymentInterface::STATE_DEPOSITED))) {
            $request->markCaptured();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_DEPOSITING))) {
            $request->markPending();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_CANCELED))) {
            $request->markCanceled();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_EXPIRED))) {
            $request->markExpired();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_FAILED))) {
            $request->markFailed();

            return;
        }

        if (in_array($payment->getState(), array(PaymentInterface::STATE_NEW, PaymentInterface::STATE_APPROVING))) {
            $request->markNew();

            return;
        }

        $request->markUnknown();
    }
689251
function invoke() {
        parent::invoke();

        $result = true;

        // Set own core attributes
        $this->does_generate = ACTION_GENERATE_HTML;

        // These are always here
        global $CFG, $XMLDB, $SESSION, $DB;

        // Get lastused
        $o = '';
        if (isset($SESSION->lastused)) {
            if ($lastused = $SESSION->lastused) {
                // Print link
                $o .= '<p class="centerpara"><a href="#lastused">' . $this->str['gotolastused'] . '</a></p>';
            }
        } else {
            $lastused = NULL;
        }

        // Calculate the buttons
        $b = '<p class="centerpara buttons">';
        // The reserved_words button
        $b .= '&nbsp;<a href="index.php?action=view_reserved_words">[' . $this->str['reservedwords'] . ']</a>';
        // The docs button
        $b .= '&nbsp;<a href="index.php?action=generate_all_documentation">[' . $this->str['doc'] . ']</a>';
        // The check indexes button
        $b .= '&nbsp;<a href="index.php?action=check_indexes&amp;sesskey=' . sesskey() . '">[' . $this->str['checkindexes'] . ']</a>';
        // The check defaults button
        $b .= '&nbsp;<a href="index.php?action=check_defaults&amp;sesskey=' . sesskey() . '">[' . $this->str['checkdefaults'] . ']</a>';
        // The check bigints button (only for MySQL and PostgreSQL) MDL-11038a
        if ($DB->get_dbfamily() == 'mysql' || $DB->get_dbfamily() == 'postgres') {
            $b .= '&nbsp;<a href="index.php?action=check_bigints&amp;sesskey=' . sesskey() . '">[' . $this->str['checkbigints'] . ']</a>';
        }
        // The check semantics button (only for Oracle) MDL-29416
        if ($DB->get_dbfamily() == 'oracle') {
            $b .= '&nbsp;<a href="index.php?action=check_oracle_semantics&amp;sesskey=' . sesskey() . '">[' . $this->str['checkoraclesemantics'] . ']</a>';
        }
        $b .= '&nbsp;<a href="index.php?action=check_foreign_keys&amp;sesskey=' . sesskey() . '">[' . $this->str['checkforeignkeys'] . ']</a>';
        $b .= '</p>';
        // Send buttons to output
        $o .= $b;

        // Do the job

        // Get the list of DB directories
        $result = $this->launch('get_db_directories');
        // Display list of DB directories if everything is ok
        if ($result && !empty($XMLDB->dbdirs)) {
            $o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="admintable generaltable">';
            $row = 0;
            foreach ($XMLDB->dbdirs as $key => $dbdir) {
                // Detect if this is the lastused dir
                $hithis = false;
                if (str_replace($CFG->dirroot, '', $key) == $lastused) {
                    $hithis = true;
                }
                $elementtext = str_replace($CFG->dirroot . '/', '', $key);
                // Calculate the dbdir has_changed field if needed
                if (!isset($dbdir->has_changed) && isset($dbdir->xml_loaded)) {
                    $dbdir->xml_changed = false;
                    if (isset($XMLDB->editeddirs[$key])) {
                        $editeddir = $XMLDB->editeddirs[$key];
                        if (isset($editeddir->xml_file)) {
                            $structure = $editeddir->xml_file->getStructure();
                            if ($structure->hasChanged()) {
                                $dbdir->xml_changed = true;
                                $editeddir->xml_changed = true;
                            }
                        }
                    }
                }
                // The file name (link to edit if the file is loaded)
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    is_readable($key) &&
                    !empty($dbdir->xml_loaded)) {
                    $f = '<a href="index.php?action=edit_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '">' . $elementtext . '</a>';
                } else {
                    $f = $elementtext;
                }
                // Calculate the buttons
                $b = ' <td class="button cell">';
                // The create button
                if ($dbdir->path_exists &&
                    !file_exists($key . '/install.xml') &&
                    is_writeable($key)) {
                    $b .= '<a href="index.php?action=create_xml_file&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['create'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['create'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The load button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    empty($dbdir->xml_loaded)) {
                    $b .= '<a href="index.php?action=load_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['load'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['load'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The edit button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    is_readable($key) &&
                    !empty($dbdir->xml_loaded)) {
                    $b .= '<a href="index.php?action=edit_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '">[' . $this->str['edit'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['edit'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The save button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_writeable($key . '/install.xml') &&
                    is_writeable($key) &&
                    !empty($dbdir->xml_loaded) &&
                    !empty($dbdir->xml_changed)) {
                    $b .= '<a href="index.php?action=save_xml_file&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['save'] . ']</a>';
                    // Check if the file has been manually edited while being modified in the editor
                    if ($dbdir->filemtime != filemtime($key . '/install.xml')) {
                        // File manually modified. Add to action error, will be displayed inline.
                        $this->errormsg = $this->str['filemodifiedoutfromeditor'];
                    }
                } else {
                    $b .= '[' . $this->str['save'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The document button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    is_readable($key)) {
                    $b .= '<a href="index.php?action=generate_documentation&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '">[' . $this->str['doc'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['doc'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The view xml button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml')) {
                    $b .= '<a href="index.php?action=view_xml&amp;file=' . urlencode(str_replace($CFG->dirroot, '', $key) . '/install.xml') . '">[' . $this->str['viewxml'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['viewxml'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The revert button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    is_writeable($key) &&
                    !empty($dbdir->xml_loaded) &&
                    !empty($dbdir->xml_changed)) {
                    $b .= '<a href="index.php?action=revert_changes&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '">[' . $this->str['revert'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['revert'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The unload button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    !empty($dbdir->xml_loaded) &&
                    empty($dbdir->xml_changed)) {
                    $b .= '<a href="index.php?action=unload_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '&amp;time=' . time() . '&amp;postaction=main_view#lastused">[' . $this->str['unload'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['unload'] . ']';
                }
                $b .= '</td><td class="button cell">';
                // The delete button
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    is_readable($key . '/install.xml') &&
                    is_writeable($key) &&
                    empty($dbdir->xml_loaded)) {
                    $b .= '<a href="index.php?action=delete_xml_file&amp;sesskey=' . sesskey() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $key)) . '">[' . $this->str['delete'] . ']</a>';
                } else {
                    $b .= '[' . $this->str['delete'] . ']';
                }
                $b .= '</td>';
                // include the higlight
                if ($hithis) {
                    $o .= '<tr class="highlight"><td class="directory cell"><a name="lastused" />' . $f . '</td>' . $b . '</tr>';
                } else {
                    $o .= '<tr class="r' . $row . '"><td class="directory cell">' . $f . '</td>' . $b . '</tr>';
                }
                $row = ($row + 1) % 2;
                // show errors if they exist
                if (isset($dbdir->xml_file)) {
                    if ($structure = $dbdir->xml_file->getStructure()) {
                        $errors = !empty($this->errormsg) ? array($this->errormsg) : array();
                        $structureerrors = $structure->getAllErrors();
                        if ($structureerrors) {
                            $errors = array_merge($errors, $structureerrors);
                        }
                        if (!empty($errors)) {
                            if ($hithis) {
                                $o .= '<tr class="highlight"><td class="error cell" colspan="10">' . implode (', ', $errors) . '</td></tr>';
                            } else {
                                $o .= '<tr class="r' . $row . '"><td class="error cell" colspan="10">' . implode (', ', $errors) . '</td></tr>';
                            }
                        }
                    }
                }
                // If there are changes pending to be saved, but the file cannot be written... inform here
                if ($dbdir->path_exists &&
                    file_exists($key . '/install.xml') &&
                    !empty($dbdir->xml_loaded) &&
                    !empty($dbdir->xml_changed) &&
                    (!is_writeable($key . '/install.xml') || !is_writeable($key))) {

                    if ($hithis) {
                        $o .= '<tr class="highlight"><td class="error cell" colspan="10">';
                    } else {
                        $o .= '<tr class="r' . $row . '"><td class="error cell" colspan="10">';
                    }
                    $o .= $this->str['pendingchangescannotbesavedreload'];
                    $o .= '</td></tr>';
                }
            }
            $o .= '</table>';

            // Set the output
            $this->output = $o;
        }

        // Finally, return result
        return $result;
    }
342246
public function Bind()
	{
		if ( $this->getCount() > 0)
		{
			if ( $this->getAbstractNode(0) instanceof PathExprNode )
			{
				/**
				 * @var PathExprNode $pathExpr
				 */
				$pathExpr = $this->getAbstractNode(0);
				if ( in_array( $this->_name, FuncNode::$s_aggregates ) && $this->_ns == XmlReservedNs::xQueryFunc )
				{
					$pathExpr->Unordered = true;
				}
			}
		}
		parent::Bind();
	}
111370
function http($url, $method, $postfields = NULL, $headers = array()) {
        $this->http_info = array();
        $ci = curl_init();
        /* Curl settings */
        curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
        curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);
        curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
        curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);
        curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
        curl_setopt($ci, CURLOPT_ENCODING, "");
        curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
        if (version_compare(phpversion(), '5.4.0', '<')) {
            curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);
        } else {
            curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);
        }
        curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
        curl_setopt($ci, CURLOPT_HEADER, FALSE);

        switch ($method) {
            case 'POST':
                curl_setopt($ci, CURLOPT_POST, TRUE);
                if (!empty($postfields)) {
                    curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
                    $this->postdata = $postfields;
                }
                break;
            case 'DELETE':
                curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
                if (!empty($postfields)) {
                    $url = "{$url}?{$postfields}";
                }
        }

        curl_setopt($ci, CURLOPT_URL, $url );
        curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );
        curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );

        $response = curl_exec($ci);
        $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
        $this->http_info = array_merge($this->http_info, curl_getinfo($ci));
        $this->url = $url;

        if ($this->debug) {
            echo "=====post data======\r\n";
            var_dump($postfields);

            echo "=====headers======\r\n";
            print_r($headers);

            echo '=====request info====='."\r\n";
            print_r( curl_getinfo($ci) );

            echo '=====response====='."\r\n";
            print_r( $response );
        }
        curl_close ($ci);
        return $response;
    }
1346618
public function forceEndDocument(): void
    {
        if (empty($this->stack)) {
            return;
        }

        $key = $this->keys;
        for ($i = $this->level - 1; $i > 0; --$i) {
            $value = array_pop($this->stack);
            //value
            $obj = array_pop($this->stack);
            if (!empty($key[$i])) {
                $obj[$key[$i]] = $value;
                $key[$i] = null;
            } else {
                $obj[] = $value;
            }
            if ($i > 1) {
                $this->stack[] = $obj;
            } else {
                $this->json = $obj;
            }
        }
    }