Set absolute

@param  boolean $absolute
@return Dir
549661
public function setAbsolute($absolute)
    {
        $this->absolute = (bool)$absolute;
        if (($this->absolute) && ($this->isRelative())) {
            $this->setRelative(false);
        }
        return $this;
    }
919481
public function binDir($dir = '')
    {
        if (!empty($dir)) {
            $this->binary_dir = Config::setBinDirectory($dir);

            return $this;
        }
        elseif ($dir == C::DFT) {
            $this->binary_dir = Config::setBinDirectory(Config::getBinDirectory());
        }

        return Config::getBinDirectory();
    }
1067722
public function withDir(string $dir): self
    {
        $builder = clone $this;
        $builder->dir = $dir;
        
        return $builder;
    }
644937
public function diff(Time $time, $absolute = true)
    {
        $diff = $this->getSeconds() - $time->getSeconds();

        return new self(0, 0, $absolute ? abs($diff) : $diff);
    }
314007
public function setDir($dir)
    {
        $dir = rtrim($dir, '/');
        if (!is_dir($dir)) {
            mkdir($dir, 0700, true);
        }
        $this->dir = $dir;

        return $this;
    }
146083
public function getBasePath($absolute = false)
    {
        $path = array();
        if ($absolute) {
            if (($basePath = Yii::getPathOfAlias($this->basePath)) === false && is_dir($this->basePath)) {
                $basePath = realpath($this->basePath);
            }
            $path[] = $basePath;
        }
        $path[] = $this->fileDir;
        return implode('/', $path);
    }
385606
public function writeToFile($filename, $content, $absolute = false)
    {
        // Get absolute / relative paths by either combining or removing base from path
        list($absolutePath, $relativePath) = $absolute
            ? [
                $filename,
                substr($filename, strlen($this->getBaseDir()))]
            : [
                $this->getBaseDir() . $filename,
                $filename
            ];
        $this->statusMessage("Setting up $relativePath");

        if ((@$fh = fopen($absolutePath, 'wb')) && fwrite($fh, $content) && fclose($fh)) {
            // Set permissions to writable
            @chmod($absolutePath, 0775);
            return true;
        }
        $this->error("Couldn't write to file $relativePath");
        return false;
    }
1262961
public function absolutePath($theme = null)
    {
        if (is_null($theme)) {
            $theme = $this->getCurrent();
        }

        return $this->config['paths']['absolute'].'/'.$theme;
    }
617331
public function setUploadDir($dir)
    {
        // Check to see if the upload directory exists.
        if (!file_exists($dir) || !is_dir($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_EXIST;
        // Check to see if the permissions are set correctly.
        } else if (!is_writable($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_WRITABLE;
        }

        $this->uploadDir = $dir;
        return $this;
    }
1257720
public function setRootDir($rootPath = false)
    {
        if (!$rootPath) {
            $this->rootDir = getcwd().DS;
        }

        $this->rootDir = $rootPath.DS;

        return $this;
    }
1084938
public function isActive($active = true)
    {
        if (! is_bool($active)) {
            $active = false;
        }
        $this->isActive = $active;

        return $this;
    }
986001
public function setActive($active = true)
    {
        if (is_callable($active)) {
            $this->active = $active($this);

            return $this;
        }

        $this->active = (bool) $active;

        return $this;
    }
449644
public function getPreviousUrl($absolute = false)
    {
        return $this->hasPrevious() ? $this->getUrl($this->getPrevious(), $absolute) : null;
    }
127664
public function setActive($active = true)
    {
        $this->active = (bool) $active;

        if ($active) {
            $this->setHtmlAttribute('class', 'active');
        }

        return $this;
    }
1146962
public function absolute($root = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');

        //if path is a directory or file
        if (is_dir($this->data) || is_file($this->data)) {
            return $this;
        }

        //if root is null
        if (is_null($root)) {
            //assume the root is doc root
            $root = $_SERVER['DOCUMENT_ROOT'];
        }

        //get the absolute path
        $absolute = $this->format($this->format($root).$this->data);

        //if absolute is a directory or file
        if (is_dir($absolute) || is_file($absolute)) {
            $this->data = $absolute;
            return $this;
        }

        //if we are here then it means that no path was found so we should throw an exception
        Exception::i()
            ->setMessage(self::ERROR_FULL_PATH_NOT_FOUND)
            ->addVariable($this->data)
            ->addVariable($absolute)
            ->trigger();
    }
1349106
public function setIsActive($isActive)
    {
        if ($this->hasParent()) {
            $this->getParent()->setIsActive($isActive);
        }

        $this->isActive = $isActive;

        return $this;
    }
949657
public function setDirectories(BBApplication $application = null)
    {
        if (null !== $application) {
            $this->_application = $application;

            $this->setTemporaryDir($application->getTemporaryDir())
                    ->setStorageDir($application->getStorageDir())
                    ->setMediaDir($application->getMediaDir());
        }

        return $this;
    }