elFinder::realpath PHP Метод

realpath() публичный Метод

Return file real path
Автор: Dmitry (dio) Levashov
public realpath ( string $hash ) : string
$hash string file hash
Результат string
    public function realpath($hash)
    {
        if (($volume = $this->volume($hash)) == false) {
            return false;
        }
        return $volume->realpath($hash);
    }

Usage Example

Пример #1
0
 /**
  * Create log record
  *
  * @param  string   $cmd       command name
  * @param  array    $result    command result
  * @param  array    $args      command arguments from client
  * @param  elFinder $elfinder  elFinder instance
  * @return void|true
  * @author Dmitry (dio) Levashov
  **/
 public function log($cmd, $result, $args, $elfinder)
 {
     $log = $cmd . ' [' . date('d.m H:s') . "]\n";
     if (!empty($result['error'])) {
         $log .= "\tERROR: " . implode(' ', $result['error']) . "\n";
     }
     if (!empty($result['warning'])) {
         $log .= "\tWARNING: " . implode(' ', $result['warning']) . "\n";
     }
     if (!empty($result['removed'])) {
         foreach ($result['removed'] as $file) {
             // removed file contain additional field "realpath"
             $log .= "\tREMOVED: " . $file['realpath'] . "\n";
             //preg_match('/[^\/]+$/', $file['realpath'], $file);
             //$log .= $file[0];
         }
     }
     if (!empty($result['added'])) {
         foreach ($result['added'] as $file) {
             $log .= "\tADDED: " . $elfinder->realpath($file['hash']) . "\n";
         }
     }
     if (!empty($result['changed'])) {
         foreach ($result['changed'] as $file) {
             $log .= "\tCHANGED: " . $elfinder->realpath($file['hash']) . "\n";
         }
     }
     $this->write($log);
 }
All Usage Examples Of elFinder::realpath