diff --git a/README.md b/README.md index e09bfd8b..7b3d77bd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,58 @@ -# appstarter -CodeIgniter 4 app starter +# CodeIgniter 4 Application Starter + +## What is CodeIgniter? +CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. +More information can be found at the [official site](http://codeigniter.com). + +This repository holds a composer-installable app starter. +It has been built from the +[development repository](https://github.com/codeigniter4/CodeIgniter4). + +**This is pre-release code and should not be used in production sites.** + +--- + +**CAUTION: This app starter is EXPERIMENTAL, and likely to change before +the framework release. We are looking for feedback and suggestions!** + +--- + +More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. + +The user guide corresponding to this version of the framework can be found +[here](https://codeigniter4.github.io/userguide/). + +##Installation & updates + +`composer create-project codeigniter4/appstarter` then `composer update` whenever +there is a new release of the framework. + +##Setup + +Copy `env` to `.env` and tailor for your app, specifically the baseURL +and any database settings. + +## Important Change with index.php + +`index.php` is no longer in the root of the project! It has been moved inside the *public* folder, +for better security and separation of components. + +This means that you should configure your web server to "point" to your project's *public* folder, and +not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the +framework are exposed. + +**Please** read the user guide for a better explanation of how CI4 works! +The user guide updating and deployment is a bit awkward at the moment, but we are working on it! + +## Server Requirements +PHP version 7.1 or higher is required, with the following extensions installed: + +- [intl](http://php.net/manual/en/intl.requirements.php) +- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library + +Additionally, make sure that the following extensions are enabled in your PHP: + +- json (enabled by default - don't turn it off) +- [mbstring](http://php.net/manual/en/mbstring.installation.php) +- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) +- xml (enabled by default - don't turn it off) diff --git a/application/.htaccess b/application/.htaccess new file mode 100644 index 00000000..f24db0ac --- /dev/null +++ b/application/.htaccess @@ -0,0 +1,6 @@ + + Require all denied + + + Deny from all + diff --git a/application/Config/App.php b/application/Config/App.php new file mode 100644 index 00000000..ef0ebee9 --- /dev/null +++ b/application/Config/App.php @@ -0,0 +1,306 @@ + SYSPATH + * `]; + */ + $psr4 = [ + 'Config' => APPPATH . 'Config', + APP_NAMESPACE => APPPATH, // For custom namespace + 'App' => APPPATH, // To ensure filters, etc still found, + ]; + + /** + * ------------------------------------------------------------------- + * Class Map + * ------------------------------------------------------------------- + * The class map provides a map of class names and their exact + * location on the drive. Classes loaded in this manner will have + * slightly faster performance because they will not have to be + * searched for within one or more directories as they would if they + * were being autoloaded through a namespace. + * + * Prototype: + * + * $Config['classmap'] = [ + * 'MyClass' => '/path/to/class/file.php' + * ]; + */ + $classmap = []; + + //-------------------------------------------------------------------- + // Do Not Edit Below This Line + //-------------------------------------------------------------------- + + $this->psr4 = array_merge($this->psr4, $psr4); + $this->classmap = array_merge($this->classmap, $classmap); + + unset($psr4, $classmap); + } + + //-------------------------------------------------------------------- + +} diff --git a/application/Config/Boot/development.php b/application/Config/Boot/development.php new file mode 100644 index 00000000..61707a9b --- /dev/null +++ b/application/Config/Boot/development.php @@ -0,0 +1,32 @@ + '127.0.0.1', + 'port' => 11211, + 'weight' => 1, + 'raw' => false, + ]; + + /* + | ------------------------------------------------------------------------- + | Redis settings + | ------------------------------------------------------------------------- + | Your Redis server can be specified below, if you are using + | the Redis or Predis drivers. + | + */ + public $redis = [ + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + ]; + + /* + |-------------------------------------------------------------------------- + | Available Cache Handlers + |-------------------------------------------------------------------------- + | + | This is an array of cache engine alias' and class names. Only engines + | that are listed here are allowed to be used. + | + */ + public $validHandlers = [ + 'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class, + 'file' => \CodeIgniter\Cache\Handlers\FileHandler::class, + 'memcached' => \CodeIgniter\Cache\Handlers\MemcachedHandler::class, + 'predis' => \CodeIgniter\Cache\Handlers\PredisHandler::class, + 'redis' => \CodeIgniter\Cache\Handlers\RedisHandler::class, + 'wincache' => \CodeIgniter\Cache\Handlers\WincacheHandler::class, + ]; +} diff --git a/application/Config/Constants.php b/application/Config/Constants.php new file mode 100644 index 00000000..3f7cef1b --- /dev/null +++ b/application/Config/Constants.php @@ -0,0 +1,77 @@ + '', + 'hostname' => 'localhost', + 'username' => '', + 'password' => '', + 'database' => '', + 'DBDriver' => 'MySQLi', + 'DBPrefix' => '', + 'pConnect' => false, + 'DBDebug' => (ENVIRONMENT !== 'production'), + 'cacheOn' => false, + 'cacheDir' => '', + 'charset' => 'utf8', + 'DBCollat' => 'utf8_general_ci', + 'swapPre' => '', + 'encrypt' => false, + 'compress' => false, + 'strictOn' => false, + 'failover' => [], + 'port' => 3306, + ]; + + /** + * This database connection is used when + * running PHPUnit database tests. + * + * @var array + */ + public $tests = [ + 'DSN' => '', + 'hostname' => '127.0.0.1', + 'username' => '', + 'password' => '', + 'database' => '', + 'DBDriver' => '', + 'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE. + 'pConnect' => false, + 'DBDebug' => (ENVIRONMENT !== 'production'), + 'cacheOn' => false, + 'cacheDir' => '', + 'charset' => 'utf8', + 'DBCollat' => 'utf8_general_ci', + 'swapPre' => '', + 'encrypt' => false, + 'compress' => false, + 'strictOn' => false, + 'failover' => [], + 'port' => 3306, + ]; + + //-------------------------------------------------------------------- + + public function __construct() + { + parent::__construct(); + + // Ensure that we always set the database group to 'tests' if + // we are currently running an automated test suite, so that + // we don't overwrite live data on accident. + if (ENVIRONMENT === 'testing') + { + $this->defaultGroup = 'tests'; + + // Under Travis-CI, we can set an ENV var named 'DB_GROUP' + // so that we can test against multiple databases. + if ($group = getenv('DB')) + { + if (is_file(TESTPATH . 'travis/Database.php')) + { + require TESTPATH . 'travis/Database.php'; + + if (! empty($dbconfig) && array_key_exists($group, $dbconfig)) + { + $this->tests = $dbconfig[$group]; + } + } + } + } + } + + //-------------------------------------------------------------------- + +} diff --git a/application/Config/DocTypes.php b/application/Config/DocTypes.php new file mode 100755 index 00000000..67d5dd20 --- /dev/null +++ b/application/Config/DocTypes.php @@ -0,0 +1,33 @@ + '', + 'xhtml1-strict' => '', + 'xhtml1-trans' => '', + 'xhtml1-frame' => '', + 'xhtml-basic11' => '', + 'html5' => '', + 'html4-strict' => '', + 'html4-trans' => '', + 'html4-frame' => '', + 'mathml1' => '', + 'mathml2' => '', + 'svg10' => '', + 'svg11' => '', + 'svg11-basic' => '', + 'svg11-tiny' => '', + 'xhtml-math-svg-xh' => '', + 'xhtml-math-svg-sh' => '', + 'xhtml-rdfa-1' => '', + 'xhtml-rdfa-2' => '', + ]; +} diff --git a/application/Config/Email.php b/application/Config/Email.php new file mode 100644 index 00000000..45661240 --- /dev/null +++ b/application/Config/Email.php @@ -0,0 +1,161 @@ + \App\Filters\CSRF::class, + 'toolbar' => \App\Filters\DebugToolbar::class, + 'honeypot' => \App\Filters\Honeypot::class, + ]; + + // Always applied before every request + public $globals = [ + 'before' => [ + //'honeypot' + // 'csrf', + ], + 'after' => [ + 'toolbar', + //'honeypot' + ], + ]; + + // Works on all of a particular HTTP method + // (GET, POST, etc) as BEFORE filters only + // like: 'post' => ['CSRF', 'throttle'], + public $methods = []; + + // List filter aliases and any before/after uri patterns + // that they should run on, like: + // 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']], + public $filters = []; +} diff --git a/application/Config/ForeignCharacters.php b/application/Config/ForeignCharacters.php new file mode 100644 index 00000000..8ee6f113 --- /dev/null +++ b/application/Config/ForeignCharacters.php @@ -0,0 +1,6 @@ + \CodeIgniter\Format\JSONFormatter::class, + 'application/xml' => \CodeIgniter\Format\XMLFormatter::class, + 'text/xml' => \CodeIgniter\Format\XMLFormatter::class, + ]; + + //-------------------------------------------------------------------- + + /** + * A Factory method to return the appropriate formatter for the given mime type. + * + * @param string $mime + * + * @return \CodeIgniter\Format\FormatterInterface + */ + public function getFormatter(string $mime) + { + if (! array_key_exists($mime, $this->formatters)) + { + throw new \InvalidArgumentException('No Formatter defined for mime type: ' . $mime); + } + + $class = $this->formatters[$mime]; + + if (! class_exists($class)) + { + throw new \BadMethodCallException($class . ' is not a valid Formatter.'); + } + + return new $class(); + } + + //-------------------------------------------------------------------- + +} diff --git a/application/Config/Honeypot.php b/application/Config/Honeypot.php new file mode 100644 index 00000000..f4444a5d --- /dev/null +++ b/application/Config/Honeypot.php @@ -0,0 +1,34 @@ +{label}'; +} diff --git a/application/Config/Images.php b/application/Config/Images.php new file mode 100644 index 00000000..730ddee7 --- /dev/null +++ b/application/Config/Images.php @@ -0,0 +1,31 @@ + \CodeIgniter\Images\Handlers\GDHandler::class, + 'imagick' => \CodeIgniter\Images\Handlers\ImageMagickHandler::class, + ]; +} diff --git a/application/Config/Logger.php b/application/Config/Logger.php new file mode 100644 index 00000000..d32e195f --- /dev/null +++ b/application/Config/Logger.php @@ -0,0 +1,140 @@ + [ + + /* + * The log levels that this handler will handle. + */ + 'handles' => [ + 'critical', + 'alert', + 'emergency', + 'debug', + 'error', + 'info', + 'notice', + 'warning', + ], + + /* + * Leave this BLANK unless you would like to set something other than the default + * writeable/logs/ directory. Use a full getServer path with trailing slash. + */ + 'path' => WRITEPATH . 'logs/', + + /* + * The default filename extension for log files. The default 'php' allows for + * protecting the log files via basic scripting, when they are to be stored + * under a publicly accessible directory. + * + * Note: Leaving it blank will default to 'php'. + */ + 'fileExtension' => 'php', + + /* + * The file system permissions to be applied on newly created log files. + * + * IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal + * integer notation (i.e. 0700, 0644, etc.) + */ + 'filePermissions' => 0644, + ], + + /** + * The ChromeLoggerHandler requires the use of the Chrome web browser + * and the ChromeLogger extension. Uncomment this block to use it. + */ + // 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [ + // /* + // * The log levels that this handler will handle. + // */ + // 'handles' => ['critical', 'alert', 'emergency', 'debug', + // 'error', 'info', 'notice', 'warning'], + // ] + ]; +} diff --git a/application/Config/Migrations.php b/application/Config/Migrations.php new file mode 100644 index 00000000..c746a22c --- /dev/null +++ b/application/Config/Migrations.php @@ -0,0 +1,63 @@ +migration->current() this is the version that schema will + | be upgraded / downgraded to. + | + */ + public $currentVersion = 0; + +} diff --git a/application/Config/Mimes.php b/application/Config/Mimes.php new file mode 100644 index 00000000..a570ef54 --- /dev/null +++ b/application/Config/Mimes.php @@ -0,0 +1,534 @@ + [ + 'application/mac-binhex40', + 'application/mac-binhex', + 'application/x-binhex40', + 'application/x-mac-binhex40', + ], + 'cpt' => 'application/mac-compactpro', + 'csv' => [ + 'text/csv', + 'text/x-comma-separated-values', + 'text/comma-separated-values', + 'application/octet-stream', + 'application/vnd.ms-excel', + 'application/x-csv', + 'text/x-csv', + 'application/csv', + 'application/excel', + 'application/vnd.msexcel', + 'text/plain', + ], + 'bin' => [ + 'application/macbinary', + 'application/mac-binary', + 'application/octet-stream', + 'application/x-binary', + 'application/x-macbinary', + ], + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => [ + 'application/octet-stream', + 'application/x-msdownload', + ], + 'class' => 'application/octet-stream', + 'psd' => [ + 'application/x-photoshop', + 'image/vnd.adobe.photoshop', + ], + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => [ + 'application/pdf', + 'application/force-download', + 'application/x-download', + 'binary/octet-stream', + ], + 'ai' => [ + 'application/pdf', + 'application/postscript', + ], + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => [ + 'application/vnd.ms-excel', + 'application/msexcel', + 'application/x-msexcel', + 'application/x-ms-excel', + 'application/x-excel', + 'application/x-dos_ms_excel', + 'application/xls', + 'application/x-xls', + 'application/excel', + 'application/download', + 'application/vnd.ms-office', + 'application/msword', + ], + 'ppt' => [ + 'application/vnd.ms-powerpoint', + 'application/powerpoint', + 'application/vnd.ms-office', + 'application/msword', + ], + 'pptx' => [ + 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'application/x-zip', + 'application/zip', + ], + 'wbxml' => 'application/wbxml', + 'wmlc' => 'application/wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'gzip' => 'application/x-gzip', + 'php' => [ + 'application/x-php', + 'application/x-httpd-php', + 'application/php', + 'text/php', + 'text/x-php', + 'application/x-httpd-php-source', + ], + 'php4' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'js' => [ + 'application/x-javascript', + 'text/plain', + ], + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => [ + 'application/x-tar', + 'application/x-gzip-compressed', + ], + 'z' => 'application/x-compress', + 'xhtml' => 'application/xhtml+xml', + 'xht' => 'application/xhtml+xml', + 'zip' => [ + 'application/x-zip', + 'application/zip', + 'application/x-zip-compressed', + 'application/s-compressed', + 'multipart/x-zip', + ], + 'rar' => [ + 'application/x-rar', + 'application/rar', + 'application/x-rar-compressed', + ], + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => [ + 'audio/mpeg', + 'audio/mpg', + 'audio/mpeg3', + 'audio/mp3', + ], + 'aif' => [ + 'audio/x-aiff', + 'audio/aiff', + ], + 'aiff' => [ + 'audio/x-aiff', + 'audio/aiff', + ], + 'aifc' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'rv' => 'video/vnd.rn-realvideo', + 'wav' => [ + 'audio/x-wav', + 'audio/wave', + 'audio/wav', + ], + 'bmp' => [ + 'image/bmp', + 'image/x-bmp', + 'image/x-bitmap', + 'image/x-xbitmap', + 'image/x-win-bitmap', + 'image/x-windows-bmp', + 'image/ms-bmp', + 'image/x-ms-bmp', + 'application/bmp', + 'application/x-bmp', + 'application/x-win-bitmap', + ], + 'gif' => 'image/gif', + 'jpg' => [ + 'image/jpeg', + 'image/pjpeg', + ], + 'jpeg' => [ + 'image/jpeg', + 'image/pjpeg', + ], + 'jpe' => [ + 'image/jpeg', + 'image/pjpeg', + ], + 'jp2' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'j2k' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'jpf' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'jpg2' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'jpx' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'jpm' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'mj2' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'mjp2' => [ + 'image/jp2', + 'video/mj2', + 'image/jpx', + 'image/jpm', + ], + 'png' => [ + 'image/png', + 'image/x-png', + ], + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'css' => [ + 'text/css', + 'text/plain', + ], + 'html' => [ + 'text/html', + 'text/plain', + ], + 'htm' => [ + 'text/html', + 'text/plain', + ], + 'shtml' => [ + 'text/html', + 'text/plain', + ], + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => [ + 'text/plain', + 'text/x-log', + ], + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => [ + 'application/xml', + 'text/xml', + 'text/plain', + ], + 'xsl' => [ + 'application/xml', + 'text/xsl', + 'text/xml', + ], + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => [ + 'video/x-msvideo', + 'video/msvideo', + 'video/avi', + 'application/x-troff-msvideo', + ], + 'movie' => 'video/x-sgi-movie', + 'doc' => [ + 'application/msword', + 'application/vnd.ms-office', + ], + 'docx' => [ + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/zip', + 'application/msword', + 'application/x-zip', + ], + 'dot' => [ + 'application/msword', + 'application/vnd.ms-office', + ], + 'dotx' => [ + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'application/zip', + 'application/msword', + ], + 'xlsx' => [ + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'application/zip', + 'application/vnd.ms-excel', + 'application/msword', + 'application/x-zip', + ], + 'word' => [ + 'application/msword', + 'application/octet-stream', + ], + 'xl' => 'application/excel', + 'eml' => 'message/rfc822', + 'json' => [ + 'application/json', + 'text/json', + ], + 'pem' => [ + 'application/x-x509-user-cert', + 'application/x-pem-file', + 'application/octet-stream', + ], + 'p10' => [ + 'application/x-pkcs10', + 'application/pkcs10', + ], + 'p12' => 'application/x-pkcs12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => [ + 'application/pkcs7-mime', + 'application/x-pkcs7-mime', + ], + 'p7m' => [ + 'application/pkcs7-mime', + 'application/x-pkcs7-mime', + ], + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'crt' => [ + 'application/x-x509-ca-cert', + 'application/x-x509-user-cert', + 'application/pkix-cert', + ], + 'crl' => [ + 'application/pkix-crl', + 'application/pkcs-crl', + ], + 'der' => 'application/x-x509-ca-cert', + 'kdb' => 'application/octet-stream', + 'pgp' => 'application/pgp', + 'gpg' => 'application/gpg-keys', + 'sst' => 'application/octet-stream', + 'csr' => 'application/octet-stream', + 'rsa' => 'application/x-pkcs7', + 'cer' => [ + 'application/pkix-cert', + 'application/x-x509-ca-cert', + ], + '3g2' => 'video/3gpp2', + '3gp' => [ + 'video/3gp', + 'video/3gpp', + ], + 'mp4' => 'video/mp4', + 'm4a' => 'audio/x-m4a', + 'f4v' => [ + 'video/mp4', + 'video/x-f4v', + ], + 'flv' => 'video/x-flv', + 'webm' => 'video/webm', + 'aac' => 'audio/x-acc', + 'm4u' => 'application/vnd.mpegurl', + 'm3u' => 'text/plain', + 'xspf' => 'application/xspf+xml', + 'vlc' => 'application/videolan', + 'wmv' => [ + 'video/x-ms-wmv', + 'video/x-ms-asf', + ], + 'au' => 'audio/x-au', + 'ac3' => 'audio/ac3', + 'flac' => 'audio/x-flac', + 'ogg' => [ + 'audio/ogg', + 'video/ogg', + 'application/ogg', + ], + 'kmz' => [ + 'application/vnd.google-earth.kmz', + 'application/zip', + 'application/x-zip', + ], + 'kml' => [ + 'application/vnd.google-earth.kml+xml', + 'application/xml', + 'text/xml', + ], + 'ics' => 'text/calendar', + 'ical' => 'text/calendar', + 'zsh' => 'text/x-scriptzsh', + '7zip' => [ + 'application/x-compressed', + 'application/x-zip-compressed', + 'application/zip', + 'multipart/x-zip', + ], + 'cdr' => [ + 'application/cdr', + 'application/coreldraw', + 'application/x-cdr', + 'application/x-coreldraw', + 'image/cdr', + 'image/x-cdr', + 'zz-application/zz-winassoc-cdr', + ], + 'wma' => [ + 'audio/x-ms-wma', + 'video/x-ms-asf', + ], + 'jar' => [ + 'application/java-archive', + 'application/x-java-application', + 'application/x-jar', + 'application/x-compressed', + ], + 'svg' => [ + 'image/svg+xml', + 'application/xml', + 'text/xml', + ], + 'vcf' => 'text/x-vcard', + 'srt' => [ + 'text/srt', + 'text/plain', + ], + 'vtt' => [ + 'text/vtt', + 'text/plain', + ], + 'ico' => [ + 'image/x-icon', + 'image/x-ico', + 'image/vnd.microsoft.icon', + ], + ]; + + //-------------------------------------------------------------------- + + /** + * Attempts to determine the best mime type for the given file extension. + * + * @param string $extension + * + * @return string|null The mime type found, or none if unable to determine. + */ + public static function guessTypeFromExtension(string $extension) + { + $extension = trim(strtolower($extension), '. '); + + if (! array_key_exists($extension, static::$mimes)) + { + return null; + } + + return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; + } + + //-------------------------------------------------------------------- + + /** + * Attempts to determine the best file extension for a given mime type. + * + * @param string $type + * @param string $proposed_extension - default extension (in case there is more than one with the same mime type) + * + * @return string|null The extension determined, or null if unable to match. + */ + public static function guessExtensionFromType(string $type, ?string $proposed_extension = null) + { + $type = trim(strtolower($type), '. '); + + $proposed_extension = trim(strtolower($proposed_extension)); + + if (! is_null($proposed_extension) && array_key_exists($proposed_extension, static::$mimes) && in_array($type, is_string(static::$mimes[$proposed_extension]) ? [static::$mimes[$proposed_extension]] : static::$mimes[$proposed_extension])) + { + return $proposed_extension; + } + + foreach (static::$mimes as $ext => $types) + { + if (is_string($types) && $types === $type) + { + return $ext; + } + else if (is_array($types) && in_array($type, $types)) + { + return $ext; + } + } + + return null; + } + + //-------------------------------------------------------------------- + +} diff --git a/application/Config/Modules.php b/application/Config/Modules.php new file mode 100644 index 00000000..2dcd22be --- /dev/null +++ b/application/Config/Modules.php @@ -0,0 +1,57 @@ +enabled) + { + return false; + } + + $alias = strtolower($alias); + + return in_array($alias, $this->activeExplorers); + } +} diff --git a/application/Config/Pager.php b/application/Config/Pager.php new file mode 100644 index 00000000..9b6ed83c --- /dev/null +++ b/application/Config/Pager.php @@ -0,0 +1,35 @@ + 'CodeIgniter\Pager\Views\default_full', + 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', + 'default_head' => 'CodeIgniter\Pager\Views\default_head', + ]; + + /* + |-------------------------------------------------------------------------- + | Items Per Page + |-------------------------------------------------------------------------- + | + | The default number of results shown in a single page. + | + */ + public $perPage = 20; +} diff --git a/application/Config/Paths.php b/application/Config/Paths.php new file mode 100644 index 00000000..a9b78b19 --- /dev/null +++ b/application/Config/Paths.php @@ -0,0 +1,91 @@ +defaultNamespace() + * + * Modifies the namespace that is added to a controller if it doesn't + * already have one. By default this is the global namespace (\). + * + * $routes->defaultController() + * + * Changes the name of the class used as a controller when the route + * points to a folder instead of a class. + * + * $routes->defaultMethod() + * + * Assigns the method inside the controller that is ran when the + * Router is unable to determine the appropriate method to run. + * + * $routes->setAutoRoute() + * + * Determines whether the Router will attempt to match URIs to + * Controllers when no specific route has been defined. If false, + * only routes that have been defined here will be available. + */ +$routes->setDefaultNamespace('App\Controllers'); +$routes->setDefaultController('Home'); +$routes->setDefaultMethod('index'); +$routes->setTranslateURIDashes(false); +$routes->set404Override(); +$routes->setAutoRoute(true); + +/** + * -------------------------------------------------------------------- + * Route Definitions + * -------------------------------------------------------------------- + */ + +// We get a performance increase by specifying the default +// route since we don't have to scan directories. +$routes->get('/', 'Home::index'); + +/** + * -------------------------------------------------------------------- + * Additional Routing + * -------------------------------------------------------------------- + * + * There will often be times that you need additional routing and you + * need to it be able to override any defaults in this file. Environment + * based routes is one such time. require() additional route files here + * to make that happen. + * + * You will have access to the $routes object within that file without + * needing to reload it. + */ +if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) +{ + require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'; +} diff --git a/application/Config/Services.php b/application/Config/Services.php new file mode 100644 index 00000000..061d0d78 --- /dev/null +++ b/application/Config/Services.php @@ -0,0 +1,49 @@ + 'Windows 10', + 'windows nt 6.3' => 'Windows 8.1', + 'windows nt 6.2' => 'Windows 8', + 'windows nt 6.1' => 'Windows 7', + 'windows nt 6.0' => 'Windows Vista', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 4.0' => 'Windows NT 4.0', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows phone' => 'Windows Phone', + 'windows' => 'Unknown Windows OS', + 'android' => 'Android', + 'blackberry' => 'BlackBerry', + 'iphone' => 'iOS', + 'ipad' => 'iOS', + 'ipod' => 'iOS', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + 'unix' => 'Unknown Unix OS', + 'symbian' => 'Symbian OS', + ]; + + // The order of this array should NOT be changed. Many browsers return + // multiple browser types so we want to identify the sub-type first. + public $browsers = [ + 'OPR' => 'Opera', + 'Flock' => 'Flock', + 'Edge' => 'Spartan', + 'Chrome' => 'Chrome', + // Opera 10+ always reports Opera/9.80 and appends Version/ to the user agent string + 'Opera.*?Version' => 'Opera', + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', + 'Internet Explorer' => 'Internet Explorer', + 'Trident.* rv' => 'Internet Explorer', + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Safari' => 'Safari', + 'Mozilla' => 'Mozilla', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse', + 'Maxthon' => 'Maxthon', + 'Ubuntu' => 'Ubuntu Web Browser', + 'Vivaldi' => 'Vivaldi', + ]; + + public $mobiles = [ + // legacy array, old values commented out + 'mobileexplorer' => 'Mobile Explorer', + // 'openwave' => 'Open Wave', + // 'opera mini' => 'Opera Mini', + // 'operamini' => 'Opera Mini', + // 'elaine' => 'Palm', + 'palmsource' => 'Palm', + // 'digital paths' => 'Palm', + // 'avantgo' => 'Avantgo', + // 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', + // 'nokia' => 'Nokia', + // 'ericsson' => 'Ericsson', + // 'blackberry' => 'BlackBerry', + // 'motorola' => 'Motorola' + + // Phones and Manufacturers + 'motorola' => 'Motorola', + 'nokia' => 'Nokia', + 'palm' => 'Palm', + 'iphone' => 'Apple iPhone', + 'ipad' => 'iPad', + 'ipod' => 'Apple iPod Touch', + 'sony' => 'Sony Ericsson', + 'ericsson' => 'Sony Ericsson', + 'blackberry' => 'BlackBerry', + 'cocoon' => 'O2 Cocoon', + 'blazer' => 'Treo', + 'lg' => 'LG', + 'amoi' => 'Amoi', + 'xda' => 'XDA', + 'mda' => 'MDA', + 'vario' => 'Vario', + 'htc' => 'HTC', + 'samsung' => 'Samsung', + 'sharp' => 'Sharp', + 'sie-' => 'Siemens', + 'alcatel' => 'Alcatel', + 'benq' => 'BenQ', + 'ipaq' => 'HP iPaq', + 'mot-' => 'Motorola', + 'playstation portable' => 'PlayStation Portable', + 'playstation 3' => 'PlayStation 3', + 'playstation vita' => 'PlayStation Vita', + 'hiptop' => 'Danger Hiptop', + 'nec-' => 'NEC', + 'panasonic' => 'Panasonic', + 'philips' => 'Philips', + 'sagem' => 'Sagem', + 'sanyo' => 'Sanyo', + 'spv' => 'SPV', + 'zte' => 'ZTE', + 'sendo' => 'Sendo', + 'nintendo dsi' => 'Nintendo DSi', + 'nintendo ds' => 'Nintendo DS', + 'nintendo 3ds' => 'Nintendo 3DS', + 'wii' => 'Nintendo Wii', + 'open web' => 'Open Web', + 'openweb' => 'OpenWeb', + + // Operating Systems + 'android' => 'Android', + 'symbian' => 'Symbian', + 'SymbianOS' => 'SymbianOS', + 'elaine' => 'Palm', + 'series60' => 'Symbian S60', + 'windows ce' => 'Windows CE', + + // Browsers + 'obigo' => 'Obigo', + 'netfront' => 'Netfront Browser', + 'openwave' => 'Openwave Browser', + 'mobilexplorer' => 'Mobile Explorer', + 'operamini' => 'Opera Mini', + 'opera mini' => 'Opera Mini', + 'opera mobi' => 'Opera Mobile', + 'fennec' => 'Firefox Mobile', + + // Other + 'digital paths' => 'Digital Paths', + 'avantgo' => 'AvantGo', + 'xiino' => 'Xiino', + 'novarra' => 'Novarra Transcoder', + 'vodafone' => 'Vodafone', + 'docomo' => 'NTT DoCoMo', + 'o2' => 'O2', + + // Fallback + 'mobile' => 'Generic Mobile', + 'wireless' => 'Generic Mobile', + 'j2me' => 'Generic Mobile', + 'midp' => 'Generic Mobile', + 'cldc' => 'Generic Mobile', + 'up.link' => 'Generic Mobile', + 'up.browser' => 'Generic Mobile', + 'smartphone' => 'Generic Mobile', + 'cellphone' => 'Generic Mobile', + ]; + + // There are hundreds of bots but these are the most common. + public $robots = [ + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'baiduspider' => 'Baiduspider', + 'bingbot' => 'Bing', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'ask jeeves' => 'Ask Jeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos', + 'yandex' => 'YandexBot', + 'mediapartners-google' => 'MediaPartners Google', + 'CRAZYWEBCRAWLER' => 'Crazy Webcrawler', + 'adsbot-google' => 'AdsBot Google', + 'feedfetcher-google' => 'Feedfetcher Google', + 'curious george' => 'Curious George', + 'ia_archiver' => 'Alexa Crawler', + 'MJ12bot' => 'Majestic-12', + 'Uptimebot' => 'Uptimebot', + ]; +} diff --git a/application/Config/Validation.php b/application/Config/Validation.php new file mode 100644 index 00000000..97f08c75 --- /dev/null +++ b/application/Config/Validation.php @@ -0,0 +1,36 @@ + 'CodeIgniter\Validation\Views\list', + 'single' => 'CodeIgniter\Validation\Views\single', + ]; + + //-------------------------------------------------------------------- + // Rules + //-------------------------------------------------------------------- +} diff --git a/application/Config/View.php b/application/Config/View.php new file mode 100644 index 00000000..f66b2532 --- /dev/null +++ b/application/Config/View.php @@ -0,0 +1,34 @@ +isCLI()) + { + return; + } + + $security = Services::security(); + + try + { + $security->CSRFVerify($request); + } + catch (SecurityException $e) + { + if (config('App')->CSRFRedirect && ! $request->isAJAX()) + { + return redirect()->back()->with('error', $e->getMessage()); + } + + throw $e; + } + } + + //-------------------------------------------------------------------- + + /** + * We don't have anything to do here. + * + * @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request + * @param ResponseInterface|\CodeIgniter\HTTP\Response $response + * + * @return mixed + */ + public function after(RequestInterface $request, ResponseInterface $response) + { + } + + //-------------------------------------------------------------------- +} diff --git a/application/Filters/DebugToolbar.php b/application/Filters/DebugToolbar.php new file mode 100644 index 00000000..145f97df --- /dev/null +++ b/application/Filters/DebugToolbar.php @@ -0,0 +1,91 @@ +getPerformanceStats(); + $data = $toolbar->run( + $stats['startTime'], + $stats['totalTime'], + $request, + $response + ); + + helper('filesystem'); + + // Updated to time() so we can get history + $time = time(); + + if (! is_dir(WRITEPATH . 'debugbar')) + { + mkdir(WRITEPATH . 'debugbar', 0777); + } + + write_file(WRITEPATH . 'debugbar/' . 'debugbar_' . $time, $data, 'w+'); + + $format = $response->getHeaderLine('content-type'); + + // Non-HTML formats should not include the debugbar + // then we send headers saying where to find the debug data + // for this response + if ($request->isAJAX() || strpos($format, 'html') === false) + { + return $response->setHeader('Debugbar-Time', (string)$time) + ->setHeader('Debugbar-Link', site_url("?debugbar_time={$time}")) + ->getBody(); + } + + $script = PHP_EOL + . '' + . '' + . '' + . PHP_EOL; + + if (strpos($response->getBody(), '') !== false) + { + return $response->setBody(str_replace('', $script . '', + $response->getBody())); + } + + return $response->appendBody($script); + } + } + + //-------------------------------------------------------------------- +} diff --git a/application/Filters/Honeypot.php b/application/Filters/Honeypot.php new file mode 100644 index 00000000..a16a55c0 --- /dev/null +++ b/application/Filters/Honeypot.php @@ -0,0 +1,44 @@ +hasContent($request)) + { + throw HoneypotException::isBot(); + } + } + + /** + * Attach a honypot to the current response. + * + * @param CodeIgniter\HTTP\RequestInterface $request + * @param CodeIgniter\HTTP\ResponseInterface $response + * @return mixed + */ + public function after(RequestInterface $request, ResponseInterface $response) + { + $honeypot = Services::honeypot(new \Config\Honeypot()); + $honeypot->attachHoneypot($response); + } + +} diff --git a/application/Filters/Throttle.php b/application/Filters/Throttle.php new file mode 100644 index 00000000..b2659e54 --- /dev/null +++ b/application/Filters/Throttle.php @@ -0,0 +1,46 @@ +check($request->getIPAddress(), 60, MINUTE) === false) + { + return Services::response()->setStatusCode(429); + } + } + + //-------------------------------------------------------------------- + + /** + * We don't have anything to do here. + * + * @param RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request + * @param ResponseInterface|\CodeIgniter\HTTP\Response $response + * + * @return mixed + */ + public function after(RequestInterface $request, ResponseInterface $response) + { + } + + //-------------------------------------------------------------------- +} diff --git a/application/Helpers/.gitkeep b/application/Helpers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/application/Language/.gitkeep b/application/Language/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/application/Libraries/.gitkeep b/application/Libraries/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/application/Models/.gitkeep b/application/Models/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/application/ThirdParty/.gitkeep b/application/ThirdParty/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/application/Views/errors/cli/error_404.php b/application/Views/errors/cli/error_404.php new file mode 100644 index 00000000..d5bccb43 --- /dev/null +++ b/application/Views/errors/cli/error_404.php @@ -0,0 +1,6 @@ + +Message: +Filename: getFile(), "\n"; ?> +Line Number: getLine(); ?> + + + + Backtrace: + getTrace() as $error): ?> + + + + + + diff --git a/application/Views/errors/cli/production.php b/application/Views/errors/cli/production.php new file mode 100644 index 00000000..f04d517d --- /dev/null +++ b/application/Views/errors/cli/production.php @@ -0,0 +1,5 @@ + + + + + 404 Page Not Found + + + + +
+

404 - File Not Found

+ +

+ + + + Sorry! Cannot seem to find the page you were looking for. + +

+
+ + diff --git a/application/Views/errors/html/error_exception.php b/application/Views/errors/html/error_exception.php new file mode 100644 index 00000000..476f40f7 --- /dev/null +++ b/application/Views/errors/html/error_exception.php @@ -0,0 +1,389 @@ + + + + + + + + <?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8') ?> + + + + + + + +
+
+

getCode() ? ' #'.$exception->getCode() : '') ?>

+

+ getMessage() ?> + getMessage())) ?>" + rel="noreferrer" target="_blank">search → +

+
+
+ + +
+

at line

+ + +
+ +
+ +
+ +
+ + + +
+ + +
+ +
    + $row) : ?> + +
  1. +

    + + + + + {PHP internal code} + + + + +   —   + + + ( arguments ) +

    + + + getParameters(); + } + foreach ($row['args'] as $key => $value) : ?> + + + + + + +
    name : "#$key", ENT_SUBSTITUTE, 'UTF-8') ?>
    +
    + + () + + + + +   —   () + +

    + + + +
    + +
    + +
  2. + + +
+ +
+ + +
+ + + +

$

+ + + + + + + + + + $value) : ?> + + + + + + +
KeyValue
+ + + + '.print_r($value, true) ?> + +
+ + + + + + +

