遇到过应该从具有自签名证书的邮件服务器发送电子邮件的问题,我得到的错误是:
PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in class.smtp.php on line 327.
Run Code Online (Sandbox Code Playgroud)
有没有人遇到类似的东西?
编辑:
我还尝试设置stream_context参数(参数:SSL上下文选项):
$options['ssl']['verify_peer'] = false;
$options['ssl']['verify_peer_name'] = false;
$options['ssl']['allow_self_signed'] = true;
Run Code Online (Sandbox Code Playgroud)
没有运气,它仍然失败,出现与上面指出的相同的错误.
谢谢.
我很困惑控制器何时实例化.此外,嵌套状态时控制器如何实例化.我可能会对范围如何附加到视图和控制器感到困惑,也就是说,如果每个视图都有自己的控制器和范围,或者它们共享相同的范围.
有人可以解释控制器何时实例化?在嵌套路由下,所有视图共享一个控制器和范围吗?当我切换状态并返回状态会发生另一个控制器实例化时会发生什么?
以下是我的路线(配置文件):
.config (googleAnalyticsCordovaProvider, $stateProvider, $urlRouterProvider, IdleProvider, KeepaliveProvider) ->
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppController'
})
.state('app.pincode', {
url: '/pincode',
views: {
menuContent: {
templateUrl: 'templates/pincode-yield.html',
controller: 'PincodeController'
}
}
})
.state('app.pincode.create', {
url: '/create',
views: {
pincode: {
templateUrl: 'templates/pincode-create.html',
controller: 'PincodeController'
}
}
})
.state('app.pincode.pincodeLogin', {
url: '/login',
views: {
pincode: {
templateUrl: 'templates/pincode-login.html',
controller: 'PincodeController'
}
}
})
.state('app.pincode.settings', {
url: '/settings',
views: {
pincode: {
templateUrl: 'templates/settings.html',
controller: 'PincodeController'
} …Run Code Online (Sandbox Code Playgroud) angularjs angularjs-scope angularjs-routing angular-ui-router
你能帮忙吗?刚开始使用Angular 2并遇到以下问题.
我的组件如下:
@Component({
selector: 'myapp',
inputs: ['mynumber']
})
@View({
template: `<p>The next number is {{ mynumber + 1 }}</p>'
})
export class App {
mynumber: number;
}
bootstrap(App);
Run Code Online (Sandbox Code Playgroud)
在我的HTML中:
<myapp [mynumber]='41'></myapp>
Run Code Online (Sandbox Code Playgroud)
但是在运行时,我得到以下内容:
下一个号码是 NaN
它看起来很简单,但我遗漏了一些东西.我想要实现的是将应用程序外部的值传递给它.
谢谢.
使用phpunit命令Laravel将在我们的项目中运行所有单元测试.如何运行一个或特定的单元测试Laravel 5.1?
我只想testFindToken从我的测试套件中运行.
<?php
use Mockery as m;
use App\Models\AccessToken;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class AccessTokenRepositoryTest extends TestCase
{
use WithoutMiddleware;
public function setUp()
{
parent::setUp();
$this->accessToken = factory(AccessToken::class);
$this->repo_AccessToken = app()->make('App\Repositories\AccessTokenRepository');
}
public function testFindToken()
{
$model = $this->accessToken->make();
$model->save();
$model_accessToken = $this->repo_AccessToken->findToken($model->id);
$this->assertInstanceOf(Illuminate\Database\Eloquent\Model::class, $model);
$this->assertNotNull(true, $model_accessToken);
}
}
Run Code Online (Sandbox Code Playgroud) https://jsfiddle.net/4byyuqtc/1/
我想在选择分组线时让ui-grid选择分组下的所有"子".在这种情况下Kit Kat(1),Goodbar先生(1),Krackel(2)并最终选择实际记录(非粗线).人们可以预期,当在分组中选择父母时,所有孩子也会被选中.
目前,当选择数据中的实际记录(非粗体线)上方的1个分组时,它会使用以下代码选择那些实际记录:
$scope.gridApi.selection.on.rowSelectionChanged($scope, function (rowChanged) {
console.log(rowChanged.treeLevel);
if (typeof (rowChanged.treeLevel) !== 'undefined' && rowChanged.treeLevel > -1) {
// this is a group header
children = $scope.gridApi.treeBase.getRowChildren(rowChanged);
console.log(children);
children.forEach(function (child) {
if (rowChanged.isSelected) {
$scope.gridApi.selection.selectRow(child.entity);
} else {
$scope.gridApi.selection.unSelectRow(child.entity);
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
此时我对ui-grid的经验不足以弄清楚如何循环选定行的子项并选择所有行.
[编辑]
使用Paul的代码,它不会选择分组,但它更接近.这个截图是我选择第337条记录.请注意它选择该记录和所有最低子记录(这是好的,因为最终那些是重要的),但在视觉上分组的记录(MFG和项目描述组)没有被选中,需要是因为用户不会永远打开最低的数据记录,以便他们看到所选的组.
我开始开发iOS应用程序,这是我的第一篇SO帖子.我正在尝试实现一个UI视图,它可以显示后置摄像头的预览视频并处理捕获的帧.我的预览图层效果很好,我可以在UI视图中看到图片显示.但是,永远不会调用captureOutput函数.
我已经在网上搜索了一段时间的silimar问题和解决方案,并试图调整不同的东西,包括输出,连接和调度队列设置,但没有一个工作.任何人都可以帮助我或分享一些见解和方向吗?非常感谢提前!
这里是我的代码,我使用的是Xcode 11 beta与iOS 10作为构建目标.
class ThreeDScanningViewController: UIViewController,
AVCaptureVideoDataOutputSampleBufferDelegate {
@IBOutlet weak var imageView: UIImageView!
var session : AVCaptureSession!
var device : AVCaptureDevice!
var output : AVCaptureVideoDataOutput!
var previewLayer : AVCaptureVideoPreviewLayer!
override func viewDidLoad() {
super.viewDidLoad()
//NotificationCenter.default.addObserver(self, selector: #selector(self.startedNotif), name: NSNotification.name.CaptureSessionDidStartRunningNotification, object: nil)
func initCamera() -> Bool {
session = AVCaptureSession()
session.sessionPreset = AVCaptureSession.Preset.medium
let devices = AVCaptureDevice.devices()
for d in devices {
if ((d as AnyObject).position == AVCaptureDevice.Position.back) {
device = d as! AVCaptureDevice …Run Code Online (Sandbox Code Playgroud) 我在一个laravel项目工作.我有一个slu ur的网址.它适用于英语.但是当我使用Bangla时它返回空.请帮我解决这个问题.
echo str_slug("hi there");
// Result: hi-there
echo str_slug("???????? ???????? ????????? ???? ????? ????? ??????????");
// Result: '' (Empty)
Run Code Online (Sandbox Code Playgroud) 我正在使用Laravel Query Builder来查询MySQL数据库,但它将整数值作为字符串值返回.
我有以下查询.
$query = DB::table('store_products')->select('products.id', 'products.name', 'products.unit_type', 'products.price', 'products.image_path', 'products.is_popular', 'store_products.price AS store_price')
->join('products', 'products.id', '=', 'store_products.product_id')
->join('product_categories', 'product_categories.product_id', '=', 'store_products.product_id')
->where('store_products.store_id', $store_id)
->where('store_products.product_id', $product_id);
Run Code Online (Sandbox Code Playgroud)
这里查询获得存在于Store_Products给定的Product store_id.
问题是,它返回id(这是产品的主键),就像string我使用查询生成器时一样.看起来像演员有问题.
我怎么解决这个问题?
非常感谢你提前.
在我的控制器中,我有一个应该重定向到POST路由的方法。我也不能使这条路线成为GET一条路线。有什么解决办法吗?
我的控制器代码如下所示:
// After a bunch of other if statements, etc
return redirect('newUser')->with('user', $user);
Run Code Online (Sandbox Code Playgroud)
现在我的路线(在 web.php 中)如下:
Route::post('/newUser', function() {
$user=session('user');
dd($user);
return view('profileNewUser', $user);
});
Run Code Online (Sandbox Code Playgroud)
向我抛出的错误是MethodNotAllowedHTTPException.
我知道我的错误与_token,无论如何我可以允许传递令牌字段吗?我尝试with在我的重定向中使用 传递它,但这也不起作用。
谢谢你的帮助。
需要一些 Laravel zip 文件的帮助。我在公共文件夹中有一个文件夹,我想在用户单击按钮时创建该文件夹的 zip(temp_file 文件夹)。
public function testing()
{
$public_dir = public_path('temp_file/');
$zipFileName = 'myZip.zip';
$zip = new ZipArchive;
if ($zip->open($public_dir . '/' . $zipFileName, ZipArchive::CREATE) === TRUE) {
$zip->addFile('file_path', 'file_name');
$zip->close();
}
$headers = array('Content-Type' => 'application/octet-stream');
$filetopath = $public_dir . '/' . $zipFileName;
}
Run Code Online (Sandbox Code Playgroud)
但它似乎没有创建 zip 文件,我无法下载它。请需要一些帮助
php ×6
laravel ×5
laravel-5 ×2
angular ×1
angularjs ×1
eloquent ×1
laravel-5.2 ×1
laravel-5.4 ×1
phpmailer ×1
phpunit ×1
swift ×1
testing ×1
ziparchive ×1