path() public static method

public static path ( $path, $absolute = true )
コード例 #1
0
ファイル: Template.php プロジェクト: bugotech/io
 /**
  * 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;
 }
コード例 #2
0
ファイル: Http.php プロジェクト: rali-udem/JSrealB
 /**
  * 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;
 }
コード例 #3
0
ファイル: View.php プロジェクト: spaghettiphp/spaghettiphp
 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');
     }
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
ファイル: FileUpload.php プロジェクト: klawdyo/spaghettiphp
 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;
 }
コード例 #6
0
ファイル: Zip.php プロジェクト: klawdyo/spaghetti-lib
 /**
 *	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;
 }
コード例 #7
0
ファイル: mPdf_Library.php プロジェクト: verticis/boleto-oop
 public function save($filename)
 {
     $this->render();
     $filename = Filesystem::path($filename);
     $this->mPDF->Output($filename, 'F');
 }
コード例 #8
0
 public function dsn()
 {
     return 'sqlite:' . Filesystem::path($this->config['path']);
 }
コード例 #9
0
ファイル: Request.php プロジェクト: klawdyo/spaghetti-lib
 /**
  * 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);
 }