[COSMIC] Project

Raizer

New Member
Messages
20
Likes
16
#1
Dear devbest members,

Introduction
In February this year I started developping on a Habbo CMS because most of the currently released CMS are deprecated and extremely bad programmed.
The project has stopped for a while because I started working for another retro called LeetHotel. Due to circumstances I quit Leet and decided to myself to continue with this project .

Leet Hotel also uses my framework at this moment but i changed the layout a bit to keep the originality.
I think this is a good start to continue the project, apart from the fact that we all know that retro's is already dying..

Before we start I want to say, thanks Metus for helping with this project and I wish you the best with you and your hotel.

AsteroidCMS
This framework has a total of 400 commit's and has undergone many changes and now we have reached a point where everyone can use it.
The most important part of the framework is of course the routing, I created my own in version 1 what I also announced [ To view this link you must register here. ] in the past.
But I chose to user the vendor [ To view this link you must register here. ] rounting because it is much more powerful than mine.

We use an MVC structure. Do you have no idea what this means exactly? On Google you can find a lot of information.
AsteroidCMS also uses middlewares for example a authentication, caching class and validation class.

You can add middleware very easy for example:
Code:
class Routes extends Router
{
    public static function init()
    {
       
        Router::PartialGroup('/', function () {
       
            Router::setDefaultNamespace('\App\Controllers');

            Router::get('/', 'Home\[email protected]')->setName('index.home')->addMiddleware(CacheMiddleware::class);
            Router::get('/home', 'Home\[email protected]')->addMiddleware(CacheMiddleware::class);
            Router::get('/lost', 'Home\[email protected]')->setName('lost');
         
    })->addMiddleware(AuthMiddleware::class);
}
Permission system has also been built with individual rights that you can assign to a specific role. Roles can also be created for your emulator and this is easy to manage in our housekeeping.
There is too much to mention what AsteroidCMS offers. You can find all of this later in a documentation.

Vendors
  • Composer project
  • Simple Validation class
Code:
    public function request()
    {
        $validate = request()->validator->validate([
            'username' => 'required|min:1|max:30',
            'password' => 'required|min:1|max:100',
            'pincode'  => 'max:6'
        ]);

        if (!$validate->isSuccess()) {
            exit;
        }
    }
  • Pecee Simple routing
  • Locale systeem (meerdere languages)
  • Twig template parser
  • Helpers
  • Page caching
  • Google 2FA authentication
  • QueryBuilder
Code:
public static function getAccessLogs($player_id, $limit = 100)
{
    return QueryBuilder::table('player_access')->where('player_id', $player_id)->limit($limit)->get();
}
Javascript
Instead of controlling a view in your controller, we have javascript for loading all the post/get requests.
This way it is possible to go in and out of the hotel without having page refresh.

Interfaces
  • Hotelmanager
  • Forms/Links handler
  • Post/Get requests
  • Customforms
  • Dialogmanager
  • Notificationmanager
Housekeeping
  • Permissions (Create: Roles, Add: Permissions)
  • Remote Control (View userdata, ban, alert & reset control) ( [ To view this link you must register here. ] )
    [ To view this link you must register here. ]
  • Room control + ban control
  • VPN control (block users based at ASN)
  • Wordfilter
  • Chatlogs
  • Banlogs
  • Stafflogs
  • Help tickets
  • FAQ manage
  • News manage
  • Shop manage
  • Catalog manage (edit your arcturus catalog).
  • Value manage

Release date
I think the release of my CMS is in 1 á 2 months.

Live preview
[ To view this link you must register here. ] asteroidcms.nl.


Friendly Regards,
Raizer.
 

Attachments

Last edited:

Wess

BYPASSING OVERRIDE
Staff member
FindRetros Moderator
Messages
3,786
Likes
2,124
#2
Thread approved. Looks good. Are you using a pre-made theme? It looks slick.

PS. Don't use Versio for hosting. Especially giving out their direct domain isn't the best idea with the amount of scriptkids around. If you get only one attack on it, they'll kick you from your servers.
 

Parsov

Active Member
Messages
189
Likes
118
#4
They been using it for a few months now on all 6 hotels, Someone from Leet said it was built with ASP though.
I hope to see this being released I like the layout. And I think it supports only Comet Emulator if i'm not wrong as Ryan uses Comet but it's easy to migrate.

Anyway always loved this layout keep up @Raizer! ;)
 

