我创建了扩展 XeroServiceProvide 的自定义服务提供者,基本上,我有多个 Xero 帐户,我想更改两个配置参数值 runtime consumer_key和consumer_secret。有没有快捷的方法。我检查了服务容器上下文绑定,但不知道如何使用。
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use DrawMyAttention\XeroLaravel\Providers\XeroServiceProvider;
class CustomXeroServiceProvider extends XeroServiceProvider
{
private $config = 'xero/config.php';
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Register the application services.
*
* @return void
*/
public function register($configParams = [])
{
parent::register();
if(file_exists(config_path($this->config))) {
$configPath = config_path($this->config);
$config = include $configPath;
}
$this->app->bind('XeroPrivate', function () use ($config,$configParams) { …Run Code Online (Sandbox Code Playgroud) 我有一个简单的处理程序,调用 getData 在单独的文件中定义
export const handler = async (event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> => {
let respData = await new DynamoDBClient().getData(123);
return {
statusCode: 200,
body: JSON.stringify(respData),
};
};
Run Code Online (Sandbox Code Playgroud)
在我的 DynamoDB 课程中,我有以下内容。
import { DynamoDB } from 'aws-sdk';
export default class DynamoDBClient {
private config: Config;
private client: DynamoDB.DocumentClient;
constructor() {
this.config = getConfig();
const dynamoDBClientConfig = this.config.mockDynamoDBEndpoint
? {
endpoint: this.config.mockDynamoDBEndpoint,
sslEnabled: false,
region: 'local'
}
: undefined;
this.client = new DynamoDB.DocumentClient(dynamoDBClientConfig);
}
// function
getData= async (id: string): Promise<any> => …Run Code Online (Sandbox Code Playgroud) 这是什么意思"换句话说,数组的引用行为是在逐个元素的基础上定义的;各个元素的引用行为与数组容器的引用状态分离."
单个元素如何与数组容器的引用状态分离?我是彻底的医生,我很困惑这意味着什么?
<?php
/* Assignment of scalar variables */
$a = 1;
$b =& $a;
$c = $b;
$c = 7; //$c is not a reference; no change to $a or $b
/* Assignment of array variables */
$arr = array(1);
$a =& $arr[0]; //$a and $arr[0] are in the same reference set
$arr2 = $arr; //not an assignment-by-reference!
$arr2[0]++;
/* $a == 2, $arr == array(2) */
/* The contents of $arr are changed even though it's …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我试图将全亮度应用到我的视图中,并将当前亮度存储在一个变量中,因此一旦我的应用程序状态变为后台/ resign-activity,我就会重置默认亮度,现在我的问题是,如果是我的应用程序崩溃我重置默认亮度的事件是什么,有任何方法在应用程序崩溃时调用?
提前致谢.
路由参数不起作用,它是抛出和错误
throw new NotFoundHttpException;
Run Code Online (Sandbox Code Playgroud)
routes.php文件
Route::any('/share-to-group/(:any)/(:any)',array('as' => 'share-to-group',
'uses' => 'HomeController@shareToGroup'));
Run Code Online (Sandbox Code Playgroud)
视野内
<a href="{{ URL::to('share-to-group',[ $group['group_id'], $UnixDateTime ]) }}">Something</a>
Run Code Online (Sandbox Code Playgroud)
和控制器
function shareToGroup($group_id,$unixtime){
echo $group_id.$unixtime;exit;
}
Run Code Online (Sandbox Code Playgroud)
我在做什么?
我已经审查了以下链接,但这是完全不同的,这之间没有任何独特之处,我认为这不重复. 如何将查询字符串参数传递给Laravel4中的路由
php ×3
ios ×1
iphone ×1
jestjs ×1
laravel ×1
laravel-4 ×1
laravel-5 ×1
laravel-5.4 ×1
objective-c ×1
reference ×1
routes ×1
symfony ×1
testing ×1
typescript ×1
unit-testing ×1
xero-api ×1