Simple user function returning a var_dump of input parameters

@param array $params
@param mixed $tsObj
@return string
498072
public function user_1(&$params, &$tsObj)
    {
        $out = '';

        // Params;
        $out .= '<pre>';
        ob_start();
        var_dump($params);
        $out .= ob_get_contents();
        ob_end_clean();
        $out .= '</pre>';

        return $out;
    }
1291221
public function outputImage($params = array())
    {
        $param_defaults = array(
            'width' => 120,
            'height' => 40,
            // 'length' => 6
        );
        $params = \array_merge($param_defaults, $params);
        $code = $this->generateCode($this->length);
        $font_size = $params['height'] * $this->font_scale;
        $image = @\imagecreate($params['width'], $params['height']) or die('Cannot initialize new GD image stream');
        // set the colors
        $color_bkg = \imagecolorallocate($image, 0, 0, 0);
        // $color_text = imagecolorallocate($image, 20, 40, 100);
        $color_text = \imagecolorallocate($image, 200, 200, 200);
        $color_noise = \imagecolorallocate($image, 150, 150, 150);
        // generate random dots in background
        for ($i=0; $i<($params['width']*$params['height'])/$this->dot_divisor; $i++) {
            \imagefilledellipse($image, \mt_rand(0, $params['width']), \mt_rand(0, $params['height']), 1, 1, $color_noise);
        }
        // generate random lines in background
        for ($i=0; $i<($params['width']*$params['height'])/$this->line_divisor; $i++) {
            \imageline($image, \mt_rand(0, $params['width']), \mt_rand(0, $params['height']), \mt_rand(0, $params['width']), \mt_rand(0, $params['height']), $color_noise);
        }
        // create textbox and add text
        $textbox = \imagettfbbox($font_size, 0, $this->font, $code); // or die('Error in imagettfbbox function');
        $x = ($params['width'] - $textbox[4])/2;
        $y = ($params['height'] - $textbox[5])/2;
        \imagettftext($image, $font_size, 0, $x, $y, $color_text, $this->font, $code); // or die('Error in imagettftext function');
        // output captcha image to browser
        \header('Last-Modified: '.\date('r'));
        \header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
        \header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
        \header('Content-Type: image/jpeg');
        \header('Pragma: no-cache');
        \imagejpeg($image);
        \imagedestroy($image);
    }
769813
protected function generateParamsTemplate($id, $st_params)
    {
        if (!isset($st_params['ApiParams']))
        {
             return;
        }

        $body = [];
        $paramSampleBtnTpl = $this->loadPartialTemplate('paramSampleBtnTpl');
        $paramContentTpl = $this->loadPartialTemplate('paramContentTpl');

        foreach ($st_params['ApiParams'] as $params) {
            $tr = array(
                '{{ name }}'        => $params['name'],
                '{{ type }}'        => $params['type'],
                '{{ nullable }}'    => @$params['nullable'] == '1' ? 'No' : 'Yes',
                '{{ description }}' => @$params['description'],
            );

            if (isset($params['sample'])) {
                $tr['{{ type }}'].= ' '.strtr($paramSampleBtnTpl, array('{{ sample }}' => $params['sample']));
            }

            $body[] = strtr($paramContentTpl, $tr);
        }

        return strtr($this->loadPartialTemplate('paramTableTpl'), array('{{ tbody }}' => implode(PHP_EOL, $body)));
    }
