spiralCore/components/dbal.php
97 {
98 $pdoDSN = $config['dbDriver'] . ':dbname=' . $config['dbName'];
99
100 if ($config['dbServer'])
101 {
102 //Server
103 $pdoDSN .= ';host=' . $config['dbServer'];
104 }
105
106 //Connection
107 self::$pdo = new PDO($pdoDSN, $config['dbUser'], $config['dbPassword'], $config['pdoOptions']);
108 }
109 catch (pdoException $pdoException)
110 {
111 self::$benchmarks['connection'] = microtime(true) - self::$benchmarks['connection'];
112 throw $pdoException;
113 }
114
115 self::$benchmarks['connection'] = microtime(true) - self::$benchmarks['connection'];
116 return self::$pdo;
117 }
spiralCore/components/orm/selector.php
411 /**
412 * Return results as dbalResult (simple query result).
413 *
414 * @param mixed $columns
415 * @return dbalResult
416 */
417 public function fetchColumns($columns = false)
418 {
419 if (!$columns)
420 {
421 return dbal::query($this->buildStatement(), dbal::select);
422 }
423
424 if (!is_array($columns))
425 {
426 //Columns as argument
427 $columns = func_get_args();
428 }
429
430 return dbal::query($this->buildStatement($columns), dbal::select);
431 }
spiralApplication/actions/home.php
58 }
59
60 }
61
62 /**
63 * Home page.
64 */
65 public function index()
66 {
67 self::$viewData['slideshow'] = orm::slideshow()->byItemID(0, '!=')->orderBy('position',
68 'DESC')->fetchColumns()->fetchAll();
69 }
70
71 /**
72 * Switching localization.
73 *
74 * @param string $localization
75 * @return void
76 */
77 public function localization($localization = '')
78 {
spiralCore/spiral.php
256 if (!is_callable([$instance, $method])) {
257 if (spiralDebug && !self::$globalConfig['spiral']['forceErrors']) {
258 throw new spiralException("Unable to call action '$action', uncallable method '$method'.");
259 }
260
261 self::callError('notFound');
262 }
263
264 spiralEvents::callEvent('callAction', $instance);
265
266 $actionResult = call_user_func_array([$instance, $method], $arguments);
267 $actionResult = (string)call_user_func([$instance, 'finishAction'], $actionResult);
268
269 spiralDebug && self::debugMessage("Action '$action' with method '$method' was successfully processed.");
270
271 if (!$parentAction) {
272 //This action was a parent of request, output should finish processing.
273 self::closeOutput($actionResult);
274 }
275
276 /**
‹ 3 ·ï܃