Set Command Path

@param string
@param string
333863
public static function set($namespace, $path)
    {
        $namespace = trim($namespace, '\\');
        $path = rtrim($path, '/');

        if (!isset(self::$_namespace_list[$namespace])) {
            self::$_namespace_list[$namespace] = [];
        }

        self::$_namespace_list[$namespace][] = $path;
    }
72940
def set_path(self, path):
		""""""
		if os.path.isabs(path):
			path = os.path.normpath(os.path.join(self.cwd, path))

		self.path = path
		self.relative = os.path.relpath(self.path, self.base)
1003455
public static function setMap($map = null)
    {
        if (is_null(self::$map)) {
            self::$map = include(__DIR__ . '/CommandLine/map.php');
        }

        if (!is_null($map)) {
            self::$map = $map;
        }
    }
867011
function svgPath($command, $arguments)
	{
		$path_cmd = '';
		$newsubpath = false;
		// mPDF 5.0.039
		$minl = $this->pathBBox[0];
		$mint = $this->pathBBox[1];
		$maxr = $this->pathBBox[2] + $this->pathBBox[0];
		$maxb = $this->pathBBox[3] + $this->pathBBox[1];

		$start = [$this->xbase, -$this->ybase];

		// taken from https://github.com/PhenX/php-svg-lib/blob/master/src/Svg/Tag/Path.php#L47
		// Handle args like: a5.38022,5.38022,0,0,1-2.4207.72246,4.50524,4.50524,0,0,1-3.12681-1.33942,9.67442,9.67442,0,0,1-2.38273-3.016,1.87506,1.87506,0,0,1,.34979-2.43562
		preg_match_all('/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/i', $arguments, $a, PREG_PATTERN_ORDER);
		$a = $a[0];

		//	if the command is a capital letter, the coords go absolute, otherwise relative
		if (strtolower($command) == $command) {
			$relative = true;
		} else {
			$relative = false;
		}


		$ile_argumentow = count($a);

		//	each command may have different needs for arguments [1 to 8]

		switch (strtolower($command)) {
			case 'm': // move
				for ($i = 0; $i < $ile_argumentow; $i+=2) {
					$x = $a[$i];
					$y = $a[$i + 1];
					if ($relative) {
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);
					$minl = min($minl, $pdf_pt['x']);
					$maxr = max($maxr, $pdf_pt['x']);
					$mint = min($mint, -$pdf_pt['y']);
					$maxb = max($maxb, -$pdf_pt['y']);
					if ($i == 0) {
						$path_cmd .= sprintf('%.3F %.3F m ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
					} else {
						$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
					}
					// mPDF 4.4.003  Save start points of subpath
					if ($this->subPathInit) {
						$this->spxstart = $this->xbase;
						$this->spystart = $this->ybase;
						$this->subPathInit = false;
					}
				}
				break;
			case 'l': // a simple line
				for ($i = 0; $i < $ile_argumentow; $i+=2) {
					$x = ($a[$i]);
					$y = ($a[$i + 1]);
					if ($relative) {
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);
					$minl = min($minl, $pdf_pt['x']);
					$maxr = max($maxr, $pdf_pt['x']);
					$mint = min($mint, -$pdf_pt['y']);
					$maxb = max($maxb, -$pdf_pt['y']);
					$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
				}
				break;
			case 'h': // a very simple horizontal line
				for ($i = 0; $i < $ile_argumentow; $i++) {
					$x = ($a[$i]);
					if ($relative) {
						$y = 0;
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$y = -$this->ybase;
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);
					$minl = min($minl, $pdf_pt['x']);
					$maxr = max($maxr, $pdf_pt['x']);
					$mint = min($mint, -$pdf_pt['y']);
					$maxb = max($maxb, -$pdf_pt['y']);
					$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
				}
				break;
			case 'v': // the simplest line, vertical
				for ($i = 0; $i < $ile_argumentow; $i++) {
					$y = ($a[$i]);
					if ($relative) {
						$x = 0;
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$x = $this->xbase;
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);
					$minl = min($minl, $pdf_pt['x']);
					$maxr = max($maxr, $pdf_pt['x']);
					$mint = min($mint, -$pdf_pt['y']);
					$maxb = max($maxb, -$pdf_pt['y']);
					$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
				}
				break;
			case 's': // bezier with first vertex equal first control
				// mPDF 4.4.003
				if (!($this->lastcommand == 'C' || $this->lastcommand == 'c' || $this->lastcommand == 'S' || $this->lastcommand == 's')) {
					$this->lastcontrolpoints = [0, 0];
				}
				for ($i = 0; $i < $ile_argumentow; $i += 4) {
					$x1 = $this->lastcontrolpoints[0];
					$y1 = $this->lastcontrolpoints[1];
					$x2 = ($a[$i]);
					$y2 = ($a[$i + 1]);
					$x = ($a[$i + 2]);
					$y = ($a[$i + 3]);
					if ($relative) {
						$pdfx1 = ($this->xbase + $x1);
						$pdfy1 = ($this->ybase - $y1);
						$pdfx2 = ($this->xbase + $x2);
						$pdfy2 = ($this->ybase - $y2);
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx1 = $this->xbase + $x1;
						$pdfy1 = $this->ybase - $y1;
						$pdfx2 = $x2;
						$pdfy2 = -$y2;
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$this->lastcontrolpoints = [($pdfx - $pdfx2), -($pdfy - $pdfy2)]; // mPDF 4.4.003 always relative

					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);

					$curves = [$pdfx1, -$pdfy1, $pdfx2, -$pdfy2, $pdfx, -$pdfy];
					$bx = $this->computeBezierBoundingBox($start, $curves);
					$minl = min($minl, $bx[0]);
					$maxr = max($maxr, $bx[2]);
					$mint = min($mint, $bx[1]);
					$maxb = max($maxb, $bx[3]);

					if (($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy)) {
						$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
					} else {
						$path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1 * $this->kp, $pdfy1 * $this->kp, $pdfx2 * $this->kp, $pdfy2 * $this->kp, $pdfx * $this->kp, $pdfy * $this->kp);
					}
				}
				break;
			case 'c': // bezier with second vertex equal second control
				for ($i = 0; $i < $ile_argumentow; $i += 6) {
					$x1 = ($a[$i]);
					$y1 = ($a[$i + 1]);
					$x2 = ($a[$i + 2]);
					$y2 = ($a[$i + 3]);
					$x = ($a[$i + 4]);
					$y = ($a[$i + 5]);


					if ($relative) {
						$pdfx1 = ($this->xbase + $x1);
						$pdfy1 = ($this->ybase - $y1);
						$pdfx2 = ($this->xbase + $x2);
						$pdfy2 = ($this->ybase - $y2);
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);
						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx1 = $x1;
						$pdfy1 = -$y1;
						$pdfx2 = $x2;
						$pdfy2 = -$y2;
						$pdfx = $x;
						$pdfy = -$y;
						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$this->lastcontrolpoints = [($pdfx - $pdfx2), -($pdfy - $pdfy2)]; // mPDF 4.4.003 always relative
					// $pdf_pt2 = $this->svg_overflow($pdfx2,$pdfy2);
					// $pdf_pt1 = $this->svg_overflow($pdfx1,$pdfy1);
					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);

					$curves = [$pdfx1, -$pdfy1, $pdfx2, -$pdfy2, $pdfx, -$pdfy];
					$bx = $this->computeBezierBoundingBox($start, $curves);
					$minl = min($minl, $bx[0]);
					$maxr = max($maxr, $bx[2]);
					$mint = min($mint, $bx[1]);
					$maxb = max($maxb, $bx[3]);

					if (($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy)) {
						$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
					} else {
						$path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1 * $this->kp, $pdfy1 * $this->kp, $pdfx2 * $this->kp, $pdfy2 * $this->kp, $pdfx * $this->kp, $pdfy * $this->kp);
					}
				}
				break;

			case 'q': // bezier quadratic avec point de control
				for ($i = 0; $i < $ile_argumentow; $i += 4) {
					$x1 = ($a[$i]);
					$y1 = ($a[$i + 1]);
					$x = ($a[$i + 2]);
					$y = ($a[$i + 3]);
					if ($relative) {
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);

						$pdfx1 = ($this->xbase + ($x1 * 2 / 3));
						$pdfy1 = ($this->ybase - ($y1 * 2 / 3));
						// mPDF 4.4.003
						$pdfx2 = $pdfx1 + 1 / 3 * ($x);
						$pdfy2 = $pdfy1 + 1 / 3 * (-$y);

						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx = $x;
						$pdfy = -$y;

						$pdfx1 = ($this->xbase + (($x1 - $this->xbase) * 2 / 3));
						$pdfy1 = ($this->ybase - (($y1 + $this->ybase) * 2 / 3));

						$pdfx2 = ($x + (($x1 - $x) * 2 / 3));
						$pdfy2 = (-$y - (($y1 - $y) * 2 / 3));

						// mPDF 4.4.003
						$pdfx2 = $pdfx1 + 1 / 3 * ($x - $this->xbase);
						$pdfy2 = $pdfy1 + 1 / 3 * (-$y - $this->ybase);

						$this->xbase = $x;
						$this->ybase = -$y;
					}
					$this->lastcontrolpoints = [($pdfx - $pdfx2), -($pdfy - $pdfy2)]; // mPDF 4.4.003 always relative

					$pdf_pt = $this->svg_overflow($pdfx, $pdfy);

					$curves = [$pdfx1, -$pdfy1, $pdfx2, -$pdfy2, $pdfx, -$pdfy];
					$bx = $this->computeBezierBoundingBox($start, $curves);
					$minl = min($minl, $bx[0]);
					$maxr = max($maxr, $bx[2]);
					$mint = min($mint, $bx[1]);
					$maxb = max($maxb, $bx[3]);

					if (($pdf_pt['x'] != $pdfx) || ($pdf_pt['y'] != $pdfy)) {
						$path_cmd .= sprintf('%.3F %.3F l ', $pdf_pt['x'] * $this->kp, $pdf_pt['y'] * $this->kp);
					} else {
						$path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1 * $this->kp, $pdfy1 * $this->kp, $pdfx2 * $this->kp, $pdfy2 * $this->kp, $pdfx * $this->kp, $pdfy * $this->kp);
					}
				}
				break;
			case 't': // bezier quadratic avec point de control simetrique a lancien point de control
				if (!($this->lastcommand == 'Q' || $this->lastcommand == 'q' || $this->lastcommand == 'T' || $this->lastcommand == 't')) {
					$this->lastcontrolpoints = [0, 0];
				}
				for ($i = 0; $i < $ile_argumentow; $i += 2) {
					$x = ($a[$i]);
					$y = ($a[$i + 1]);

					$x1 = $this->lastcontrolpoints[0];
					$y1 = $this->lastcontrolpoints[1];

					if ($relative) {
						$pdfx = ($this->xbase + $x);
						$pdfy = ($this->ybase - $y);

						$pdfx1 = ($this->xbase + ($x1));
						$pdfy1 = ($this->ybase - ($y1));
						// mPDF 4.4.003
						$pdfx2 = $pdfx1 + 1 / 3 * ($x);
						$pdfy2 = $pdfy1 + 1 / 3 * (-$y);

						$this->xbase += $x;
						$this->ybase += -$y;
					} else {
						$pdfx = $x;
						$pdfy = -$y;

						$pdfx1 = ($this->xbase + ($x1));
						$pdfy1 = ($this->ybase - ($y1));
						// mPDF 4.4.003
						$pdfx2 = $pdfx1 + 1 / 3 * ($x - $this->xbase);
						$pdfy2 = $pdfy1 + 1 / 3 * (-$y - $this->ybase);

						$this->xbase = $x;
						$this->ybase = -$y;
					}

					$this->lastcontrolpoints = [($pdfx - $pdfx2), -($pdfy - $pdfy2)]; // mPDF 4.4.003 always relative

					$curves = [$pdfx1, -$pdfy1, $pdfx2, -$pdfy2, $pdfx, -$pdfy];
					$bx = $this->computeBezierBoundingBox($start, $curves);
					$minl = min($minl, $bx[0]);
					$maxr = max($maxr, $bx[2]);
					$mint = min($mint, $bx[1]);
					$maxb = max($maxb, $bx[3]);

					$path_cmd .= sprintf('%.3F %.3F %.3F %.3F %.3F %.3F c ', $pdfx1 * $this->kp, $pdfy1 * $this->kp, $pdfx2 * $this->kp, $pdfy2 * $this->kp, $pdfx * $this->kp, $pdfy * $this->kp);
				}

				break;
			case 'a': // Elliptical arc
				for ($i = 0; $i < $ile_argumentow; $i += 7) {
					$rx = ($a[$i]);
					$ry = ($a[$i + 1]);
					$angle = ($a[$i + 2]); //x-axis-rotation
					$largeArcFlag = ($a[$i + 3]);
					$sweepFlag = ($a[$i + 4]);
					$x2 = ($a[$i + 5]);
					$y2 = ($a[$i + 6]);
					$x1 = $this->xbase;
					$y1 = -$this->ybase;
					if ($relative) {
						$x2 = $this->xbase + $x2;
						$y2 = -$this->ybase + $y2;
						$this->xbase += ($a[$i + 5]);
						$this->ybase += -($a[$i + 6]);
					} else {
						$this->xbase = $x2;
						$this->ybase = -$y2;
					}
					list($pcmd, $bounds) = $this->Arcto($x1, $y1, $x2, $y2, $rx, $ry, $angle, $largeArcFlag, $sweepFlag);
					$minl = min($minl, $x2, min($bounds[0]));
					$maxr = max($maxr, $x2, max($bounds[0]));
					$mint = min($mint, $y2, min($bounds[1]));
					$maxb = max($maxb, $y2, max($bounds[1]));
					$path_cmd .= $pcmd;
				}
				break;
			case 'z':
				$path_cmd .= 'h ';
				$this->subPathInit = true;
				$newsubpath = true;
				$this->xbase = $this->spxstart;
				$this->ybase = $this->spystart;
				break;
			default:
				break;
		}

		if (!$newsubpath) {
			$this->subPathInit = false;
		}
		$this->lastcommand = $command;
		// mPDF 5.0.039
		$this->pathBBox[0] = $minl;
		$this->pathBBox[1] = $mint;
		$this->pathBBox[2] = $maxr - $this->pathBBox[0];
		$this->pathBBox[3] = $maxb - $this->pathBBox[1];
		return $path_cmd;
	}
