Dibi \ Exception
Expected number, '6635/73267' given. Dibi\Exception thrown with message "Expected number, '6635/73267' given." Stacktrace: #9 Dibi\Exception in /var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php:365 #8 Dibi\Translator:formatValue in /var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php:573 #7 Dibi\Translator:cb in [internal]:0 #6 preg_replace_callback in /var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php:111 #5 Dibi\Translator:translate in /var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php:302 #4 Dibi\Connection:translateArgs in /var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php:235 #3 Dibi\Connection:query in /var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php:592 #2 Dibi\Connection:fetch in /var/www/html/controllers/catalog.php:16 #1 catalog:get_view in /var/www/html/router.php:38 #0 router:process in /var/www/html/public/index.php:13
Stack frames (10)
9
Dibi\Exception
/vendor/dibi/dibi/src/Dibi/Translator.php365
8
Dibi\Translator formatValue
/vendor/dibi/dibi/src/Dibi/Translator.php573
7
Dibi\Translator cb
[internal]0
6
preg_replace_callback
/vendor/dibi/dibi/src/Dibi/Translator.php111
5
Dibi\Translator translate
/vendor/dibi/dibi/src/Dibi/Connection.php302
4
Dibi\Connection translateArgs
/vendor/dibi/dibi/src/Dibi/Connection.php235
3
Dibi\Connection query
/vendor/dibi/dibi/src/Dibi/Connection.php592
2
Dibi\Connection fetch
/controllers/catalog.php16
1
catalog get_view
/router.php38
0
router process
/public/index.php13
/var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php
                case 'in': // deprecated
                    trigger_error('Modifier %in is deprecated, use %iN.', E_USER_DEPRECATED);
                    // break omitted
                case 'iN': // signed int or null
                    if ($value == '') {
                        $value = null;
                    }
                    // break omitted
                case 'i':  // signed int
                case 'u':  // unsigned int, ignored
                    if ($value === null) {
                        return 'NULL';
                    } elseif (is_string($value)) {
                        if (preg_match('#[+-]?\d++(?:e\d+)?\z#A', $value)) {
                            return $value; // support for long numbers - keep them unchanged
                        } elseif (substr($value, 1, 1) === 'x' && is_numeric($value)) {
                            trigger_error('Support for hex strings has been deprecated.', E_USER_DEPRECATED);
                            return (string) hexdec($value);
                        } else {
                            throw new Exception("Expected number, '$value' given.");
                        }
                    } else {
                        return (string) (int) $value;
                    }
                    // break omitted
                case 'f':  // float
                    if ($value === null) {
                        return 'NULL';
                    } elseif (is_string($value)) {
                        if (is_numeric($value) && substr($value, 1, 1) !== 'x') {
                            return $value; // support for long numbers - keep them unchanged
                        } else {
                            throw new Exception("Expected number, '$value' given.");
                        }
                    } else {
                        return rtrim(rtrim(number_format($value + 0, 10, '.', ''), '0'), '.');
                    }
                    // break omitted
                case 'd':  // date
                case 't':  // datetime
