Files::makePath PHP Méthode

makePath() public méthode

Concat two paths together. Basically $pathA+$pathB
public makePath ( string $pathA, string $pathB ) : string
$pathA string path one
$pathB string path two
Résultat string a trailing slash combinded path.
    function makePath($pathA, $pathB)
    {
        $pathA = Files::fixPath($pathA);
        if (substr($pathB, 0, 1) == '/') {
            $pathB = substr($pathB, 1);
        }
        return Files::fixPath($pathA . $pathB);
    }

Usage Example

 /**
  * Create new directories.
  * If in safe_mode, nothing happens.
  * @return boolean true if created, false otherwise.
  */
 function processNewDir()
 {
     if ($this->config['safe_mode'] == true) {
         return false;
     }
     if (isset($_GET['newDir']) && isset($_GET['dir'])) {
         $newDir = rawurldecode($_GET['newDir']);
         $dir = rawurldecode($_GET['dir']);
         $path = Files::makePath($this->getImagesDir(), $dir);
         $fullpath = Files::makePath($path, Files::escape($newDir));
         if (is_dir($fullpath)) {
             return false;
         }
         return Files::createFolder($fullpath);
     }
 }
All Usage Examples Of Files::makePath