Wess

BYPASSING OVERRIDE
Staff member
FindRetros Moderator
Messages
3,786
Likes
2,124
#14
Repo is available! [ To view this link you must register here. ]
Had a quick look and it actually seems quite good, the only thing I don't get is why you're making everything a static function. It makes testabililty and maintainability a pure hell.
 

LeChris

Well-Known Member
Messages
2,646
Likes
1,235
#15
Had a quick look and it actually seems quite good, the only thing I don't get is why you're making everything a static function. It makes testabililty and maintainability a pure hell.
The functionality of the classes using static functions looks limited to the App/ directory from what I can see.

Chances are he's doing it to prevent needing to constantly make a new instance of the class to do the same functionality, when you can just use a static function. They're being used as individual functions served under a collection pretty much.

I would argue that it doesn't have any impact on testing.
[ To view this link you must register here. ]

You can easily assert that
  1. it finds a ban when it exists for the player
  2. it will exit with a bad status code if ban exists
  3. If staff it will store a log of the action
  4. if ban does not exist it calls both Session and Player with the right data

If you want to move away from static functions everywhere, look into dependency injection which can construct a new instance of the injected dependency for you automatically. Unsure how good PHP DI is, but on TS you can get some pretty good results
 

Wess

BYPASSING OVERRIDE
Staff member
FindRetros Moderator
Messages
3,786
Likes
2,124
#16
The functionality of the classes using static functions looks limited to the App/ directory from what I can see.

Chances are he's doing it to prevent needing to constantly make a new instance of the class to do the same functionality, when you can just use a static function. They're being used as individual functions served under a collection pretty much.

I would argue that it doesn't have any impact on testing.
[ To view this link you must register here. ]

You can easily assert that
  1. it finds a ban when it exists for the player
  2. it will exit with a bad status code if ban exists
  3. If staff it will store a log of the action
  4. if ban does not exist it calls both Session and Player with the right data

If you want to move away from static functions everywhere, look into dependency injection which can construct a new instance of the injected dependency for you automatically. Unsure how good PHP DI is, but on TS you can get some pretty good results
No, you can't easily assert that. I'm talking about unit testing. Static functions called in static functions breaks proper unit testing, besides that, using all those static methods are basically just globals. I know why one would use it, but still, it isn't the best idea. Besides that, I was asking the OP why, because it felt like he misunderstood facades from Laravel and tried to do the same.

Dependency injection is the way to go.

[ To view this link you must register here. ]
 

LeChris

Well-Known Member
Messages
2,646
Likes
1,235
#17
No, you can't easily assert that. I'm talking about unit testing. Static functions called in static functions breaks proper unit testing, besides that, using all those static methods are basically just globals. I know why one would use it, but still, it isn't the best idea. Besides that, I was asking the OP why, because it felt like he misunderstood facades from Laravel and tried to do the same.

Dependency injection is the way to go.

[ To view this link you must register here. ]
You can easily assert that. I test code all the time. It sounds like you may not like it because you can't test the mock interaction and instead now have to go E2E.

(PS, you can still override a static with a mock if you wanted to)
 

Wess

BYPASSING OVERRIDE
Staff member
FindRetros Moderator
Messages
3,786
Likes
2,124
#18
You can easily assert that. I test code all the time. It sounds like you may not like it because you can't test the mock interaction and instead now have to go E2E.

(PS, you can still override a static with a mock if you wanted to)
What...? You want to have proper unit tests besides E2E (integration) tests. Besides that, even the creator of PHPUnit advices against it, but who is he, we have Chris!
 

Raizer

New Member
Messages
20
Likes
16
#19
Wow haha.. Well DI is the best way to do that but in my opinion DI is not that good if you go for performance. But with this routing I can implement it easily. The reason I use static is because I think it works more efficiently and it keeps your code clean. it is purely based on that. And also, I never work with laravel because I like to discover and realize things by myself. I fully agree with Chris' first reaction, good to receive feedback from you guys, thanks!
 

LeChris

Well-Known Member
Messages
2,646
Likes
1,235
#20
To get fair, avoiding common design patterns for pre optimization isn’t ideal.

Compilers can optimize better than any human, so its best to design code for other humans reading.

I will agree that static is easier to follow because you’re not constantly making a new instance of the class.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top