Posted in core
5525
11:33 pm, December 13, 2018
 

Core Class - Basic Core Structure

A Core class that can be used as a base for all content types and uses the extend classes to define the database variables. So basically you can set up core class and then create sub extend classes to define everything easily. I wanted something where i could just add items into an array and they would auto be created in a database taking away some of the pain of creating table structures and all that kind of thing.

For each core extend it creates a new database file in sqlite, so each extend is contained in its own file. Im not sure how this degrades the site performance, but it seems to work ok so far.

When the rows of each database exceed 100,000 it seems to slow a bit in text searching but i would guess that this would happen most data bases that have text searching so it wouldnt make too much of a difference. 

This is just the core class structure i will add each core function seperately and explain each bit or just add the code. 

PHP

class core {

    public $status = "";
    public $nice_name = "Core";
    public $nice_description = "The Main Core";
    public $title_url_length = 100;
    public $images_enabled = true; // enable or disable the use of image links in this class

    public $db; // was private static
    public $db_directory = "/../db/";
    public $db_table_name = "core";
    public $db_file_location = ""; // can set manually if do not want to use default name. 

    public $add_to_menu = false; // add this class to the main menu

    protected $core_version = "core 1.0.1";
    
    // default database variables + array
    public $id;
    public $uid;
    public $insdate;
    public $title;
    public $additional;
    public $category;
    
    public $load_array = [
    "id",
    "uid",
    "insdate",
    "title",
    "additional",
    "category",
    ]; 

}

View Statistics
This Week
172
This Month
589
This Year
763

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown
Random CSS Property

<angle>

The <angle> CSS data type represents an angle value expressed in degrees, gradians, radians, or turns. It is used, for example, in <gradient>s and in some transform functions.
angle#rad css reference