CI_Unit_test::run()

run($test[, $expected = TRUE[, $test_name = 'undefined'[, $notes = '']]]) Parameters: $test (mixed) – Test data $expected (mixed) – Expected result $test_name (string) – Test name $notes (string) – Any notes to be attached to the test Returns: Test report Return type: string Runs unit tests.

Profiling Your Application

The Profiler Class will display benchmark results, queries you have run, and $_POST data at the bottom of your pages. This information can be useful during development in order to help with debugging and optimization. Initializing the Class Important This class does NOT need to be initialized. It is loaded automatically by the Output Library if profiling is enabled as shown below. Enabling the Profiler To enable the profiler place the following line anywhere within your Controller methods: $t

CI_DB_utility::repair_table()

repair_table($table_name) Parameters: $table_name (string) – Name of the table to repair Returns: Array of repair messages or FALSE on failure Return type: array Repairs a database table.

CI_DB_result::num_fields()

num_fields() Returns: Number of fields in the result set Return type: int Returns the number of fields in the result set. Usage: see Result Helper Methods.

Connecting to your Database

There are two ways to connect to a database: Automatically Connecting The “auto connect” feature will load and instantiate the database class with every page load. To enable “auto connecting”, add the word database to the library array, as indicated in the following file: application/config/autoload.php Manually Connecting If only some of your pages require database connectivity you can manually connect to your database by adding this line of code in any function where it is needed, or in your

CI_Loader::clear_vars()

clear_vars() Returns: CI_Loader instance (method chaining) Return type: CI_Loader Clears cached view variables.

CI_Input

class CI_Input $raw_input_stream Read only property that will return php://input data as is. The property can be read multiple times. post([$index = NULL[, $xss_clean = NULL]]) Parameters: $index (mixed) – POST parameter name $xss_clean (bool) – Whether to apply XSS filtering Returns: $_POST if no parameters supplied, otherwise the POST value if found or NULL if not Return type: mixed The first parameter will contain the name of the POST item you are looking for: $this->i

CI_DB_query_builder::flush_cache()

flush_cache() Returns: CI_DB_query_builder instance (method chaining) Return type: CI_DB_query_builder Empties the Query Builder cache.

CI_DB_forge::create_database()

create_database($db_name) Parameters: $db_name (string) – Name of the database to create Returns: TRUE on success, FALSE on failure Return type: bool Creates a new database. Usage: See Creating and Dropping Databases.

CI_DB_query_builder::not_group_start()

not_group_start() Returns: CI_DB_query_builder instance (method chaining) Return type: CI_DB_query_builder Starts a group expression, using AND NOTs for the conditions inside it.