我正在管理一个使用Laravel 5.1和php7的遗留项目,它在CentOS中运行。
现在我正在尝试使用ubuntu 14.04和php5或带有php7的Centos在测试环境中运行它,但是我无法弄清楚为什么我在尝试运行项目时遇到此错误。
import UIKit
class FlowLayout: UICollectionViewFlowLayout {
// SET SCROLL TO HORIZONTAL
override init(){
super.init()
scrollDirection = .Horizontal
}
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
self.scrollDirection = .Horizontal
}
// SET VARIABLES: Content height/width and layout attributes
private var contentWidth: CGFloat = 0.0
private var contentHeight: CGFloat = 50.0
private var cache = [UICollectionViewLayoutAttributes]()
override func prepareLayout() {
super.prepareLayout()
// RUNS ONLY ONCE
if cache.isEmpty {
var row = 0
let numberOfRows = 2
var rowWidth = [CGFloat](count: numberOfRows, repeatedValue: 0)
var xOffset = [CGFloat](count: numberOfRows, repeatedValue: 0)
for item in 0 ..< collectionView!.numberOfItemsInSection(0) {
let indexPath = NSIndexPath(forItem: item, inSection: 0)
let tag = super.layoutAttributesForItemAtIndexPath(indexPath)
let attributes = UICollectionViewLayoutAttributes(forCellWithIndexPath: indexPath)
attributes.frame = tag!.frame
attributes.frame.origin.x = xOffset[row]
cache.append(attributes)
rowWidth[row] = rowWidth[row] + tag!.frame.size.width + 8
xOffset[row] = xOffset[row] + tag!.frame.size.width + 8
row = row >= (numberOfRows - 1) ? 0 : 1
}
contentWidth = rowWidth.maxElement()!
}
}
// SETS DYNAMIC WIDTH BASED ON TAGS
override func collectionViewContentSize() -> CGSize {
return CGSize(width: contentWidth, height: contentHeight)
}
// UPDATES CELL ATTRIBUTES
override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
var layoutAttributes = [UICollectionViewLayoutAttributes]()
for attributes in cache {
if CGRectIntersectsRect(attributes.frame, rect ) {
layoutAttributes.append(attributes)
}
}
return layoutAttributes
}
override func shouldInvalidateLayoutForBoundsChange(newBounds: CGRect) -> Bool {
return true
}
}
网站正在制作中,我已经复制了完全相同的文件
环境档案:
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class log does not exist' in /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php:1291\nStack trace:\n#0
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1291): ReflectionClass->__construct('log')\n#1
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1242): Illuminate\\Container\\Container->build('log', Array)\n#2
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1780): Illuminate\\Container\\Container->make('log', Array)\n#3
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1334): Illuminate\\Foundation\\Application->make('Psr\\\\Log\\\\LoggerI...')\n#4
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1318): Illuminate\\Container\\Container->resolveClass(Object(ReflectionParameter))\n#5 /var/www/html/versioned/software/track2/bootstrap/cache/compiled.php(1304 in
/var/www/html/versioned/software/track2/bootstrap/cache/compiled.php on line 1291, referer:
http://localhost/versioned/software/track2/
答案 0 :(得分:1)
这可能是因为.env文件中的某个配置文件或空格中的值有错误。
如果.env文件中需要空格,请改用ENV_KEY='some value here'
。
更多信息:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist