当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::path方法代码示例

本文整理汇总了PHP中Filesystem::path方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::path方法的具体用法?PHP Filesystem::path怎么用?PHP Filesystem::path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filesystem的用法示例。


在下文中一共展示了Filesystem::path方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: file

 /**
  * Aplicar template de um arquivo único.
  *
  * @param $file
  * @param $target
  */
 public function file($file, $target)
 {
     // Verificar se template existe na lista
     if ($this->files->exists($file) != true) {
         error('Template %s não foi encontrado', $file);
     }
     $this->outpath = '';
     $this->filters = [$target];
     // Criar diretório destino
     $path = $this->files->path($target);
     $this->files->force($path);
     // Copiar arquivo
     $this->files->copy($file, $target);
     return $this;
 }
开发者ID:bugotech,项目名称:io,代码行数:21,代码来源:Template.php

示例2: getStaticProperUrl

 /**
  * Return URL with fingerprint
  * @param type $sRootPath Path from root
  */
 public static function getStaticProperUrl($sRootPath)
 {
     $sFilePath = Filesystem::path($sRootPath);
     $sFileName = Filesystem::name($sRootPath);
     $sFileExtension = Filesystem::extension($sRootPath);
     $sFileLastModificationDate = filemtime($sRootPath);
     $sUrl = Config::get('app.url') . $sFilePath . Config::get('format.dir.slash') . $sFileName . '_' . $sFileLastModificationDate . '_.' . $sFileExtension;
     return $sUrl;
 }
开发者ID:rali-udem,项目名称:JSrealB,代码行数:13,代码来源:Http.php

示例3: element

 public function element($element, $data = array())
 {
     $element_path = Filesystem::path('app/views/') . $this->elementName($element);
     if (Filesystem::exists($element_path)) {
         return $this->renderView($element_path, $data);
     } else {
         throw new MissingViewException($this->filename($element) . ' could not be found');
     }
 }
开发者ID:spaghettiphp,项目名称:spaghettiphp,代码行数:9,代码来源:View.php

示例4: renderTemplate

 public function renderTemplate($source, $destination, $data = array())
 {
     if (!Filesystem::exists($destination)) {
         $view = new View();
         $content = $view->renderView(Filesystem::path($source), $data);
         Filesystem::write($destination, $content);
         $this->log('created', $destination);
     } else {
         $this->log('exists', $destination);
     }
 }
开发者ID:spaghettiphp,项目名称:spaghettiphp,代码行数:11,代码来源:Generator.php

示例5: upload

 public function upload($file, $name = null, $path = '')
 {
     $path = Filesystem::path('public/' . $path);
     if (is_null($name)) {
         $name = $file['name'];
     }
     if ($this->validates($file)) {
         if (!is_dir($path)) {
             Filesystem::createDir($path, 0777);
         }
         if (move_uploaded_file($file['tmp_name'], $path . '/' . $name)) {
             return true;
         } else {
             return $this->error('CantMoveFile');
         }
     }
     return false;
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:18,代码来源:FileUpload.php

示例6: addFiles

 /**
 *	Adiciona arquivos ao zip
 *	
 *	@param	mixed 	Um arquivo ou array de arquivos para serem adicionados 
 *	@param	string 	Diretório interno do arquivo zip. Caso não seja informado,
                   os arquivos serão adicionados na raiz do arquivo zip.
 *	@return 
 */
 public function addFiles($file, $path = '')
 {
     $path = empty($path) ? '' : trim($path, '/') . '/';
     if (is_array($file)) {
         foreach ($file as $f) {
             $filename = $path . basename($f);
             pr($filename);
             $this->object->addFile(Filesystem::path($f), $filename);
         }
     } else {
         $filename = $path . basename($file);
         $this->object->addFile(Filesystem::path($file), $filename);
     }
     return $this;
 }
开发者ID:klawdyo,项目名称:spaghetti-lib,代码行数:23,代码来源:Zip.php

示例7: save

 public function save($filename)
 {
     $this->render();
     $filename = Filesystem::path($filename);
     $this->mPDF->Output($filename, 'F');
 }
开发者ID:verticis,项目名称:boleto-oop,代码行数:6,代码来源:mPdf_Library.php

示例8: dsn

 public function dsn()
 {
     return 'sqlite:' . Filesystem::path($this->config['path']);
 }
开发者ID:klawdyo,项目名称:spaghettiphp,代码行数:4,代码来源:SQLiteDatasource.php

示例9: forceDownload

 /**
  * Força o download do arquivo
  * 
  * @version    1.0
  *          - Initial
  * 
  * @param $file O nome do arquivo, relativo a /SPAGHETTI_ROOT
  */
 public static function forceDownload($file)
 {
     $file = Filesystem::path($file);
     header('Content-Description: File Transfer');
     header('Content-Type: application/octet-stream');
     header('Content-Disposition: attachment; filename=' . basename($file));
     header('Content-Transfer-Encoding: binary');
     header('Expires: 0');
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Pragma: public');
     header('Content-Length: ' . filesize($file));
     ob_clean();
     flush();
     readfile($file);
 }
开发者ID:klawdyo,项目名称:spaghetti-lib,代码行数:23,代码来源:Request.php


注:本文中的Filesystem::path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。