Inserts path to framework's yiic.php into application's yiic.php

@param string $source source file path
@param array $params
@return string modified source file content
176200
public function generateYiic($source,$params)
	{
		$content=file_get_contents($source);
		$yiic=realpath(dirname(__FILE__).'/../../yiic.php');
		$yiic=$this->getRelativePath($yiic,$this->_rootPath.DIRECTORY_SEPARATOR.'protected'.DIRECTORY_SEPARATOR.'yiic.php');
		$yiic=str_replace('\\','\\\\',$yiic);
		return preg_replace('/\$yiic\s*=(.*?);/',"\$yiic=$yiic;",$content);
	}
471606
public static function webassets(array $params):string
    {
        return (FEnv::get("host.web.components.apps").strtolower(FEnv::get("framework.env")).
            "/".((isset($params['app']) && $params['app'] != "")? "min"."." :
                strtolower(FEnv::get("app.call")))."/".$params['path']);
    }
793192
protected function writeSource($filename, array $source)
    {
        $source = str_replace(['  ', "\n"], ["\t", "\n\t"], var_export($source, true));
        $source = <<<FILE
<?php
	return $source;
FILE;

        return @file_put_contents($filename, $source) != 0;
    }
1275849
protected function buildUrl(string $pathName, array $params = []): string
    {
        $uri = new BasicUri($this->baseUrl.$this->token.$pathName);
        foreach ($params as $name => $value) {
            if (is_bool($value)) {
                $value = (int)$value;
            }
            $uri = $uri->withQueryValue($name, $value);
        }

        return (string) $uri;
    }
43920
public function applyToMenuSource(\Gems_Menu_ParameterSource $source)
    {
        $source->setTrackId($this->_trackId);
        $source->offsetSet('gtr_active', isset($this->_trackData['gtr_active']) ? $this->_trackData['gtr_active'] : 0);
        return $this;
    }
306452
public function put($source, $target) {
		$path1 = $this->escapeLocalPath($source); //first path is local, needs different escaping
		$path2 = $this->escapePath($target);
		$output = $this->execute('put ' . $path1 . ' ' . $path2);
		return $this->parseOutput($output, $target);
	}
1263132
public function sourceRecords($params = null)
    {
        return SiteTree::get()
            ->exclude('ClassName', RedirectorPage::class)
            ->filter('Content', [null, '', '<p></p>', '<p>&nbsp;</p>'])
            ->sort('Title');
    }
744650
public function show(string $change, array $params = [])
    {
        $path = $this->buildChangesPath($change);

        return $this->get($path, $params);
    }
935489
public function resolveResorceSource($source = null)
    {
        // Base path to use
        $basePath = '../';

        // if no source has been specified
        // look up default source

        if ($source == null) {
            $source = "app/config/routing.yml";
        }

        // Check resource extension
        $extension = Path::getExtension($source);

        // Check if source is of a known type
        // And if not then use default: routing.yml
        if (!in_array($extension, self::$knownSourceTypes) && empty($extension)) {
            $source = $source . '/routing.yml';
        }

        return $basePath . $source;
    }
1095051
public function append($source)
    {
        $importNode = $this->ownerDocument->importNode($this->ownerDocument->importSourceNode($source), true);

        return $this->insertBefore($importNode, $this->firstChild);
    }
63129
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
    {
        return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
    }
738353
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
    {
        if (strpos($source->resource, '://') !== false) {
            $source->filepath = $source->resource;
        } else {
            $source->filepath = str_replace(':', '://', $source->resource);
        }
        $source->uid = false;
        $source->content = $this->getContent($source);
        $source->timestamp = false;
        $source->exists = !!$source->content;
    }
