Skip to content

Commit 957064e

Browse files
author
Dmytro Lukianenko
committed
Merge remote-tracking branch 'origin/3.5.x' into 3.5.x
2 parents 0eea7ad + 76cf432 commit 957064e

14 files changed

Lines changed: 2527 additions & 22 deletions

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,7 @@ Most significant, though, is **Evolution CMS's** ability to empower you to quick
3535

3636
## Install
3737
You can use the single click installer: [Evolution CMS Installer](https://github.com/evolution-cms/installer)
38-
Evolution CMS 3.3.x requires **PHP >= 8.3**
39-
40-
## Docker
41-
42-
Run command ```php core/artisan salo:install``` for generating **docker-compose.yml** file. And ```php core/artisan salo:build``` for build Docker container.
43-
44-
To run **Evolution CMS** using Docker, run the ```php core/artisan salo:up``` command in the terminal. Additional configuration and access options can be found in the **docker-compose.yml** file and the docker folder.
45-
46-
To stop the container, use the ```php core/artisan salo:down``` command.
47-
48-
#### For Windows
49-
50-
See documentation for install WSL https://learn.microsoft.com/en-us/windows/wsl/install-manual
38+
Evolution CMS 3.5.x requires **PHP >= 8.3**. Recommend **PHP >= 8.4**.
5139

5240
## References
5341

core/bootstrap.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33

44
require_once __DIR__ . '/vendor/autoload.php';
55

6-
$tmp = __DIR__ . '.install';
7-
define('EVO_INSTALL_TIME', is_readable($tmp) ? (int)file_get_contents($tmp) : 0);
8-
unset($tmp);
6+
if (!defined('EVO_INSTALL_TIME')) {
7+
$tmp = __DIR__ . '.install';
8+
define('EVO_INSTALL_TIME', is_readable($tmp) ? (int)file_get_contents($tmp) : 0);
9+
unset($tmp);
10+
}
911

1012
$envFile = __DIR__ . '/custom/.env';
1113
if (is_readable($envFile) && class_exists(Dotenv\Dotenv::class)) {

core/database/migrations/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

core/database/migrations/2025_12_25_000000_initial_schema.php

Lines changed: 701 additions & 0 deletions
Large diffs are not rendered by default.

core/database/seeders/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php namespace Database\Seeders;
2+
3+
use Illuminate\Database\Seeder;
4+
use Illuminate\Support\Facades\DB;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AdminUserTableSeeder extends Seeder
8+
{
9+
public function run(): void
10+
{
11+
if (!Schema::hasTable('users') || !Schema::hasTable('user_attributes')) {
12+
return;
13+
}
14+
15+
$username = (string) env('EVO_ADMIN_USERNAME', 'admin');
16+
$email = (string) env('EVO_ADMIN_EMAIL', 'admin@example.com');
17+
$password = (string) env('EVO_ADMIN_PASSWORD', 'admin');
18+
19+
$roleId = 1;
20+
if (Schema::hasTable('user_roles')) {
21+
$adminRoleId = DB::table('user_roles')->where('name', 'Administrator')->value('id');
22+
if ($adminRoleId !== null) {
23+
$roleId = (int) $adminRoleId;
24+
} else {
25+
$minRoleId = DB::table('user_roles')->min('id');
26+
if ($minRoleId !== null) {
27+
$roleId = (int) $minRoleId;
28+
}
29+
}
30+
}
31+
32+
$now = time();
33+
34+
DB::transaction(function () use ($username, $email, $password, $roleId, $now): void {
35+
$existingId = DB::table('users')->where('username', $username)->value('id');
36+
37+
$usersData = [
38+
'username' => $username,
39+
'password' => md5($password),
40+
'cachepwd' => '',
41+
'refresh_token' => null,
42+
'access_token' => null,
43+
'valid_to' => null,
44+
'verified_key' => null,
45+
];
46+
47+
$userId = null;
48+
if ($existingId !== null) {
49+
$userId = (int) $existingId;
50+
} else {
51+
$usersColumns = Schema::getColumnListing('users');
52+
$usersInsert = array_intersect_key($usersData, array_flip($usersColumns));
53+
$userId = (int) DB::table('users')->insertGetId($usersInsert);
54+
}
55+
56+
if ($userId <= 0) {
57+
return;
58+
}
59+
60+
$attributesData = [
61+
'internalKey' => $userId,
62+
'fullname' => $username,
63+
'first_name' => null,
64+
'last_name' => null,
65+
'middle_name' => null,
66+
'role' => $roleId,
67+
'email' => $email,
68+
'phone' => '',
69+
'mobilephone' => '',
70+
'blocked' => 0,
71+
'blockeduntil' => 0,
72+
'blockedafter' => 0,
73+
'logincount' => 0,
74+
'lastlogin' => 0,
75+
'thislogin' => 0,
76+
'failedlogincount' => 0,
77+
'sessionid' => '',
78+
'dob' => null,
79+
'gender' => 0,
80+
'country' => '',
81+
'street' => '',
82+
'city' => '',
83+
'state' => '',
84+
'zip' => '',
85+
'fax' => '',
86+
'photo' => '',
87+
'comment' => null,
88+
'createdon' => $now,
89+
'editedon' => $now,
90+
'verified' => 1,
91+
];
92+
93+
$attributesColumns = Schema::getColumnListing('user_attributes');
94+
$attributesInsert = array_intersect_key($attributesData, array_flip($attributesColumns));
95+
96+
$attributesExists = DB::table('user_attributes')->where('internalKey', $userId)->exists();
97+
if (!$attributesExists) {
98+
DB::table('user_attributes')->insert($attributesInsert);
99+
}
100+
});
101+
}
102+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php namespace Database\Seeders;
2+
3+
use Illuminate\Database\Seeder;
4+
use Illuminate\Support\Facades\DB;
5+
use EvolutionCMS\Models\SiteContent;
6+
7+
class SiteContentTableSeeder extends Seeder
8+
{
9+
/**
10+
* Run the database seeds.
11+
*
12+
* @return void
13+
*/
14+
public function run(): void
15+
{
16+
DB::table('site_content')->delete();
17+
$resource = SiteContent::create(
18+
[
19+
'type' => 'document',
20+
'contentType' => 'text/html',
21+
'pagetitle' => 'Evolution CMS Install Success',
22+
'longtitle' => 'Welcome to the Evolution CMS Content Management System',
23+
'description' => '',
24+
'alias' => 'minimal-base',
25+
'link_attributes' => '',
26+
'published' => 1,
27+
'pub_date' => 0,
28+
'unpub_date' => 0,
29+
'parent' => 0,
30+
'isfolder' => 0,
31+
'introtext' => '',
32+
'content' => '<h3>Install Successful!</h3>
33+
<p>You have successfully installed Evolution CMS.</p>
34+
35+
<h3>Getting Help</h3>
36+
<p>The <a href="http://evo.im/" target="_blank">Evolution CMS Community</a> provides a great starting point to learn all things Evolution CMS, or you can also <a href="http://evo.im/">see some great learning resources</a> (books, tutorials, blogs and screencasts).</p>
37+
<p>Welcome to Evolution CMS!</p>
38+
',
39+
'richtext' => 1,
40+
'template' => 1,
41+
'searchable' => 1,
42+
'cacheable' => 1,
43+
'createdby' => 1,
44+
'createdon' => time(),
45+
'editedby' => 1,
46+
'editedon' => time(),
47+
'deleted' => 0,
48+
'deletedon' => 0,
49+
'deletedby' => 0,
50+
'publishedon' => time(),
51+
'publishedby' => 1,
52+
'menutitle' => 'Base Install',
53+
'hide_from_tree' => 0,
54+
'privateweb' => 0,
55+
'privatemgr' => 0,
56+
'content_dispo' => 0,
57+
'hidemenu' => 0,
58+
'alias_visible' => 1,
59+
]);
60+
$resource->save();
61+
}
62+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php namespace Database\Seeders;
2+
3+
use Illuminate\Database\Seeder;
4+
use Illuminate\Support\Facades\DB;
5+
6+
class SiteTemplatesTableSeeder extends Seeder
7+
{
8+
/**
9+
* Run the database seeds.
10+
*
11+
* @return void
12+
*/
13+
public function run(): void
14+
{
15+
DB::table('site_templates')->delete();
16+
DB::table('site_templates')->insert([
17+
[
18+
'templatename' => 'Minimal Template',
19+
'templatealias' => '',
20+
'description' => 'Default minimal empty template (content returned only)',
21+
'editor_type' => 0,
22+
'category' => 0,
23+
'icon' => '',
24+
'template_type' => 0,
25+
'content' => '[*content*]',
26+
'locked' => 0,
27+
'selectable' => 1,
28+
'createdon' => 0,
29+
'editedon' => 0,
30+
],
31+
]);
32+
}
33+
}

0 commit comments

Comments
 (0)