Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Typo

givanz51f60f5dfeef
diff --git a/system/cache/memcached.php b/system/cache/memcached.php
index dc4b7e8..c0c22b0 100755
--- a/system/cache/memcached.php
+++ b/system/cache/memcached.php
@@ -66,7 +66,7 @@ class Memcached {
public function getMulti($namespace, $keys, $serverKey = false) {
if ($serverKey) {
- return $this->memcached->getMultiByKey($serverKey, $key);
+ return $this->memcached->getMultiByKey($serverKey, $keys);
} else {
return $this->memcached->getMulti($keys);
}
diff --git a/system/cache/redis.php b/system/cache/redis.php
index a3056a0..a08bee2 100755
--- a/system/cache/redis.php
+++ b/system/cache/redis.php
@@ -27,6 +27,8 @@ class Redis {
private $redis;
+ private $cachePrefix = ''; //'cache.';
+
private $options = ['expire' => 3000, 'prefix' => 'vvveb.'];
public function __construct($options) {
@@ -39,7 +41,7 @@ class Redis {
$this->redis->pconnect($this->options['host'], $this->options['port']);
if (isset($this->options['password'])) {
- $redis->auth($this->options['password']);
+ $this->redis->auth($this->options['password']);
}
}
diff --git a/system/component/component.php b/system/component/component.php
index ac409bd..0aecfcb 100644
--- a/system/component/component.php
+++ b/system/component/component.php
@@ -292,7 +292,7 @@ class Component {
$this->components = NULL;
if ($notFound404) {
- FrontController::notFound(false);
+ \Vvveb\System\Core\FrontController::notFound(false);
}
}
@@ -457,7 +457,7 @@ class Component {
//save options
foreach ($opts as $name => $option) {
if (in_array($name, $validOptions) && isset($option) !== false) {
- if ((isset($option[0]) && ($option[0] == '{')) || (strpos($option, ',') !== false)) {
+ if ((isset($option[0]) && ($option[0] == '{' || $option[0] == '[')) || (strpos($option, ',') !== false)) {
$options[$name] = json_decode($option, 1);
} else {
$options[$name] = $option;
diff --git a/system/core/frontcontroller.php b/system/core/frontcontroller.php
index 45b9148..3f5eaf6 100755
--- a/system/core/frontcontroller.php
+++ b/system/core/frontcontroller.php
@@ -77,7 +77,7 @@ class FrontController {
return self :: $status;
}
- static private function callAction($module, $action = 'index') {
+ static private function callAction($controller, $action = 'index') {
//header(' ', true, $statusCode);
if (include_once DIR_APP . DS . 'controller' . DS . "$controller.php") {
$controller = 'Vvveb\Controller\\' . $controller;
diff --git a/system/db/dbdriver.php b/system/db/dbdriver.php
index 7b43ef0..39abb53 100755
--- a/system/db/dbdriver.php
+++ b/system/db/dbdriver.php
@@ -26,6 +26,8 @@ define('SQL_VAR_REGEX',
'/:([a-zA-Z0-9\[][\.\'a-zA-Z0-9\[\]_-]+)/ms');
class DBDriver {
+ protected $quote;
+
public function _filter($data, $columns, $addMissingDefaults = false) {
//remove fields that are not table columns, $colums is returned by sqlp->getColumnsMeta()
foreach ($data as $key => $name) {
@@ -295,8 +297,8 @@ class DBDriver {
if (is_array($value)) {
$value = var_export($value, 1);
} else {
- if (! is_numeric($value)) {
- $value = "'$value'";
+ if (! is_numeric($value)) {
+ $value = "'$value'";
}
}
diff --git a/system/db/mysqli.php b/system/db/mysqli.php
index f541aff..a6e0abc 100755
--- a/system/db/mysqli.php
+++ b/system/db/mysqli.php
@@ -47,6 +47,7 @@ class mysqli_result {
public function fetch_assoc() {
//$meta = $this->stmt->store_result();
$meta = $this->stmt->result_metadata();
+ $row = [];
while ($field = $meta->fetch_field()) {
$params[] = &$row[$field->name];
@@ -55,6 +56,8 @@ class mysqli_result {
call_user_func_array([$this->stmt, 'bind_result'], $params);
while ($this->stmt->fetch()) {
+ $c = [];
+
foreach ($row as $key => $val) {
$c[$key] = $val;
}
@@ -62,7 +65,7 @@ class mysqli_result {
}
//$this->stmt->free_result();
- $this->stmt->close();
+ //$this->stmt->close();
return $result;
}
@@ -250,6 +253,16 @@ class Mysqli extends DBDriver {
return "LIMIT $start, $limit";
}
+ public function fetchArray($stmt) {
+ $result = $stmt->get_result();
+
+ if ($result) {
+ return $result->fetch_array(MYSQLI_ASSOC);
+ }
+
+ return [];
+ }
+
public function fetchAll($stmt) {
$result = $stmt->get_result();
diff --git a/system/db/pgsql.php b/system/db/pgsql.php
index 3c2d288..bdc5bb3 100755
--- a/system/db/pgsql.php
+++ b/system/db/pgsql.php
@@ -157,6 +157,16 @@ class Pgsql extends DBDriver {
return "LIMIT $limit OFFSET $start";
}
+ public function fetchArray(&$result) {
+ if (pg_num_rows($result)) {
+ $values = pg_fetch_assoc($result);
+
+ return $values;
+ }
+
+ return [];
+ }
+
public function fetchAll(&$result) {
if (pg_num_rows($result)) {
$values = pg_fetch_all($result);
@@ -212,7 +222,7 @@ class Pgsql extends DBDriver {
}
public function get_one($query, $parameters = null) {
- $res = $this->exec($query, $parameters);
+ $res = $this->query($query, $parameters);
if (pg_num_rows($res)) {
return pg_fetch_result($res, 0, 0);
@@ -222,7 +232,7 @@ class Pgsql extends DBDriver {
}
function get_row($query, $parameters) {
- $res = $this->exec($query . ' LIMIT 1', $parameters);
+ $res = $this->query($query . ' LIMIT 1', $parameters);
if ($res === null) {
$res = $this->last_res;
@@ -238,7 +248,7 @@ class Pgsql extends DBDriver {
}
public function get_all($query, $parameters = null) {
- $res = $this->exec($query, $parameters);
+ $res = $this->query($query, $parameters);
if (pg_num_rows($res)) {
$values = pg_fetch_all($res);
diff --git a/system/extensions/extensions.php b/system/extensions/extensions.php
index 2675c78..4cd6fd9 100755
--- a/system/extensions/extensions.php
+++ b/system/extensions/extensions.php
@@ -39,6 +39,10 @@ abstract class Extensions {
static protected $baseDir = 'extension';
+ static protected $url;
+
+ static protected $feedUrl;
+
const KEY_VALUE_REGEX = '/^([\w ]+):\s+(.+)$/m';
static function getParams($comments) {
diff --git a/system/extensions/themes.php b/system/extensions/themes.php
index ee6c616..afed567 100755
--- a/system/extensions/themes.php
+++ b/system/extensions/themes.php
@@ -24,7 +24,7 @@ namespace Vvveb\System\Extensions;
use \Vvveb\System\Event;
use \Vvveb\System\Sites;
-use Vvveb\__;
+use function Vvveb\__;
use Vvveb\System\Functions\Str;
class Themes extends Extensions {
@@ -52,6 +52,7 @@ class Themes extends Extensions {
$list = glob(DIR_ROOT . '/public/themes/*/index.html');
$themes = [];
+
foreach ($list as $file) {
$folder = Str::match('@/([^/]+)/[a-z]+.\w+$@', $file);
$dir = Str::match('@(.+)/[a-z]+.\w+$@', $file);
diff --git a/system/import/rss.php b/system/import/rss.php
index 2a58367..9d3fba4 100755
--- a/system/import/rss.php
+++ b/system/import/rss.php
@@ -24,9 +24,11 @@ namespace Vvveb\System\Import;
#[\AllowDynamicProperties]
class Rss {
- private $dom;
+ private $dom;
- private $xpath;
+ private $xpath;
+
+ private $rss;
private $importXMLOptions = LIBXML_NOBLANKS |
LIBXML_COMPACT |
diff --git a/system/import/sql.php b/system/import/sql.php
index 013e407..2e9ec31 100755
--- a/system/import/sql.php
+++ b/system/import/sql.php
@@ -26,7 +26,9 @@ use function Vvveb\globBrace;
#[\AllowDynamicProperties]
class Sql {
- public $db;
+ private $db;
+
+ private $prefix;
function __construct($driver = DB_ENGINE, $host = DB_HOST, $dbname = DB_NAME, $user = DB_USER, $pass = DB_PASS, $port = DB_PASS, $prefix = DB_PREFIX) {
$this->sqlPath = DIR_ROOT . "install/sql/$driver/";
@@ -159,7 +161,7 @@ class Sql {
//try to speed up install
$query = 'pragma journal_mode = WAL;pragma synchronous = normal;pragma temp_store = memory;pragma mmap_size = 30000000000;PRAGMA writable_schema = 1;';
$this->db->query($query , 'journal_mode WAL');
-
+
//check if sql file has minimum version and if current version is supported
//$currentVersion = \SQLite3::version()['versionString'] ?? '3.0.0';
//$fts5Support = (version_compare($currentVersion,'3.9.0') >= 0);
diff --git a/system/sqlp/lexer.php b/system/sqlp/lexer.php
index 89db9e4..7bc2a5d 100755
--- a/system/sqlp/lexer.php
+++ b/system/sqlp/lexer.php
@@ -43,7 +43,7 @@ class Lexer {
while (isset($string[$offset])) {
if (! preg_match($this->regex, $string, $matches, 0, $offset)) {
- throw new Exception(sprintf('Unexpected character "%s" at offset %d', $string[$offset], $offset));
+ throw new \Exception(sprintf('Unexpected character "%s" at offset %d', $string[$offset], $offset));
}
// find the first non-empty element (but skipping $matches[0]) using a quick for loop
diff --git a/system/sqlp/sqlp.php b/system/sqlp/sqlp.php
index ba3524b..18902b5 100755
--- a/system/sqlp/sqlp.php
+++ b/system/sqlp/sqlp.php
@@ -27,7 +27,7 @@ use Vvveb\System\Db;
define('TAB', "\n\n\t\t");
#[\AllowDynamicProperties]
-class SqlP {
+class Sqlp {
private $types = ['int' => 'i', 'double' => 'd', 'decimal' => 'd', 'blob' => 'b', 'array' => 'a'/*, 'CHAR' => 's'*/];
private $prefix = DB_PREFIX;
@@ -36,6 +36,16 @@ class SqlP {
private $tree = [];
+ private $db;
+
+ private $namespace;
+
+ private $model;
+
+ private $modelName;
+
+ private $filename;
+
function __construct() {
$this->db = Db::getInstance();
$this->config = include 'config.php';
diff --git a/system/user/role.php b/system/user/role.php
index dd45816..bffdd47 100755
--- a/system/user/role.php
+++ b/system/user/role.php
@@ -93,13 +93,6 @@ class Role {
}
}
- public static function add($permission) {
- }
-
- public static function getTree() {
- $list = $this->getControllerList();
- }
-
public static function mkmap($dir, &$path = []) {
if ($dir[0] == '.') {
return;