当我从localhost使用我的应用程序时它工作正常,但是当我在服务器中部署应用程序时,我得到了下一个错误:
致命错误:第59行的/var/www/html/pfpdi/module/PFC/Module.php中找不到“PFC \ Model \ GestoresPFC”
我正在使用具有下一个树结构的模块
gestoresPFC.php 就像:
<?php
namespace PFC\Model;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
class GestoresPFC implements InputFilterAwareInterface
{
public $gestor_id;
public $plan_id;
protected $inputFilter; // <-- Add this variable
public function exchangeArray($data)
{
$this->gestor_id = (isset($data['gestor_id'])) ? $data['gestor_id'] : null;
$this->plan_id = (isset($data['plan_id'])) ? $data['plan_id'] : null;
}
public function getArrayCopy()
{
return get_object_vars($this);
}
// Add content to these methods:
public function setInputFilter(InputFilterInterface $inputFilter)
{
throw new \Exception("Not used");
}
public function getInputFilter()
{
if (!$this->inputFilter) {
$inputFilter = new InputFilter();
$inputFilter->add(array(
'name' => 'gestor_id',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
'options' => array(
'encoding' => 'UTF-8',
'min' => 1,
'max' => 100,
),
),
),
));
$inputFilter->add(array(
'name' => 'plan_id',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
'options' => array(
'encoding' => 'UTF-8',
'min' => 1,
'max' => 11,
),
),
),
));
$this->inputFilter = $inputFilter;
}
return $this->inputFilter;
}
}
Module.php 就像:
<?php
namespace PFC;
use PFC\Model\PFC;
use PFC\Model\PFCTable;
use PFC\Model\GestoresPFC;
use PFC\Model\GestoresPFCTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements AutoloaderProviderInterface, ConfigProviderInterface
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getServiceConfig()
{
return array(
'factories' => array(
'PFC\Model\PFCTable' => function($sm) {
$tableGateway = $sm->get('PFCTableGateway');
$table = new PFCTable($tableGateway);
return $table;
},
'PFCTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new PFC());
return new TableGateway('plan_formacion', $dbAdapter, null, $resultSetPrototype);
},
'PFC\Model\GestoresPFCTable' => function($sm) {
$tableGateway = $sm->get('GestoresPFCTableGateway');
$table = new GestoresPFCTable($tableGateway);
return $table;
},
'GestoresPFCTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new GestoresPFC());
return new TableGateway('gestores', $dbAdapter, null, $resultSetPrototype);
},
),
);
}
}
答案 0 :(得分:2)
adb shell service call bluetooth_manager 9
应为gestoresPFC.php
。文件名需要与类名匹配。我猜你是在一个不区分大小写的文件系统(例如Windows)上开发这个网站的,这无关紧要。