342315
public function search($params)
    {//echo __METHOD__;var_dump($params);
        $this->load($params);//var_dump($this->titleMinLength);var_dump($this->title);var_dump($this->body);

        $modelNewsClassname = $this->module->model('News')->className();
        $query = $this->module->model('NewsQuery', [$modelNewsClassname]);//var_dump($query);exit;

        $query->orderBy(['show_from_time' => SORT_DESC]);

        //$query->alias('main')->leftJoin(['i18n' => NewsI18n::tableName()], "main.id = i18n.news_id AND i18n.lang_code = '{$this->langCodeMain}'");

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        if (!$this->validate()) {
            $query->where('0=1'); // uncomment this line if you do not want to return any records when validation fails
            return $dataProvider;
        }

        // required criterias
        $query->where(['is_visible' => true]);

        $tzShiftSec = intval(date('Z')); // server time zone shift in seconds: west UTC <0, east UTC >0
        if (!empty($tzShiftSec)) {
            $now = new Expression("DATE_SUB(NOW(), INTERVAL {$tzShiftSec} SECOND)"); // UTC time
        }
        $query->andWhere(['<=', 'show_from_time', $now])
              ->andWhere(['or',
                  ['>=', 'show_to_time', $now],
                  ['show_to_time' => null],
                  //new Expression("show_to_time IS NULL"), //?? ['show_to_time' => null],
              ]);
        // no news for current language
/*
        $query->andWhere(['not', ['title' => null]]);
        $query->andWhere(['not', ['body'  => null]]);
        $query->andWhere(['not', ['title' => ''  ]]);
        $query->andWhere(['not', ['body'  => ''  ]]);
*/
        $query->andWhere(['and',
          ['not', ['title' => null]],
          ['not', ['body'  => null]],
          ['not', ['title' => ''  ]],
          ['not', ['body'  => ''  ]],
        ]);
        if (isset($this->titleMinLength)) {
            //$lengthExpr = new Expression("LENGTH(title)"); //! length in bytes, not UTF8-symbols
            $lengthExpr = new Expression("CHAR_LENGTH(title)");
            $query->andFilterWhere(['>=', $lengthExpr, $this->titleMinLength]);
        }
        if (isset($this->bodyMinLength)) {
            //$lengthExpr = new Expression("LENGTH(body)"); //! length in bytes, not UTF8-symbols
            $lengthExpr = new Expression("CHAR_LENGTH(body)");
            $query->andFilterWhere(['>=', $lengthExpr, $this->bodyMinLength]);
        }

        // additional search criterias
        $query->andFilterWhere(['owner_id' => $this->owner_id]);
        $query->andFilterWhere(['like', 'title', $this->title]);
        $query->andFilterWhere(['like', 'body', $this->body]);

        //list($sql, $sqlParams) = Yii::$app->db->getQueryBuilder()->build($query);var_dump($sql);var_dump($sqlParams);
        return $dataProvider;
    }
405238
public static function extractParamValues($params, &$values) {
        foreach ($params as $k => $v) {
            if (is_array($v) || is_object($v)) {
                self::extractParamValues($v, $values);
            } else {
                if (is_bool($v))  {
                    //if a value is set as false, invalid hash will generate
                    //https://github.com/sailthru/sailthru-php5-client/issues/4
                    $v = intval($v);
                }
                $values[] = $v;
            }
        }
    }
515956
public static function var_dump($var, $varname = '...', $params = array())
    {
        if (!self::isDebug()) {
            return false;
        }

        // var_dump the variable into a buffer and keep the output
        ob_start();
        var_dump($var);
        $output = ob_get_clean();
        $_this  = self::i();

        // neaten the newlines and indents
        $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
        //if (!extension_loaded('xdebug')) {
        $output = $_this->_htmlChars($output);
        //}

        $_this->_dumpRenderHtml($output, $varname . '::html', $params);

        return $_this;
    }
267438
public function dumpParameters()
    {
        $parameters = [];
        foreach ($this->getParameters() as $parameter) {
            $string = '';
            if ($parameter->isArray()) {
                $string .= 'array ';
            } elseif ($parameter->getClass()) {
                $string .= $parameter->getClass()->name.' ';
            }
            if ($parameter->isPassedByReference()) {
                $string .= '&';
            }
            $string .= '$'.$parameter->name;
            if ($parameter->isOptional()) {
                $string .= ' = '.var_export($parameter->getDefaultValue(), true);
            }
            $parameters[] = $string;
        }

        return '('.implode(', ', $parameters).')';
    }
1248453
function paramsFromStringPath(path, paramsObj) {
        //Get all the parameter names from the path.
        var elements = path.split('/');
        var params = elements.reduce(function(params, element) {
            if (element.charAt(0) === ':') {
                var paramName = element.slice(1);
                params.push(paramsObj[paramName]);
            }
            return params;
        }, []);
        return params;
    }
612121
private function paramStrToArr(string $paramString)
    {
        $str = \substr($paramString, 2, -2);
        $result = \array_filter(\preg_split('/\\s+/', $str), function ($a) {
            return '' !== \trim($a);
        });
        $result = \array_values($result);

        if (!\in_array(\strpos($result[0], ':'), [0, false], true)) {
            $first = \array_shift($result);
            list($a, $b) = \explode(':', $first, 2);
            $b = ':' . $b;
            \array_unshift($result, $a, $b);
        }

        return $result;
    }
1130675
public function getQueryString(array $new_params = [])
    {
        $params = $_GET;
        if (!empty($this->input)) {
            $params[$this->getKey()] = $this->input;
        }
        if (!empty($new_params)) {
            if (empty($params[$this->getKey()])) {
                $params[$this->getKey()] = [];
            }
            foreach ($new_params as $key => $value) {
                $params[$this->getKey()][$key] = $value;
            }
        }
        return http_build_query($params);
    }
