method __construct documentation in bbn\File

Constructor.

Example

$file=new bbn\File('/home/user/Desktop/test.txt'); function($file, bbn\File\System $fs = NULL) { $this->fs = $fs ?: new File\System(); if ( \is_array($file) ) { if ( isset($file['name'],$file['tmp_name']) ) { $this->path = ''; $this->name = $file['name']; $this->size = $file['size']; $file = $file['tmp_name']; } } else if ( \is_string($file) ) { $file = trim($file); if (strrpos($file,'/')) { /* The -2 in strrpos means that if there is a final /, it will be kept in the file name */ $this->name = substr($file,strrpos($file,'/',-2)+1); $this->path = substr($file,0,-\strlen($this->name)); if ( substr($this->path,0,2) == '//' ){ $this->path = 'http://'.substr($this->path,2); } } else { $this->name = $file; $this->path = './'; } } if ( \is_string($file) && is_file($file) ){ $this->file = $file; $this->getExtension(); } else{ $this->getExtension(); $this->make(); } }

Constructor. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.