Aller au contenu

Nouveau membre ?! Pense à te présenter pour accéder au contenu du forum !

New member ?! Introduce yourself to get access to the forum !

  • 0
Kaico33

en cours Site CMS

Question

Bonjour , j'essaye de creer mon site CMS mais je n'ai pas de tuto pour m'expliquer j'ai fait comme sur un site mais quand je met mon ip hamachi dans google sa me met sa :

 

Warning: mysql_connect() [function.mysql-connect]: [2002] Aucune connexion n�a pu �tre �tablie car l�ordinateur cible l�a (trying to connect via tcp://localhost:3306) in C:\Users\nicolas\Documents\DOFUS PRIVEE\wamp\www\config\config.php on line 27

Call Stack

# Time Memory Function Location

1 0.0018 371064 {main}( ) ..\index.php:0

2 0.0035 395584 require( 'C:\Users\nicolas\Documents\DOFUS PRIVEE\wamp\www\config\config.php' ) ..\index.php:6

3 0.0036 397512 mysql_connect ( ) ..\config.php:27

 

( ! ) Warning: mysql_connect() [function.mysql-connect]: Aucune connexion n�a pu �tre �tablie car l�ordinateur cible l�a express�ment refus�e. in C:\Users\nicolas\Documents\DOFUS PRIVEE\wamp\www\config\config.php on line 27

Call Stack

# Time Memory Function Location

1 0.0018 371064 {main}( ) ..\index.php:0

2 0.0035 395584 require( 'C:\Users\nicolas\Documents\DOFUS PRIVEE\wamp\www\config\config.php' ) ..\index.php:6

3 0.0036 397512 mysql_connect ( ) ..\config.php:27

Aucune connexion n�a pu �tre �tablie car l�ordinateur cible l�a express�ment refus�e.

 

 

 

Si quelqun pourrait m'aider :S

Partager ce message


Lien à poster
Partager sur d’autres sites

46 réponses à cette question

Messages recommandés

  • 0

Essaye de déchiffrer un peut ;).

Il y'a un problème à ces ligne :

config.php ligne 27

index.php ligne 6

 

Montre ces lignes s'il te plaît ;).

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Jai supprimer ce dossier et j'ai fait avec RebenCMS . Sa marcher =) . Quand je rentre mon adresse IP Hamachi dans la barre http:// alors que localhost marche pas . Mais j'ai une question pourquoi ai-je ce message en plein milieu du site ?

 

"Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée."

 

Et quand je veux creer un compte aussi sa me met qu'il faut remplir tout les champs car ils sont obligatoires mais je les ai tous remplis =S

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Désolé, je ne connait pas RebenCMS =(

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Erf :'(

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Enfaite tu es sous quel emu ? ^^'

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Ancestra Remake

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Il n'y a pas la boutique ^^'

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Erf' ^^'.

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Le rebenCMS n'est pas beau.

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Oui mais je ne connais que sa ^^ Ce que je veux c'est un site ou on peut s'inscrire et qu'il y est une boutique

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

InfiniteCMS ou un autre CMS crée par Nicow que tu trouveras sur un autre forum (sans vouloir faire de publicité)

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Sur le CMS de Nicow ya 2 truc que je sais pas mettre : NDC et MDP Base de donnée ? C'est les NDC ET MDP que jai choisi quand j'ai telecharger MySQL ?

 

 

Et lien de vote pour rpg-paradize je met quoi ?

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Perso lotuscms est pas mal je trouve

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Pouvez vous me repondre svp =P

 

Sur le CMS de Nicow ya 2 truc que je sais pas mettre : NDC et MDP Base de donnée ? C'est les NDC ET MDP que jai choisi quand j'ai telecharger MySQL ?

 

 

Et lien de vote pour rpg-paradize je met quoi ?

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

ça doit être :

NDC : root

MDP : rien

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Et rpg ?


Et script de mon t'chat ^^ ?

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

- rpg :http://www.rpg-paradize.com/?page=vote&vote=17235 (Le dernier numéro doit être l'ID de ton site)

 

- Script t'chat : Va sur xat et créer ton t'chat et tu auras ton script ;)

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Merci et comment je sais l'ID de mon site ?

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Quand tu t'es inscris sur rpg paradize soit tu te rends sur ton compte soit tu vas dans "autres" puis tu recherches ton site puis tu cliques sur "vote" et là tu auras le lien de vote de ton site.

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

