* @license LGPL-3+ * @filesource */ // Search the initialize.php. $dir = dirname($_SERVER['SCRIPT_FILENAME']); while ($dir != '.' && $dir != '/' && !is_file($dir . '/system/initialize.php')) { $dir = dirname($dir); } if (!is_file($dir . '/system/initialize.php')) { echo 'Could not find initialize.php, where is Contao?'; exit; } define('TL_ROOT', $dir); while ($dir != '.' && $dir != '/') { if (is_file($dir . '/composer/vendor/autoload.php')) { $file = $dir . '/composer/vendor/autoload.php'; break; } if (is_file($dir . '/vendor/autoload.php')) { $file = $dir . '/vendor/autoload.php'; break; } $dir = dirname($dir); } if (!(isset($file) && is_file($file))) { echo 'Could not find autoload.php, where is Composer?'; exit; } require_once $file; \CyberSpectrum\ContaoDebugger\Debugger::getPersisted();
/** * Magic method caller. * * @param string $func The name of the method to be called. * * @param array $argv The parameters to use. * * @return $this|StatementDelegator|mixed|null */ public function __call($func, $argv) { if ($func == 'execute') { return $this->__call('prepare', $argv)->__call($func, array()); } if ($func == 'prepare') { $statement = new StatementDelegator($this->invoke('createStatement', array($this->reflectionProperty('resConnection'), $this->reflectionProperty('blnDisableAutocommit'))), $this); $statement->invoke('prepare', $argv); return $statement; } $result = $this->invoke($func, $argv); if ($result === $this->getDatabase()) { return $this; } if ($result instanceof Statement) { Debugger::addDebug('\\Contao\\Database\\Statement::' . $func . ' wrap()'); return new StatementDelegator($result, $this); } return $result; }