Constants

+ + + + + + + + + + $value) : ?> + + + + + + +
KeyValue
+ + + + '.print_r($value, true) ?> + +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pathuri ?>
HTTP MethodgetMethod(true) ?>
IP AddressgetIPAddress() ?>
Is AJAX Request?isAJAX() ? 'yes' : 'no' ?>
Is CLI Request?isCLI() ? 'yes' : 'no' ?>
Is Secure Request?isSecure() ? 'yes' : 'no' ?>
User AgentgetUserAgent()->getAgentString() ?>
+ + + + + + + + +

$

+ + + + + + + + + + $value) : ?> + + + + + + +
KeyValue
+ + + + '.print_r($value, true) ?> + +
+ + + + + +
+ No $_GET, $_POST, or $_COOKIE Information to show. +
+ + + + getHeaders(); ?> + + +

Headers

+ + + + + + + + + + $value) : ?> + + + + + + + + + + +
HeaderValue
getName(), 'html') ?>getValueLine(), 'html') ?>
+ + +
+ + + setStatusCode(http_response_code()); + ?> +
+ + + + + +
Response StatusgetStatusCode().' - '.$response->getReason() ?>
+ + getHeaders(); ?> + + + +

Headers

+ + + + + + + + + + $value) : ?> + + + + + + +
HeaderValue
getHeaderLine($name), 'html') ?>
+ + +
+ + +
+ + +
    + +
  1. + +