/var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php
                } elseif ($this->comment) {
                    return "(limit $arg)";
                } else {
                    $this->limit = Helpers::intVal($arg);
                }
                return '';
 
            } elseif ($mod === 'ofs') { // apply offset
                $arg = $this->args[$cursor++];
                if ($arg === null) {
                } elseif ($this->comment) {
                    return "(offset $arg)";
                } else {
                    $this->offset = Helpers::intVal($arg);
                }
                return '';
 
            } else { // default processing
                $cursor++;
                return $this->formatValue($this->args[$cursor - 1], $mod);
            }
        }
 
        if ($this->comment) {
            return '...';
        }
 
        if ($matches[1]) { // SQL identifiers: `ident`
            return $this->identifiers->{$matches[1]};
 
        } elseif ($matches[2]) { // SQL identifiers: [ident]
            return $this->identifiers->{$matches[2]};
 
        } elseif ($matches[3]) { // SQL strings: '...'
            return $this->driver->escapeText(str_replace("''", "'", $matches[4]));
 
        } elseif ($matches[5]) { // SQL strings: "..."
            return $this->driver->escapeText(str_replace('""', '"', $matches[6]));
 
        } elseif ($matches[7]) { // string quote
[internal]
/var/www/html/vendor/dibi/dibi/src/Dibi/Translator.php
                    $sql[] = $arg;
                } else {
                    $sql[] = substr($arg, 0, $toSkip)
/*
                    . preg_replace_callback('/
                    (?=[`[\'":%?])                    ## speed-up
                    (?:
                        `(.+?)`|                     ## 1) `identifier`
                        \[(.+?)\]|                   ## 2) [identifier]
                        (\')((?:\'\'|[^\'])*)\'|     ## 3,4) 'string'
                        (")((?:""|[^"])*)"|          ## 5,6) "string"
                        (\'|")|                      ## 7) lone quote
                        :(\S*?:)([a-zA-Z0-9._]?)|    ## 8,9) :substitution:
                        %([a-zA-Z~][a-zA-Z0-9~]{0,5})|## 10) modifier
                        (\?)                         ## 11) placeholder
                    )/xs',
*/                  // note: this can change $this->args & $this->cursor & ...
                    . preg_replace_callback('/(?=[`[\'":%?])(?:`(.+?)`|\[(.+?)\]|(\')((?:\'\'|[^\'])*)\'|(")((?:""|[^"])*)"|(\'|")|:(\S*?:)([a-zA-Z0-9._]?)|%([a-zA-Z~][a-zA-Z0-9~]{0,5})|(\?))/s',
                            [$this, 'cb'],
                            substr($arg, $toSkip)
                    );
                    if (preg_last_error()) {
                        throw new PcreException;
                    }
                }
                continue;
            }
 
            if ($comment) {
                $sql[] = '...';
                continue;
            }
 
            if ($arg instanceof \Traversable) {
                $arg = iterator_to_array($arg);
            }
 
            if (is_array($arg) && is_string(key($arg))) {
                // associative array -> autoselect between SET or VALUES & LIST
                if ($commandIns === null) {
/var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php
        $args = func_get_args();
        return new DataSource($this->translateArgs($args), $this);
    }
 
 
    /**
     * Generates SQL query.
     * @param  array
     * @return string
     */
    protected function translateArgs($args)
    {
        if (!$this->connected) {
            $this->connect();
        }
        if (!$this->translator) {
            $this->translator = new Translator($this);
        }
        $translator = clone $this->translator;
        return $translator->translate($args);
    }
 
 
    /**
     * Executes the SQL query.
     * @param  string           SQL statement.
     * @return Result|int   result set or number of affected rows
     * @throws Exception
     */
    final public function nativeQuery($sql)
    {
        if (!$this->connected) {
            $this->connect();
        }
 
        \dibi::$sql = $sql;
        $event = $this->onEvent ? new Event($this, Event::QUERY, $sql) : null;
        try {
            $res = $this->driver->query($sql);
 
/var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php
     */
    final public function getDriver()
    {
        if (!$this->connected) {
            $this->connect();
        }
        return $this->driver;
    }
 
 
    /**
     * Generates (translates) and executes SQL query.
     * @param  array|mixed      one or more arguments
     * @return Result|int   result set or number of affected rows
     * @throws Exception
     */
    final public function query($args)
    {
        $args = func_get_args();
        return $this->nativeQuery($this->translateArgs($args));
    }
 
 
    /**
     * Generates SQL query.
     * @param  array|mixed      one or more arguments
     * @return string
     * @throws Exception
     */
    final public function translate($args)
    {
        $args = func_get_args();
        return $this->translateArgs($args);
    }
 
 
    /**
     * Generates and prints SQL query.
     * @param  array|mixed  one or more arguments
     * @return bool
/var/www/html/vendor/dibi/dibi/src/Dibi/Connection.php
    {
        return strpos($value, ':') === false
            ? $value
            : preg_replace_callback('#:([^:\s]*):#', function ($m) { return $this->substitutes->{$m[1]}; }, $value);
    }
 
 
    /********************* shortcuts ****************d*g**/
 
 
    /**
     * Executes SQL query and fetch result - shortcut for query() & fetch().
     * @param  array|mixed    one or more arguments
     * @return Row|false
     * @throws Exception
     */
    public function fetch($args)
    {
        $args = func_get_args();
        return $this->query($args)->fetch();
    }
 
 
    /**
     * Executes SQL query and fetch results - shortcut for query() & fetchAll().
     * @param  array|mixed    one or more arguments
     * @return Row[]|array[]
     * @throws Exception
     */
    public function fetchAll($args)
    {
        $args = func_get_args();
        return $this->query($args)->fetchAll();
    }
 
 
    /**
     * Executes SQL query and fetch first column - shortcut for query() & fetchSingle().
     * @param  array|mixed    one or more arguments
     * @return mixed
/var/www/html/controllers/catalog.php
<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\JsonResponse;

class catalog extends controller {

  function get_view(Request $request) {
    $path = trim($request->getPathInfo(), '/');
    $id = str_replace('catalog/view/', '', $path);

    $tpl = $this->common();

    $item = $this->app['db']->fetch('
      SELECT *
      FROM catalog
      WHERE id = %i
    ', $id);

    if (!$item) {
      return $this->app['/error']->get($request, 404);
    }


    //группа, подгруппа товара
    $item['group'] = $this->app['db']->fetch('
      SELECT * FROM catalog_groups WHERE id_1c = %s
    ', $item['group']);
    if ($item['group']['parent_id_1c']) {
      $item['subgroup'] = $this->app['db']->fetch('
        SELECT * FROM catalog_groups WHERE id_1c = %s
      ', $item['group']['parent_id_1c']);
    }


    //все фотографии
    //сначала ищем с конкретным цветом
    $photos = $this->app['db']->fetchAll('
/var/www/html/router.php
 
    //front контроллер
    if (empty($path)) $path = 'front';
 
    $path_parts = explode('/', $path);
    //части пути от длинной к короткой
    for ($i=count($path_parts); $i > 0; $i--) { 
      $guess_controller = '/'.implode('/', array_slice($path_parts, 0, $i));
 
      if (isset($this->app[$guess_controller])) { //нашли подходящий контролер
        $controller = $this->app[$guess_controller];
        //ищем подходящий метод
        $method_parts = array_merge([strtolower($method)], array_slice($path_parts, $i));
        for ($j=count($method_parts); $j > 0; $j--) {
          $guess_method = implode('_', array_slice($method_parts, 0, $j));
          if (method_exists($controller, $guess_method)) {
            if ($answer = $controller->pre_request($request)) return $answer; //pre_request
            $pre_method = 'pre_'.strtolower($method); if ($answer = $controller->$pre_method($request)) return $answer; //pre_get, pre_post...
            //return $controller->$guess_method($request);
            if ($ret = $controller->$guess_method($request)) return $ret;
          }
        }
      }
    }
 
    //контроллер по умолчанию
    if ($response = $this->app['/pages']->get($request)) return $response;
 
    //404
    return $this->app['/error']->get($request, 404);
 
  }
 
 
  /*public function process($request) {
 
    $method = $request->getMethod();
    $path = $request->getPathInfo();
    $path = trim($path, '/');
 
/var/www/html/public/index.php
<?php

    define('APP_START', microtime(true));

    $app = require_once __DIR__.'/../app.php';

  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpFoundation\Response;

    
  if (isset($whoops)) {
    $request = Request::createFromGlobals();
    $response = $app['router']->process($request);
  } else try {
    $request = Request::createFromGlobals();
    $response = $app['router']->process($request);
    } catch (Exception $e) {
    $response = new Response('An error occurred<br><pre>'.$e->getTraceAsString().'</pre>', 500);
    }

  $response->send();
    
  //if ($env != 'prod') echo '<!--' . (microtime(true)-APP_START) . ' sec -->';

Environment & details:

Key Value
Latest SQL query SELECT * FROM settings
Duration in sec
empty
empty
empty
empty
Key Value
_sf2_attributes Array ( )
_symfony_flashes Array ( )
_sf2_meta Array ( [u] => 1710845884 [c] => 1710845884 [l] => 0 )
Key Value
REDIRECT_STATUS 200
HTTP_HOST alfavit24.ru
HTTP_X_REAL_IP 34.228.7.237
HTTP_X_FORWARDED_FOR 34.228.7.237
HTTP_X_FORWARDED_PROTO https
HTTP_CONNECTION close
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE <address>Apache/2.4.38 (Debian) Server at alfavit24.ru Port 80</address>
SERVER_SOFTWARE Apache/2.4.38 (Debian)
SERVER_NAME alfavit24.ru
SERVER_ADDR 10.11.10.31
SERVER_PORT 80
REMOTE_ADDR 10.11.10.1
DOCUMENT_ROOT /var/www/html/public
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /var/www/html/public
SERVER_ADMIN webmaster@localhost
SCRIPT_FILENAME /var/www/html/public/index.php
REMOTE_PORT 32814
REDIRECT_URL /catalog/view/6635/73267
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.0
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /catalog/view/6635/73267
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710845884.9091
REQUEST_TIME 1710845884
empty
0. Whoops\Handler\PrettyPageHandler