362555
protected static function setPath(&$m, $path, $val)
    {
        foreach ($path as $p) {
            $m =& $m[$p];
        }
        $m = $val;
    }
1215204
public static function route(string $command, array $args) : void {
        $object = new static('test');
        echo "\n";
        if (method_exists(static::class, $command)) {
            $response = call_user_func_array([$object, $command], $args);
            if ($response === NULL)
                echo "SUCCESS";
            else if ($response === FALSE)
                echo "FALSE";
            else if ($response === TRUE)
                echo "TRUE";
            else {
                if (is_string($response))
                    echo $response;
                else print_r($response);
            }
        } else echo "No such method available";
        echo "\n\n";
    }
247491
protected function setPath($path, $permission)
    {
        if (true !== $this->files->exists($path)) {
            $this->files->mkdir($path, $permission, true);
        }
        $this->path = $path;
    }
635528
def setCmd(self, cmd):
        """"""
        cmd = cmd.upper()
        if cmd not in VALID_COMMANDS:
            raise FrameError("The cmd '%s' is not valid! It must be one of '%s' (STOMP v%s)." % (
                cmd, VALID_COMMANDS, STOMP_VERSION)
            )
        else:
            self._cmd = cmd
893700
public function setPath($key, $path)
	{
		$this->paths[(string) $key] = (string) $path;

		return $this;
	}
