[COSMIC] Project

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
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.
 

Raizer

Active Member
Feb 21, 2019
145
76
Version 1.0 stable has been released. We added new features, for example (marketplace at the website) connected with RCON. Forum's integrated with habbo groups. We fixed also alot of bugs and upgrade the layout a bit.
 

habtard

Member
Jan 30, 2020
32
30
I mean by the standards of this community, its okay. There's a couple of things I want to mention which have probably already been said so I'll keep it brief.

Everything is static, which means it has a global mutable state. Being able to call the static method which holds state is the worst. If you want to know why globals are so bad, create a small method which calls ::getInstance on some class and load some global, then challenge yourself to write a unit test.

Echo and exit, its probably better if you throw some kind of exception here. It's rarely a good idea to kill the script like that.

You wrote a class which judging from your documentation is a session handler. You don't have any custom logic in this class so it seems like you're over complicating it. Lots of little useless blocks of code here, like checking if a session has been started before destroying it, which PHP probably already does under the hood. Especially when you're calling session_start early in your script, before even initiating the handler class.

Start following PSR-7, your coding conventions are all over the place.

You're using echo to print views or "responses" to route callbacks, might be a better option to return actual HTTP responses.

You switched to SimpleRoute for a more powerful router, but you're using less than half of its features. I would spend time writing your own router, with only the features you're actually using if you cared that much.

I would also suggest you avoid using require_once, its generally only good to avoid something accidentally being redeclared in multiple libraries.

Constant use of __DIR__, create a define("DIR", __DIR__); and start using a constant.

There's lots more but I won't go on.
 
Last edited:

Ekalus

New Member
Mar 27, 2020
29
4
Love the CMS. In housekeeping I cannot save anything in housekeeping (news articles, permissions, etc) , making a helptool ticket doesnt show up in housekeeping, but does show in database.
 

Ekalus

New Member
Mar 27, 2020
29
4
Because you using xampp and xampp authorization headers are disabled by default
Thank you! It worked for a bit. Now it cannot find assets/js/web/user_settings.js I tried installing it again, but it keeps giving the loading screen when I want to visit the website
 

Raizer

Active Member
Feb 21, 2019
145
76
Thank you! It worked for a bit. Now it cannot find assets/js/web/user_settings.js I tried installing it again, but it keeps giving the loading screen when I want to visit the website
And whats the error.. its a fake route so yes it doesnt exists, but its still there.
 

Raizer

Active Member
Feb 21, 2019
145
76
It works just follow the steps
Post automatically merged:

Cosmic has alot of updates already but it is too much to write. The best update so far is that you are now able to manage the catalogue from the housekeeping. With a simple, drag & drop system you can order the catalogue in a visual way.




Cosmic is also now compitable with php 8.0.1. and version 3 of cosmic is also under construction with a new layout and framework. Also i'm working on Circinus, frontend project builded with typescript +vue and mobx, which is builded for Ares backend. Follow the thread here:

Get Cosmic here
 
Last edited:

Users who are viewing this thread

Top