In OAuth, what is the difference between an access token and a refresh token?

  • A string representing the resource owner's authorization grant
  • A token issued to the client to access protected resources
  • A token that contains information about the user
  • A token used to obtain a new access token
In OAuth, an access token is used to access a resource, while a refresh token is used to obtain a new access token when the original one expires. The refresh token provides a way to maintain access without requiring the user to re-authenticate.

Which directory contains the primary index.php file that serves as the entry point for a CodeIgniter application?

  • application
  • public
  • root
  • system
The primary index.php file that serves as the entry point for a CodeIgniter application is located in the 'public' directory. This file initializes the framework and routes incoming requests to the appropriate controllers. It is essential for the proper functioning of the CodeIgniter application.

For advanced debugging and logging, developers can utilize the ________ directory in CodeIgniter.

  • application
  • config
  • logs
  • system
In CodeIgniter, the 'logs' directory is crucial for advanced debugging and logging. It contains log files that provide valuable information for identifying and troubleshooting issues in the application. Developers can find detailed error messages and system activity logs here.

For a project requiring a database to be populated with specific types of data for testing, the developer would use ________.

  • Controller
  • Database Seeder
  • Model
  • Query Builder
CodeIgniter provides a Database Seeder feature that allows developers to populate the database with specific data for testing purposes. This ensures a controlled environment for testing and validating various scenarios.

To optimize a search feature, a CodeIgniter Model might use ________ to filter results.

  • Active Record
  • Controller
  • Libraries
  • Routing
CodeIgniter's Active Record feature allows the Model to easily filter and retrieve specific data from the database, making it a suitable choice for optimizing search features in an application.

How does pagination improve the performance of a CodeIgniter application with large datasets?

  • By loading all data at once
  • By minimizing the use of controllers
  • By reducing the number of database queries
  • By using external APIs for data retrieval
Pagination in CodeIgniter improves performance by reducing the number of database queries. It fetches and displays only the required data for each page, optimizing resource usage and enhancing overall application speed.

For advanced transaction handling, CodeIgniter provides the ________ feature to manage complex scenarios.

  • Isolation Levels
  • Nested Transactions
  • Savepoints
  • Transaction Guard
CodeIgniter provides the "Savepoints" feature for advanced transaction handling. Savepoints allow you to set points within a transaction to which you can later roll back if needed. This is especially useful for managing complex scenarios where certain parts of a transaction may need to be rolled back independently.

To enhance security, a developer implements a feature that checks the referrer header and token validity. This technique is known as ________.

  • CSRF Protection
  • Cross-Origin Security
  • Header Validation
  • Token Authentication
This technique is known as CSRF (Cross-Site Request Forgery) protection, where the referrer header and token validity are checked to prevent unauthorized form submissions.

To retrieve database error messages in CodeIgniter, use the ________ function.

  • db_error()
  • error_msg()
  • get_error()
  • last_error()
In CodeIgniter, to retrieve database error messages, the correct function is db_error(). This function allows you to get the last database error that occurred.

For advanced caching in CodeIgniter, the cache adapter is set in the ________ configuration file.

  • cache.php
  • config.php
  • database.php
  • routes.php
CodeIgniter uses the config.php file to set up various configurations, including the cache adapter for advanced caching.