/** * Test method */ public function test() { date_default_timezone_set('Europe/Warsaw'); $system = System::getInstance(); $this->assertTrue($system->getIpAddress()->getAddress() === System::DEFAULT_IP); $this->assertTrue($system->getIpAddress()->getAddress(true) === ip2long(System::DEFAULT_IP)); }
/** * Instance of construct */ public function __construct() { if (null === self::$dir) { self::$dir = APPLICATION_PATH . '/../public'; } if (null === self::$domain) { self::$domain = System::getInstance()->getDomain()->getAddress(); } }
/** * Get system object * * @return \Extlib\System */ public function getSystem() { if (null === $this->system) { $this->system = \Extlib\System::getInstance(); } return $this->system; }
/** * Get date as directory - 2013-06-10 to 2013/06/10 * * @return string */ public static function getDateDirectory() { return str_replace('-', DIRECTORY_SEPARATOR, \Extlib\System::getInstance()->getDate()->format('Y-m-d')); }
/** * Instance of construct * * @param string $namespace * @param int $lifetime * @param string $path * @param string $secure * @param string $httponly */ public function __construct($namespace = null, $lifetime = self::COOKIE_EXPIRES_ONE_YEAR, $path = null, $secure = false, $httponly = false) { $this->lifetime = $lifetime; $this->date = System::getInstance()->getDate(); if (null !== $namespace) { $this->namespace = $namespace; } if (null !== $path) { $this->path = $path; } if (false !== $secure) { $this->secure = $secure; } if (false !== $httponly) { $this->httponly = $httponly; } if (self::isExist($this->namespace)) { $this->instance = unserialize(base64_decode(self::get($this->namespace))); } else { $this->instance = new \stdClass(); } }
public function getUrl() { return \Extlib\System::getInstance()->getDomain()->getAddress() . '/system/image/hash/' . $this->getHash(); }
/** * Instance of construct */ private function __construct() { $this->system = \Extlib\System::getInstance(); $this->ipAddress = new IpAddress(); $this->urlAddress = new Url(); }