Missing Database Connection
Error:
A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: SQLSTATE[HY000] [2002] No such file or directory
Notice:
If you want to customize this error message, create app/View/Errors/missing_connection.ctp
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 278 → Mysql->connect()
));
}
if ($autoConnect) {
$this->connect();
}
- CORE/Cake/Model/ConnectionManager.php line 105 → DboSource->__construct()
'message' => 'Datasource is not found in Model/Datasource package.'
));
}
static::$_dataSources[$name] = new $class(static::$config->{$name});
static::$_dataSources[$name]->configKeyName = $name;
- CORE/Cake/Model/Model.php line 3659 → ConnectionManager::getDataSource()
$this->useDbConfig = $dataSource;
}
$db = ConnectionManager::getDataSource($this->useDbConfig);
if (!empty($oldConfig) && isset($db->config['prefix'])) {
- CORE/Cake/Model/Model.php line 1162 → Model->setDataSource()
* @return void
*/
public function setSource($tableName) {
$this->setDataSource($this->useDbConfig);
$db = ConnectionManager::getDataSource($this->useDbConfig);
- CORE/Cake/Model/Model.php line 3686 → Model->setSource()
public function getDataSource() {
if (!$this->_sourceConfigured && $this->useTable !== false) {
$this->_sourceConfigured = true;
$this->setSource($this->useTable);
}
- CORE/Cake/Model/Model.php line 1394 → Model->getDataSource()
*/
public function schema($field = false) {
if ($this->useTable !== false && (!is_array($this->_schema) || $field === true)) {
$db = $this->getDataSource();
$db->cacheSources = ($this->cacheSources && $db->cacheSources);
- CORE/Cake/Model/Model.php line 1490 → Model->schema()
}
if (empty($this->_schema)) {
$this->schema();
}
- CORE/Cake/Model/Model.php line 1477 → Model->hasField()
public function hasField($name, $checkVirtual = false) {
if (is_array($name)) {
foreach ($name as $n) {
if ($this->hasField($n, $checkVirtual)) {
return $n;
- CORE/Cake/Model/Model.php line 914 → Model->hasField()
*/
public function __get($name) {
if ($name === 'displayField') {
return $this->displayField = $this->hasField(array('title', 'name', $this->primaryKey));
}
- CORE/Cake/Model/Behavior/TreeBehavior.php line 442 → Model->__get()
}
$fields = null;
if (!$keyPath && !$valuePath && $Model->hasField($Model->displayField)) {
$fields = array($Model->primaryKey, $Model->displayField, $left, $right);
- CORE/Cake/Model/BehaviorCollection.php line 238 → TreeBehavior->generateTreeList()
}
return call_user_func_array(
array($this->_loaded[$method[0]], $method[1]),
array_merge(array(&$model), $params)
);
- CORE/Cake/Model/Model.php line 829 → BehaviorCollection->dispatchMethod()
* @return mixed Whatever is returned by called method
*/
public function __call($method, $params) {
$result = $this->Behaviors->dispatchMethod($this, $method, $params);
if ($result !== array('unhandled')) {
- APP/Controller/AppController.php line 90 → Model->__call()
*/
public function checkMolClassSession($p_forceRedefine = false){
if(!isset($_SESSION['molecule_classes']) || $p_forceRedefine) {
$_SESSION['molecule_classes'] = $this->MoleculeClass->generateTreeList(null, null, null, '— ' );
}
- APP/Controller/AppController.php line 54 → AppController->checkMolClassSession()
* @see Controller::beforeFilter()
*/
public function beforeFilter(){
$this->checkMolClassSession();
$this->Navigation->createNav();
- APP/Controller/FeController.php line 33 → AppController->beforeFilter()
* @see Controller::beforeFilter()
*/
public function beforeFilter() {
parent::beforeFilter();
if(!isset($_SESSION['called_mol'])) {
- CORE/Cake/Event/CakeEventManager.php line 244 → FeController->beforeFilter()
if ($listener['passParams'] === true) {
$result = call_user_func_array($listener['callable'], $event->data);
} else {
$result = call_user_func($listener['callable'], $event);
}
- CORE/Cake/Controller/Controller.php line 687 → CakeEventManager->dispatch()
* @triggers Controller.startup $this
*/
public function startupProcess() {
$this->getEventManager()->dispatch(new CakeEvent('Controller.initialize', $this));
$this->getEventManager()->dispatch(new CakeEvent('Controller.startup', $this));
- CORE/Cake/Routing/Dispatcher.php line 189 → Controller->startupProcess()
*/
protected function _invoke(Controller $controller, CakeRequest $request) {
$controller->constructClasses();
$controller->startupProcess();
- CORE/Cake/Routing/Dispatcher.php line 167 → Dispatcher->_invoke()
));
}
$response = $this->_invoke($controller, $request);
if (isset($request->params['return'])) {
- APP/webroot/index.php line 107 → Dispatcher->dispatch()
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);