本文整理汇总了PHP中FileManager::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::instance方法的具体用法?PHP FileManager::instance怎么用?PHP FileManager::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance()
{
if (!self::$instance instanceof self) {
self::$instance = new self();
}
return self::$instance;
}
示例2: FileManager
function FileManager()
{
if (!FileManager::$instance) {
FileManager::$instance = $this;
}
//initailze site
$this->__RootFolder = $this->getCurrentFolder();
//register virtual folders
$this->__VirtualFolders = array();
$curDir = $this->getCurrentFolder();
$this->addVirtualFolder($curDir, '$This', 1, 0);
$this->addVirtualFolder($curDir . '/file_icons', '$Icons', 1, 0);
$ds = $this->getDrives();
if (is_array($ds)) {
foreach ($ds as $d) {
$this->addVirtualFolder($d['drive'] . '/', '$' . substr($d['drive'], 0, 1), 1, 0);
}
}
usort($this->__VirtualFolders, '_cmpPath');
//register application workspace
$_app = '';
$_sid = '';
$b = true;
$a = true;
if ($b) {
if (isset($_GET)) {
if (isset($_GET['app'])) {
$a = false;
$_app = $_GET['app'];
}
if (isset($_GET['sid'])) {
$b = false;
$_sid = $_GET['sid'];
}
}
}
if (isset($_POST)) {
if ($a) {
if (isset($_POST['app'])) {
$a = false;
$_app = $_POST['app'];
}
}
if ($b) {
if (isset($_POST['sid'])) {
$b = true;
$_sid = $_POST['sid'];
}
}
}
//register icons
$this->__IconExt = array();
$this->registerIconExt('zip', 'rar,gzip');
$this->registerIconExt('txt', 'ini');
$this->registerIconExt('bat', 'php,asp,aspx,cgi');
$this->registerIconExt('doc', 'rtf');
$this->registerIconExt('mp3', 'wav');
$this->registerIconExt('mdb', 'db,db2');
$this->registerIconExt('jpg', 'gif,png,jpeg');
$this->registerIconExt('htm', 'html');
//initialize instance
if (FileManager::$instance === $this) {
FileManager::$sid = $_sid;
FileManager::$ip = $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : $_SERVER['REMOTE_HOST'];
if (!empty($_app)) {
FileManager::$app = $this->deCrypt($_app);
}
}
$this->__Initialized = true;
}
示例3: getInstance
/**
* getInstance
*
* if an instance exists, it returns it,
* if not, it creates a new one and returns
* it
*
* @access public
* @static
* @return instance
*/
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new FileManager();
}
return self::$instance;
}