Posted in core
5536
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
183
This Month
600
This Year
774

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
1. Show your work to the world instead of keeping in your head💆. 2. Do the work consistently👌 3. Respect your work🥰 4. Don't postpone your work 5. Make mistakes 🔥🔥🔥
Unknown
Random CSS Property

repeating-linear-gradient()

The repeating-linear-gradient() CSS function creates an image consisting of repeating linear gradients. It is similar to linear-gradient() and takes the same arguments, but it repeats the color stops infinitely in all directions so as to cover its entire container. The function's result is an object of the <gradient> data type, which is a special kind of <image>.
repeating-linear-gradient() css reference