1055666
private function _get_args_from_params(array $params)
	{
		$byType	=	$this->container->requestRouteParams;
		$args	=	[];
		foreach ($params as $param)
		{
			if ($param->hasType() && isset($byType[$type = strtolower($param->getType())]))
				$args[] = $byType[$type];
			else if (isset($this->params[$param->name]))
				$args[] = $this->params[$param->name];
			else if (isset($_GET[$param->name]))
				$args[] = $_GET[$param->name];
			else if (isset($_POST[$param->name]))
				$args[] = $_POST[$param->name];
			else
			{
				if ( ! $param->isOptional())
					throw new \Exception('Unable to find NON-optional parameter `' . $param->name . ($param->hasType() ? '` of type `' . $param->getType() : null) . '` for route controller/handler: ' . var_export($this->route, true));
				$args[] = $param->getDefaultValue();
			}
		}
		return $args;
	}
1129030
public function ajouterActualite($params = array())
    {
        if (isset($this->variablesPost['idActualite']) && $this->variablesPost['idActualite']!='') {
            $d = new dateObject();
            $desactive = 0;
            if (isset($this->variablesPost['desactive']) && $this->variablesPost['desactive']=='1') {
                $desactive = 1;
            }
            $envoi = 0;
            if (isset($this->variablesPost['envoiMailHebdomadaire']) && $this->variablesPost['envoiMailHebdomadaire']=='1') {
                $envoi = 1;
            }
            $req = "INSERT INTO actualites (titre,sousTitre,`date`,texte,urlFichier,fichierPdf,desactive,texteMailHebdomadaire,envoiMailHebdomadaire) VALUES (
            \"".mysql_real_escape_string($this->variablesPost['titre'])."\",
            \"".mysql_real_escape_string($this->variablesPost['sousTitre'])."\",
            \"".$d->toBdd(mysql_real_escape_string($this->variablesPost['date']))."\",
            \"".mysql_real_escape_string($this->variablesPost['texte'])."\",
            \"".mysql_real_escape_string($this->variablesPost['urlFichier'])."\",
            \"".mysql_real_escape_string($this->variablesPost['fichierPdf'])."\",
            '".$desactive."',
            \"".mysql_real_escape_string($this->variablesPost['texteMailHebdomadaire'])."\",
            '".$envoi."'
            ) ";
            $res = $this->connexionBdd->requete($req);

            //\"".mysql_real_escape_string($this->variablesPost['photoIllustration'])."\",
            $idNewActualite = mysql_insert_id();
            if (!file_exists($this->getCheminPhysique()."images/actualites/$idNewActualite/")) {
                mkdir($this->getCheminPhysique()."images/actualites/$idNewActualite/");
            }
            $f = new fileObject();

            // gestion de l'upload
            if (isset($_FILES['photoIllustration']) && !$_FILES['photoIllustration']['error']) {
                $f->handleUploadedFileSimpleMoveTo(array('inputFileName'=>'photoIllustration', 'redimensionneImageConfig'=>array(150=>array('destination'=>$this->getCheminPhysique()."images/actualites/".$idNewActualite."/illustration200.jpg"))));

                // on met a jour la bdd , meme si dans les prochaines actu cela ne sert a rien de garder le champs , vu le fonctionnement, on le garde pour les anciennes actus
                $reqIllustration = "UPDATE actualites SET photoIllustration='illustration200.jpg' WHERE idActualite='".$idNewActualite."' ";
                $resIllustration = $this->connexionBdd->requete($reqIllustration);
            }

            // on verifie dans le repertoire d'uploadMultiple pour voir s'il y a des images a transferer
            if (file_exists($this->getCheminPhysique()."images/uploadMultipleActualites/")) {
                $f->convertDirectoryFilesNamesToUTF8(array('repertoire'=>$this->getCheminPhysique()."images/uploadMultipleActualites/"));
                $arrayFiles = $f->getListeFichiersArrayFrom($this->getCheminPhysique()."images/uploadMultipleActualites/");
                foreach ($arrayFiles as $indice=>$fichier) {
                    // on deplace tous les fichiers dans le repertoire de l'actu , ceux qui auront le meme nom seront ecrasés.
                    if ($fichier!='.' && $fichier!='..') {
                        rename($this->getCheminPhysique()."images/uploadMultipleActualites/".$fichier, $this->getCheminPhysique()."images/actualites/$idNewActualite/".$f->removeSpecialCharFromFileName($fichier));
                    }
                }
                $f->convertDirectoryFilesNamesToUTF8(array('repertoire'=>$this->getCheminPhysique()."images/actualites/$idNewActualite/"));
            }

            // creation automatique du fichier pdf
            if ($this->variablesPost['urlFichier']=='') {

                // evite de creer un fichier pdf pour rien
                $pdfObject = new pdfObject();
                $pdfObject->setContent(stripslashes($this->variablesPost['titre'].$this->variablesPost['sousTitre'].$this->variablesPost['texte']));
                $pdfObject->writeToFile($this->getCheminPhysique()."images/actualites/$idNewActualite/versionPdf.pdf");
                if (file_exists($this->getCheminPhysique()."images/actualites/$idNewActualite/versionPdf.pdf")) {

                    // pas genial , mais c'est pour garder la compatibilié avec les news precedentes qui n'etait pas generee automatiquement en pdf sur lesquelles on precisait le nom du fichier que l'on uploadait a la main 
                    $reqUpdatePdf = "UPDATE actualites SET fichierPdf='versionPdf.pdf' WHERE idActualite = '$idNewActualite'";
                }
                $resUpdatePdf = $this->connexionBdd->requete($reqUpdatePdf);
            }
        }
        if (isset($this->variablesGet['previsualisationMail']) && $this->variablesGet['previsualisationMail']=='1') {
            $auth=new archiAuthentification();
            $preview=isset($_GET["preview"])?"&preview=1":"";
            $testMail=isset($_GET["testMail"])?"&testMail=1":"";
            echo "<script>location.href='".$this->getUrlRacine()."/script/cronMailsNouvellesAdresses.php?modePrevisualisationAdmin=1&idActualite=$idNewActualite&idUtilisateur=".$auth->getIdUtilisateur().$preview.$testMail."';</script>";

            //$this->creerUrl('','', array("modePrevisualisationAdmin"=>1,"idActualite"=>$idActualite,"idUtilisateur"=>$authentification->getIdUtilisateur()))
        }
    }