1174511
public function setPath(string $path): ServiceWriter {

		// remove trailing '/' if found
		if( substr($path, -1) === '/' )
			$path = substr($path, 0, -1);

		$this->path = $path;
		return $this;
	}
277193
private function setPath($path)
    {
        $this->info['path'] = $this->info['file'] = $this->info['extension'] = $this->info['content'] = null;

        if ($this->getScheme() === 'data') {
            $this->info['content'] = $path;

            return;
        }

        $file = substr(strrchr($path, '/'), 1);

        if (strlen($file)) {
            $path = substr($path, 0, -strlen($file));

            if (preg_match('/(.*)\.([\w]+)$/', $file, $match)) {
                $this->info['file'] = rawurldecode($match[1]);
                $this->info['extension'] = $match[2];
            } else {
                $this->info['file'] = rawurldecode($file);
            }
        }

        $this->info['path'] = [];

        foreach (explode('/', $path) as $dir) {
            $dir = rawurldecode($dir);

            if ($dir !== '') {
                $this->info['path'][] = $dir;
            }
        }
    }
1279904
public function setPath ($path)
	{
		
		if (!is_dir ($path) && !mkdir ($path, 0755, TRUE))
		{
			return FALSE;
		}
		
		if (!is_writable ($path))
		{
			return FALSE;
		}
		
		$this->path	= $path;
		return TRUE;
		
	}
