本文整理汇总了PHP中L类的典型用法代码示例。如果您正苦于以下问题:PHP L类的具体用法?PHP L怎么用?PHP L使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了L类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getSendToUsernames
function getSendToUsernames($type, $tid)
{
global $windid, $db;
$usernames = array();
if (!$type || !$tid) {
return $usernames;
}
$remindUsernames = $db->get_value("SELECT db_value FROM pw_config WHERE db_name = 'report_remind'");
$remindUsernames = $remindUsernames ? unserialize($remindUsernames) : array();
foreach ($remindUsernames as $key => $value) {
if ($value['username'] == $windid) {
continue;
}
$usernames[] = $value['username'];
}
if ($type != 'topic') {
return $usernames;
}
$_cacheService = Perf::gatherCache('pw_threads');
$threads = $_cacheService->getThreadByThreadId($tid);
$fid = $threads['fid'];
L::loadClass('forum', 'forum', false);
$forumService = new PwForum($fid);
$foruminfo = $forumService->foruminfo;
$forumadmins = $foruminfo['forumadmin'];
$forumadmins = explode(',', $forumadmins);
foreach ($forumadmins as $forumadmin) {
if (!$forumadmin || $forumadmin == $windid) {
continue;
}
$usernames[] = $forumadmin;
}
return $usernames;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:34,代码来源:report.php
示例2: query
public function query($limit = 25, $index = 0)
{
if ($this->user->getClass() < User::CLASS_ADMIN) {
throw new Exception(L::get("PERMISSION_DENIED"), 401);
}
$sth = $this->db->query("SELECT COUNT(*) FROM nyregg");
$res = $sth->fetch();
$totalCount = $res[0];
$sth = $this->db->prepare("SELECT nyregg.ip, nyregg.userid, nyregg.datum AS added, nyregg.email, nyregg.hostname, nyregg.log_mail, nyregg.log_ip, nyregg.level, users.warned, users.enabled, users.username FROM nyregg LEFT JOIN users ON nyregg.userid = users.id ORDER BY nyregg.id DESC LIMIT ?, ?");
$sth->bindParam(1, $index, PDO::PARAM_INT);
$sth->bindParam(2, $limit, PDO::PARAM_INT);
$sth->execute();
$result = array();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$r = array();
$r["added"] = $row["added"];
$r["hostname"] = $row["hostname"];
$r["ip"] = $row["ip"];
$r["email"] = $row["email"];
$r["log_ip"] = $row["log_ip"];
$r["level"] = $row["level"];
$r["log_mail"] = $row["log_mail"];
$r["user"] = array("id" => $row["userid"], "username" => $row["username"], "warned" => $row["warned"], "enabled" => $row["enabled"]);
array_push($result, $r);
}
return array($result, $totalCount);
}
开发者ID:swetorrentking,项目名称:rartracker,代码行数:27,代码来源:Signups.php
示例3: run
public function run()
{
if ($_SERVER['SERVER_ADDR'] != $_SERVER["REMOTE_ADDR"]) {
throw new Exception(L::get("MUST_BE_RUN_BY_SERVER_ERROR"), 401);
}
/* 1. Save all users current seed amount. Run every hour */
$now = time('Y-m-d H');
$user = $this->db->query('SELECT * FROM users WHERE enabled = "yes"');
while ($u = $user->fetch(PDO::FETCH_ASSOC)) {
$res = $this->db->query('SELECT torrents.size, peers.to_go FROM peers JOIN torrents ON peers.torrent = torrents.id WHERE userid = ' . $u["id"] . ' GROUP BY userid, torrent');
$seededAmount = 0;
while ($r = $res->fetch(PDO::FETCH_ASSOC)) {
$seededAmount += $r["size"] - $r["to_go"];
}
$gb = round($seededAmount / 1073741824);
if ($gb > 0) {
$this->db->query('INSERT INTO leechbonus(userid, datum, gbseed) VALUES(' . $u["id"] . ', ' . $now . ', ' . $gb . ')');
}
}
/* 2. Erase all logs older than 3 days */
$timeSpan = time() - 259200;
// 3 days
$this->db->query('DELETE FROM leechbonus WHERE datum < ' . $timeSpan);
/* 3. Update all leechbonus percent based on the last 3 days */
$user = $this->db->query('SELECT id, UNIX_TIMESTAMP(added) AS added FROM users');
while ($u = $user->fetch(PDO::FETCH_ASSOC)) {
$res = $this->db->query('SELECT SUM(gbseed) AS seedsum FROM leechbonus WHERE userid = ' . $u["id"] . ' ');
$res2 = $res->fetch(PDO::FETCH_ASSOC);
$leechbonus = $this->leechbonus($res2["seedsum"] / 72);
// Split into 24*3 hours
$this->db->query('UPDATE users SET leechbonus = ' . $leechbonus . ' WHERE id = ' . $u["id"]);
}
}
开发者ID:swetorrentking,项目名称:rartracker,代码行数:33,代码来源:Leechbonus.php
示例4: update
function update($uploaddb)
{
$fieldService = L::loadClass('ActivityField', 'activity');
if ($this->tid) {
$defaultAttach = $userAttach = array();
foreach ($uploaddb as $key => $value) {
if ($value['id']) {
$attach = array();
$attach = $fieldService->getField($value['id']);
$this->attachs[$attach['fieldname']] = $value['fileuploadurl'];
if ($attach['fieldname'] && $attach['ifdel'] == 1) {
$userAttach[$attach['fieldname']] = $value['fileuploadurl'];
} elseif ($attach['fieldname'] && !$attach['ifdel']) {
$defaultAttach[$attach['fieldname']] = $value['fileuploadurl'];
}
}
}
$defaultValueTableName = getActivityValueTableNameByActmid();
$userDefinedValueTableName = getActivityValueTableNameByActmid($this->actmid, 1, 1);
if ($defaultAttach) {
$this->db->update("UPDATE {$defaultValueTableName} SET " . S::sqlSingle($defaultAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
if ($userAttach) {
$this->db->update("UPDATE {$userDefinedValueTableName} SET " . S::sqlSingle($userAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
} else {
foreach ($uploaddb as $key => $value) {
$this->attachs['fileuploadurl'] = $value['fileuploadurl'];
}
}
return true;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:32,代码来源:activityupload.class.php
示例5: CheckUserTool
function CheckUserTool($uid, $tooldb)
{
global $db, $groupid, $credit;
if (!$tooldb['state']) {
Showmsg('tool_close');
}
$condition = unserialize($tooldb['conditions']);
if ($condition['group'] && strpos($condition['group'], ",{$groupid},") === false) {
Showmsg('tool_grouplimit');
}
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userdb = $userService->get($uid, false, true);
require_once R_P . 'require/credit.php';
$creditdb = $credit->get($uid, 'CUSTOM');
foreach ($condition['credit'] as $key => $value) {
if ($value) {
if (is_numeric($key)) {
$creditdb[$key] < $value && Showmsg('tool_creditlimit');
} elseif ($userdb[$key] < $value) {
Showmsg('tool_creditlimit');
}
}
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:25,代码来源:tool.php
示例6: transfer
function transfer()
{
if (empty($this->flashatt)) {
return false;
}
global $timestamp, $winddb;
require_once R_P . 'require/functions.php';
$pw_attachs = L::loadDB('attachs', 'forum');
$saveAttach = $this->getSaveAttach($this->uid);
$deltmp = array();
$attach = $pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0));
foreach ($attach as $rt) {
$deltmp[] = $rt['aid'];
if (!isset($this->flashatt[$rt['aid']])) {
pwDelatt($rt['attachurl'], $this->ifftp);
continue;
}
$saveAttach && $saveAttach->add($rt);
$value = $this->flashatt[$rt['aid']];
$rt['descrip'] = $value['desc'];
$this->attachs[] = array('id' => $rt['aid'], 'attname' => 'attachment', 'name' => $rt['name'], 'type' => $rt['type'], 'fileuploadurl' => $rt['attachurl'], 'size' => $rt['size'], 'descrip' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']);
$winddb['uploadnum']++;
$winddb['uploadtime'] = $timestamp;
}
$saveAttach && $saveAttach->execute();
$deltmp && $pw_attachs->delete($deltmp);
return true;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:28,代码来源:articleupload.class.php
示例7: _getDataAnalyseService
function _getDataAnalyseService()
{
if (!$this->_dataAnalyseService) {
$this->_dataAnalyseService = L::loadClass('datanalyseService', 'datanalyse');
}
return $this->_dataAnalyseService;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:7,代码来源:groupimagesource.class.php
示例8: create
/**
* Create the category menu with his childrens
* @todo test
*/
public function create()
{
// get the categories
$categories = $this->r->getRootNodes();
$cat_menu = new Collection();
if ($categories) {
foreach ($categories as $category) {
// get the childrens
$childrens = $category->children()->whereLang(L::get())->count() ? $category->children()->whereLang(L::get())->get(["id", "description", "slug_lang"]) : null;
// create the menuitems
//@todo handle multiple recursive subitems with a better algorithm
$cat_menu_item = new MenuItem($category->description, $category->slug_lang, $this->cat_type, null, $this->getActive($category->slug_lang));
if ($childrens) {
foreach ($childrens as $children) {
$children_item = new MenuItem($children->description, $children->slug_lang, $this->cat_type, null, $this->getActive($children->slug_lang));
// if has sub-subcategories
if ($children->children()->whereLang(L::get())->count()) {
$childrens_children = $children->children()->whereLang(L::get())->get(["id", "description", "slug_lang"]);
foreach ($childrens_children as $children_children) {
$children_item->add(new MenuItem($children_children->description, $children_children->slug_lang, $this->cat_type, null, $this->getActive($children_children->slug_lang)));
}
}
$cat_menu_item->add($children_item);
}
}
// append to original menu
$cat_menu->push($cat_menu_item);
}
}
return $cat_menu;
}
开发者ID:palmabit,项目名称:catalog,代码行数:35,代码来源:MenuCategoryFactory.php
示例9: actionConfirmation
public function actionConfirmation()
{
$hash = trim(Yii::app()->request->getParam('hash', null));
if (!empty($hash) && ($user = User::model()->find('sha(concat(email, "' . Yii::app()->params['salt'] . '")) = :hash', array(':hash' => $hash)))) {
// Пользователь найден, регистрация окончена
$user->password_confirm = $user->password;
$user->status = L::r_item('userStatus', 'active');
$user->activated = date('Y-m-d H:i:s');
$user->save();
if (empty($user->errors)) {
// добавляю пользователя в RBAC
$auth = Yii::app()->authManager;
$auth->assign('user', $user->username);
$loginForm = new LoginForm();
$loginForm->username = $user->username;
$loginForm->password = $user->password;
$loginForm->login();
$this->redirect(array('users/view', 'username' => $user->username));
}
} elseif (!empty($hash)) {
Yii::app()->user->setFlash('registration', 'Вы ввели неверный ключ. Попробуйте еще раз.');
} else {
Yii::app()->user->setFlash('registration', 'На указанный Вами e-mail было отправленно письмо с кодом подтверждения. Введите его.');
}
$this->render('confirmation', array('hash' => $hash));
}
开发者ID:BGCX261,项目名称:zoomtyre-svn-to-git,代码行数:26,代码来源:UsersController.php
示例10: _getElement
function _getElement()
{
if (!$this->_element) {
$this->_element = L::loadClass('element');
}
return $this->_element;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:7,代码来源:imagesource.class.php
示例11: query
public function query($postdata)
{
if ($this->user->getClass() < User::CLASS_ADMIN) {
throw new Exception(L::get("PERMISSION_DENIED"), 401);
}
$limit = (int) $postdata["limit"] ?: 25;
$index = (int) $postdata["index"] ?: 0;
$search = $postdata["search"] ?: "";
$where = "";
if (strlen($search) > 0) {
$searchWords = Helper::searchTextToWordParams($search);
$where = "WHERE MATCH (adminlog.search_text) AGAINST (" . $this->db->quote($searchWords) . " IN BOOLEAN MODE)";
}
$sth = $this->db->query("SELECT COUNT(*) FROM adminlog " . $where);
$res = $sth->fetch();
$totalCount = $res[0];
$sth = $this->db->prepare("SELECT adminlog.added, adminlog.id AS aid, adminlog.txt, users.id, users.username FROM adminlog LEFT JOIN users ON adminlog.userid = users.id " . $where . " ORDER BY adminlog.id DESC LIMIT ?, ?");
$sth->bindParam(1, $index, PDO::PARAM_INT);
$sth->bindParam(2, $limit, PDO::PARAM_INT);
$sth->execute();
$result = array();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$r = array();
$r["id"] = $row["aid"];
$r["added"] = $row["added"];
$r["txt"] = str_replace("{{username}}", "[url=/user/" . $row["id"] . "/" . $row["username"] . "][b]" . $row["username"] . "[/b][/url]", $row["txt"]);
array_push($result, $r);
}
return array($result, $totalCount);
}
开发者ID:swetorrentking,项目名称:rartracker,代码行数:30,代码来源:AdminLogs.php
示例12: addPluginsTo
public function addPluginsTo(SSLPluggable $sslpluggable)
{
L::level(L::DEBUG) && L::log(L::DEBUG, __CLASS__, "yielding %d plugins", array(count($this->plugins)));
foreach ($this->plugins as $plugin) {
$sslpluggable->addPlugin($plugin);
}
}
开发者ID:rabyunghwa,项目名称:sslscrobbler,代码行数:7,代码来源:CLIIrcCatPlugin.php
示例13: create
public function create($postdata = null)
{
if ($this->user->getClass() < User::CLASS_ACTOR) {
throw new Exception(L::get("SEED_REQUEST_CLASS_REQUIREMENT"), 401);
}
$sth = $this->db->prepare('SELECT * FROM reseed_requests WHERE torrentid = ? AND added > DATE_ADD(NOW(),INTERVAL -1 MONTH)');
$sth->bindParam(1, $postdata["torrentid"], PDO::PARAM_INT);
$sth->execute();
if ($sth->rowCount() > 0) {
throw new Exception(L::get("SEED_REQUEST_ALREADY_REQUESTED"), 412);
}
if ($this->user->getBonus() < 5) {
throw new Exception(L::get("NOT_ENOUGH_BONUS"), 412);
}
$torrent = $this->torrent->get($postdata["torrentid"]);
if ($torrent["seeders"] > 2) {
throw new Exception(L::get("SEED_REQUEST_SEEDERS_REQUIREMENT"), 412);
}
$this->user->bonusLog(-5, L::get("SEED_REQUEST_BONUS_LOG"), $this->user->getId());
$sth = $this->db->query("SELECT snatch.userid, users.language FROM snatch LEFT JOIN users ON users.id = snatch.userid WHERE torrentid = " . $torrent["id"] . " AND lastaction > DATE_ADD(NOW(),INTERVAL -6 MONTH) AND timesCompleted > 0 AND userid != " . $this->user->getId());
while ($res = $sth->fetch(PDO::FETCH_ASSOC)) {
$this->mailbox->sendSystemMessage($res["userid"], L::get("SEED_REQUEST_PM_SUBJECT", null, $res["language"]), L::get("SEED_REQUEST_PM_BODY", [$torrent["id"], $torrent["name"], $torrent["name"]], $res["language"]));
}
$sth = $this->db->prepare("INSERT INTO reseed_requests(torrentid, userid, added) VALUES(?, ?, NOW())");
$sth->bindParam(1, $torrent["id"], PDO::PARAM_INT);
$sth->bindValue(2, $this->user->getId(), PDO::PARAM_INT);
$sth->execute();
$this->log->log(1, L::get("SEED_REQUEST_SITE_LOG", [$torrent["id"], $torrent["name"], $torrent["name"]], Config::DEFAULT_LANGUAGE), $this->user->getId(), 1);
}
开发者ID:swetorrentking,项目名称:rartracker,代码行数:29,代码来源:ReseedRequests.php
示例14: AttUpload
function AttUpload($uid, $flashatt = null, $savetoalbum = 0, $albumid = 0)
{
global $db, $pwforum, $pwpost, $db_ifathumb, $db_athumbsize, $db_uploadfiletype;
parent::uploadBehavior();
$this->pw_attachs = L::loadDB('attachs', 'forum');
$this->uid = $uid;
$this->db =& $db;
$this->forum =& $pwforum;
$this->post =& $pwpost;
if ($pwforum->forumset['ifthumb'] == 1) {
$this->ifthumb = 1;
$this->thumbsize = $pwforum->forumset['thumbsize'];
} elseif ($pwforum->forumset['ifthumb'] == 2) {
$this->ifthumb = 0;
$this->thumbsize = 0;
} else {
$this->ifthumb = $db_ifathumb;
$this->thumbsize = $db_athumbsize;
}
list($uploadcredit, $uploadmoney) = explode("\t", $pwforum->forumset['uploadset']);
$this->uploadmoney = $uploadmoney;
$this->uploadcredit = $uploadcredit;
$this->ftype =& $db_uploadfiletype;
$this->uploadImgNum = 0;
$this->uptype = 'all';
$this->setFlashAtt($flashatt, $savetoalbum, $albumid);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:27,代码来源:attupload.class.php
示例15: update
function update($uploaddb)
{
global $windid, $winduid, $timestamp, $pintro;
foreach ($uploaddb as $key => $value) {
$this->attachs[] = array('aid' => $this->aid, 'pintro' => $pintro[$value['id']] ? $pintro[$value['id']] : substr($value['name'], 0, strrpos($value['name'], '.')), 'path' => $value['fileuploadurl'], 'uploader' => $windid, 'uptime' => $timestamp, 'ifthumb' => $value['ifthumb']);
}
if ($this->attachs) {
$this->db->update("INSERT INTO pw_cnphoto (aid,pintro,path,uploader,uptime,ifthumb) VALUES " . S::sqlMulti($this->attachs));
$this->pid = $this->db->insert_id();
$cnalbum = $this->db->get_one("SELECT * FROM pw_cnalbum WHERE aid=" . S::sqlEscape($this->aid));
if ($this->atype) {
if (!$cnalbum['private']) {
updateDatanalyse($this->pid, 'groupPicNew', $timestamp);
}
} else {
$statistics = L::loadClass('Statistics', 'datanalyse');
$statistics->photouser($winduid, count($this->attachs));
}
if (isset($cnalbum['lastphoto']) && !$cnalbum['lastphoto']) {
$lastphoto = $this->getLastPhotoThumb();
$lastphotosqlAdd = ",lastphoto= " . S::sqlEscape($lastphoto);
}
$this->db->update("UPDATE pw_cnalbum SET photonum=photonum+" . S::sqlEscape(count($this->attachs)) . ",lasttime=" . S::sqlEscape($timestamp) . $lastphotosqlAdd . " WHERE aid=" . S::sqlEscape($this->aid));
}
return true;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:26,代码来源:photoupload.class.php
示例16: topicPost
function topicPost($tid, $postdata)
{
global $timestamp, $winduid, $windid;
if (!$this->info) {
return false;
}
$this->_db->update("INSERT INTO pw_argument SET " . S::sqlSingle(array('tid' => $tid, 'cyid' => $this->info['id'], 'postdate' => $timestamp, 'lastpost' => $timestamp)));
if ($postdata['ifcheck'] > 0) {
require_once R_P . 'u/require/core.php';
//tnum加一
//* $this->_db->update("UPDATE pw_colonys SET tnum=tnum+'1',pnum=pnum+'1',todaypost=todaypost+'1' WHERE id=" . S::sqlEscape($this->cyid));
$this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET tnum=tnum+1,pnum=pnum+1,todaypost=todaypost+1 WHERE id=:id", array('pw_colonys', $this->cyid)));
$this->info['tnum']++;
$this->info['pnum']++;
updateGroupLevel($this->cyid, $this->info);
if ($this->info['ifopen']) {
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weiboContent = substrs(stripWindCode($postdata['content']), 125);
$weiboExtra = array('cyid' => $this->cyid, 'title' => stripslashes($postdata['title']), 'cname' => $this->info['cname']);
$weiboService->send($winduid, $weiboContent, 'group_article', $tid, $weiboExtra);
}
}
//更新群成员表里面的最后发言时间
$this->_db->update("UPDATE pw_cmembers SET lastpost=" . S::sqlEscape($timestamp) . " WHERE uid=" . S::sqlEscape($winduid));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:26,代码来源:colonypost.class.php
示例17: it_translates_to
/**
* @test
**/
public function it_translates_to()
{
L::shouldReceive('get')->once()->andReturn('en')->shouldReceive('t')->andReturn('prova');
$transl = new UrlTranslatorIlluminate();
$url = $transl->to('prova');
$this->assertContains('/en/prova', $url);
}
开发者ID:palmabit,项目名称:multilanguage,代码行数:10,代码来源:UrlTranslatorIlluminateTest.php
示例18: syncredit
function syncredit($arr)
{
if (is_array($arr)) {
foreach ($arr as $uid => $setv) {
$updateMemberData = array();
foreach ($setv as $cid => $value) {
if (is_numeric($cid)) {
$value = intval($value);
/**
$this->db->pw_update(
"SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"UPDATE pw_membercredit SET value=" . S::sqlEscape($value) . ' WHERE uid=' . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"INSERT INTO pw_membercredit SET " . S::sqlSingle(array('uid' => $uid, 'cid' => $cid, 'value' => $value))
);
**/
$this->db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid), pwQuery::updateClause('pw_membercredit', 'uid=:uid AND cid=:cid', array($uid, $cid), array('value' => $value)), pwQuery::insertClause('pw_membercredit', array('uid' => $uid, 'cid' => $cid, 'value' => $value)));
} elseif (in_array($cid, array('money', 'rvrc', 'credit', 'currency'))) {
$cid == 'rvrc' && ($value *= 10);
$updateMemberData[$cid] = intval($value);
}
}
if ($updateMemberData) {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userService->update($uid, array(), $updateMemberData);
}
}
}
return new ApiResponse(1);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:30,代码来源:class_Credit.php
示例19: _uploadCsv
/**
* 上传csv文件到服务器端
*
*/
function _uploadCsv()
{
L::loadClass('csvupload', 'upload', false);
$csvupload = new CsvUpload($this->_uid);
PwUpload::upload($csvupload);
$this->_filename = $csvupload->pathname;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:11,代码来源:csv.inv.php
示例20: loadCompiled
/**
* @return Unpacker|NULL
*/
protected function loadCompiled($filename)
{
$basename = basename($filename, '.xoup');
$class = 'XOUP' . $basename . 'Unpacker';
if (!class_exists($class, false)) {
$dirname = dirname($filename);
$compiled_name = $dirname . '/' . $basename . '.php';
if (file_exists($dirname . '/' . $basename . '.php')) {
$source_ts = filemtime($filename);
$compiled_ts = filemtime($compiled_name);
if ($compiled_ts < $source_ts) {
L::level(L::DEBUG) && L::log(L::DEBUG, __CLASS__, 'source modified since last compilation', array());
return null;
}
require_once $compiled_name;
if (!class_exists($class)) {
throw new RuntimeException("{$class} not present in {$compiled_name}");
}
L::level(L::DEBUG) && L::log(L::DEBUG, __CLASS__, 'loaded compiled XOUP class %s from file %s', array($class, $compiled_name));
} else {
// no compiled file exists
L::level(L::DEBUG) && L::log(L::DEBUG, __CLASS__, 'compiled XOUP file %s does not (yet) exist', array($compiled_name));
return null;
}
}
return new $class();
}
开发者ID:rabyunghwa,项目名称:sslscrobbler,代码行数:30,代码来源:XoupLoader.php
注:本文中的L类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论