-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
###System Requirements
THINKer has been tested with PHP 5.4 and above and MySQL 5.4 and above. It is platform independent.
###Development Environments
You will need a web and database server to develop using the THINKer Framework. For development environments, XAMPP is recommended as it provides lightweight Apache and MySQL server applications. Download and install it with Apache, PHP, and MySQL using all of the default settings. Note the installation directory (PCs are usually C:\xampp, Macs are /Applications/XAMPP/xamppfiles/). The web root for XAMPP installations is the 'htdocs' directory in there.
###Production/Test Environments
Your production and test environments should be identical, down to the specific versions of software you're using. In a tight-budget scenario you can get away with not having a test server, but it is highly recommended to have one. The different between the two instances is that Test should be running the development copy of your code, whereas the Production server should have the current stable release of your code.
I recommend using the latest LTS build of Ubuntu Server running the most recent versions of Apache2 and MySQL Server. You can optimize them as needed - THINKer does not need any additional modules in its initial state.
If you're creating a brand-new application, you must first install Composer. Then, navigate to your web root (wherever you store your web files) and run composer create-project corygehr/thinker -s dev ./{applicationDirectoryName}
. This should automatically download the required libraries. Say 'yes' when it asks to remove the existing VCS.
If you're working an an existing project, you can clone the repository locally, and then run composer install
within the application's directory to download the necessary libraries.
You will need to point your web server to at the 'www' directory inside of the framework's root directory, as this is where index.php lies.
There are two primary configuration files, located in shared/config:
- system.ini
- Contains the core system configuration information
- database.ini
- Contains connection information for databases used by every application
Each of these has a 'configtemplate' to accompany it in this directory, which can be used as a fallback or to customize your installation further.
Additionally, each application has its own configuration file called 'application.ini' as well as a separate 'database.ini' file for database connections that should only be used by that particular application. These are located in the 'config' directory in the application root.
Below are all of the configuration options for system.ini:
- core
- Primary System Configuration Options
- application
- The default application to load.
- Ex. thinkerfw
- environment
- Application environment
- Ex: Test, Production, Staging
- application
- Primary System Configuration Options
- applications
- This is where you register every application being used by the framework, along with its entry point. The entry point is typically the domain or IP address which selects the application, and the right side of the '=' is the name of the directory where the application resides within the framework's root.
- In most cases, you'll just have one application. The only time you'll want more than one is if you want an additional application which shares much of the functionality as the original, but you want to access it differently (ex. a site that has an internal and external portal).
- Ex.
- localhost = thinkerfw-internal
- localhost:8000 = thinkerfw-external
Each bracketed section in the ini is considered a separate connection. All database connections used should appear here.
- driver
- Database Application (must be supported by PDO)
- Ex: mysql
- host
- Hostname of database
- Ex: localhost
- port
- Port for database application
- Ex: 3306
- user
- Username for connection
- Ex: thinker
- password
- Password for connection
- schema
- Schema (database) to use by default
- Ex: thinker
- auto_connect
- Automatically connect to this database on page load
- true/false
- Use this if the database connection needs to be used by a majority of the pages on the site
##application.ini
Application-specific settings
- general
- General application settings
- directory
- Name of the directory containing the application
- namespace
- Namespace used by the application
- base_url
- Base URL of the application, used when creating URLs for it
- use_ssl
- HTTP/S setting. Application uses HTTPS when true
- default_section
- Section to load by default when none is specified in the URL
- session_class
- Class to use for Session Handling
- view
- Application view settings
- default_view
- Default View class to use
- view-html
- Html view settings
- template
- Html template to use for the application
THINKer Framework + Libraries Copyright © Cory Gehr. All rights reserved.