Define onde os arquivos de cache serão salvos

Irá verificar se a pasta existe e pode ser escrita, caso contrário
uma mensagem de erro será exibida

@param string $folder Local para salvar os arquivos de cache (opcional)

@return void
439711
protected function setFolder($folder) {
        // Se a pasta existir, for uma pasta e puder ser escrita
        if (file_exists($folder) && is_dir($folder) && is_writable($folder)) {
            $this->folder = $folder;
        } else {
            trigger_error('Não foi possível acessar a pasta de cache', E_USER_ERROR);
        }
    }
206634
public function deleteFolder($folder)
    {
        if (!$this->isDir($folder)) {
            $path = $this->pathRoot.$folder;
            throw new ExceptionStorage("Directory {$path} Not found or Not Is Diretory", static::E_NOT_IS_DIR);
        }

        $metadata = $this->dropbox->delete($this->pathRoot.$folder);
        return !is_null($metadata);
    }
676506
protected function readPackageFolder(string $folder): array
    {
        $packages = [];
        foreach (scandir($folder) as $path) {
            if ($path === '.' || $path === '..') {
                continue;
            }

            $fullPath = $this->pathHelper->join($folder, $path);

            if (!is_dir($fullPath)) {
                continue;
            }

            $composerJson = $this->composerParser->parse(
                $this->pathHelper->realize($this->pathHelper->join($fullPath, 'composer.json'))
            );

            $packages[$fullPath] = $composerJson;
        }

        return $packages;
    }
1289964
protected function createBreadcrumbJson(Folder $folder)
    {
        $breadcrumbs = array();
        while ($folder->exists()) {
            $breadcrumbs[] = array(
                'title' => $folder->Title,
                'id' => $folder->ID
            );

            $folder = $folder->Parent();
        }
        $breadcrumbs[] = array(
            'title' => ASSETS_DIR,
            'id' => 0
        );

        return array_reverse($breadcrumbs);
    }
140067
protected function createCacheFile($key, $content) {
        // Gera o nome do arquivo
        $filename = $this->generateFileLocation($key);

        // Cria o arquivo com o conteúdo
        return file_put_contents($filename, $content)
        OR trigger_error('Não foi possível criar o arquivo de cache', E_USER_ERROR);
    }
1342939
private function buildFileList($folder)
    {
        // The list of files to use
        $files = array();

        // Cycle through all of the files in our storage folder removing
        // any files that exceed the cache duration.
        $directory = new DirectoryIterator($folder);

        foreach ($directory as $file)
        {
            // Check if the file is the local file (i.e. dot)
            if($file->isDot())
            {
                // We are the dot, so just skip
                continue;
            }

            // Check if the file is a directory
            if($file->isDir())
            {
                // Recursively call this function
                $files = array_merge($files, $this->buildFileList($file->getRealPath()));
            }
            else
            {
                // Add in the file
                $files[] = $file->getRealPath();
            }
        }

        return $files;
    }
595307
public function update(Folder $folder)
    {
        $this->em->persist($folder);
        $this->em->flush($folder);

        $uriPart = $folder->getUriPart();

        // Если не указан сегмент URI, тогда он устанавливается в ID папки.
        if (empty($uriPart) and $folder->getId() > 1) {
            $folder->setUriPart($folder->getId());
            $this->em->persist($folder);
            $this->em->flush($folder);
        }

        return $this;
    }
966405
public function setFileFolder(FileFolder $folder)
    {
        $em = \ORM::entityManager('core');

        $this->folderTreeNodeID = $folder->getTreeNodeID();

        $em->persist($this);
        $em->flush();
    }
312090
protected function saveBlocksFromFolder($folder)
    {
        $ids = [];
        if (is_dir($folder)) {
            foreach (FileHelper::findFiles($folder) as $blockItem) {
                $ids[] = $this->saveBlockByPath($blockItem);
            }
        }
        
        return $ids;
    }
733030
public function setCache($file)
	{
		if ( ! empty($file)) {
			$this->cache = new AccessTokenCache($file);

			$this->setAccessToken($this->cache->get());
		}
	}
1250439
private function removeFolder(Folder $folder)
	{
		$this->removeFolderInFileSystem($folder);

		$entityManager = $this->getDoctrineEntityManager();
		$entityManager->remove($folder);
		$entityManager->flush();
	}
1315175
public function createFolder($folder)
    {
        $folder = trim($folder, "/") . "/";

        if ($folder === "/") {
            return true;
        }

        // Fail if this pseudo directory key already exists
        if ($this->exists($folder)) {
            return true;
        }

        $response = $this->clientS3->putObject(array(
            'Bucket' => $this->bucket,
            'Key'    => $folder,
            'ACL'    => static::ACL_PUBLIC_READ,
            'Body'   => "",
        ));

        return (bool) $response;
    }
861893
public function createFolder(Folder $folder)
	{
		// validating folder before creation
		foreach ($this->folderUploadFilters as $filter) {
			$filter->validateFolder($folder);
		}

		$this->createBothFoldersInFileSystem($folder);
	}
1187513
public static function delFolder($bucket, $folder) {
        if (empty($bucket) || empty($folder)) {
            return array(
                    'code' => COSAPI_PARAMS_ERROR,
                    'message' => 'bucket or path is empty');
        }

        $folder = self::normalizerPath($folder, True);

        return self::delBase($bucket, $folder);
    }
508105
public static function findPhakefileParts($folder)
    {
        $result = array();

        $dir = new DirectoryIterator($folder);
        $regex = new RegexIterator($dir, '/\.php$/');
        foreach ($regex as $item) {
            $result[] = $item->getRealpath();
        }

        return $result;
    }
646323
protected function setDestinationPath($folder)
    {
        $this->destinationPath = wp_upload_dir();
        $this->destinationPath = rtrim($this->destinationPath['basedir'], 'uploads') . $folder; // fix rtrim uploads name
    }
442247
public function setUploadFolder($folder)
    {
        $this->uploadPath  = $this->basePath . $folder . '/' . $this->getUniqueFolderName() . '/';
        $this->destination = $this->publicPath ? public_path($this->uploadPath) : $this->uploadPath;
    }