+
+ + +
+ + + + + + + + + + + + + + + + +
Memory Usage
Peak Memory Usage:
Memory Limit:
+ +
+ +
+ +
+ + + + + diff --git a/application/Views/errors/html/production.php b/application/Views/errors/html/production.php new file mode 100644 index 00000000..b912a015 --- /dev/null +++ b/application/Views/errors/html/production.php @@ -0,0 +1,25 @@ + + + + + + + Whoops! + + + + + +
+ +

Whoops!

+ +

We seem to have hit a snag. Please try again later...

+ +
+ + + + diff --git a/application/Views/welcome_message.php b/application/Views/welcome_message.php new file mode 100644 index 00000000..0c3281ad --- /dev/null +++ b/application/Views/welcome_message.php @@ -0,0 +1,139 @@ + + + + Welcome to CodeIgniter + + + + + + + +
+ +

Welcome to CodeIgniter

+ +

version

+ + + +
+

The page you are looking at is being generated dynamically by CodeIgniter.

+ +

If you would like to edit this page you'll find it located at:

+ +
+				
+					application/Views/welcome_message.php
+				
+				
+ +

The corresponding controller for this page is found at:

+ +
+				
+					application/Controllers/Home.php
+				
+				
+ +

If you are exploring CodeIgniter for the very first time, you + should start by reading the + User Guide.