BOn j'ai crée la config mais le truc cest que ya pas de tuto ... Donc j'ai copier/coller tout les dossier dans wamp/www . Mais aprés ya quoi a faire ? je met mon ip hamachi mais google trouve rien

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Cherche pas sur google x.x'

Entre ton adresse hamachi comme adresse (genre youtube)

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

Oui mais sa marche pas localhost non plus :/

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

On wamp.

Partager ce message


Lien à poster
Partager sur d’autres sites
  • 0

JE vais essayer ac infiniteCMS dans ce cas


Voila ce que me dit quand je met mon ip Hamachi :

 

Warning: PDO::__construct() [pdo.--construct]: [2002] Aucune connexion n’a pu être établie car l’ordinateur cible l’a (trying to connect via tcp://localhost:3306) in C:\Users\nicolas\Documents\DOFUS PRIVEE\wamp\www\lib\Doctrine.php on line 39

 

Voici la ligne 39 :

 

 

class Doctrine_Connection extends Doctrine_Configurable implements Countable, IteratorAggregate, Serializable { protected $dbh; protected $tables = array(); protected $_name; protected $driverName; protected $isConnected = false; protected $supported = array(); protected $pendingAttributes = array(); private $modules = array('transaction' => false, 'expression' => false, 'dataDict' => false, 'export' => false, 'import' => false, 'sequence' => false, 'unitOfWork' => false, 'formatter' => false, 'util' => false, ); protected $properties = array('sql_comments' => array(array('start' => '--', 'end' => "\n", 'escape' => false), array('start' => '/*', 'end' => '*/', 'escape' => false)), 'identifier_quoting' => array('start' => '"', 'end' => '"','escape' => '"'), 'string_quoting' => array('start' => "'", 'end' => "'", 'escape' => false, 'escape_pattern' => false), 'wildcards' => array('%', '_'), 'varchar_max_length' => 255, 'sql_file_delimiter' => ";\n", 'max_identifier_length' => 64, ); protected $serverInfo = array(); protected $options = array(); private static $supportedDrivers = array( 'Mysql', 'Pgsql', 'Oracle', 'Mssql', 'Sqlite', ); protected $_count = 0; protected $_usedNames = array( 'foreign_keys' => array(), 'indexes' => array() ); public function __construct(Doctrine_Manager $manager, $adapter, $user = null, $pass = null) { if (is_object($adapter)) { if ( ! ($adapter instanceof PDO) && ! in_array('Doctrine_Adapter_Interface', class_implements($adapter))) { throw new Doctrine_Connection_Exception('First argument should be an instance of PDO or implement Doctrine_Adapter_Interface'); } $this->dbh = $adapter; $this->isConnected = true; } else if (is_array($adapter)) { $this->pendingAttributes[Doctrine_Core::ATTR_DRIVER_NAME] = $adapter['scheme']; $this->options['dsn'] = $adapter['dsn']; $this->options['username'] = $adapter['user']; $this->options['password'] = $adapter['pass']; $this->options['other'] = array(); if (isset($adapter['other'])) { $this->options['other'] = array(Doctrine_Core::ATTR_PERSISTENT => $adapter['persistent']); } } $this->setParent($manager); $this->setAttribute(Doctrine_Core::ATTR_CASE, Doctrine_Core::CASE_NATURAL); $this->setAttribute(Doctrine_Core::ATTR_ERRMODE, Doctrine_Core::ERRMODE_EXCEPTION); $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->onOpen($this); } public function isConnected() { return $this->isConnected; } public function getOptions() { return $this->options; } public function getOption($option) { if (isset($this->options[$option])) { return $this->options[$option]; } } public function setOption($option, $value) { return $this->options[$option] = $value; } public function getAttribute($attribute) { if ($attribute >= 100 && $attribute < 1000) { if ( ! isset($this->attributes[$attribute])) { return parent::getAttribute($attribute); } return $this->attributes[$attribute]; } if ($this->isConnected) { try { return $this->dbh->getAttribute($attribute); } catch (Exception $e) { throw new Doctrine_Connection_Exception('Attribute ' . $attribute . ' not found.'); } } else { if ( ! isset($this->pendingAttributes[$attribute])) { $this->connect(); $this->getAttribute($attribute); } return $this->pendingAttributes[$attribute]; } } public static function getAvailableDrivers() { return PDO::getAvailableDrivers(); } public static function getSupportedDrivers() { return self::$supportedDrivers; } public function setAttribute($attribute, $value) { if ($attribute >= 100 && $attribute < 1000) { parent::setAttribute($attribute, $value); } else { if ($this->isConnected) { $this->dbh->setAttribute($attribute, $value); } else { $this->pendingAttributes[$attribute] = $value; } } return $this; } public function getName() { return $this->_name; } public function setName($name) { $this->_name = $name; } public function getDriverName() { return $this->driverName; } public function __get($name) { if (isset($this->properties[$name])) { return $this->properties[$name]; } if ( ! isset($this->modules[$name])) { throw new Doctrine_Connection_Exception('Unknown module / property ' . $name); } if ($this->modules[$name] === false) { switch ($name) { case 'unitOfWork': $this->modules[$name] = new Doctrine_Connection_UnitOfWork($this); break; case 'formatter': $this->modules[$name] = new Doctrine_Formatter($this); break; default: $class = 'Doctrine_' . ucwords($name) . '_' . $this->getDriverName(); $this->modules[$name] = new $class($this); } } return $this->modules[$name]; } public function getManager() { return $this->getParent(); } public function getDbh() { $this->connect(); return $this->dbh; } public function connect() { if ($this->isConnected) { return false; } $event = new Doctrine_Event($this, Doctrine_Event::CONN_CONNECT); $this->getListener()->preConnect($event); $e = explode(':', $this->options['dsn']); $found = false; if (extension_loaded('pdo')) { if (in_array($e[0], self::getAvailableDrivers())) { try { $this->dbh = new PDO($this->options['dsn'], $this->options['username'], (!$this->options['password'] ? '':$this->options['password']), $this->options['other']); $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { throw new Doctrine_Connection_Exception('PDO Connection Error: ' . $e->getMessage()); } $found = true; } } if ( ! $found) { $class = 'Doctrine_Adapter_' . ucwords($e[0]); if (class_exists($class)) { $this->dbh = new $class($this->options['dsn'], $this->options['username'], $this->options['password'], $this->options); } else { throw new Doctrine_Connection_Exception("Couldn't locate driver named " . $e[0]); } } foreach($this->pendingAttributes as $attr => $value) { if ($attr == Doctrine_Core::ATTR_DRIVER_NAME) { continue; } $this->dbh->setAttribute($attr, $value); } $this->isConnected = true; $this->getListener()->postConnect($event); return true; } public function incrementQueryCount() { $this->_count++; } public function driverName($name) { } public function supports($feature) { return (isset($this->supported[$feature]) && ($this->supported[$feature] === 'emulated' || $this->supported[$feature])); } public function replace(Doctrine_Table $table, array $fields, array $keys) { if (empty($keys)) { throw new Doctrine_Connection_Exception('Not specified which fields are keys'); } $identifier = (array) $table->getIdentifier(); $condition = array(); foreach ($fields as $fieldName => $value) { if (in_array($fieldName, $keys)) { if ($value !== null) { $condition[] = $table->getColumnName($fieldName) . ' = ?'; $conditionValues[] = $value; } } } $affectedRows = 0; if ( ! empty($condition) && ! empty($conditionValues)) { $query = 'DELETE FROM ' . $this->quoteIdentifier($table->getTableName()) . ' WHERE ' . implode(' AND ', $condition); $affectedRows = $this->exec($query, $conditionValues); } $this->insert($table, $fields); $affectedRows++; return $affectedRows; } public function delete(Doctrine_Table $table, array $identifier) { $tmp = array(); foreach (array_keys($identifier) as $id) { $tmp[] = $this->quoteIdentifier($table->getColumnName($id)) . ' = ?'; } $query = 'DELETE FROM ' . $this->quoteIdentifier($table->getTableName()) . ' WHERE ' . implode(' AND ', $tmp); return $this->exec($query, array_values($identifier)); } public function update(Doctrine_Table $table, array $fields, array $identifier) { if (empty($fields)) { return false; } $set = array(); foreach ($fields as $fieldName => $value) { if ($value instanceof Doctrine_Expression) { $set[] = $this->quoteIdentifier($table->getColumnName($fieldName)) . ' = ' . $value->getSql(); unset($fields[$fieldName]); } else { $set[] = $this->quoteIdentifier($table->getColumnName($fieldName)) . ' = ?'; } } $params = array_merge(array_values($fields), array_values($identifier)); $sql = 'UPDATE ' . $this->quoteIdentifier($table->getTableName()) . ' SET ' . implode(', ', $set) . ' WHERE ' . implode(' = ? AND ', $this->quoteMultipleIdentifier($table->getIdentifierColumnNames())) . ' = ?'; return $this->exec($sql, $params); } public function insert(Doctrine_Table $table, array $fields) { $tableName = $table->getTableName(); $cols = array(); $a = array(); foreach ($fields as $fieldName => $value) { $cols[] = $this->quoteIdentifier($table->getColumnName($fieldName)); if ($value instanceof Doctrine_Expression) { $a[] = $value->getSql(); unset($fields[$fieldName]); } else { $a[] = '?'; } } $query = 'INSERT INTO ' . $this->quoteIdentifier($tableName) . ' (' . implode(', ', $cols) . ')' . ' VALUES (' . implode(', ', $a) . ')'; return $this->exec($query, array_values($fields)); } public function quoteIdentifier($str, $checkOption = true) { if (strpos($str, '.')) { $e = explode('.', $str); return $this->formatter->quoteIdentifier($e[0], $checkOption) . '.' . $this->formatter->quoteIdentifier($e[1], $checkOption); } return $this->formatter->quoteIdentifier($str, $checkOption); } public function quoteMultipleIdentifier($arr, $checkOption = true) { foreach ($arr as $k => $v) { $arr[$k] = $this->quoteIdentifier($v, $checkOption); } return $arr; } public function convertBooleans($item) { return $this->formatter->convertBooleans($item); } public function quote($input, $type = null) { return $this->formatter->quote($input, $type); } public function setDateFormat($format = null) { } public function fetchAll($statement, array $params = array()) { return $this->execute($statement, $params)->fetchAll(Doctrine_Core::FETCH_ASSOC); } public function fetchOne($statement, array $params = array(), $colnum = 0) { return $this->execute($statement, $params)->fetchColumn($colnum); } public function fetchRow($statement, array $params = array()) { return $this->execute($statement, $params)->fetch(Doctrine_Core::FETCH_ASSOC); } public function fetchArray($statement, array $params = array()) { return $this->execute($statement, $params)->fetch(Doctrine_Core::FETCH_NUM); } public function fetchColumn($statement, array $params = array(), $colnum = 0) { return $this->execute($statement, $params)->fetchAll(Doctrine_Core::FETCH_COLUMN, $colnum); } public function fetchAssoc($statement, array $params = array()) { return $this->execute($statement, $params)->fetchAll(Doctrine_Core::FETCH_ASSOC); } public function fetchBoth($statement, array $params = array()) { return $this->execute($statement, $params)->fetchAll(Doctrine_Core::FETCH_BOTH); } public function query($query, array $params = array(), $hydrationMode = null) { $parser = Doctrine_Query::create(); $res = $parser->query($query, $params, $hydrationMode); $parser->free(); return $res; } public function prepare($statement) { $this->connect(); try { $event = new Doctrine_Event($this, Doctrine_Event::CONN_PREPARE, $statement); $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->prePrepare($event); $stmt = false; if ( ! $event->skipOperation) { $stmt = $this->dbh->prepare($statement); } $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->postPrepare($event); return new Doctrine_Connection_Statement($this, $stmt); } catch(Doctrine_Adapter_Exception $e) { } catch(PDOException $e) { } $this->rethrowException($e, $this, $statement); } public function queryOne($query, array $params = array()) { $parser = Doctrine_Query::create(); $coll = $parser->query($query, $params); if ( ! $coll->contains(0)) { return false; } return $coll[0]; } public function select($query, $limit = 0, $offset = 0) { if ($limit > 0 || $offset > 0) { $query = $this->modifyLimitQuery($query, $limit, $offset); } return $this->execute($query); } public function standaloneQuery($query, $params = array()) { return $this->execute($query, $params); } public function execute($query, array $params = array()) { $this->connect(); try { if ( ! empty($params)) { $stmt = $this->prepare($query); $stmt->execute($params); return $stmt; } else { $event = new Doctrine_Event($this, Doctrine_Event::CONN_QUERY, $query, $params); $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->preQuery($event); if ( ! $event->skipOperation) { $stmt = $this->dbh->query($query); $this->_count++; } $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->postQuery($event); return $stmt; } } catch (Doctrine_Adapter_Exception $e) { } catch (PDOException $e) { } $this->rethrowException($e, $this, $query); } public function exec($query, array $params = array()) { $this->connect(); try { if ( ! empty($params)) { $stmt = $this->prepare($query); $stmt->execute($params); return $stmt->rowCount(); } else { $event = new Doctrine_Event($this, Doctrine_Event::CONN_EXEC, $query, $params); $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->preExec($event); if ( ! $event->skipOperation) { $count = $this->dbh->exec($query); $this->_count++; } $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->postExec($event); return $count; } } catch (Doctrine_Adapter_Exception $e) { } catch (PDOException $e) { } $this->rethrowException($e, $this, $query); } public function rethrowException(Exception $e, $invoker, $query = null) { $event = new Doctrine_Event($this, Doctrine_Event::CONN_ERROR); $this->getListener()->preError($event); $name = 'Doctrine_Connection_' . $this->driverName . '_Exception'; $message = $e->getMessage(); if ($query) { $message .= sprintf('. Failing Query: "%s"', $query); } $exc = new $name($message, (int) $e->getCode()); if ( ! isset($e->errorInfo) || ! is_array($e->errorInfo)) { $e->errorInfo = array(null, null, null, null); } $exc->processErrorInfo($e->errorInfo); if ($this->getAttribute(Doctrine_Core::ATTR_THROW_EXCEPTIONS)) { throw $exc; } $this->getListener()->postError($event); } public function hasTable($name) { return isset($this->tables[$name]); } public function getTable($name) { if (isset($this->tables[$name])) { return $this->tables[$name]; } $class = $name . 'Table'; if (class_exists($class, $this->getAttribute(Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES)) && in_array('Doctrine_Table', class_parents($class))) { $table = new $class($name, $this, true); } else { $tableClass = $this->getAttribute(Doctrine_Core::ATTR_TABLE_CLASS); $table = new $tableClass($name, $this, true); } return $table; } public function getTables() { return $this->tables; } public function getIterator() { return new ArrayIterator($this->tables); } public function count() { return $this->_count; } public function addTable(Doctrine_Table $table) { $name = $table->getComponentName(); if (isset($this->tables[$name])) { return false; } $this->tables[$name] = $table; return true; } public function create($name) { return $this->getTable($name)->create(); } public function createQuery() { return Doctrine_Query::create(); } public function flush() { try { $this->beginInternalTransaction(); $this->unitOfWork->saveAll(); $this->commit(); } catch (Exception $e) { $this->rollback(); throw $e; } } public function clear() { foreach ($this->tables as $k => $table) { $table->getRepository()->evictAll(); $table->clear(); } } public function evictTables() { $this->tables = array(); $this->exported = array(); } public function close() { $event = new Doctrine_Event($this, Doctrine_Event::CONN_CLOSE); $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->preClose($event); $this->clear(); unset($this->dbh); $this->isConnected = false; $this->getAttribute(Doctrine_Core::ATTR_LISTENER)->postClose($event); } public function getTransactionLevel() { return $this->transaction->getTransactionLevel(); } public function errorCode() { $this->connect(); return $this->dbh->errorCode(); } public function errorInfo() { $this->connect(); return $this->dbh->errorInfo(); } public function getResultCacheDriver() { if ( ! $this->getAttribute(Doctrine_Core::ATTR_RESULT_CACHE)) { throw new Doctrine_Exception('Result Cache driver not initialized.'); } return $this->getAttribute(Doctrine_Core::ATTR_RESULT_CACHE); } public function getQueryCacheDriver() { if ( ! $this->getAttribute(Doctrine_Core::ATTR_QUERY_CACHE)) { throw new Doctrine_Exception('Query Cache driver not initialized.'); } return $this->getAttribute(Doctrine_Core::ATTR_QUERY_CACHE); } public function lastInsertId($table = null, $field = null) { return $this->sequence->lastInsertId($table, $field); } public function beginTransaction($savepoint = null) { return $this->transaction->beginTransaction($savepoint); } public function beginInternalTransaction($savepoint = null) { return $this->transaction->beginInternalTransaction($savepoint); } public function commit($savepoint = null) { return $this->transaction->commit($savepoint); } public function rollback($savepoint = null) { return $this->transaction->rollback($savepoint); } public function createDatabase() { if ( ! $dsn = $this->getOption('dsn')) { throw new Doctrine_Connection_Exception('You must create your Doctrine_Connection by using a valid Doctrine style dsn in order to use the create/drop database functionality'); } $info = $this->getManager()->parsePdoDsn($dsn); $tmpConnection = $this->getTmpConnection($info); try { $tmpConnection->export->createDatabase($info['dbname']); } catch (Exception $e) {} $this->getManager()->closeConnection($tmpConnection); if (isset($e)) { throw $e; } } public function dropDatabase() { if ( ! $dsn = $this->getOption('dsn')) { throw new Doctrine_Connection_Exception('You must create your Doctrine_Connection by using a valid Doctrine style dsn in order to use the create/drop database functionality'); } $info = $this->getManager()->parsePdoDsn($dsn); $tmpConnection = $this->getTmpConnection($info); try { $tmpConnection->export->dropDatabase($info['dbname']); } catch (Exception $e) {} $this->getManager()->closeConnection($tmpConnection); if (isset($e)) { throw $e; } } public function getTmpConnection($info) { $pdoDsn = $info['scheme'] . ':'; if ($info['unix_socket']) { $pdoDsn .= 'unix_socket=' . $info['unix_socket'] . ';'; } $pdoDsn .= 'host=' . $info['host']; if ($info['port']) { $pdoDsn .= ';port=' . $info['port']; } if (isset($this->export->tmpConnectionDatabase) && $this->export->tmpConnectionDatabase) { $pdoDsn .= ';dbname=' . $this->export->tmpConnectionDatabase; } $username = $this->getOption('username'); $password = $this->getOption('password'); $conn = $this->getManager()->openConnection(array($pdoDsn, $username, $password), 'doctrine_tmp_connection', false); $conn->setOption('username', $username); $conn->setOption('password', $password); return $conn; } public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false) { return $query; } public function modifyLimitSubquery(Doctrine_Table $rootTable, $query, $limit = false, $offset = false, $isManip = false) { return $this->modifyLimitQuery($query, $limit, $offset, $isManip); } public function __toString() { return Doctrine_Lib::getConnectionAsString($this); } public function serialize() { $vars = get_object_vars($this); $vars['dbh'] = null; $vars['isConnected'] = false; return serialize($vars); } public function unserialize($serialized) { $array = unserialize($serialized); foreach ($array as $name => $values) { $this->$name = $values; } } public function generateUniqueRelationForeignKeyName(Doctrine_Relation $relation) { $parts = array( $relation['localTable']->getTableName(), $relation->getLocalColumnName(), $relation['table']->getTableName(), $relation->getForeignColumnName(), ); $key = implode('_', array_merge($parts, array($relation['onDelete']), array($relation['onUpdate']))); $format = $this->getAttribute(Doctrine_Core::ATTR_FKNAME_FORMAT); return $this->_generateUniqueName('foreign_keys', $parts, $key, $format, $this->properties['max_identifier_length']); } public function generateUniqueIndexName($tableName, $fields) { $fields = (array) $fields; $parts = array($tableName); $parts = array_merge($parts, $fields); $key = implode('_', $parts); $format = $this->getAttribute(Doctrine_Core::ATTR_IDXNAME_FORMAT); return $this->_generateUniqueName('indexes', $parts, $key, $format, $this->properties['max_identifier_length']); } protected function _generateUniqueName($type, $parts, $key, $format = '%s', $maxLength = 64) { if (isset($this->_usedNames[$type][$key])) { return $this->_usedNames[$type][$key]; } $generated = implode('_', $parts); if (strlen(sprintf($format, $generated)) > $maxLength) { $generated = ''; foreach ($parts as $part) { $generated .= $part[0]; } $name = $generated; } else { $name = $generated; } while (in_array($name, $this->_usedNames[$type])) { $e = explode('_', $name); $end = end($e); if (is_numeric($end)) { unset($e[count($e) - 1]); $fkName = implode('_', $e); $name = $fkName . '_' . ++$end; } else { $name .= '_1'; } } $this->_usedNames[$type][$key] = $name; return $name; } }

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.

×

Information importante

By using this site, you agree to our Conditions d’utilisation.