本文整理汇总了PHP中io::alias方法的典型用法代码示例。如果您正苦于以下问题:PHP io::alias方法的具体用法?PHP io::alias怎么用?PHP io::alias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io
的用法示例。
在下文中一共展示了io::alias方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* 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: __construct
/**
* Initialize security helper class.
*
* @return object
*/
public function __construct()
{
// Register shortcut aliases using h::method();
\io::alias(__CLASS__, get_class_methods(__CLASS__));
}
示例10: __construct
/**
* Initialize markdown helper class.
*
* @return object
*/
public function __construct()
{
// Register shortcut aliases using h::method();
\io::alias(__CLASS__, ['markdown', 'parsedown']);
}
示例11: __construct
/**
* Initialize html helper class.
*
* @return object
*/
public function __construct()
{
// Register shortcut aliases using h::method();
\io::alias(__CLASS__, ['html', 'tag', 'mailto']);
}
示例12: __construct
/**
* 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__));
}