1287354
public function setPath($path)
    {
        if (!$this->databaseIsPath) {
            $path = ltrim($path, '/');
        }
        $this->setDatabase($path);
    }
1083175
protected function addCommandInPath(string $root)
    {
        $iterator = new DirectoryIterator($root);

        foreach ($iterator as $path) {
            if ($path->isDot()) {
                continue;
            }

            if ($path->isDir()) {
                $this->addCommandInPath($path->getPathName());
            }

            if ($path->isFile() && $path->getExtension() === 'php') {
                if ($command = $this->createCommand($path)) {
                    $this->add($command);
                }
            }
        }

        unset($iterator);
    }
375953
private function setPath($path)
    {
        $parts = pathinfo($path);

        $this->info['path'] = [];

        if (isset($parts['dirname'])) {
            foreach (explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $parts['dirname'])) as $dir) {
                if ($dir !== '') {
                    $this->info['path'][] = $dir;
                }
            }
        }

        $this->info['file'] = isset($parts['filename']) ? $parts['filename'] : null;
        $this->info['extension'] = isset($parts['extension']) ? $parts['extension'] : null;
    }
861711
public function setPath($path)
    {
        $this->parts = Path::translatePath($this->outer->getProject(), $path);
    }
617319
public function setCommand($command, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = array())
    {
        if (method_exists(Process::class, 'fromShellCommandline')) {
            $this->process = Process::fromShellCommandline($command, $cwd, $env, $input, $timeout, $options);

        } else {
            $this->process = new Process($command, $cwd, $env, $input, $timeout, $options);
        }
    }