我最近尝试从Laravel 4.0升级到Laravel 4.1,运行php composer.phar update时出现以下错误:
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
Run Code Online (Sandbox Code Playgroud)
我只要求:
"require": {
"laravel/framework": "4.1.*",
"way/generators": "2.*",
"madewithlove/laravel-oauth2": "0.4.*"
},
Run Code Online (Sandbox Code Playgroud)
另外,我在错误之前收到了这个(即使我在我的环境中运行php 5.4.10):
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
phpseclib/phpseclib suggests installing pear-pear/PHP_Compat (Install PHP_Compat to get phpseclib working …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Homebrew在我的Mac OS X机器上更新PHP,并且我收到以下输出:
*********:Library *********$ brew install php56
Error: No available formula for php56
==> Searching formulae...
==> Searching taps...
homebrew/php/php56-amqp homebrew/php/php56-phalcon
homebrew/php/php56-apcu homebrew/php/php56-pimple
homebrew/php/php56-augmentedtypes homebrew/php/php56-proctitle
homebrew/php/php56-binpack homebrew/php/php56-propro
homebrew/php/php56-blitz homebrew/php/php56-protobuf
homebrew/php/php56-boxwood homebrew/php/php56-pspell
homebrew/php/php56-chdb homebrew/php/php56-pthreads
homebrew/php/php56-couchbase homebrew/php/php56-qr
homebrew/php/php56-crypto homebrew/php/php56-raphf
homebrew/php/php56-dbase homebrew/php/php56-redis
homebrew/php/php56-dbus homebrew/php/php56-redland
homebrew/php/php56-dmtx homebrew/php/php56-riak
homebrew/php/php56-eio homebrew/php/php56-runkit
homebrew/php/php56-ev homebrew/php/php56-scrypt
homebrew/php/php56-event homebrew/php/php56-snappy
homebrew/php/php56-fast_assert homebrew/php/php56-snmp
homebrew/php/php56-gearman homebrew/php/php56-sodium
homebrew/php/php56-geoip homebrew/php/php56-solr
homebrew/php/php56-gmagick homebrew/php/php56-sphinx
homebrew/php/php56-gmp homebrew/php/php56-spl-types
homebrew/php/php56-graphdat homebrew/php/php56-ssh2
homebrew/php/php56-grpc homebrew/php/php56-stats
homebrew/php/php56-hprose homebrew/php/php56-stemmer
homebrew/php/php56-htscanner homebrew/php/php56-suhosin
homebrew/php/php56-http homebrew/php/php56-sundown
homebrew/php/php56-igbinary homebrew/php/php56-svm
homebrew/php/php56-imagick homebrew/php/php56-swoole
homebrew/php/php56-inclued homebrew/php/php56-symfony-debug
homebrew/php/php56-intl homebrew/php/php56-thrift
homebrew/php/php56-ioncubeloader homebrew/php/php56-tidy …
Run Code Online (Sandbox Code Playgroud) click事件工作正常,但onmouseover事件不起作用.
ProfImage = React.createClass({
getInitialState: function() {
return { showIcons: false };
},
onClick: function() {
if(this.state.showIcons == true) {
this.setState({ showIcons: false });
}
else {
this.setState({ showIcons: true });
}
},
onHover: function() {
this.setState({ showIcons: true });
},
render: function() {
return (
<div>
<span className="major">
<img src="/images/profile-pic.png" height="100" onClick={this.onClick} onmouseover={this.onHover} />
</span>
{ this.state.showIcons ? <SocialIcons /> : null }
</div>
);
}
});
Run Code Online (Sandbox Code Playgroud) 所以我尝试使用我的root密码(用户名:root密码:******)登录phpMyAdmin,但是,我继续收到错误:#2002无法登录MySQL服务器
我很确定我知道root密码,因为我在Mac OS X上输入了终端:
sudo /usr/local/mysql/support-files/mysql.server start
Run Code Online (Sandbox Code Playgroud)
并被提示"Password:"
一行.我键入了密码,终端读取:
Starting MySQL...SUCCESS!
因此服务器启动了.我不确定为什么相同的密码不适用于phpMyAdmin.
我尝试使用以下命令在终端中设置密码:
/usr/local/mysql/bin/mysqladmin -u root password *******
Run Code Online (Sandbox Code Playgroud)
但是我收到了输出:
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Run Code Online (Sandbox Code Playgroud)
我非常感谢帮助.我对此有所了解.我已经尝试了几个网站,而mySQL指令在这个问题上毫无用处.有关如何解决此问题的详细说明(在Mac OS X Lion上)将非常有用.谢谢.
更新:
我一直在尝试重置root密码,并且一直按照以下说明操作:http://www.coolestguyplanet.net/how-to-change-the-mysql-root-password/
但是,当我使用命令时:/ usr/local/mysql/bin/mysqld_safe --skip-grant-tables
我收到以下输出:
111217 10:00:42 mysqld_safe Logging to '/usr/local/mysql/data/******-********-MacBook-Pro.local.err'.
111217 10:00:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql/data/********-********-MacBook-Pro.local.err: Permission denied
/usr/local/mysql/bin/mysqld_safe: line 144: /usr/local/mysql/data/*******-**********-MacBook-Pro.local.err: Permission denied
111217 10:00:42 mysqld_safe …
Run Code Online (Sandbox Code Playgroud) 我想获得我在Laravel 4表单中设置的一系列复选框的值.以下是视图中设置复选框的代码:
@foreach ($friends as $friend)
<input tabindex="1" type="checkbox" name="friend[]" id="{{$friend}}" value="{{$friend}}">
@endforeach
Run Code Online (Sandbox Code Playgroud)
在我的控制器中,我想获取复选框的值并将它们放在一个数组中.我不确定如何做到这一点,但我认为它是这样的:
array[];
foreach($friend as $x)
if (isset(Input::get('friend')) {
array[] = Input::get('friend');
}
endforeach
Run Code Online (Sandbox Code Playgroud)
你能帮我解决这个问题吗?谢谢.
编辑:
这就是我在控制器中的含义:
public function describe_favorite() {
$fan = Fan::find(Auth::user()->id);
$fan->favorite_venue = Input::get('venue');
$fan->favorite_experience = Input::get('experience');
$friends_checked = Input::get('friend[]');
print_r($friends_checked);
if(is_array($friends_checked))
{
$fan->experience_friends = 5;
}
$fan->save();
return Redirect::to('fans/home');
}
Run Code Online (Sandbox Code Playgroud)
它没有经过"if"循环.如何查看print_r的输出以查看$ friends_checked变量中的内容?
我有一个Facebook登录我正在使用OAuth2执行,然后我使用Laravel 4的内置身份验证系统来重新登录用户.对于大多数用户,我认为没有任何问题,但对于一个用户,他看到登录时出现以下错误:
ErrorException
Argument 1 passed to Illuminate\Auth\Guard::login() must implement interface Illuminate\Auth\UserInterface, null given
open: */nfs/c09/h04/mnt/139243/domains/crowdsets.com/vendor/laravel/framework/src/Illuminate/Auth/Guard.php
* /**
* Log a user into the application.
*
* @param \Illuminate\Auth\UserInterface $user
* @param bool $remember
* @return void
*/
public function login(UserInterface $user, $remember = false)
{
$id = $user->getAuthIdentifier();
Run Code Online (Sandbox Code Playgroud)
以下是控制器中的相关登录/验证代码:
$check = Fan::where('fbid', '=', $user['uid'])->first();
if(is_null($check)) {
$fan = new Fan;
$fan->fbid = $user['uid'];
$fan->email = $user['email'];
$fan->first_name = $user['first_name'];
$fan->last_name = $user['last_name'];
$fan->gender = $user['gender'];
$fan->birthday = $user['birthday'];
$fan->age …
Run Code Online (Sandbox Code Playgroud) 我正在我的本地Mac OS X El Capitan机器上运行react-native应用程序.我已经安装了所需的依赖项,但该应用程序仍未在iOS模拟器中启动.
这是输出:
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/F8v2.app/F8v2 normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/F8v2.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/-/f8app/node_modules/react-native/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/F8v2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的Mac OS X机器上更新brew,以便我可以更新php.但是,在尝试运行时brew install
,我收到此错误:
error: The following untracked working tree files would be overwritten by merge:
Library/Homebrew/extend/enumerable.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull --quiet origin refs/heads/master:refs/remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
酿酒医生:
警告:找到了损坏的符号链接.删除它们brew prune
:/ usr/local/bin/wget /usr/local/share/man/man1/wget.1/usr/local/Library/LinkedKegs/wget
我试图在视图之间导航以在React Native中工作,如下所示:
newUserFlow() {
this.props.navigator.push({
title: "Create Account",
component: F8InfoView,
});
}
<TopFiveButton
style={styles.button}
onPress={this.newUserFlow.bind(this)}
caption="Create Account"
/>
Run Code Online (Sandbox Code Playgroud)
但是,我在点击时遇到此错误:
ExceptionsManager.js:75 Argument 0 (NSNumber) of RCTNavigatorManager.requestSchedulingJavaScriptNavigation must not be null
Run Code Online (Sandbox Code Playgroud)
这在以前工作,但似乎有些变化.可能是什么问题?谢谢.
调试器在例外manageR中引用它:
// Flow doesn't like it when you set arbitrary values on a global object
(console: any)._errorOriginal = console.error.bind(console);
Run Code Online (Sandbox Code Playgroud)
我在打破流量吗?谢谢.
编辑:
index.ios.js看起来像这样:
class nomad extends Component {
render() {
return (
<NavigatorIOS
style={styles.container}
initialRoute={{
title: 'Nomad',
component: LoginScreen
}} />
);
}
};
Run Code Online (Sandbox Code Playgroud)
然后在LoginScreen中:
class LoginScreen extends React.Component {
newUserFlow() …
Run Code Online (Sandbox Code Playgroud) 我有一个在false和true之间切换的某个变量作为一个状态(我们可以称之为提交).我想做的是在几秒钟之后将状态更改设置为true后将状态更改为false.我该怎么做?
我有一个单击按钮时调用的函数,以及状态更改的位置:
saveAndContinue: function(e) {
e.preventDefault()
if(this.state.submitted==false) {
email = this.refs.email.getDOMNode().value
this.setState({email: email})
this.setState({submitted: !this.state.submitted});
}
}
Run Code Online (Sandbox Code Playgroud)
我想补充一点,我有一个计时器设置变量提交回false.我该怎么做呢?
laravel ×3
laravel-4 ×3
homebrew ×2
php ×2
react-native ×2
reactjs ×2
checkbox ×1
composer-php ×1
javascript ×1
mysql ×1
osx-lion ×1
phpmyadmin ×1