本文整理汇总了PHP中App类的典型用法代码示例。如果您正苦于以下问题:PHP App类的具体用法?PHP App怎么用?PHP App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了App类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: expire_run
function expire_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
require_once 'library/simplepie/simplepie.inc';
require_once 'include/items.php';
require_once 'include/Contact.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
logger('expire: start');
$r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
if (count($r)) {
foreach ($r as $rr) {
logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
item_expire($rr['uid'], $rr['expire']);
}
}
return;
}
开发者ID:nphyx,项目名称:friendica,代码行数:30,代码来源:expire.php
示例2: expire_run
function expire_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
require_once 'library/simplepie/simplepie.inc';
require_once 'include/items.php';
require_once 'include/Contact.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
// physically remove anything that has been deleted for more than two months
$r = q("delete from item where deleted = 1 and changed < UTC_TIMESTAMP() - INTERVAL 60 DAY");
q("optimize table item");
logger('expire: start');
$r = q("SELECT `uid`,`username`,`expire` FROM `user` WHERE `expire` != 0");
if (count($r)) {
foreach ($r as $rr) {
logger('Expire: ' . $rr['username'] . ' interval: ' . $rr['expire'], LOGGER_DEBUG);
item_expire($rr['uid'], $rr['expire']);
}
}
return;
}
开发者ID:nextgensh,项目名称:friendica,代码行数:33,代码来源:expire.php
示例3: gprobe_run
function gprobe_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
require_once 'include/session.php';
require_once 'include/datetime.php';
load_config('config');
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
load_hooks();
if ($argc != 2) {
return;
}
$url = hex2bin($argv[1]);
$r = q("select * from gcontact where nurl = '%s' limit 1", dbesc(normalise_link($url)));
if (!count($r)) {
$arr = probe_url($url);
if (count($arr) && x($arr, 'network') && $arr['network'] === NETWORK_DFRN) {
q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)\n\t\t\t\tvalues ( '%s', '%s', '%s', '%s') ", dbesc($arr['name']), dbesc($arr['url']), dbesc(normalise_link($arr['url'])), dbesc($arr['photo']));
}
$r = q("select * from gcontact where nurl = '%s' limit 1", dbesc(normalise_link($url)));
}
if (count($r)) {
poco_load(0, 0, $r[0]['id'], str_replace('/profile/', '/poco/', $r[0]['url']));
}
return;
}
开发者ID:robhell,项目名称:friendica,代码行数:35,代码来源:gprobe.php
示例4: smstorage_parseMessages
public static function smstorage_parseMessages($data)
{
$emoji = new App();
foreach ($data['messages'] as $message) {
$message->body = $emoji->any_to_html($message->body);
}
}
开发者ID:DOM-Digital-Online-Media,项目名称:apps,代码行数:7,代码来源:hooks.php
示例5: route
/**
* The route method calls a specefic controller
* then apply the action and passing the arguments passed in URL
* @param App $app
* @return mixte
*/
public function route(App $app)
{
$urls = $this->cleanUrl();
$controller = !empty($urls) ? array_shift($urls) : 'index';
$action = !empty($urls) ? array_shift($urls) : '';
$params = !empty($urls) ? $urls : '';
if ($controller === 'index') {
return $app->controller->index();
} else {
if ($app->exists($app->{$controller})) {
if ($action !== '') {
if (method_exists($app->{$controller}, $action)) {
call_user_func_array([$app->{$controller}, $action], [$params]);
return;
} else {
return $app->controller->e404();
}
} else {
return $app->{$controller}->index();
}
} else {
return $app->controller->e404();
}
}
}
开发者ID:bazizi426,项目名称:SimpleBlog,代码行数:31,代码来源:Router.php
示例6: directory_run
function directory_run(&$argv, &$argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "include/dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
load_config('config');
load_config('system');
if ($argc != 2) {
return;
}
load_config('system');
load_hooks();
$a->set_baseurl(get_config('system', 'url'));
$dir = get_config('system', 'directory_submit_url');
if (!strlen($dir)) {
return;
}
$arr = array('url' => $argv[1]);
call_hooks('globaldir_update', $arr);
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
if (strlen($arr['url'])) {
fetch_url($dir . '?url=' . bin2hex($arr['url']));
}
return;
}
开发者ID:rahmiyildiz,项目名称:friendica,代码行数:32,代码来源:directory.php
示例7: getAppDetails
function getAppDetails($appID, $connection)
{
$appQuerySQL = "SELECT id, appID, averageUserRating, currency";
$appQuerySQL .= ", price, releaseDate, sellerName, sellerURL";
$appQuerySQL .= ", userRatingCount, version";
$appQuerySQL .= " FROM craft_demo.`app`";
$appQuerySQL .= " WHERE appID = '" . $appID . "';";
$appResult = $connection->query($appQuerySQL);
$app = null;
$rating_floor = 4;
if ($row = $appResult->fetch_assoc()) {
$app = new App($appID, $row['averageUserRating'], $row['userRatingCount'], $row['currency'], $row['price'], $row['sellerName'], $row['releaseDate']);
if ($row['version']) {
$app->setVersion($row['version']);
}
if ($row['sellerURL']) {
$app->setSellerUrl($row['sellerURL']);
}
$reviews = array();
$reviewQuerySQL = "SELECT author, title, content, rating";
$reviewQuerySQL .= " FROM craft_demo.`reviews`";
$reviewQuerySQL .= " WHERE app_id = " . $row['id'];
$reviewQuerySQL .= " AND rating > " . $rating_floor . ";";
$reviewResult = $connection->query($reviewQuerySQL);
while ($reviewRow = $reviewResult->fetch_assoc()) {
$review = new Review($reviewRow['author'], $reviewRow['title'], $reviewRow['content'], $reviewRow['rating']);
$reviews[] = $review;
}
$app->setReviews($reviews);
}
return $app;
}
开发者ID:DrJCFitz,项目名称:craft-demo,代码行数:32,代码来源:getAppDetails.php
示例8: directory_run
function directory_run($argv, $argc)
{
global $a, $db;
if (is_null($a)) {
$a = new App();
}
if (is_null($db)) {
@(include ".htconfig.php");
require_once "dba.php";
$db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
}
load_config('config');
load_config('system');
if ($argc != 2) {
return;
}
load_config('system');
$a->set_baseurl(get_config('system', 'url'));
$dir = get_config('system', 'directory_submit_url');
if (!strlen($dir)) {
return;
}
fetch_url($dir . '?url=' . bin2hex($argv[1]));
return;
}
开发者ID:nextgensh,项目名称:friendica,代码行数:26,代码来源:directory.php
示例9: __construct
/**
* @param App $app
*/
public function __construct($app)
{
$this->commandConfig = $app->getCommandConfig();
if ($this->commandConfig->isMultipleCommandMode()) {
$this->subcommandName = $app->getSubcommandName();
}
}
开发者ID:hyperframework,项目名称:hyperframework,代码行数:10,代码来源:Help.php
示例10: getAdv_list
function getAdv_list($params)
{
$getOption = strip_tags(JRequest::getVar('option'));
$app = new App();
$getAdvs = $app->getAdv();
$getUrl = JURI::base();
if (strpos($getUrl, 'local') !== false) {
$prefix = 'local_';
} elseif (strpos($getUrl, 'staging2') !== false) {
$prefix = 'staging_';
} elseif (strpos($getUrl, 'live') !== false) {
$prefix = '';
} else {
$prefix = '';
}
if ($params->get("layout") == "_:default") {
if ($getOption == "com_video" || $getOption == "com_gallery") {
return $getAdvs[$prefix . 'gpt_adv_id_gallery_video'];
}
return $getAdvs[$prefix . 'gpt_adv_id_topbanner'];
} elseif ($params->get("layout") == "_:right") {
if ($getOption == "com_video" || $getOption == "com_gallery") {
return $getAdvs[$prefix . 'gpt_adv_id_gallery'];
}
return $getAdvs[$prefix . 'gpt_adv_id_right'];
}
}
开发者ID:tuantran1,项目名称:rusty,代码行数:27,代码来源:helper.php
示例11: __construct
public function __construct()
{
$this->app = App::getInstance();
$this->view = View::getInstance();
$this->config = $this->app->getConfig();
$this->input = InputData::getInstance();
}
开发者ID:KonstantinKirchev,项目名称:WebDevelopment,代码行数:7,代码来源:DefaultController.php
示例12: change_theme
function change_theme($job)
{
$json = $job->workload();
$data = json_decode($json, true);
$app = new App($data['token']);
$app->themeWorker($data);
}
开发者ID:kehers,项目名称:tinypress,代码行数:7,代码来源:change_theme.php
示例13: main
function main()
{
$app = new App();
$app->bootstrap();
$app->setupErrorHandling();
$app->dispatch();
}
开发者ID:rajatkhanduja,项目名称:opc,代码行数:7,代码来源:bootstrap.php
示例14: testRenderWithStatusCode
public function testRenderWithStatusCode()
{
$mock = $this->getMock('View\\TemplateEngineInterface');
$mock->expects($this->once())->method('render')->will($this->returnValue('Heya'));
$app = new \App($mock);
$this->assertEquals('Heya', $app->render('a/template.php', array(), 201));
$this->assertEquals(201, $this->readStatusCode($app));
}
开发者ID:yannisrichard,项目名称:uframework,代码行数:8,代码来源:AppTest.php
示例15: makeModel
public function makeModel()
{
$model = $this->_app->getFacadeApplication()->make($this->model());
if (!$model instanceof Model) {
throw new \Exception("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model");
}
return $this->model = $model;
}
开发者ID:nekonekonik,项目名称:nuswhispers,代码行数:8,代码来源:BaseRepository.php
示例16: __construct
public function __construct(App $app)
{
$this->app = $app;
$dbConfig = $app->getConfig()['db'];
$provider = strtolower($dbConfig['provider']);
$provider[0] = strtoupper($provider[0]);
$connectionClass = __NAMESPACE__ . '\\' . $provider . 'Connection';
$this->conn = new $connectionClass($dbConfig['host'], $dbConfig['user'], $dbConfig['password'], $dbConfig['name']);
}
开发者ID:boggad,项目名称:waddle-mvc,代码行数:9,代码来源:QueryBuilder.php
示例17: registerGithub
/**
* Register the GitHub class.
*
* @param App $app
* @return null
*/
protected function registerGithub($app)
{
$app->singleton('github', function ($app) {
$config = $app['config'];
$factory = $app['github.factory'];
return new Github($config, $factory);
});
$app->alias('github', 'Caffeinated\\Github\\Github');
}
开发者ID:caffeinated,项目名称:github,代码行数:15,代码来源:GithubServiceProvider.php
示例18: testStringEscape
public function testStringEscape()
{
// Arrange
$app = new App();
$string = "<a>some string</a>";
// Act
$result = $app->escape($string);
// Assert
$this->assertEquals("<a>some string</a>", $result);
}
开发者ID:Grifs99,项目名称:auth-input,代码行数:10,代码来源:AppTest.php
示例19: show
public function show()
{
include_once "views/app.php";
$app = new App();
$result = $app->show();
$this->user = unserialize($_SESSION["user"]);
$this->vars = array();
$this->vars["user"] = $this->user;
$this->vars["result"] = $result;
AppView::show($this->vars);
}
开发者ID:asancheza,项目名称:box,代码行数:11,代码来源:AppController.php
示例20: run
public static function run()
{
Bootstrap::setup();
$app = new App();
if (Util::has_request_param("action")) {
$api = new Api($app);
$api->apply();
} else {
define("FALLBACK", $app->get_fallback());
normalized_require_once("page");
}
}
开发者ID:WebPassions,项目名称:local,代码行数:12,代码来源:class-bootstrap.php
注:本文中的App类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论