예제 #1
0
 public function __construct(API $base)
 {
     parent::__construct($base);
     if (!class_exists('PDO')) {
         throw new CoreException('PDO is not installed, but it is required');
     }
 }
예제 #2
0
 public function run()
 {
     DB::table('core_modules')->delete();
     CoreModule::create(array('name' => 'about us', 'key' => '7699aded6da716dbca47963fhee85c67', 'description' => 'a little info about your company', 'no_of_installation' => 3, 'version_number' => 2, 'activated' => 1));
     CoreModule::create(array('name' => 'contact us', 'key' => '7699aded6da716dbca47963faee85c67', 'description' => 'a contact info of your company', 'no_of_installation' => 6, 'version_number' => 3, 'activated' => 1));
     CoreModule::create(array('name' => 'service package', 'key' => '7699aded6da716dbca47963fnee85c67', 'description' => 'a service package management module', 'no_of_installation' => 7, 'version_number' => 4, 'activated' => 1));
 }
예제 #3
0
 public function __construct(API $base, $number)
 {
     parent::__construct($base);
     $parts = self::validate($number);
     $this->country_code = $parts[self::RE_PHONE_PART_COUNTRY_CODE];
     $this->operator_code = $parts[self::RE_PHONE_PART_OPERATOR_CODE];
     $this->number = $parts[self::RE_PHONE_PART_NUMBER];
 }
예제 #4
0
 public function manageableModules()
 {
     $module_ids = array();
     $pages = CorePage::select('module_id')->whereIn('_id', $this->page_ids)->get();
     foreach ($pages as $page) {
         $module_ids[] = $page->module_id;
     }
     return CoreModule::where('manageable', '=', '1')->whereIn('_id', $module_ids)->get();
 }
예제 #5
0
 public function __construct(API $base, LayoutDirectory $directory, $filename)
 {
     parent::__construct($base);
     $this->twig = $directory->twig();
     try {
         $this->template = $this->twig->loadTemplate($filename);
     } catch (\Twig_Error $e) {
         throw new TemplateException($e);
     }
 }
예제 #6
0
 public function __construct(API $base, $path)
 {
     parent::__construct($base);
     if (!@file_exists($path)) {
         throw new FileIOException($path, FileIOException::FILE_IO_DIRECTORY_NOT_FOUND);
     }
     if (!@is_dir($path)) {
         throw new FileIOException($path, FileIOException::FILE_IO_NOT_A_DIRECTORY);
     }
     $this->path = $path;
 }
예제 #7
0
 /**
  * Returns a nicely formatted date string for given Datetime string.
  *
  * @param string $dateString Datetime string
  * @param int $format Format of returned date
  * @return string Formatted date string
  */
 public static function nice($dateString = null, $time = true)
 {
     $date = $dateString ? (int) $dateString ? $dateString : strtotime($dateString) : time();
     $y = self::isThisYear($date) ? '' : ' Y';
     if (self::isToday($date)) {
         $return = $time ? sprintf(CoreModule::t('Today') . ', %s', date("H:i", $date)) : CoreModule::t('Today');
     } elseif (self::wasYesterday($date)) {
         $return = $time ? sprintf(CoreModule::t('Yesterday') . ', %s', date("H:i", $date)) : CoreModule::t('Yesterday');
     } else {
         $return = $time ? date("d F{$y}, H:i", $date) : date("d M{$y}", $date);
     }
     return $return;
 }
예제 #8
0
 public function __construct(API $base, $filename)
 {
     parent::__construct($base);
     $this->filename = $filename;
     if (!@file_exists($filename)) {
         throw new FileIOException($filename, FileIOException::FILE_IO_FILE_NOT_FOUND);
     }
     if (!@is_readable($filename)) {
         throw new FileIOException($filename, FileIOException::FILE_IO_ACCESS_DENIED);
     }
     $handle = @fopen($filename, 'r');
     $this->header = @fgets($handle, 64);
     @fclose($handle);
 }
예제 #9
0
 public function __construct(API $base)
 {
     parent::__construct($base);
     switch ($base->frontend()) {
         case API::FRONTEND_BASIC:
             $this->get_variables =& $_GET;
             $this->post_variables =& $_POST;
             $this->cookie_variables =& $_COOKIE;
             $this->method = strtolower($_SERVER['REQUEST_METHOD']);
             $this->path = $_SERVER['REQUEST_URI'];
             $this->host = $_SERVER['HTTP_HOST'];
             break;
         case API::FRONTEND_FASTCGI:
             // nothing
             break;
     }
 }
예제 #10
0
 public function __construct(API $base, Request $request)
 {
     parent::__construct($base);
     // TODO: FastCGI, heavy refactoring
     session_start();
     $this->request = $request;
     if (!isset($_SESSION['IP'])) {
         $_SESSION['IP'] = (string) $request->ip(false);
     } else {
         if ($_SESSION['IP'] != (string) $request->ip(false)) {
             session_unset();
         }
     }
     $this->logged_in = false;
     $this->login_callback = array($this, 'loginDefault');
     if (@$_SESSION['SPINDASH_LOGGED_IN'] == 'yes') {
         $this->logged_in = true;
         $this->username = @$_SESSION['SPINDASH_USERNAME'];
     }
 }
예제 #11
0
파일: bbcode.inc.php 프로젝트: wst/spindash
 public function __construct(API $base)
 {
     parent::__construct($base);
 }
예제 #12
0
 public function __construct(API $base, $username, $password)
 {
     parent::__construct($base);
     $this->username = $username;
     $this->password = $password;
 }
예제 #13
0
 public function __construct(API $base, $address = NULL)
 {
     parent::__construct($base);
 }
예제 #14
0
 public function __construct(API $base, $api_key = NULL)
 {
     parent::__construct($base);
     $this->api_key = $api_key;
 }
예제 #15
0
 public function __construct($key_prefix, API $base)
 {
     parent::__construct($base);
     $this->key_prefix = $key_prefix;
 }