828907
public function build($params = [], $anchor = '')
    {
        if (!count($params)) {
            return '/';
        }

        $config = Application::getConfigManager()->loadForModule('Cmf\System', 'module');

        $defaultModule = mb_strtolower($config->defaultModule);
        $defaultController = mb_strtolower($config->defaultController);
        $defaultAction = mb_strtolower($config->defaultAction);

        $defaults = ['module' => $defaultModule, 'controller' => $defaultController, 'action' => $defaultAction,];
        $params = array_merge($defaults, $params);

        $module = preg_replace('/^(Cmf\\\\)/', '', $params['module']);
        $module = str_replace('\\', '-', $module);
        $module = ltrim(mb_strtolower(preg_replace('/([A-Z])/', "_$1", $module)), '_');
        $module = str_replace('-_', '-', $module);

        $controller = ltrim(mb_strtolower(preg_replace('/([A-Z])/', "_$1", $params['controller'])), '_');
        $action = mb_strtolower($params['action']);

        $fullModuleName = mb_strtolower($params['module']);
        if ($fullModuleName == $defaultModule && $controller == $defaultController && $action == $defaultAction) {
            $url = '';
        } elseif ($controller == $defaultController && $action == $defaultAction) {
            $url = '/' . urlencode($module) . '/';
        } elseif ($action == $defaultAction) {
            $url = '/' . urlencode($module) . '/' . urlencode($controller);
        } else {
            $url = '/' . urlencode($module) . '/' . urlencode($controller) . '/' . urlencode($action);
        }

        foreach ($params as $key => $val) {
            if (in_array($key, array('module', 'controller', 'action'))) {
                continue;
            } elseif ($val instanceof Sort) {
                /** @var $sort Sort */
                $sort = $val;
                if ($field = $sort->getField()) {
                    $sortName = $sort->getRequestVariable();
                    $url .= '/' . $sortName . '~field~' . $field;
                    if ($direction = $sort->getDirection()) {
                        $url .= '/' . $sortName . '~direction~' . $direction;
                    }
                }
            } elseif ($val) {
                if ($part = $this->buildRecursive(urlencode($key), $val)) {
                    $url .= ($url ? '/' : '') . $part;
                }
            }
        }

        if (!$url) {
            $url = '/';
        }

        if ($anchor) {
            $url .= '#' . urlencode($anchor);
        }

        return $url;
    }
1220837
public function getPaths($source)
    {
        $source = $this->cleanSource($source);
        list(, $paths) = $this->parse($source);

        return $paths;
    }
157915
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
    {
        $source->filepath = $this->buildFilepath($source, $_template);

        if ($source->filepath !== false) {
            if (is_object($source->smarty->security_policy)) {
                $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
            }

            $source->uid = sha1($source->filepath);
            if ($source->smarty->compile_check) {
                $source->timestamp = @filemtime($source->filepath);
                $source->exists = !!$source->timestamp;
            }
        }
    }
1102828
protected function _save(array $params = []) {
		$params['path'] = Inflector::underscore($this->request->action);
		$params['file'] = $this->request->args(0);

		$contents = $this->_template();
		$result = Text::insert($contents, $params);

		if (!empty($this->_library['path'])) {
			$path = $this->_library['path'] . "/views/{$params['path']}/{$params['file']}";
			$file = str_replace('//', '/', "{$path}.php");
			$directory = dirname($file);

			if (!is_dir($directory)) {
				if (!mkdir($directory, 0755, true)) {
					return false;
				}
			}
			$directory = str_replace($this->_library['path'] . '/', '', $directory);
			if (file_exists($file)) {
				$prompt = "{$file} already exists. Overwrite?";
				$choices = ['y', 'n'];
				if ($this->in($prompt, compact('choices')) !== 'y') {
					return "{$params['file']} skipped.";
				}
			}
			if (is_int(file_put_contents($file, $result))) {
				return "{$params['file']}.php created in {$directory}.";
			}
		}
		return false;
	}
1194417
public function compileFile($source, $compiled)
    {
        $source = $this->alias->resolve($source);
        $compiled = $this->alias->resolve($compiled);

        $dir = dirname($compiled);

        /** @noinspection NotOptimalIfConditionsInspection */
        if (!is_dir($dir) && !@mkdir($dir, 0755, true) && !is_dir($dir)) {
            throw new CreateDirectoryFailedException(['create `:dir` directory failed: :last_error_message', 'dir' => $dir]);
        }

        if (($str = file_get_contents($source)) === false) {
            throw new InvalidArgumentException(['read `:file` sword source file failed: :last_error_message', 'file' => $source]);
        }

        $result = $this->compileString($str);

        $result = $this->_replaceAjaxLinks($source, $result);
        $result = $this->_replaceAxiosLinks($source, $result);
        $result = $this->_replaceAttrLinks($source, $result);
        $result = $this->_replaceVueAttrLinks($source, $result);
        $result = $this->_replaceUrlValLinks($source, $result);

        if (file_put_contents($compiled, $result, LOCK_EX) === false) {
            throw new RuntimeException(['write `:compiled` compiled file for `:source` file failed: :last_error_message',
                'complied' => $compiled,
                'source' => $source]);
        }

        return $this;
    }