Skip to content

Commit 5cf5784

Browse files
committed
update typerocket core and bump version 5.1.12
1 parent 8af26d7 commit 5cf5784

File tree

15 files changed

+318
-47
lines changed

15 files changed

+318
-47
lines changed

typerocket-v5.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: TypeRocket - Andromeda
44
Plugin URI: https://typerocket.com/
55
Description: TypeRocket is a framework that joins refined UI elements and modern programming architecture together.
6-
Version: 5.1.11
6+
Version: 5.1.12
77
Requires at least: 6.0
88
Requires PHP: 7.4
99
Author: TypeRocket
@@ -34,7 +34,7 @@ public function __construct()
3434
return;
3535
}
3636

37-
define('TYPEROCKET_PLUGIN_VERSION', '5.1.11');
37+
define('TYPEROCKET_PLUGIN_VERSION', '5.1.12');
3838
define('TYPEROCKET_PLUGIN_INSTALL', __DIR__);
3939

4040
if(!defined('TYPEROCKET_ROOT_WP'))

typerocket/composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typerocket/vendor/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@
11091109
'TypeRocket\\Database\\ResultsPostMeta' => $vendorDir . '/typerocket/core/src/Database/ResultsPostMeta.php',
11101110
'TypeRocket\\Database\\ResultsTermMeta' => $vendorDir . '/typerocket/core/src/Database/ResultsTermMeta.php',
11111111
'TypeRocket\\Database\\ResultsUserMeta' => $vendorDir . '/typerocket/core/src/Database/ResultsUserMeta.php',
1112+
'TypeRocket\\Database\\SqlRaw' => $vendorDir . '/typerocket/core/src/Database/SqlRaw.php',
11121113
'TypeRocket\\Database\\SqlRunner' => $vendorDir . '/typerocket/core/src/Database/SqlRunner.php',
11131114
'TypeRocket\\Elements\\BaseFields' => $vendorDir . '/typerocket/core/src/Elements/BaseFields.php',
11141115
'TypeRocket\\Elements\\BaseForm' => $vendorDir . '/typerocket/core/src/Elements/BaseForm.php',

typerocket/vendor/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,7 @@ class ComposerStaticInit1ea299e54fdefaef41f855b3138bc6c1
12171217
'TypeRocket\\Database\\ResultsPostMeta' => __DIR__ . '/..' . '/typerocket/core/src/Database/ResultsPostMeta.php',
12181218
'TypeRocket\\Database\\ResultsTermMeta' => __DIR__ . '/..' . '/typerocket/core/src/Database/ResultsTermMeta.php',
12191219
'TypeRocket\\Database\\ResultsUserMeta' => __DIR__ . '/..' . '/typerocket/core/src/Database/ResultsUserMeta.php',
1220+
'TypeRocket\\Database\\SqlRaw' => __DIR__ . '/..' . '/typerocket/core/src/Database/SqlRaw.php',
12201221
'TypeRocket\\Database\\SqlRunner' => __DIR__ . '/..' . '/typerocket/core/src/Database/SqlRunner.php',
12211222
'TypeRocket\\Elements\\BaseFields' => __DIR__ . '/..' . '/typerocket/core/src/Elements/BaseFields.php',
12221223
'TypeRocket\\Elements\\BaseForm' => __DIR__ . '/..' . '/typerocket/core/src/Elements/BaseForm.php',

