草庐IT

check_command

全部标签

php - Laravel 的 Auth::attempt() 返回 true 但 Auth::check() 返回 false

如标题所示,Laravel的函数Auth::attempt()返回true如下代码部分(删除了不重要的部分):publicfunctiondoLogin(){$validator=[..]if($validator->fails()){[..]}else{$userdata=array('username'=>Input::get('username'),'password'=>Input::get('password'));if(Auth::attempt($userdata,true)){returnRedirect::to('/');}else{returnRedirect::t

php - Silex check_path 验证用户登录的代码

我目前正在关注SecurityServiceProvider上的Silex教程.我有登录表单,使用此代码将我的check_path设置为/login_check:$app->register(newSilex\Provider\SecurityServiceProvider(),array('security.firewalls'=>array('admin'=>array('pattern'=>'^/contacts/add','form'=>array('login_path'=>'/login','check_path'=>'/login_check'),'users'=>arr

php - 在 Symfony2 和 FOSUserBundle 中,覆盖 login_check

在用户通过身份验证的那一刻,我需要检查他的角色以将他重定向到正确的页面(两个不同的角色对应两个不同的页面)。我没有在文档中找到如何覆盖login_check。从bundle开始,它使用security.yml配置代理告诉引擎转到一个唯一的默认页面。有什么线索吗?同样的注销问题。 最佳答案 如果我没理解错的话,你想将新登录/注销的用户重定向到适当的路由取决于它的作用?Here是关于如何使用表单处理程序对登录/注销进行重定向的教程。 关于php-在Symfony2和FOSUserBundle

php - 一般错误 : '"mysqldump"' is not recognized as an internal or external command

我用的是LaravelSpatieBackup,安装完成,首先运行这个$composerrequirespatie/laravel-backup$composerrequirespatie/laravel-backupUsingversion^5.6forspatie/laravel-backup./composer.jsonhasbeenupdatedLoadingcomposerrepositorieswithpackageinformationUpdatingdependencies(includingrequire-dev)Packageoperations:3installs

php - PDO:PDO::MYSQL_ATTR_INIT_COMMAND 中的多个命令

我正在使用这个PDO连接:try{$db=newPDO("mysql:host=localhost;dbname=...","dbu...","pass",array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SETlc_time_names='de_DE'"));}catch(PDOException$e){die("Error!");}现在我想添加另一个初始化命令:array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SETlc_time_names='de_DE'",PDO::MYSQL_ATTR_INIT_COMMAND=>"SETNAM

php - Laravel PHP fatal error : Class 'Table' not found with migrate command

我正在使用Laravel,我正在尝试将一些表迁移到我的数据库(phpmyadmin)。之前给我带来了一些麻烦,所以我在数据库中删除了迁移表中的所有行,所以现在什么都没有了。所以我尝试运行“phpartisanmigrate”,但出现以下错误:PHPFatalerror:Class'Table'notfoundin/var/www/loja/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.phponline301{"error":{"type":"Symfony\Component\Debug\Ex

php - Doctrine 迁移 : There are no commands defined in the "" namespace

我正在尝试将DoctrineMigrations设置为独立程序,但遇到了一些麻烦。我在同一文件夹中有doctrine-migrations.phar和migrations.yml。migrations.yml包含以下内容:name:DoctrineSandboxMigrationsmigrations_namespace:DoctrineMigrationstable_name:doctrine_migration_versionsmigrations_directory:/home/myusername/myproject/Database/Update在/home/myuserna

php - 更改 symfony2 login_check URL

我正在根据设定的规范实现Symfony2解决方案。规范规定GET/login处的登录表单必须恢复为POST/login。如何更改/login_check的URL?我可以创建一个直接调用安全Controller的路由,如下所示吗?我在安全包中没有看到任何Controller。oft_auth_login:pattern:/logindefaults:{_controller:MagicSecurityBundle:Default:login_check}methods:[POST]根据security.yml的文档,check_path(type:string,default:/logi

php - 在 laravel 5 中,如何从外部类访问 Command 类方法?

我正在开发一个Illuminate\Console\Command。使用phpartisan通过cli运行。此Command类正在使用其他类。我很欣赏Command->info()、Command->error()、方法...我如何在依赖项中使用它们?直到现在我将$this作为参数传递给其他类例如classMyClassextendsCommand{....$g=newMyOtherClass($this,$param...);$g->find();....}classMyOtherClass{$command;....publicfunction__construct($comman

php - 交响乐 2 : Access updated configuration from inside a command

我们正在创建一个依赖于其他命令来生成新数据库并构建其架构的命令。到目前为止,我们已经成功地让它读取config.yml文件,添加我们的新连接信息,并将文件写回。在同一个命令中,我们然后尝试运行symfony命令来创建数据库和模式:更新。这是我们遇到问题的地方。我们收到以下错误:[InvalidArgumentException]DoctrineORMManagernamed"mynewdatabase"doesnotexist.如果我们第二次运行该命令,则不会出现错误,因为更新后的配置文件会重新加载到应用程序中。如果我们在写入config.yml文件后手动运行doctrine命令,它也