示例#1
0
 public function __construct()
 {
     $this->setFile(Path::getRoot() . 'System/Config.txt');
     $handle = fopen($this->file, 'a+');
     $data = fread($handle, filesize($this->file));
     fclose($handle);
     if (!empty($data)) {
         $this->setData(json_decode($data, true));
     }
 }
/**
 * function autoLoader
 *
 * @param string $name the namespace of the class
 * @return void
 *
 */
function autoLoader($class)
{
    $path = Path::getPackageRoot();
    $dirs = explode("\\", $class);
    $className = $dirs[count($dirs) - 1] . '.php';
    array_pop($dirs);
    if (!empty($dirs)) {
        $path .= '/' . implode('/', $dirs);
        $path = implode('/', array_unique(explode('/', $path))) . '/';
    }
    if (file_exists($path . $className)) {
        require_once $path . $className;
    }
}
示例#3
0
 protected function __construct()
 {
     $this->skins = Path::getRoot() . 'Skins/' . Session::getAccountId() . '/';
     $this->default = Path::getRoot() . 'Skins/' . Session::getGuestAccountId() . '/';
 }
示例#4
0
<?php

echo __FILE__ . '(' . __LINE__ . ') __FILE__: <pre>' . print_r(__FILE__, true) . '</pre>';
/**
 * @todo this code should check to see if the file exists first, and if not get the file from the default account
 */
include '../System/BootStrap.php';
use System\Functions\Path;
header("Content-type: text/css; charset: UTF-8");
$file = str_replace('|', '/', $_GET['file']);
$css = Path::getRoot() . 'Skins/' . $_GET['accountId'] . '/Css/' . $file;
include $css;
示例#5
0
<?php

/**
 * @todo allow this to open gif's & jpg's as well
 * @todo this code should check to see if the file exists first, and if not get the file from the default account
 */
include '../System/BootStrap.php';
use System\Functions\Path;
$file = str_replace('|', '/', $_GET['file']);
$png = Path::getRoot() . 'Skins/' . $_GET['accountId'] . '/Images/' . $file;
$imgPng = imageCreateFromPng($png);
header("Content-type: image/png");
imagePng($imgPng);