src/GuillermoMartinez/Filemanager/Filemanager.php
public function newFolder($namefile,$path){
        $fullpath = $this->getFullPath().$path;
        $namefile = $this->clearNameFile($namefile);
        $namefile = $this->sanitizeNameFolder($namefile);
        $dir = new Filesystem;
        if($dir->exists($fullpath.$namefile)){
            $result = array("query"=>"BE_NEW_FOLDER_EXISTED %s","params"=>array($path.$namefile));
            $this->setInfo(array("msg"=>$result,"status"=>0));
            if( $this->config['debug'] ) $this->_log(__METHOD__." - Ya existe: ".$path.$namefile);
            return false;
        }else{
            $dir->mkdir($fullpath.$namefile);
            $result = array("query"=>"BE_NEW_FOLDER_CREATED %s","params"=>array($path.$namefile));
            $this->setInfo(array("msg"=>$result,"data"=>array( "path" => $path, "namefile" => $namefile )));
            return true;
        }
    }
public function newFolder($namefile,$path){
        $fullpath = $this->getFullPath().$path;
        $namefile = $this->clearNameFile($namefile);
        $namefile = $this->sanitizeNameFolder($namefile);
        $dir = new Filesystem;
        if($dir->exists($fullpath.$namefile)){
            $result = array("query"=>"BE_NEW_FOLDER_EXISTED %s","params"=>array($path.$namefile));
            $this->setInfo(array("msg"=>$result,"status"=>0));
            if( $this->config['debug'] ) $this->_log(__METHOD__." - Ya existe: ".$path.$namefile);
            return false;
        }else{
            $dir->mkdir($fullpath.$namefile);
            $result = array("query"=>"BE_NEW_FOLDER_CREATED %s","params"=>array($path.$namefile));
            $this->setInfo(array("msg"=>$result,"data"=>array( "path" => $path, "namefile" => $namefile )));
            return true;
        }
    }
public function newFolder ( $ namefile , $ path ) { $ fullpath = $ this -> getFullPath ( ) . $ path ; $ namefile = $ this -> clearNameFile ( $ namefile ) ; $ namefile = $ this -> sanitizeNameFolder ( $ namefile ) ; $ dir = new Filesystem ; if ( $ dir -> exists ( $ fullpath . $ namefile ) ) { $ result = array ( "query" => "BE_NEW_FOLDER_EXISTED %s" , "params" => array ( $ path . $ namefile ) ) ; $ this -> setInfo ( array ( "msg" => $ result , "status" => 0 ) ) ; if ( $ this -> config [ 'debug' ] ) $ this -> _log ( __METHOD__ . " - Ya existe: " . $ path . $ namefile ) ; return false ; } else { $ dir -> mkdir ( $ fullpath . $ namefile ) ; $ result = array ( "query" => "BE_NEW_FOLDER_CREATED %s" , "params" => array ( $ path . $ namefile ) ) ; $ this -> setInfo ( array ( "msg" => $ result , "data" => array ( "path" => $ path , "namefile" => $ namefile ) ) ) ; return true ; } }
Renombra una carpeta
@param string $namefile
@param string $path
@return boolean
Renombra una carpeta