本文整理汇总了PHP中Core::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::__construct方法的具体用法?PHP Core::__construct怎么用?PHP Core::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct()
{
parent::__construct();
$this->Shell = Core::GetShellInstance();
$this->IfConfigBin = FCONFIG_BIN;
$this->Eth = DEFAULT_ETH;
}
示例2: foreach
function __construct()
{
parent::__construct();
$this->activeDirectory = $GLOBALS['config']['lib']['activeDirectory'];
foreach ($this->activeDirectory as $activeDirectory) {
$dn = explode('.', $activeDirectory['domain']);
$ldapDN = '';
foreach ($dn as $item) {
$ldapDN = $ldapDN . 'DC=' . $item . ',';
}
$ldapDN = substr($ldapDN, 0, strlen($ldapDN) - 1);
//colocar no array
// Connect to AD
$ad = ldap_connect($activeDirectory['host']);
if (!$ad) {
consoleWrite("Cant CONNECT to Active Directory!");
return false;
}
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ad, LDAP_OPT_SIZELIMIT, 1500);
//LIMITA A QUANTIDADE DE REGISTROS RETORNADOS
$this->activeDirectory[$activeDirectory['id']]['ad'] = $ad;
$this->activeDirectory[$activeDirectory['id']]['ldapDN'] = $ldapDN;
}
}
示例3: explode
function __construct()
{
parent::__construct();
$this->coreModule = $GLOBALS['CoreModule'];
$this->toView['coreModule'] = $this->coreModule;
/* LOAD THE AUTOLOAD LIBRARIES*/
$libraries = explode('|', core::$config['autoload']);
if (core::$config['autoload'] > '') {
foreach ($libraries as $library) {
$class = 'Core\\' . $library;
if (class_exists($class)) {
$this->{$library} = new $class();
} else {
if ($GLOBALS['CoreVars'][0] != 'AdminCore') {
$errorPage = "You have configured <b>{$library}</b> into AUTOLOAD, but it isn't in the lib folder. Please make sure that your instalation is ok";
require 'errorPage.php';
}
}
}
}
$this->baseLink = MODULEDIR;
$this->toView['baseLink'] = $this->baseLink;
//User to create easy links
define('PAGEDIR', MODULEDIR . '/' . get_class($this));
}
示例4: __construct
/**
* DBAdapter construcotr
*
* @param string $tableName Table name
*/
public function __construct($tableName = null)
{
parent::__construct();
// Get the LOG table name
$this->TableName = is_null($tableName) ? self::LOG_DB_TABLE : $tableName;
$this->Options = array('fieldMessage' => 'message', 'fieldLevel' => 'level', 'fieldDatetime' => false, 'fieldTimestamp' => false, 'fieldTrnID' => false);
}
示例5: sqlite
function __construct()
{
parent::__construct();
$table = 'lib_statistics';
$sqlite = new sqlite($table);
$this->sqlite = $sqlite;
$data = $sqlite->select();
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$this->user_agent = $_SERVER['HTTP_USER_AGENT'];
$this->language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
} else {
$this->user_agent = 'UPDATING';
$this->language = 'UPDATING';
}
if (!$data) {
$stmt = "CREATE TABLE IF NOT EXISTS {$table} (\n\t\t\t\t\t\tid INTEGER NOT NULL,\n\t\t\t\t\t\tip TEXT(15) NOT NULL,\n\t\t\t\t\t\tuser_agent TEXT(100) NOT NULL,\n\t\t\t\t\t\tlanguage TEXT(100) NOT NULL,\n\t\t\t\t\t\tfirst_access TEXT(19) NOT NULL,\n\t\t\t\t\t\tlast_access TEXT(19) NOT NULL,\n\t\t\t\t\t\tPRIMARY KEY ('id')\n\t\t\t\t\t);";
$sqlite->exec($stmt);
}
$data = $sqlite->selectWhere('ip = "' . $_SERVER['REMOTE_ADDR'] . '"');
if (!$data) {
$this->insert();
} else {
if ($data['user_agent'] != $this->user_agent) {
$this->insert();
} else {
$this->update($data['id']);
}
}
}
示例6: Cache
/**
* Constructs a Session object.
*/
function __construct()
{
parent::__construct();
$this->cache = new Cache('session');
$this->password = new Password();
/*session_set_save_handler(
array(&$this, 'open'),
array(&$this, 'close'),
array(&$this, 'read'),
array(&$this, 'write'),
array(&$this, 'destroy'),
array(&$this, 'clean'));
*/
$this->create();
if (isset($_COOKIE[session_name()])) {
session_id($_COOKIE[session_name()]);
}
$this->params = array("lifetime" => SESSION_EXPIRE, "path" => ini_get("session.cookie_path"), "domain" => ini_get("session.cookie_domain"), "secure" => ini_get("session.cookie_secure"), "httponly" => ini_get("session.cookie_httponly"));
session_start();
$data = $this->get();
$this->set_cookie($data && $data["remember"]);
// check to see if ips match and if session still active
if ($data && $_SERVER['REMOTE_ADDR'] === $data['ip'] && $data["ua"] === $_SERVER['HTTP_USER_AGENT']) {
// place data in session cookie
if (!$data["remember"] || $data["timestamp"] + $this->params["lifetime"] > $_SERVER['REQUEST_TIME']) {
$this->cookie = $data;
$this->cookie["timestamp"] = $_SERVER['REQUEST_TIME'];
} else {
$this->del();
}
}
$this->set();
$this->make_defined();
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->_oWallModel = new WallModel();
$this->_oAvatarDesign = new AvatarDesignCore();
// Avatar Design Class
switch ($this->httpRequest->post('type')) {
case 'show':
$this->show();
break;
case 'showCommentProfile':
$this->showCommentProfile();
break;
case 'add':
$this->add();
break;
case 'edit':
$this->edit();
break;
case 'delete':
$this->delete();
break;
default:
Framework\Http\Http::setHeadersByCode(400);
exit('Bad Request Error!');
}
}
示例8: Password
/**
* Constructs a Account object.
*/
function __construct()
{
global $session;
parent::__construct();
$this->session = $session;
$this->password = new Password();
}
示例9:
/**
* Constructor
* @access public
* @param string $host Host to connect
* @param int $port Port to connect
* @param string $login SSH Login to authenticate with
* @param string $password SSH Password to authenticate with
* @return bool
*/
function __construct($host, $port, $authinfo)
{
parent::__construct();
// Default values
$this->InstallPath = ZEUS_INSTALL_ROOT;
$this->Authinfo = $authinfo;
// SSH2
$this->SSH2 = new SSH2();
if ($this->Authinfo["type"] == "password")
$this->SSH2->AddPassword($this->Authinfo["login"], $this->Authinfo["password"]);
elseif ($this->Authinfo["type"] == "pubkey")
$this->SSH2->AddPubkey($this->Authinfo["login"], $this->Authinfo["pubkey_path"], $this->Authinfo["privkey_path"], $this->Authinfo["key_pass"]);
$this->SSH2->Connect($host, $port);
if ($this->SSH2->IsConnected())
{
// CD to install path
$exec = $this->SSH2->Exec("cd ".$this->InstallPath."/webadmin/bin && pwd");
if (stristr($exec, "No such file"))
{
$this->RaiseWarning("{$this->InstallPath}/webadmin/bin - not found");
$this->IsInit = false;
}
else
$this->IsInit = true;
}
else
$this->IsInit = false;
}
示例10: __construct
public function __construct()
{
parent::__construct();
if ($this->config->nf_http_authentication && is_null($this->session('user_id')) && $this->session('session', 'http_authentication')) {
$this->session->destroy('session', 'http_authentication');
if (isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
$login = $_SERVER['PHP_AUTH_USER'];
$password = $_SERVER['PHP_AUTH_PW'];
} else {
if (isset($_SERVER['REDIRECT_REMOTE_USER']) && preg_match('/Basic (.*)/', $_SERVER['REDIRECT_REMOTE_USER'], $matches)) {
list($login, $password) = explode(':', base64_decode($matches[1]));
}
}
if (isset($login, $password)) {
$user = $this->db->select('user_id', 'password', 'salt')->from('nf_users')->where('last_activity_date <>', 0)->where('deleted', FALSE)->where('BINARY username', $login, 'OR', 'BINARY email', $login)->row();
if ($user) {
if (!$user['salt'] && $this->load->library('password')->is_valid($password, $user['password'], FALSE)) {
$this->db->where('user_id', (int) $user['user_id'])->update('nf_users', array('password' => $user['password'] = $this->password->encrypt($password . ($salt = unique_id())), 'salt' => $user['salt'] = $salt));
}
if ($this->load->library('password')->is_valid($password . $user['salt'], $user['password'])) {
$this->login((int) $user['user_id'], FALSE);
if ($this->config->request_url == 'user/logout.html') {
redirect();
}
}
}
}
}
$this->_init();
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->db->where('remember_me', FALSE)->where('UNIX_TIMESTAMP(last_activity) <', time() - strtoseconds($this->config->nf_cookie_expire))->delete('nf_sessions');
$this->_ip_address = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
$this->_host_name = utf8_string(gethostbyaddr($this->_ip_address));
if (isset($_COOKIE[$this->config->nf_cookie_name]) && $this->_check_cookie($cookie = $_COOKIE[$this->config->nf_cookie_name], $last_activity)) {
if (strtotime($this->config->nf_cookie_expire, $last_activity) < time()) {
$this->_session_id();
} else {
$this->_session_id = $cookie;
}
$this->db->where('session_id', $cookie)->update('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'last_activity' => now()));
if (!is_null($time_zone = $this('session', 'time_zone'))) {
set_time_zone($time_zone);
$this->db->update_time_zone();
}
} else {
if (!is_asset() && !$this->config->ajax_url && !$this->config->ajax_header && $_SERVER['REQUEST_METHOD'] != 'OPTIONS') {
$this->_session_id();
$crawler = is_crawler();
if ($crawler !== FALSE) {
$this->db->insert('nf_crawlers', array('name' => $crawler, 'path' => $this->config->request_url));
}
$this->db->insert('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'is_crawler' => $crawler !== FALSE));
$this->_user_data['session']['date'] = time();
$this->_user_data['session']['javascript'] = FALSE;
$this->_user_data['session']['referer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$this->_user_data['session']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
}
}
statistics('nf_sessions_max_simultaneous', $this->_sessions = $this->db->select('COUNT(DISTINCT IFNULL(user_id, session_id))')->from('nf_sessions')->where('last_activity > DATE_SUB(NOW(), INTERVAL 5 MINUTE)')->where('is_crawler', FALSE)->row(), function ($a, $b) {
return $a > $b;
});
}
示例12: __construct
public function __construct()
{
parent::__construct();
foreach ($this->db->from('nf_settings_addons')->get() as $addon) {
$this->_addons[$addon['type']][$addon['name']] = (bool) $addon['enable'];
}
}
示例13:
function __construct($data)
{
parent::__construct($data);
$this->setPrerequisites('userid,lat,lng,alignment,transport');
if ($this->checkPrerequisites()) {
$this->addPoint();
}
}
示例14: __construct
public function __construct()
{
// initialisation du CORE
parent::__construct();
$class = self::$curent_class;
// appel du controlleur
echo $class::{Request::getController() . 'Controller'}();
}
示例15: redirect
function __construct()
{
parent::__construct();
//$this->load->model('admincore_model');
if (!$this->session->userdata('username')) {
redirect('login');
}
}