我使用 commandline 创建一个实体php app/console generate:doctrine:entity。现在我想删除该实体(yml,架构..)。我删除了 Doctrine yml 文件和实体目录,但是当我使用命令行时,doctrine:schemal:create总是创建表,该表的名称 = 数据库中的该实体?
我的一个应用程序突然开始出错:
Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in /var/www/_slim/_core/system/generator.001.php:133 Stack trace: #0 /var/www/_slim/_core/system/generator.001.php(133): Redis->auth('77B1BFFBC0378DF...') #1 /var/www/_slim/_core/system/generator.007.php(144): Generator001->r6_redis_start('R') #2 /var/www/_slim/_core/system/generator.007.php(26): Generator007->HarvestRedis() #3 /var/www/_slim/_core/system/generator.shopping.php(14): Generator007->Generator007() #4 /var/www/_slim/_core/system/generator.last.php(43): Generator008->Generator008() #5 /var/www/_slim/site/home/php/index.php(16): GeneratorLast->GeneratorLast() #6 /var/www/index.php(96): Gui->Gui()
#7 {main} thrown in /var/www/_slim/_core/system/generator.001.php on line 133
Run Code Online (Sandbox Code Playgroud)
我重新安装redis-server但到目前为止没有运气.有什么建议?
我有两个由两个工作人员监控的 Amazon SQS 队列。我用它来发送电子邮件,发送一些工人请求。典型的后端东西。本月必须有大约 100 个工作岗位。
但是,我收到了来自 Amazon 的电子邮件,说我已经达到了 887,457 个免费等级 1,000,000 个 Amazon Simple Queue Service 请求的请求。
我想知道我是如何得到这个数字的?工作人员是否轮询被视为请求的队列?如果是这样,我们可以增加这个间隔吗?
继承人控制器:
class HomeController extends BaseController {
public function index() {
return View::make('home', array('username' => 'Vaughan'));
}
}
Run Code Online (Sandbox Code Playgroud)
这里是主刀片视图:
{{ $username }}
Run Code Online (Sandbox Code Playgroud)
然而,视图正在输出:
{{ $username }}
Run Code Online (Sandbox Code Playgroud)
变量未呈现.这可能与Apache或PHP有关吗?
我想覆盖类中的method(isValidatable)Illuminate\Validation\Validator.我通过创建一个扩展Validator的类(在Illuminate之外)并且只覆盖该isValidatable方法来完成此操作.
我认为这将有效,除了我不确定如何为Validator类(或实际CustomLaravelValidator类)创建服务提供程序.我以前创建过服务提供程序,但似乎在Validator serviceprovider(Illuminate\Validation\ValidationServiceProvider)中有很多内容.因此,我不知道我的这个类的自定义服务提供程序应该是什么样子.
这是我的CustomLaravelValidator类:
<?php namespace API\Extensions\Core;
use Illuminate\Validation\Validator;
class CustomLaravelValidator extends Validator {
/**
* Determine if the attribute is validatable.
*
* @param string $rule
* @param string $attribute
* @param mixed $value
* @return bool
*/
protected function isValidatable($rule, $attribute, $value)
{
// Validate integers on empty strings as well
if($rule == 'IntStrict')
{
return true;
}
return $this->presentOrRuleIsImplicit($rule, $attribute, $value) &&
$this->passesOptionalCheck($attribute);
}
}
Run Code Online (Sandbox Code Playgroud)
这是Laravel的默认ValidationServiceProvider:
<?php …Run Code Online (Sandbox Code Playgroud) 我是laravel 5的新手,我在homecontroller中添加一行:
echo Lang::getLocale();
Run Code Online (Sandbox Code Playgroud)
但错误发生在:
FatalErrorException in HomeController.php line 47:
Class 'App\Http\Controllers\Lang' not found
Run Code Online (Sandbox Code Playgroud)
<?php namespace App\Http\Controllers;
use App\Article;
use App\Photo;
use App\VideoAlbum;
use App\PhotoAlbum;
use Illuminate\Database\Eloquent;
use Illuminate\Support\Facades\DB;
class HomeController extends Controller {
/*
|--------------------------------------------------------------------------
| Home Controller
|--------------------------------------------------------------------------
|
| This controller renders your application's "dashboard" for users that
| are authenticated. Of course, you are free to change or remove the
| controller as you wish. It is just here to get your app started!
|
*/ …Run Code Online (Sandbox Code Playgroud) 我遇到了Angular模板的问题 - 主视图(最初加载的视图)不是包含正确的模板,而是渲染两次.在过去两天的大部分时间里试图解决这个问题后,我仍然无处可去.
更详细的描述:
我正在使用Angular开发一个用于管理网站内容的单页面应用程序.本网站的其余部分是使用Laravel构建的.Angular仅用于内容管理系统,该系统是受Laravel的HTTP过滤器和身份验证系统保护的独立应用程序.
当Angular应用程序不位于根URL时(例如,http://application.dev工作,而http://application.dev/admin不是),会发生此问题.
主要代码(为了找到问题而剥离到必需品):
/*global angular*/
var App = angular.module('Dashboard', ['ui.router']);
App.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
'use strict';
$locationProvider.html5Mode(true).hashPrefix('!');
$stateProvider.state('statistics', {
url: '/statistics',
templateUrl: 'statistics/index.html'
});
$stateProvider.state('notifications', {
url: '/notifications',
templateUrl: 'notifications/index.html'
});
$urlRouterProvider.when('/', '/statistics');
});
Run Code Online (Sandbox Code Playgroud)
应用程序视图:
<!DOCTYPE html>
<html lang="en" ng-app="Dashboard">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/admin/">
</head>
<body>
<div id="container" class="full">
<header>
<nav>
<ul>
<li><a ui-sref="statistics">Statistics</a></li>
<li><a ui-sref="notifications">Notifications</a></li>
</ul>
</nav>
</header>
<div id="content" ui-view></div>
</div> …Run Code Online (Sandbox Code Playgroud) 在laravel中,我从哪里查询得到这种类型的数组。我只想获得parent为0的那些菜单;
$memus = Menu::where('parent', 0)->get()->toArray();
Array
(
[0] => Array
(
[id] => 13
[name] => Movies
[parent] => 0
[deleted_at] =>
[created_at] => 2015-04-07 02:48:48
[updated_at] => 2015-04-07 02:48:48
)
[1] => Array
(
[id] => 16
[name] => zxcvxc
[parent] => 0
[deleted_at] =>
[created_at] => 2015-04-07 02:53:26
[updated_at] => 2015-04-07 03:03:39
)
[2] => Array
(
[id] => 17
[name] => alsdkf
[parent] => 0
[deleted_at] =>
[created_at] => 2015-04-07 02:53:41
[updated_at] => 2015-04-07 03:02:04
)
) …Run Code Online (Sandbox Code Playgroud) 我想在 larave.log 文件中添加我的应用程序中的所有活动。我能够在其中添加用户登录名,但不能添加注销。
我使用 Laravel 5.8 和 mysql 5 数据库来做到这一点。
这是 HomeController 中用于注册登录用户加载主视图的代码。
public function index()
{
Log::info('Utente collegato: '.Auth::user()->name);
return view( config('configpath.user_home') );// loading user homepage
}
Run Code Online (Sandbox Code Playgroud)
下面的代码在 Laravel 默认的 LoginController 中
public function userLogout()
{
Log::info('User '.Auth::user()->name. 'has logged out');
Auth::guard('web')->logout();
return redirect()->route('login');
}
Run Code Online (Sandbox Code Playgroud)
使用注销时,我希望在登录时看到有关用户注销的消息,但我没有看到。有人可以给我一个解释吗?谢谢!
php ×8
laravel ×6
laravel-4 ×3
amazon-sqs ×1
angularjs ×1
blade ×1
javascript ×1
laravel-5 ×1
laravel-5.8 ×1
phpredis ×1
redis ×1
symfony ×1
validation ×1