コード例 #1
0
ファイル: benchmark.php プロジェクト: olscore/ornithopter.io
 /**
  * Setup and configure the benchmark library class.
  */
 public function __construct()
 {
     // Run the first benchmark
     self::mark('init');
     // Register shortcut aliases using io::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }
コード例 #2
0
ファイル: str.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize str helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Private methods to exclude from shortcuts
     $excluded = array('casespace');
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, array_diff(get_class_methods(__CLASS__), $excluded));
 }
コード例 #3
0
ファイル: file.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize file helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // By default exclude annoying files
     self::exclusive();
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }
コード例 #4
0
ファイル: page.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize the page.
  *
  * @return void
  */
 public function __construct()
 {
     // Encapsulates output
     ob_start();
     // Shortcut reference
     $r = \io::route();
     // Set defaults for a page
     self::$data = array('title' => ucwords($r['controller'] . ' - ' . $r['action'] . ' | ' . \io::h('web')->domain()), 'description' => false, 'optimize' => false);
     // Register shortcut aliases using io::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }
コード例 #5
0
ファイル: crawler.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize the crawler class.
  *
  * @return void
  */
 public function __construct()
 {
     // Create a new web agent
     self::$data['crawler'] = \io::libraries('agent');
     // Crawler should be faster
     self::$data['timeout'] = 2500;
     // Set timeout within the user agent
     self::$data['crawler']->timeout(self::$data['timeout']);
     // Crawler disregards SSL verification
     self::$data['crawler']->secure(false);
     // Register shortcut aliases using io::method();
     \io::alias(__CLASS__, ['crawler', 'crawl', 'wait']);
 }
コード例 #6
0
ファイル: cron.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize cron helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Initialize defaults
     self::$data['jobs'] = array();
     self::$data['crontab'] = '/usr/bin/crontab';
     // Reads the crontab file into a string
     $crontab = stream_get_contents(popen(self::$data['crontab'] . ' -l', 'r'));
     // Iterates through all non-empty lines from crontab file
     foreach (array_filter(explode(PHP_EOL, $crontab)) as $line) {
         // Ignore comment lines
         if (trim($line)[0] != '#') {
             // Parse jobs into a developer friendly format
             self::$data['jobs'][md5($line)] = self::parse($line);
         }
     }
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, ['tasks', 'flush', 'schedule', 'unschedule']);
 }
コード例 #7
0
ファイル: session.php プロジェクト: olscore/ornithopter.io
 /**
  * Setup the session environment, check session exists, runs security.
  */
 public function __construct()
 {
     // This sets the cookie name
     session_name('app_id');
     // Check for a valid session cookie
     if (!isset($_COOKIE['app_id']) or !isset($_COOKIE['app_id'][63])) {
         // Generate a new session id
         session_id(self::session_id(true));
     } else {
         // Use the user provided session
         self::$session = $_COOKIE['app_id'];
     }
     // Starts the session
     session_start();
     // Security measures
     self::security();
     // Flashdata cleanup
     self::clean_flashdata();
     // User tracking
     self::tracking();
     // Register shortcut aliases using io::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }
コード例 #8
0
ファイル: inflector.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize inflector helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Setup internal data arrays
     self::internals();
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, ['singular', 'plural', 'inflector']);
 }
コード例 #9
0
ファイル: security.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize security helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }
コード例 #10
0
ファイル: markdown.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize markdown helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, ['markdown', 'parsedown']);
 }
コード例 #11
0
ファイル: html.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize html helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, ['html', 'tag', 'mailto']);
 }
コード例 #12
0
ファイル: time.php プロジェクト: olscore/ornithopter.io
 /**
  * Initialize time helper class.
  *
  * @return object
  */
 public function __construct()
 {
     // Default settings
     self::$settings = array('context' => ['units' => 1, 'relative' => 0], 'calc' => ['round' => 1, 'floor' => 0, 'ceil' => 0], 'display' => ['normal' => 1, 'short' => 0, 'tiny' => 0], 'past' => ['from ', ' ago', 0, 1], 'future' => ['in ', ' remaining', 0, 1], 'format' => ['normal' => 1, 'ucfirst' => 0, 'ucwords' => 0, 'strtoupper' => 0]);
     // Register shortcut aliases using h::method();
     \io::alias(__CLASS__, get_class_methods(__CLASS__));
 }