git::escargs PHP Method

escargs() static public method

static public escargs ( $args )
    static function escargs($args)
    {
        if ($args === null) {
            return '';
        }
        return is_string($args) ? escapeshellarg($args) : implode(' ', array_map('escapeshellarg', $args));
    }

Usage Example

Example #1
0
 function rawPatch($paths = null)
 {
     $paths = git::escargs($paths);
     $cmd = 'log -p --full-index --pretty="format:" --encoding=UTF-8 --date=iso --dense ' . escapeshellarg($this->id) . ' -1';
     if ($paths) {
         $cmd .= ' -- ' . $paths;
     }
     $s = git::exec($cmd);
     return $s ? substr($s, 1, -1) : '';
 }