Embed a file in the message and get the CID.

@param string $path
@param string $name

@return string
349727
public function embed($path, $name = null)
    {
        $name = $name ?: basename($path);
        $this->messageBuilder->addInlineImage("@{$path}", $name);

        return "cid:{$name}";
    }
473905
protected function getPathArgument($name, $realpath = true, $command = null)
    {
        if (null == $command) {
            $command = $this->getParseResult()->command;
        }
        $path = isset($command->args[$name]) ? $command->args[$name] : \getcwd();

        if (!$this->isAbsolute($path)) { // not an absolute path
            $path = \getcwd() . '/./' . $path;
        }

        if ($realpath) {
            $path = realpath($path);
        }

        return $path;
    }
262889
protected function getPath($name)
    {
        $name = isset($this->map[$name]) ? $this->map[$name] : $name;

        return "{$this->basePath}/{$name}.svg";
    }
150840
public function open($path, $name) {
    $rand = $this->psl['crypt/rand'];

    /* Set some variables we need later. */
    $this->savePath  = $path;
    $this->name      = $name;
    $this->keyCookie = $name.'_secret';

    /* Set current and new ID. */
    if(isset($_COOKIE[$name])) {
      $this->currID = $_COOKIE[$name];
    } else {
      $this->currID = null;
    }
    if($this->sessIdRegen === true || $this->currID === null) {
      $this->newID = $rand->str(128, 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ-_.!*#=%');
    } else {
      $this->newID = $this->currID;
    }

    /* Set cookie with new session ID. */
    $cookieParam = session_get_cookie_params();
    setcookie(
        $name,
        $this->newID,
        $cookieParam['lifetime'],
        $cookieParam['path'],
        $cookieParam['domain'],
        $cookieParam['secure'],
        $cookieParam['httponly']
    );

    /* If we don't have a encryption key, create one. */
    if(!isset($_COOKIE[$this->keyCookie])) {
      /* Create a secret used for encryption of session. */
      $this->setSecret();
    } else {
      $this->secret = base64_decode($_COOKIE[$this->keyCookie]);
    }
    return true;
  }
1328228
public function generateRequest($name)
    {
        if (!$content = $this->getRequestContent($name)) {
            return '';
        }

        $path = app_path('Http/Requests/'.implode('/', $this->sectionSegmentsStudly).'/'.studly_case($name).'.php');

        if (is_file($path)) {
            return '';
        }

        $this->createMissingDirs($path);

        return file_put_contents($path, $content) !== false ? $path : '';
    }
316457
public function downloadFile($path = '', $destination = '', $name = '')
    {
        $response = $this->sendRequest('GET', $path);
        if ($name === '' && $response->getHeader('Content-Disposition')
            && is_array($response->getHeader('Content-Disposition'))
            && count($response->getHeader('Content-Disposition')) > 0
        ) {
            $matchResults = [];
            preg_match(
                "/.*?filename=\"(.*?)\".*?/",
                $response->getHeader('Content-Disposition')[0],
                $matchResults
            );
            $name = urldecode($matchResults[1]);
        }

        $file = $destination . $name;

        $result = file_put_contents($file, $response->getBody()) ? $file : false;

        return $result;
    }
105937
public function buildClassName( $name, $path = '' )
	{
		$className = array_map( 'ucfirst', array_map( 'strtolower', (array) preg_split( '/[-_]/', $name )));
		$className = implode( '', $className );

		return !empty( $path )
			? str_replace( '\\\\', '\\', sprintf( '%s\%s', $path, $className ))
			: $className;
	}
700370
public function EmbedBase64Image($path)
    {
        $mime = $this->getMimeType($path);
        if ($mime) {
            $content = file_get_contents($path);

            if ($content) {
                return "data:{$mime};base64," . base64_encode($content);
            }
        }

        return null;
    }
146618
protected function getAsset($name) {
		$path  = $this->assetsPath . DIRECTORY_SEPARATOR . $name;
		$asset = file_get_contents($path);
		
		if ($asset === false) {
			throw new InvalidPath('Unable to get asset "' . $name . '" by path "' . $path . '"');
		}
		
		return $asset;
	}
537282
static function changeName($path, $name)
    {
        $f = self::fileInfo($path);
        return $f['dir'].$name.'.'.$f['ext'];
    }
338716
protected function getPathToRelationshipId(string $name): string
    {
        return $this->getPathToRelationship($name) . '/' .
            DocumentInterface::KEYWORD_DATA . '/' . DocumentInterface::KEYWORD_ID;
    }
117806
public function download($path, $name = null, array $headers = [])
    {
        return $this->response($path, $name, $headers, 'attachment');
    }
808103
protected function _mkdir($path, $name) {
		return $this->make($path, $name, 'directory') ? $this->_joinPath($path, $name) : false;
	}
428980
public function url(string $name)
  {
    $path = self::__isStatic() ? self::__getDefault() : $this->path;
    $file = (substr($name, 0, 1) == DIRECTORY_SEPARATOR ? substr($name, 1) : $name);
    return realpath($path . DIRECTORY_SEPARATOR . $file);
  }
747608
protected function _mkfile($path, $name) {
		if ($this->tmp) {
			$path = $path.'/'.$name;
			$local = $this->getTempFile();
			$res = touch($local) && ftp_put($this->connect, $path, $local, FTP_ASCII);
			@unlink($local);
			return $res ? $path : false;
		}
		return false;
	}
1355041
protected function _mkdir($path, $name) {
		$path = $path.'/'.$name;
		if (ftp_mkdir($this->connect, $path) === false) {
			return false;
		} 
		
		$this->options['dirMode'] && @ftp_chmod($this->connect, $this->options['dirMode'], $path);
		return $path;
	}
271255
public function create( $name, $path )
	{
		$path = $this->getPath( $name, $path );

		$stub = $this->getStub( 'model' );

		$this->files->put( $path, $this->parseStub( $stub, [
			'table' => $this->tableize( $name ),
			'class' => $this->classify( $name )
		] ) );

		return $path;
	}