本文整理汇总了PHP中Webmozart\Assert\Assert::directory方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::directory方法的具体用法?PHP Assert::directory怎么用?PHP Assert::directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::directory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* {@inheritdoc}
*/
public function __construct($filesystemPath, $path = null)
{
Assert::directory($filesystemPath);
parent::__construct($filesystemPath, $path);
}
示例2: setAsciiDocDir
/**
* Sets the directory containing the AsciiDoc pages.
*
* @param string $dir The directory that contains the AsciiDoc pages.
*/
public function setAsciiDocDir($dir)
{
Assert::directory($dir);
$this->asciiDocDir = $dir;
}
示例3: __construct
/**
* Creates a new repository.
*
* @param string $baseDir The base directory of the repository on the file
* system.
* @param bool $symlink Whether to use symbolic links for added files. If
* symbolic links are not supported on the current
* system, the repository will create hard copies
* instead.
* @param bool $relative Whether to create relative symbolic links. If
* relative links are not supported on the current
* system, the repository will create absolute links
* instead.
* @param ChangeStream|null $changeStream If provided, the repository will log
* resources changes in this change stream.
*/
public function __construct($baseDir = '/', $symlink = true, $relative = true, ChangeStream $changeStream = null)
{
parent::__construct($changeStream);
Assert::directory($baseDir);
Assert::boolean($symlink);
$this->baseDir = rtrim(Path::canonicalize($baseDir), '/');
$this->baseDirLength = strlen($baseDir);
$this->symlink = $symlink && self::isSymlinkSupported();
$this->relative = $this->symlink && $relative;
$this->filesystem = new Filesystem();
}
示例4: __construct
/**
* Creates a new repository.
*
* @param string $baseDir The base directory of the repository on the file
* system.
* @param bool $symlink Whether to use symbolic links for added files. If
* symbolic links are not supported on the current
* system, the repository will create hard copies
* instead.
* @param bool $relative Whether to create relative symbolic links. If
* relative links are not supported on the current
* system, the repository will create absolute links
* instead.
*/
public function __construct($baseDir = '/', $symlink = true, $relative = true)
{
Assert::directory($baseDir);
Assert::boolean($symlink);
$this->baseDir = rtrim(Path::canonicalize($baseDir), '/');
$this->symlink = $symlink && self::isSymlinkSupported();
$this->relative = $this->symlink && $relative;
$this->filesystem = new Filesystem();
}