+ +
+ + + +
+ + + diff --git a/application/index.html b/application/index.html new file mode 100644 index 00000000..b702fbc3 --- /dev/null +++ b/application/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..4f250a38 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "codeigniter4/appstarter", + "type": "project", + "description": "CodeIgniter4 starter app", + "homepage": "https://codeigniter.com", + "license": "MIT", + "require": { + "php": ">=7.1", + "codeigniter4/framework": "^4", + "ext-curl": "*", + "ext-intl": "*", + "kint-php/kint": "^2.1", + "zendframework/zend-escaper": "^2.5" + }, + "require-dev": { + "mikey179/vfsStream": "1.6.*", + "phpunit/phpunit": "^7.0" + }, + "autoload": { + "psr-4": { + "CodeIgniter\\": "vendor/codeigniter4/framework/system/", + "Psr\\Log\\": "vendor/codeigniter4/framework/system/ThirdParty/PSR/Log/" + } + }, + "scripts": { + "post-update-cmd": [ + "composer dump-autoload" + ] + }, + "support": { + "forum": "http://forum.codeigniter.com/", + "source": "https://github.com/codeigniter4/CodeIgniter4", + "slack": "https://codeigniterchat.slack.com" + } +} diff --git a/contributing.md b/contributing.md new file mode 100644 index 00000000..8e236f0c --- /dev/null +++ b/contributing.md @@ -0,0 +1,79 @@ +# Contributing to CodeIgniter4 + + +## Contributions + +We expect all contributions to conform to our style guide, be commented (inside the PHP source files), +be documented (in the user guide), and unit tested (in the test folder). +There is a [Contributing to CodeIgniter](./contributing/index.rst) section in the repository which describes the contribution process; this page is an overview. + +## Issues + +Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please check a few things first: + +1. There is not already an open Issue +2. The issue has already been fixed (check the develop branch, or look for closed Issues) +3. Is it something really obvious that you can fix yourself? + +Reporting issues is helpful but an even [better approach](https://codeigniter4.github.io/CodeIgniter4/contributing/workflow.html) is to send a Pull Request, which is done by "Forking" the main repository and committing to your own copy. This will require you to use the version control system called Git. + +## Guidelines + +Before we look into how, here are the guidelines. If your Pull Requests fail +to pass these guidelines it will be declined and you will need to re-submit +when you’ve made the changes. This might sound a bit tough, but it is required +for us to maintain quality of the code-base. + +### PHP Style + +All code must meet the [Style Guide](https://codeigniter4.github.io/CodeIgniter4/contributing/styleguide.html). +This makes certain that all code is the same format as the existing code and means it will be as readable as possible. + +### Documentation + +If you change anything that requires a change to documentation then you will need to add it. New classes, methods, parameters, changing default values, etc are all things that will require a change to documentation. The change-log must also be updated for every change. Also PHPDoc blocks must be maintained. + +### Compatibility + +CodeIgniter4 requires PHP 7.1. + +### Branching + +CodeIgniter4 uses the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model which requires all pull requests to be sent to the "develop" branch. This is +where the next planned version will be developed. The "master" branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g: an emergency security patch) can be applied to master to create a new version, without worrying about other features holding it up. For this reason all commits need to be made to "develop" and any sent to "master" will be closed automatically. If you have multiple changes to submit, please place all changes into their own branch on your fork. + +One thing at a time: A pull request should only contain one change. That does not mean only one commit, but one change - however many commits it took. The reason for this is that if you change X and Y but send a pull request for both at the same time, we might really want X but disagree with Y, meaning we cannot merge the request. Using the Git-Flow branching model you can create new branches for both of these features and send two requests. + +### Signing + +You must [GPG-sign](https://codeigniter4.github.io/CodeIgniter4/contributing/signing.html) your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open source project. This is *not* just a "signed-off-by" commit, but instead a digitally signed one. + +## How-to Guide + +The best way to contribute is to fork the CodeIgniter4 repository, and "clone" that to your development area. That sounds like some jargon, but "forking" on GitHub means "making a copy of that repo to your account" and "cloning" means "copying that code to your environment so you can work on it". + +1. Set up Git (Windows, Mac & Linux) +2. Go to the CodeIgniter4 repo +3. Fork it (to your Github account) +4. Clone your CodeIgniter repo: git@github.com:\/CodeIgniter4.git +5. Create a new branch in your project for each set of changes you want to make. +6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them. +7. Commit the changed files in your contribution branch +8. Push your contribution branch to your fork +9. Send a pull request [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/) + +The codebase maintainers will now be alerted about the change and at least one of the team will respond. If your change fails to meet the guidelines it will be bounced, or feedback will be provided to help you improve it. + +Once the maintainer handling your pull request is happy with it they will merge it into develop and your patch will be part of the next release. + +### Keeping your fork up-to-date + +Unlike systems like Subversion, Git can have multiple remotes. A remote is the name for a URL of a Git repository. By default your fork will have a remote named "origin" which points to your fork, but you can add another remote named "codeigniter" which points to `git://github.com/codeigniter4/CodeIgniter4.git`. This is a read-only remote but you can pull from this develop branch to update your own. + +If you are using command-line you can do the following: + +1. `git remote add codeigniter git://github.com/codeigniter4/CodeIgniter4.git` +2. `git pull codeigniter develop` +3. `git push origin develop` + +Now your fork is up to date. This should be done regularly, or before you send a pull request at least. diff --git a/env b/env new file mode 100644 index 00000000..d5559450 --- /dev/null +++ b/env @@ -0,0 +1,87 @@ +#-------------------------------------------------------------------- +# Example Environment Configuration file +# +# This file can be used as a starting point for your own +# custom .env files, and contains most of the possible settings +# available in a default install. +# +# By default, all of the settings are commented out. If you want +# to override the setting, you must un-comment it by removing the '#' +# at the beginning of the line. +#-------------------------------------------------------------------- + +#-------------------------------------------------------------------- +# APP +#-------------------------------------------------------------------- + +# app.baseURL = '' +# app.forceGlobalSecureRequests = false + +# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler' +# app.sessionCookieName = 'ci_session' +# app.sessionSavePath = NULL +# app.sessionMatchIP = false +# app.sessionTimeToUpdate = 300 +# app.sessionRegenerateDestroy = false + +# app.cookiePrefix = '' +# app.cookieDomain = '' +# app.cookiePath = '/' +# app.cookieSecure = false +# app.cookieHTTPOnly = false + +# app.CSRFProtection = false +# app.CSRFTokenName = 'csrf_test_name' +# app.CSRFCookieName = 'csrf_cookie_name' +# app.CSRFExpire = 7200 +# app.CSRFRegenerate = true +# app.CSRFExcludeURIs = [] + +# app.CSPEnabled = false + +#-------------------------------------------------------------------- +# DATABASE +#-------------------------------------------------------------------- + +# database.default.hostname = localhost +# database.default.database = ci4 +# database.default.username = root +# database.default.password = root +# database.default.DBDriver = MySQLi + +# database.tests.hostname = localhost +# database.tests.database = ci4 +# database.tests.username = root +# database.tests.password = root +# database.tests.DBDriver = MySQLi + +#-------------------------------------------------------------------- +# CONTENT SECURITY POLICY +#-------------------------------------------------------------------- + +# contentsecuritypolicy.reportOnly = false +# contentsecuritypolicy.defaultSrc = 'none' +# contentsecuritypolicy.scriptSrc = 'self' +# contentsecuritypolicy.styleSrc = 'self' +# contentsecuritypolicy.imageSrc = 'self' +# contentsecuritypolicy.base_uri = null +# contentsecuritypolicy.childSrc = null +# contentsecuritypolicy.connectSrc = 'self' +# contentsecuritypolicy.fontSrc = null +# contentsecuritypolicy.formAction = null +# contentsecuritypolicy.frameAncestors = null +# contentsecuritypolicy.mediaSrc = null +# contentsecuritypolicy.objectSrc = null +# contentsecuritypolicy.pluginTypes = null +# contentsecuritypolicy.reportURI = null +# contentsecuritypolicy.sandbox = false +# contentsecuritypolicy.upgradeInsecureRequests = false + +#-------------------------------------------------------------------- +# HONEYPOT +#-------------------------------------------------------------------- + +# honeypot.hidden = 'true' +# honeypot.label = 'Fill This Field' +# honeypot.name = 'honeypot' +# honeypot.template = '' diff --git a/license.txt b/license.txt new file mode 100644 index 00000000..b41fa19b --- /dev/null +++ b/license.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018 British Columbia Institute of Technology + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 00000000..3a3f07de --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,97 @@ +# ---------------------------------------------------------------------- +# Environment Name +# ---------------------------------------------------------------------- + +# Sets the environment that CodeIgniter runs under. +# SetEnv CI_ENVIRONMENT development + +# ---------------------------------------------------------------------- +# UTF-8 encoding +# ---------------------------------------------------------------------- + +# Use UTF-8 encoding for anything served text/plain or text/html +AddDefaultCharset utf-8 + +# Force UTF-8 for a number of file formats + + AddCharset utf-8 .atom .css .js .json .rss .vtt .xml + + +# ---------------------------------------------------------------------- +# Rewrite engine +# ---------------------------------------------------------------------- + +# Turning on the rewrite engine is necessary for the following rules and features. +# FollowSymLinks must be enabled for this to work. + + Options +FollowSymlinks + RewriteEngine On + + # If you installed CodeIgniter in a subfolder, you will need to + # change the following line to match the subfolder you need. + # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase + RewriteBase / + + # Redirect Trailing Slashes... + RewriteRule ^(.*)/$ /$1 [L,R=301] + + # Rewrite "www.example.com -> example.com" + RewriteCond %{HTTPS} !=on + RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] + RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] + + # Checks to see if the user is attempting to access a valid file, + # such as an image or css document, if this isn't true it sends the + # request to the front controller, index.php + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ index.php/$1 [L] + + # Ensure Authorization header is passed along + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + + + # If we don't have mod_rewrite installed, all 404's + # can be sent to index.php, and everything works as normal. + ErrorDocument 404 index.php + + +# ---------------------------------------------------------------------- +# Gzip compression +# ---------------------------------------------------------------------- + + + + # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # Compress all output labeled with one of the following MIME-types + # (for Apache versions below 2.3.7, you don't need to enable `mod_filter` + # and can remove the `` and `` lines as + # `AddOutputFilterByType` is still in the core directives) + + AddOutputFilterByType DEFLATE application/atom+xml \ + application/javascript \ + application/json \ + application/rss+xml \ + application/vnd.ms-fontobject \ + application/x-font-ttf \ + application/xhtml+xml \ + application/xml \ + font/opentype \ + image/svg+xml \ + image/x-icon \ + text/css \ + text/html \ + text/plain \ + text/x-component \ + text/xml + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..7ecfce21 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.php b/public/index.php new file mode 100644 index 00000000..86d06eda --- /dev/null +++ b/public/index.php @@ -0,0 +1,44 @@ +systemDirectory, '/ ') . '/bootstrap.php'; + +/* + *--------------------------------------------------------------- + * LAUNCH THE APPLICATION + *--------------------------------------------------------------- + * Now that everything is setup, it's time to actually fire + * up the engines and make this app do its thang. + */ +$app->run(); diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..9e60f970 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/spark b/spark new file mode 100755 index 00000000..7ce369bb --- /dev/null +++ b/spark @@ -0,0 +1,60 @@ +#!/usr/bin/env php +publicDirectory, '/'); + +// Path to the front controller +define('FCPATH', realpath($public) . DIRECTORY_SEPARATOR); + +// Ensure the current directory is pointing to the front controller's directory +chdir($public); + +$app = require rtrim($paths->systemDirectory, '/ ') . '/bootstrap.php'; + +// Grab our Console +$console = new \CodeIgniter\CLI\Console($app); + +// We want errors to be shown when using it from the CLI. +error_reporting(-1); +ini_set('display_errors', 1); + +// Show basic information before we do anything else. +$console->showHeader(); + +// fire off the command the main framework. +$console->run(); diff --git a/writable/.htaccess b/writable/.htaccess new file mode 100755 index 00000000..f24db0ac --- /dev/null +++ b/writable/.htaccess @@ -0,0 +1,6 @@ + + Require all denied + + + Deny from all + diff --git a/writable/cache/index.html b/writable/cache/index.html new file mode 100755 index 00000000..b702fbc3 --- /dev/null +++ b/writable/cache/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/writable/debugbar/.gitkeep b/writable/debugbar/.gitkeep new file mode 100755 index 00000000..e69de29b diff --git a/writable/debugbar/debugbar_1543529344 b/writable/debugbar/debugbar_1543529344 new file mode 100644 index 00000000..6f5617cc --- /dev/null +++ b/writable/debugbar/debugbar_1543529344 @@ -0,0 +1 @@ +{"url":"http:\/\/example.com\/","method":"GET","isAJAX":false,"startTime":1543529344.905057,"totalTime":9,"totalMemory":"1.091","segmentDuration":5,"segmentCount":2,"CI_VERSION":"4.0.0-alpha.2","collectors":[{"title":"Timers","titleSafe":"timers","titleDetails":"","display":[],"badgeValue":null,"isEmpty":false,"hasTabContent":false,"hasLabel":false,"icon":"","hasTimelineData":true,"timelineData":[{"name":"Bootstrap","component":"Timer","start":1543529344.90528,"duration":0.005461931228637695},{"name":"Routing","component":"Timer","start":1543529344.910745,"duration":0.00011610984802246094},{"name":"Controller","component":"Timer","start":1543529344.911656,"duration":0.0024101734161376953},{"name":"Controller Constructor","component":"Timer","start":1543529344.911657,"duration":0.0011358261108398438}]},{"title":"Database","titleSafe":"database","titleDetails":"(0 Queries across 0 Connection)","display":{"queries":[]},"badgeValue":0,"isEmpty":true,"hasTabContent":true,"hasLabel":false,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADMSURBVEhLY6A3YExLSwsA4nIycQDIDIhRWEBqamo\/UNF\/SjDQjF6ocZgAKPkRiFeEhoYyQ4WIBiA9QAuWAPEHqBAmgLqgHcolGQD1V4DMgHIxwbCxYD+QBqcKINseKo6eWrBioPrtQBq\/BcgY5ht0cUIYbBg2AJKkRxCNWkDQgtFUNJwtABr+F6igE8olGQD114HMgHIxAVDyAhA\/AlpSA8RYUwoeXAPVex5qHCbIyMgwBCkAuQJIY00huDBUz\/mUlBQDqHGjgBjAwAAACexpph6oHSQAAAAASUVORK5CYII=","hasTimelineData":true,"timelineData":[]},{"title":"Logs","titleSafe":"logs","titleDetails":"","display":{"logs":[]},"badgeValue":null,"isEmpty":true,"hasTabContent":true,"hasLabel":false,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACYSURBVEhLYxgFJIHU1FSjtLS0i0D8AYj7gEKMEBkqAaAFF4D4ERCvAFrwH4gDoFIMKSkpFkB+OTEYqgUTACXfA\/GqjIwMQyD9H2hRHlQKJFcBEiMGQ7VgAqCBvUgK32dmZspCpagGGNPT0\/1BLqeF4bQHQJePpiIwhmrBBEADR1MRfgB0+WgqAmOoFkwANHA0FY0CUgEDAwCQ0PUpNB3kqwAAAABJRU5ErkJggg==","hasTimelineData":false,"timelineData":[]},{"title":"Views","titleSafe":"views","titleDetails":"","display":[],"badgeValue":1,"isEmpty":false,"hasTabContent":false,"hasLabel":true,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADeSURBVEhL7ZSxDcIwEEWNYA0YgGmgyAaJLTcUaaBzQQEVjMEabBQxAdw53zTHiThEovGTfnE\/9rsoRUxhKLOmaa6Uh7X2+UvguLCzVxN1XW9x4EYHzik033Hp3X0LO+DaQG8MDQcuq6qao4qkHuMgQggLvkPLjqh00ZgFDBacMJYFkuwFlH1mshdkZ5JPJERA9JpI6xNCBESvibQ+IURA9JpI6xNCBESvibQ+IURA9DTsuHTOrVFFxixgB\/eUFlU8uKJ0eDBFOu\/9EvoeKnlJS2\/08Tc8NOwQ8sIfMeYFjqKDjdU2sp4AAAAASUVORK5CYII=","hasTimelineData":true,"timelineData":[{"name":"View: welcome_message.php","component":"Views","start":1543529344.913878,"duration":0.00011801719665527344}]},{"title":"Files","titleSafe":"files","titleDetails":"( 83 )","display":{"coreFiles":[{"name":"AutoloadConfig.php","path":"BASEPATH\/Config\/AutoloadConfig.php"},{"name":"Autoloader.php","path":"BASEPATH\/Autoloader\/Autoloader.php"},{"name":"BaseCollector.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/BaseCollector.php"},{"name":"BaseConfig.php","path":"BASEPATH\/Config\/BaseConfig.php"},{"name":"BaseService.php","path":"BASEPATH\/Config\/BaseService.php"},{"name":"CacheFactory.php","path":"BASEPATH\/Cache\/CacheFactory.php"},{"name":"CacheInterface.php","path":"BASEPATH\/Cache\/CacheInterface.php"},{"name":"CodeIgniter.php","path":"BASEPATH\/CodeIgniter.php"},{"name":"Common.php","path":"BASEPATH\/Common.php"},{"name":"Config.php","path":"BASEPATH\/Config\/Config.php"},{"name":"Config.php","path":"BASEPATH\/Database\/Config.php"},{"name":"Controller.php","path":"BASEPATH\/Controller.php"},{"name":"Database.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Database.php"},{"name":"DotEnv.php","path":"BASEPATH\/Config\/DotEnv.php"},{"name":"Events.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Events.php"},{"name":"Events.php","path":"BASEPATH\/Events\/Events.php"},{"name":"Exceptions.php","path":"BASEPATH\/Debug\/Exceptions.php"},{"name":"FileHandler.php","path":"BASEPATH\/Cache\/Handlers\/FileHandler.php"},{"name":"FileLocator.php","path":"BASEPATH\/Autoloader\/FileLocator.php"},{"name":"Files.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Files.php"},{"name":"FilterInterface.php","path":"BASEPATH\/Filters\/FilterInterface.php"},{"name":"Filters.php","path":"BASEPATH\/Filters\/Filters.php"},{"name":"Header.php","path":"BASEPATH\/HTTP\/Header.php"},{"name":"IncomingRequest.php","path":"BASEPATH\/HTTP\/IncomingRequest.php"},{"name":"Logger.php","path":"BASEPATH\/Log\/Logger.php"},{"name":"LoggerInterface.php","path":"BASEPATH\/ThirdParty\/PSR\/Log\/LoggerInterface.php"},{"name":"Logs.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Logs.php"},{"name":"Message.php","path":"BASEPATH\/HTTP\/Message.php"},{"name":"RendererInterface.php","path":"BASEPATH\/View\/RendererInterface.php"},{"name":"Request.php","path":"BASEPATH\/HTTP\/Request.php"},{"name":"RequestInterface.php","path":"BASEPATH\/HTTP\/RequestInterface.php"},{"name":"Response.php","path":"BASEPATH\/HTTP\/Response.php"},{"name":"ResponseInterface.php","path":"BASEPATH\/HTTP\/ResponseInterface.php"},{"name":"ResponseTrait.php","path":"BASEPATH\/API\/ResponseTrait.php"},{"name":"RouteCollection.php","path":"BASEPATH\/Router\/RouteCollection.php"},{"name":"RouteCollectionInterface.php","path":"BASEPATH\/Router\/RouteCollectionInterface.php"},{"name":"Router.php","path":"BASEPATH\/Router\/Router.php"},{"name":"RouterInterface.php","path":"BASEPATH\/Router\/RouterInterface.php"},{"name":"Routes.php","path":"BASEPATH\/Config\/Routes.php"},{"name":"Routes.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Routes.php"},{"name":"Services.php","path":"BASEPATH\/Config\/Services.php"},{"name":"Timer.php","path":"BASEPATH\/Debug\/Timer.php"},{"name":"Timers.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Timers.php"},{"name":"Toolbar.php","path":"BASEPATH\/Debug\/Toolbar.php"},{"name":"URI.php","path":"BASEPATH\/HTTP\/URI.php"},{"name":"UserAgent.php","path":"BASEPATH\/HTTP\/UserAgent.php"},{"name":"View.php","path":"BASEPATH\/Config\/View.php"},{"name":"View.php","path":"BASEPATH\/View\/View.php"},{"name":"Views.php","path":"BASEPATH\/Debug\/Toolbar\/Collectors\/Views.php"},{"name":"bootstrap.php","path":"BASEPATH\/bootstrap.php"},{"name":"kint.php","path":"BASEPATH\/ThirdParty\/Kint\/kint.php"},{"name":"rewrite.php","path":"BASEPATH\/Commands\/Server\/rewrite.php"},{"name":"url_helper.php","path":"BASEPATH\/Helpers\/url_helper.php"}],"userFiles":[{"name":"App.php","path":"APPPATH\/Config\/App.php"},{"name":"Autoload.php","path":"APPPATH\/Config\/Autoload.php"},{"name":"Cache.php","path":"APPPATH\/Config\/Cache.php"},{"name":"ClassLoader.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/composer\/ClassLoader.php"},{"name":"Constants.php","path":"APPPATH\/Config\/Constants.php"},{"name":"Database.php","path":"APPPATH\/Config\/Database.php"},{"name":"DebugToolbar.php","path":"APPPATH\/Filters\/DebugToolbar.php"},{"name":"Events.php","path":"APPPATH\/Config\/Events.php"},{"name":"Exceptions.php","path":"APPPATH\/Config\/Exceptions.php"},{"name":"Filters.php","path":"APPPATH\/Config\/Filters.php"},{"name":"Home.php","path":"APPPATH\/Controllers\/Home.php"},{"name":"Kint.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/kint-php\/kint\/src\/Kint.php"},{"name":"Logger.php","path":"APPPATH\/Config\/Logger.php"},{"name":"Modules.php","path":"APPPATH\/Config\/Modules.php"},{"name":"Paths.php","path":"APPPATH\/Config\/Paths.php"},{"name":"Routes.php","path":"APPPATH\/Config\/Routes.php"},{"name":"Services.php","path":"APPPATH\/Config\/Services.php"},{"name":"UserAgents.php","path":"APPPATH\/Config\/UserAgents.php"},{"name":"View.php","path":"APPPATH\/Config\/View.php"},{"name":"autoload.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/autoload.php"},{"name":"autoload_real.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/composer\/autoload_real.php"},{"name":"autoload_static.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/composer\/autoload_static.php"},{"name":"deep_copy.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/myclabs\/deep-copy\/src\/DeepCopy\/deep_copy.php"},{"name":"development.php","path":"APPPATH\/Config\/Boot\/development.php"},{"name":"index.php","path":"FCPATH\/index.php"},{"name":"init.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/kint-php\/kint\/init.php"},{"name":"init_footer.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/kint-php\/kint\/init_footer.php"},{"name":"init_header.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/kint-php\/kint\/init_header.php"},{"name":"init_helpers.php","path":"\/pub7\/htdocs\/CodeIgniter4\/vendor\/kint-php\/kint\/init_helpers.php"},{"name":"welcome_message.php","path":"APPPATH\/Views\/welcome_message.php"}]},"badgeValue":83,"isEmpty":false,"hasTabContent":true,"hasLabel":false,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGBSURBVEhL7ZQ9S8NQGIVTBQUncfMfCO4uLgoKbuKQOWg+OkXERRE1IAXrIHbVDrqIDuLiJgj+gro7S3dnpfq88b1FMTE3VZx64HBzzvvZWxKnj15QCcPwCD5HUfSWR+JtzgmtsUcQBEva5IIm9SwSu+95CAWbUuy67qBa32ByZEDpIaZYZSZMjjQuPcQUq8yEyYEb8FSerYeQVGbAFzJkX1PyQWLhgCz0BxTCekC1Wp0hsa6yokzhed4oje6Iz6rlJEkyIKfUEFtITVtQdAibn5rMyaYsMS+a5wTv8qeXMhcU16QZbKgl3hbs+L4\/pnpdc87MElZgq10p5DxGdq8I7xrvUWUKvG3NbSK7ubngYzdJwSsF7TiOh9VOgfcEz1UayNe3JUPM1RWC5GXYgTfc75B4NBmXJnAtTfpABX0iPvEd9ezALwkplCFXcr9styiNOKc1RRZpaPM9tcqBwlWzGY1qPL9wjqRBgF5BH6j8HWh2S7MHlX8PrmbK+k\/8PzjOOzx1D3i1pKTTAAAAAElFTkSuQmCC","hasTimelineData":false,"timelineData":[]},{"title":"Routes","titleSafe":"routes","titleDetails":"","display":{"matchedRoute":[{"directory":"","controller":"\\App\\Controllers\\Home","method":"index","paramCount":0,"truePCount":0,"params":[]}],"routes":[{"from":"\/","to":"\\App\\Controllers\\Home::index"}]},"badgeValue":1,"isEmpty":false,"hasTabContent":true,"hasLabel":false,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFDSURBVEhL7ZRNSsNQFIUjVXSiOFEcuQIHDpzpxC0IGYeE\/BEInbWlCHEDLsSiuANdhKDjgm6ggtSJ+l25ldrmmTwIgtgDh\/t37r1J+16cX0dRFMtpmu5pWAkrvYjjOB7AETzStBFW+inxu3KUJMmhludQpoflS1zXban4LYqiO224h6VLTHr8Z+z8EpIHFF9gG78nDVmW7UgTHKjsCyY98QP+pcq+g8Ku2s8G8X3f3\/I8b038WZTp+bO38zxfFd+I6YY6sNUvFlSDk9CRhiAI1jX1I9Cfw7GG1UB8LAuwbU0ZwQnbRDeEN5qqBxZMLtE1ti9LtbREnMIuOXnyIf5rGIb7Wq8HmlZgwYBH7ORTcKH5E4mpjeGt9fBZcHE2GCQ3Vt7oTNPNg+FXLHnSsHkw\/FR+Gg2bB8Ptzrst\/v6C\/wrH+QB+duli6MYJdQAAAABJRU5ErkJggg==","hasTimelineData":false,"timelineData":[]},{"title":"Events","titleSafe":"events","titleDetails":"","display":{"events":{"pre_system":{"event":"pre_system","duration":"0.02","count":1}}},"badgeValue":1,"isEmpty":false,"hasTabContent":true,"hasLabel":false,"icon":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEASURBVEhL7ZXNDcIwDIVTsRBH1uDQDdquUA6IM1xgCA6MwJUN2hk6AQzAz0vl0ETUxC5VT3zSU5w81\/mRMGZysixbFEVR0jSKNt8geQU9aRpFmp\/keX6AbjZ5oB74vsaN5lSzA4tLSjpBFxsjeSuRy4d2mDdQTWU7YLbXTNN05mKyovj5KL6B7q3hoy3KwdZxBlT+Ipz+jPHrBqOIynZgcZonoukb\/0ckiTHqNvDXtXEAaygRbaB9FvUTjRUHsIYS0QaSp+Dw6wT4hiTmYHOcYZsdLQ2CbXa4ftuuYR4x9vYZgdb4vsFYUdmABMYeukK9\/SUme3KMFQ77+Yfzh8eYF8+orDuDWU5LAAAAAElFTkSuQmCC","hasTimelineData":false,"timelineData":[]}],"vars":{"varData":{"View Data":[]},"headers":{"Host":"localhost:8080","User-Agent":"Mozilla\/5.0 (X11; Linux x86_64; rv:60.0) Gecko\/20100101 Firefox\/60.0","Accept":"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8","Accept-Language":"en-US,en;q=0.5","Accept-Encoding":"gzip, deflate","Connection":"keep-alive","Upgrade-Insecure-Requests":"1"},"request":"HTTP\/1.1","response":{"statusCode":200,"reason":"OK","contentType":"text\/html; charset=UTF-8"}},"config":{"ciVersion":"4.0.0-alpha.2","phpVersion":"7.1.18","phpSAPI":"cli-server","environment":"development","baseURL":"http:\/\/example.com","timezone":"America\/Chicago","locale":"en","cspEnabled":false,"salt":""}} \ No newline at end of file diff --git a/writable/logs/index.html b/writable/logs/index.html new file mode 100755 index 00000000..b702fbc3 --- /dev/null +++ b/writable/logs/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/writable/session/index.html b/writable/session/index.html new file mode 100755 index 00000000..b702fbc3 --- /dev/null +++ b/writable/session/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + diff --git a/writable/uploads/index.html b/writable/uploads/index.html new file mode 100755 index 00000000..b702fbc3 --- /dev/null +++ b/writable/uploads/index.html @@ -0,0 +1,11 @@ + + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + +