⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.89
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
Controller
/
Edit File: UrlWriter.php
<?php /** * Copyright 2008-2017 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsd. * * @author Mike Naberezny <mike@maintainable.com> * @author Derek DeVries <derek@maintainable.com> * @author Chuck Hagenbuch <chuck@horde.org> * @category Horde * @license http://www.horde.org/licenses/bsd BSD * @package Controller */ /** * URL generation utility for controllers * * @author Mike Naberezny <mike@maintainable.com> * @author Derek DeVries <derek@maintainable.com> * @author Chuck Hagenbuch <chuck@horde.org> * @category Horde * @copyright 2008-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD * @package Controller */ class Horde_Controller_UrlWriter { /** * Defaults to merge into route parameters when not using named routes. * @var array */ protected $_defaults; /** * @var Horde_Routes_Util */ protected $_utils; /** * Class constructor * * @param Horde_Routes_Utils $utils Route utilities * @param array $defaults Defaults to merge for urlFor() */ public function __construct(Horde_Routes_Utils $utils, $defaults = array()) { $this->_utils = $utils; $this->_defaults = $defaults; } /** * Generate a URL. Same signature as Horde_Routes_Utils->urlFor(). * * @param $first mixed * @param $second mixed * @return string */ public function urlFor($first, $second = array()) { // anonymous route: serialize to params & merge defaults // urlFor(array('controller' => 'books')) if (is_array($first)) { $first = array_merge($this->_defaults, $this->_serializeToParams($first)); } // named route: serialize to params only (no merge) // urlFor('notes', array('action' => 'show', 'id' => 1)) if (is_array($second)) { $second = $this->_serializeToParams($second); } // url generation "route memory" is not useful here $this->_utils->mapperDict = array(); // generate url return $this->_utils->urlFor($first, $second); } /** * Serialize any objects in the collection supporting toParam() before * passing the collection to Horde_Routes. * * @param array $collection * @param array */ protected function _serializeToParams($collection) { foreach ($collection as &$value) { if (is_object($value) && method_exists($value, 'toParam')) { $value = $value->toParam(); } } return $collection; } }
Simpan