public function __get($strName)
 {
     switch ($strName) {
         case "Src":
             return $this->strSrc;
         case "FileLoc":
             return $this->strFileLoc;
         case "MediaObject":
             return $this->objMedia;
         case "FileUrl":
             $arrFileInfo = path_info($this->strFileLoc);
             return sprintf('http://%s/%s/%s', $_SERVER['DOCUMENT_ROOT'], __UPLOAD_ASSETS__, $arrFileInfo['basename']);
         case "Success":
             return $this->strSuccess;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Esempio n. 2
0
 public function pathInfo()
 {
     $path = $this->path;
     $type = $this->in['type'];
     if ($type == "folder") {
         $data = path_info($path, $this->L['time_type_info']);
     } else {
         $data = file_info($path, $this->L['time_type_info']);
     }
     show_json($data);
 }
Esempio n. 3
0
 public function __construct()
 {
     $this->cwd = getcwd();
     $this->dom = new DOM();
     $this->uid = 'html_' . sha($_SERVER['PATH_INFO']);
     $this->dir = path_info();
     $this->page = path_info(1);
     $this->url = $this->URL();
     if (!isset($_GET['nocache']) && function_exists('apc_fetch') && ($html = apc_fetch($this->uid))) {
         @$this->dom->loadHTML($html);
         $this->content = $this->dom->query(constant('de_content_xpath'))->item(0);
         return;
     }
     @$this->dom->loadHTMLFile('index.html');
     $this->content = $this->dom->query(constant('de_content_xpath'))->item(0);
     if ($this->dir && is_dir($this->dir)) {
         $links = $this->dom->query('//a[@href="' . constant('de_root_dir') . $this->dir . '/"]');
         foreach ($links as $link) {
             $link->setAttribute('class', 'active');
         }
         if ($this->page && is_file($this->dir . '/' . $this->page . '.html')) {
             $this->Import($this->dir . '/header.html');
             $this->Import($this->dir . '/' . $this->page . '.html');
             $this->Import($this->dir . '/footer.html');
             $this->Description();
         } else {
             $this->Import($this->dir . '/index.html');
         }
         $this->Title();
         $link_tag = $this->dom->query('//link[@rel="canonical"]')->item(0);
         if ($link_tag) {
             $link_tag->setAttribute('href', $this->url);
         }
     }
     if (function_exists('apc_store')) {
         apc_store($this->uid, $this->dom->saveHTML(), constant('de_apc_cache_timeout'));
     }
 }
Esempio n. 4
0
/**
 * 获取多选文件信息,包含子文件夹数量,文件数量,总大小,父目录权限
 */
function path_info_muti($list, $time_type)
{
    if (count($list) == 1) {
        if ($list[0]['type'] == "folder") {
            return path_info($list[0]['path'], $time_type);
        } else {
            return file_info($list[0]['path'], $time_type);
        }
    }
    $pathinfo = array('file_num' => 0, 'folder_num' => 0, 'size' => 0, 'size_friendly' => '', 'father_name' => '', 'mod' => '');
    foreach ($list as $val) {
        if ($val['type'] == 'folder') {
            $pathinfo['folder_num']++;
            $temp = path_info($val['path']);
            $pathinfo['folder_num'] += $temp['folder_num'];
            $pathinfo['file_num'] += $temp['file_num'];
            $pathinfo['size'] += $temp['size'];
        } else {
            $pathinfo['file_num']++;
            $pathinfo['size'] += get_filesize($val['path']);
        }
    }
    $pathinfo['size_friendly'] = size_format($pathinfo['size']);
    $father_name = get_path_father($list[0]['path']);
    $pathinfo['mode'] = get_mode($father_name);
    return $pathinfo;
}
?>
</li>
      <li>MySQL Support: <?php 
echo mysql_ext();
?>
</li>
      <li>GD Support: <?php 
echo gd_ext();
?>
</li>
      <li>JSON Support: <?php 
echo json_test();
?>
</li>
      <li>PATH INFO Global: <?php 
echo path_info();
?>
</li>
    </ul>
    <h1>Concerto Config</h1>
    <ul>
      <li>Config access: <?php 
echo config_found();
?>
</li><? include('../config.inc.php'); ?>
      <li>Common Directory: <?php 
echo common_dir();
?>
</li>
      <li>Image Upload Directory: <?php 
echo image_dir();
Esempio n. 6
0
 * 		size => 1234,
 * 		...
 * 	},
 * 	{ ... }
 * ]
 */
if (!empty($_FILES)) {
    $files = new \Sauce\Vector();
    foreach ($_FILES as $field => $uploads) {
        $keys = array_keys($uploads);
        $count = count($uploads[$keys[0]]);
        $obj = new \Sauce\Object();
        if (!is_array($keys[0])) {
            foreach ($keys as $key) {
                $obj->{$key} = $uploads[$key];
            }
        } else {
            for ($i = 0; $i < $count; $i++) {
                foreach ($keys as $key) {
                    $obj->{$key} = $uploads[$key][$i];
                }
                $obj->field = $field;
            }
        }
        $files->push($obj);
    }
    $params->files = $files;
}
$app = new \Bacon\App($config->app, $session, $log, $params, $env, $authcookie);
$app->prepare(path_info(), http_method());
$app->run();