497769
private static function parseInputToString($params)
    {
        return is_array($params) ? array_map(function ($item) {
            return trim(htmlspecialchars($item, ENT_QUOTES, 'UTF-8'));
        }, $params) : trim(htmlspecialchars($params, ENT_QUOTES, 'UTF-8'));
    }
528218
private function _exec($request, $params = null): ?string
  {
    if ( is_string($request) && bbn\str::is_json($request) ){
      $request = json_decode($request, true);
    }
    if ( is_array($request) ){
      return $this->_exec_array($request);
    }
    return $this->_exec_string($request, $params);
  }
1283621
public function toSQL(Parameters $params, bool $inner_clause)
    {
        $func = $this->getFunction();
        $arguments = $this->getArguments();
        
        $args = array();
        foreach ($arguments as $arg)
            $args[] = $params->getDriver()->toSQL($params, $arg, false);

        return $func . '(' . implode(', ', $args) . ')';
    }
911925
public function generateScripts(array $params = null)
    {
        $cball = <<<CBALL
(function(window,$){ 
            $('body').on('click', '#%s', function () {
                $('div.test-results').remove();
                var form=$(this).parents('form:first');                
                $.ajax({
                    url:"%s",
                    data:form.serialize(),
                    type:"POST",
                    beforeSend:function(){                        
                        form.find('input,button,select,textarea').addClass('btn-disabled').attr('disabled','disabled');
                    },
                    success:function(response){
                        $('<div/>').attr('class','test-results').html(response).insertAfter(form);
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    },
                    error:function(response){
                        form.find('input,button,select,textarea').removeClass('btn-disabled').removeAttr('disabled');
                    }
                });
                return false;
            });      
   })(window,jQuery);

CBALL;

        $inlineScript = sprintf($cball, $params['id'], handles('antares::tools/tester/run', ['csrf' => true]));
        app('antares.asset')
                ->container(app('config')->get('antares/tester::container'))
                ->inlineScript($params['id'], $inlineScript);
    }
584969
private static String[] convertParameters(Class<?>[] params)
   {
      List<String> tmp = new ArrayList<String>();
      for (Class<?> c : params)
      {
         if (c.isArray())
         {
            StringBuffer sb = new StringBuffer();
            Class<?> subType = c.getComponentType();
            sb.append(subType.getName());
            // Convert to type[][]...[]
            while (subType != null)
            {
               sb.append("[]");
               subType = subType.getComponentType();
            }
            tmp.add(sb.toString());
         }
         else
         {
            tmp.add(c.getName());
         }
      }
      String[] sig = new String[tmp.size()];
      tmp.toArray(sig);
      return sig;
   }