Adds a new location object which is relative to $this location.

@param string $relative_path
@param array  $contents
181297
public function addRelativeLocation($relative_path, array $contents = array())
    {
        $location = $this->newInstance();

        $location->setBasePath($this->base_path.'/'.$relative_path);

        if ($this->base_url) {
            $location->setBaseURL($this->base_url.'/'.$relative_path);
        }

        return $contents ? $location->defineContents($contents) : $location;
    }
2901
static function p($tag, array $contents, array $p = []) {return
		(new static([self::$P__CONTENTS => $contents, self::$P__TAG => $tag] + $p))->_p();
	}
242226
protected function addSection($section, $contents, $overwrite = false)
    {
        if ($overwrite || !isset($this->sections[$section])) {
            $this->sections[$section] = $contents;
        }

        return $this;
    }
806561
public function addContents($contents)
    {
        if (current($contents) instanceof Content) {
            foreach ($contents as $content) {
                $this->addContent($content);
            }
        } else {
            foreach ($contents as $key => $value) {
                $this->addContent($key, $value);
            }
        }
    }
20443
protected function realSetPath($path, $relative)
    {
        if (!is_string($path) || !$this->validatePath($path, $relative)) {
            throw new \InvalidArgumentException(
                'Invalid path; use relative() for relative paths'
            );
        }
        $this->path = $path;
    }
1271307
public function put($path, $contents, array $config = [])
    {
        $path = Util::normalizePath($path);
        $config += $this->config;

        if (!$this->adapter->canOverwrite() && $this->has($path)) {
            return (bool) $this->adapter->update($path, $contents, $config);
        }

        return (bool) $this->adapter->write($path, $contents, $config);
    }
1105272
public function putContents($file, $contents)
    {
        $dir = dirname($file);
        if (! file_exists($dir)) throw new Exception("Can not put contents, not exists dirctory. -> {$dir}");
        file_put_contents($file, $contents);
    }
281358
static public function buildAbsolutePath($relative_path, $basepath) {
        if (strpos($relative_path, static::PATH_SEGMENT_SEPARATOR) === 0) {
            return static::normalizePath($relative_path);
        }
        $basedir = static::dirname($basepath);
        if ($basedir == '.' || $basedir == static::PATH_SEGMENT_SEPARATOR || $basedir == '\\' || $basedir == DIRECTORY_SEPARATOR) $basedir = '';
        return static::normalizePath($basedir . self::PATH_SEGMENT_SEPARATOR . $relative_path);
    }
973343
private static function iterateProcessPathInnerHelper(string $dir, string $relative_path) {
		if ($relative_path == '') {
			return $dir;
		} else {
			$dir = trim2($dir, '^' . $relative_path, '');
			$dir = ltrim($dir, DIRECTORY_SEPARATOR);
			return $dir;
		}
	}
228703
public function create($path, $contents='')
    {
        $this->fs[$path] = $this->newFile();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
1002801
public function put($path, $contents)
    {
        $this->makeDirectory(dirname($path));

        return file_put_contents($path, $contents);
    }
235856
public function put($path, $contents, array $config = [])
    {
        return $this->fileSystem->put($path, $contents, $config);
    }
684455
public static function put(string $path, string $contents, bool $lock = false): int
    {
        return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);
    }
9245
public function send_relative_file($relativepath) {
        if ($this->repository && $this->repository->supports_relative_file()) {
            $relativepath = clean_param($relativepath, PARAM_PATH);
            $this->repository->send_relative_file($this, $relativepath);
        } else {
            send_file_not_found();
        }
    }
1114000
public function put($path, $contents, array $config = []) {
        return $this->getFileSystem()->put($path, $contents, $config);
    }
1082924
public function putString($remote, $contents)
    {
        foreach ($this->connections as $connection) {
            $connection->putString($remote, $contents);
        }
    }
1351737
def relative_path
      @rel_path ||= begin 
        date_array = id.split("-")[0..2]
        date_path = date_array.join("/")
        article_id = begin
          str = id.gsub date_array.join("-"), ''
          if str[0] == "-"
            str[1..-1] 
          else
            str
          end
        end
        "#{category}/#{date_path}/#{article_id}"
      end
    end