typerocket/vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,17 +2720,17 @@
27202720
},
27212721
{
27222722
"name": "typerocket/core",
2723-
"version": "v5.1.30",
2724-
"version_normalized": "5.1.30.0",
2723+
"version": "v5.1.36",
2724+
"version_normalized": "5.1.36.0",
27252725
"source": {
27262726
"type": "git",
27272727
"url": "https://github.com/TypeRocket/core.git",
2728-
"reference": "3e1e2f85d459927a7224e681d012ec6eb973dec8"
2728+
"reference": "c589a9710285ada75dabcd5f123ae45935583697"
27292729
},
27302730
"dist": {
27312731
"type": "zip",
2732-
"url": "https://api.github.com/repos/TypeRocket/core/zipball/3e1e2f85d459927a7224e681d012ec6eb973dec8",
2733-
"reference": "3e1e2f85d459927a7224e681d012ec6eb973dec8",
2732+
"url": "https://api.github.com/repos/TypeRocket/core/zipball/c589a9710285ada75dabcd5f123ae45935583697",
2733+
"reference": "c589a9710285ada75dabcd5f123ae45935583697",
27342734
"shasum": ""
27352735
},
27362736
"require": {
@@ -2744,7 +2744,7 @@
27442744
"require-dev": {
27452745
"phpunit/phpunit": "^9.5"
27462746
},
2747-
"time": "2022-09-02T14:58:01+00:00",
2747+
"time": "2022-09-03T00:23:16+00:00",
27482748
"type": "library",
27492749
"installation-source": "dist",
27502750
"autoload": {
@@ -2773,7 +2773,7 @@
27732773
"support": {
27742774
"docs": "https://typerocket.com/docs/v5/",
27752775
"issues": "https://github.com/TypeRocket/core/issues",
2776-
"source": "https://github.com/TypeRocket/core/tree/v5.1.30"
2776+
"source": "https://github.com/TypeRocket/core/tree/v5.1.36"
27772777
},
27782778
"install-path": "../typerocket/core"
27792779
},

typerocket/vendor/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'typerocket/typerocket',
44
'pretty_version' => 'dev-main',
55
'version' => 'dev-main',
6-
'reference' => '16d7b32849959ed21b03dd89cd2b89093f607555',
6+
'reference' => '8af26d78efedd20566140445c9d388c3834a0913',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -368,9 +368,9 @@
368368
'dev_requirement' => true,
369369
),
370370
'typerocket/core' => array(
371-
'pretty_version' => 'v5.1.30',
372-
'version' => '5.1.30.0',
373-
'reference' => '3e1e2f85d459927a7224e681d012ec6eb973dec8',
371+
'pretty_version' => 'v5.1.36',
372+
'version' => '5.1.36.0',
373+
'reference' => 'c589a9710285ada75dabcd5f123ae45935583697',
374374
'type' => 'library',
375375
'install_path' => __DIR__ . '/../typerocket/core',
376376
'aliases' => array(),
@@ -379,7 +379,7 @@
379379
'typerocket/typerocket' => array(
380380
'pretty_version' => 'dev-main',
381381
'version' => 'dev-main',
382-
'reference' => '16d7b32849959ed21b03dd89cd2b89093f607555',
382+
'reference' => '8af26d78efedd20566140445c9d388c3834a0913',
383383
'type' => 'library',
384384
'install_path' => __DIR__ . '/../../',
385385
'aliases' => array(),

typerocket/vendor/typerocket/core/src/Database/Query.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,10 @@ protected function compileTable()
14391439
*/
14401440
protected function tickSqlName($column)
14411441
{
1442+
if($column instanceof SqlRaw) {
1443+
return $column;
1444+
}
1445+
14421446
$c = preg_replace($this->columnPattern, '', $column);
14431447

14441448
if(!Str::contains('`', $column)) {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace TypeRocket\Database;
4+
5+
class SqlRaw
6+
{
7+
protected string $sql = '';
8+
9+
/**
10+
* SQL Raw constructor.
11+
*
12+
* @param string $sql
13+
*/
14+
public function __construct(string $sql)
15+
{
16+
$this->sql = $sql;
17+
}
18+
19+
/**
20+
* To String
21+
*
22+
* @return string|null
23+
*/
24+
public function __toString()
25+
{
26+
return $this->sql;
27+
}
28+
29+
/**
30+
* @param mixed ...$args
31+
*
32+
* @return static
33+
*/
34+
public static function new(...$args)
35+
{
36+
return new static(...$args);
37+
}
38+
}

typerocket/vendor/typerocket/core/src/Models/Model.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,54 @@ public function count($column = null)
16911691
return $this->query->count($column);
16921692
}
16931693

1694+
/**
1695+
* Sum
1696+
*
1697+
* @param string $column
1698+
*
1699+
* @return array|bool|false|int|null|object
1700+
*/
1701+
public function sum( $column )
1702+
{
1703+
return $this->query->sum($column);
1704+
}
1705+
1706+
/**
1707+
* Min
1708+
*
1709+
* @param string $column
1710+
*
1711+
* @return array|bool|false|int|null|object
1712+
*/
1713+
public function min( $column )
1714+
{
1715+
return $this->query->min($column);
1716+
}
1717+
1718+
/**
1719+
* Max
1720+
*
1721+
* @param string $column
1722+
*
1723+
* @return array|bool|false|int|null|object
1724+
*/
1725+
public function max( $column )
1726+
{
1727+
return $this->query->max($column);
1728+
}
1729+
1730+
/**
1731+
* Average
1732+
*
1733+
* @param string $column
1734+
*
1735+
* @return array|bool|false|int|null|object
1736+
*/
1737+
public function avg( $column )
1738+
{
1739+
return $this->query->avg($column);
1740+
}
1741+
16941742
/**
16951743
* Select only specific columns
16961744
*

typerocket/vendor/typerocket/core/src/Models/WPUser.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ public function posts( $modelClass = WPPost::class )
9999
return $this->hasMany( $modelClass, 'post_author');
100100
}
101101

102+
/**
103+
* @param $capability
104+
*
105+
* @return Model|WPUser
106+
*/
107+
public function whereCapabilityLike($capability)
108+
{
109+
return $this->whereMeta( 'wp_capabilities', 'like', '%:"'.$capability.'";%' );
110+
}
111+
102112
/**
103113
* Find WP_User Instance
104114
*

0 commit comments

Comments
 (0)