feat(episodes): add create form and view pages for episode

- add james-heinrich/getid3 library as a dependency to composer.json
- update DEPENDENCIES.md file
- fix episodes table migration script
- add js devDependencies: prettier, @prettier/plugin-php and lint-staged to automatically format staged files before commit
- reformat all files to the prettier format
- refactor code by separating some logic as helper functions
- overwrite existing files when uploading new files with the same name

fixes #1
This commit is contained in:
Yassine Doghri 2020-06-10 15:00:12 +00:00
parent 044482174e
commit f3b2c8b84f
84 changed files with 4744 additions and 2236 deletions

View File

@ -12,7 +12,8 @@
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
"naumovs.color-highlight", "naumovs.color-highlight",
"heybourn.headwind", "heybourn.headwind",
"anish-m.ci-snippets2", "wayou.vscode-todo-highlight",
"wayou.vscode-todo-highlight" "esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
] ]
} }

11
.gitignore vendored
View File

@ -125,15 +125,16 @@ nb-configuration.xml
/phpunit*.xml /phpunit*.xml
/.phpunit.*.cache /.phpunit.*.cache
# Media files
public/media/*
# npm # npm
yarn.lock yarn.lock
node_modules node_modules
# potcss generated file # public folder
public/index.css public/*
!public/.htaccess
!public/favicon.ico
!public/index.php
!public/robots.txt
#------------------------- #-------------------------
# Docker volumes # Docker volumes

13
.prettierrc.json Normal file
View File

@ -0,0 +1,13 @@
{
"trailingComma": "es5",
"overrides": [
{
"files": "*.php",
"options": {
"phpVersion": "7.2",
"singleQuote": true,
"trailingCommaPHP": true
}
}
]
}

View File

@ -11,3 +11,4 @@ Castopod uses the following components:
- [User agent list](https://github.com/opawg/user-agents) ([by Open Podcast Analytics Working Group](https://github.com/opawg)) ([MIT license](https://github.com/opawg/user-agents/blob/master/LICENSE)) - [User agent list](https://github.com/opawg/user-agents) ([by Open Podcast Analytics Working Group](https://github.com/opawg)) ([MIT license](https://github.com/opawg/user-agents/blob/master/LICENSE))
- [WhichBrowser/Parser-PHP](https://github.com/WhichBrowser/Parser-PHP) ([MIT License](https://github.com/WhichBrowser/Parser-PHP/blob/master/LICENSE)) - [WhichBrowser/Parser-PHP](https://github.com/WhichBrowser/Parser-PHP) ([MIT License](https://github.com/WhichBrowser/Parser-PHP/blob/master/LICENSE))
- [Quill Rich Text Editor](https://github.com/quilljs/quill) ([BSD 3-Clause "New" or "Revised" License](https://github.com/quilljs/quill/blob/develop/LICENSE)) - [Quill Rich Text Editor](https://github.com/quilljs/quill) ([BSD 3-Clause "New" or "Revised" License](https://github.com/quilljs/quill/blob/develop/LICENSE))
- [getID3](https://github.com/JamesHeinrich/getID3) ([GNU General Public License v3](https://github.com/JamesHeinrich/getID3/blob/2.0/licenses/license.gpl-30.txt))

View File

@ -12,3 +12,8 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install intl && docker-php-ext-install intl
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
RUN echo "file_uploads = On\n" \
"memory_limit = 100M\n" \
"upload_max_filesize = 100M\n" \
> /usr/local/etc/php/conf.d/uploads.ini

View File

@ -23,7 +23,6 @@ Moreover Podcasters can choose to publish on Castopod while keeping their existi
You can check castopod's documentation for [setting up a development environment](./docs/setup-development.md). You can check castopod's documentation for [setting up a development environment](./docs/setup-development.md).
## Support ## Support
[Castopod](https://nlnet.nl/project/Castopod/) was funded through the [NGI0 Discovery](https://nlnet.nl/discovery/) Fund, a fund established by NLnet with financial support from the European Commission's [Next Generation Internet](https://www.ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825322. [Castopod](https://nlnet.nl/project/Castopod/) was funded through the [NGI0 Discovery](https://nlnet.nl/discovery/) Fund, a fund established by NLnet with financial support from the European Commission's [Next Generation Internet](https://www.ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825322.

View File

@ -6,8 +6,7 @@ use CodeIgniter\Config\BaseConfig;
class App extends BaseConfig class App extends BaseConfig
{ {
/*
/*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Base Site URL | Base Site URL
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -23,9 +22,9 @@ class App extends BaseConfig
| environments. | environments.
| |
*/ */
public $baseURL = 'http://localhost:8080/'; public $baseURL = 'http://localhost:8080/';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Index File | Index File
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -35,9 +34,9 @@ class App extends BaseConfig
| variable so that it is blank. | variable so that it is blank.
| |
*/ */
public $indexPage = 'index.php'; public $indexPage = 'index.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| URI PROTOCOL | URI PROTOCOL
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -52,9 +51,9 @@ class App extends BaseConfig
| |
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/ */
public $uriProtocol = 'REQUEST_URI'; public $uriProtocol = 'REQUEST_URI';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Locale | Default Locale
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -65,9 +64,9 @@ class App extends BaseConfig
| should run under for this request. | should run under for this request.
| |
*/ */
public $defaultLocale = 'en'; public $defaultLocale = 'en';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Negotiate Locale | Negotiate Locale
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -78,9 +77,9 @@ class App extends BaseConfig
| If false, no automatic detection will be performed. | If false, no automatic detection will be performed.
| |
*/ */
public $negotiateLocale = true; public $negotiateLocale = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Supported Locales | Supported Locales
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -90,9 +89,9 @@ class App extends BaseConfig
| found, the first locale will be used. | found, the first locale will be used.
| |
*/ */
public $supportedLocales = ['en']; public $supportedLocales = ['en'];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Timezone | Application Timezone
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -101,9 +100,9 @@ class App extends BaseConfig
| dates with the date helper, and can be retrieved through app_timezone() | dates with the date helper, and can be retrieved through app_timezone()
| |
*/ */
public $appTimezone = 'America/Chicago'; public $appTimezone = 'America/Chicago';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Character Set | Default Character Set
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -114,9 +113,9 @@ class App extends BaseConfig
| See http://php.net/htmlspecialchars for a list of supported charsets. | See http://php.net/htmlspecialchars for a list of supported charsets.
| |
*/ */
public $charset = 'UTF-8'; public $charset = 'UTF-8';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| URI PROTOCOL | URI PROTOCOL
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -126,9 +125,9 @@ class App extends BaseConfig
| secure, the user will be redirected to a secure version of the page | secure, the user will be redirected to a secure version of the page
| and the HTTP Strict Transport Security header will be set. | and the HTTP Strict Transport Security header will be set.
*/ */
public $forceGlobalSecureRequests = false; public $forceGlobalSecureRequests = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Session Variables | Session Variables
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -183,15 +182,15 @@ class App extends BaseConfig
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
| |
*/ */
public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'; public $sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler';
public $sessionCookieName = 'ci_session'; public $sessionCookieName = 'ci_session';
public $sessionExpiration = 7200; public $sessionExpiration = 7200;
public $sessionSavePath = WRITEPATH . 'session'; public $sessionSavePath = WRITEPATH . 'session';
public $sessionMatchIP = false; public $sessionMatchIP = false;
public $sessionTimeToUpdate = 300; public $sessionTimeToUpdate = 300;
public $sessionRegenerateDestroy = false; public $sessionRegenerateDestroy = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cookie Related Variables | Cookie Related Variables
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -206,13 +205,13 @@ class App extends BaseConfig
| 'cookie_httponly') will also affect sessions. | 'cookie_httponly') will also affect sessions.
| |
*/ */
public $cookiePrefix = ''; public $cookiePrefix = '';
public $cookieDomain = ''; public $cookieDomain = '';
public $cookiePath = '/'; public $cookiePath = '/';
public $cookieSecure = false; public $cookieSecure = false;
public $cookieHTTPOnly = false; public $cookieHTTPOnly = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Reverse Proxy IPs | Reverse Proxy IPs
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -228,9 +227,9 @@ class App extends BaseConfig
| Comma-separated: '10.0.1.200,192.168.5.0/24' | Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24') | Array: array('10.0.1.200', '192.168.5.0/24')
*/ */
public $proxyIPs = ''; public $proxyIPs = '';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cross Site Request Forgery | Cross Site Request Forgery
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -245,14 +244,14 @@ class App extends BaseConfig
| CSRFRegenerate = Regenerate token on every submission | CSRFRegenerate = Regenerate token on every submission
| CSRFRedirect = Redirect to previous page with error on failure | CSRFRedirect = Redirect to previous page with error on failure
*/ */
public $CSRFTokenName = 'csrf_test_name'; public $CSRFTokenName = 'csrf_test_name';
public $CSRFHeaderName = 'X-CSRF-TOKEN'; public $CSRFHeaderName = 'X-CSRF-TOKEN';
public $CSRFCookieName = 'csrf_cookie_name'; public $CSRFCookieName = 'csrf_cookie_name';
public $CSRFExpire = 7200; public $CSRFExpire = 7200;
public $CSRFRegenerate = true; public $CSRFRegenerate = true;
public $CSRFRedirect = true; public $CSRFRedirect = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Content Security Policy | Content Security Policy
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -266,5 +265,5 @@ class App extends BaseConfig
| - http://www.html5rocks.com/en/tutorials/security/content-security-policy/ | - http://www.html5rocks.com/en/tutorials/security/content-security-policy/
| - http://www.w3.org/TR/CSP/ | - http://www.w3.org/TR/CSP/
*/ */
public $CSPEnabled = false; public $CSPEnabled = false;
} }

View File

@ -13,80 +13,79 @@ require_once SYSTEMPATH . 'Config/AutoloadConfig.php';
*/ */
class Autoload extends \CodeIgniter\Config\AutoloadConfig class Autoload extends \CodeIgniter\Config\AutoloadConfig
{ {
public $psr4 = [ public $psr4 = [
'App' => APPPATH, 'App' => APPPATH,
]; ];
public $classmap = []; public $classmap = [];
//-------------------------------------------------------------------- //--------------------------------------------------------------------
/** /**
* Collects the application-specific autoload settings and merges * Collects the application-specific autoload settings and merges
* them with the framework's required settings. * them with the framework's required settings.
* *
* NOTE: If you use an identical key in $psr4 or $classmap, then * NOTE: If you use an identical key in $psr4 or $classmap, then
* the values in this file will overwrite the framework's values. * the values in this file will overwrite the framework's values.
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
/** /**
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* Namespaces * Namespaces
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* This maps the locations of any namespaces in your application * This maps the locations of any namespaces in your application
* to their location on the file system. These are used by the * to their location on the file system. These are used by the
* Autoloader to locate files the first time they have been instantiated. * Autoloader to locate files the first time they have been instantiated.
* *
* The '/app' and '/system' directories are already mapped for * The '/app' and '/system' directories are already mapped for
* you. You may change the name of the 'App' namespace if you wish, * you. You may change the name of the 'App' namespace if you wish,
* but this should be done prior to creating any namespaced classes, * but this should be done prior to creating any namespaced classes,
* else you will need to modify all of those classes for this to work. * else you will need to modify all of those classes for this to work.
* *
* DO NOT change the name of the CodeIgniter namespace or your application * DO NOT change the name of the CodeIgniter namespace or your application
* WILL break. * * WILL break. *
* Prototype: * Prototype:
* *
* $Config['psr4'] = [ * $Config['psr4'] = [
* 'CodeIgniter' => SYSPATH * 'CodeIgniter' => SYSPATH
* `]; * `];
*/ */
$psr4 = [ $psr4 = [
'App' => APPPATH, // To ensure filters, etc still found, 'App' => APPPATH, // To ensure filters, etc still found,
APP_NAMESPACE => APPPATH, // For custom namespace APP_NAMESPACE => APPPATH, // For custom namespace
'Config' => APPPATH . 'Config', 'Config' => APPPATH . 'Config',
]; ];
/** /**
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* Class Map * Class Map
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* The class map provides a map of class names and their exact * The class map provides a map of class names and their exact
* location on the drive. Classes loaded in this manner will have * location on the drive. Classes loaded in this manner will have
* slightly faster performance because they will not have to be * slightly faster performance because they will not have to be
* searched for within one or more directories as they would if they * searched for within one or more directories as they would if they
* were being autoloaded through a namespace. * were being autoloaded through a namespace.
* *
* Prototype: * Prototype:
* *
* $Config['classmap'] = [ * $Config['classmap'] = [
* 'MyClass' => '/path/to/class/file.php' * 'MyClass' => '/path/to/class/file.php'
* ]; * ];
*/ */
$classmap = []; $classmap = [];
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Do Not Edit Below This Line // Do Not Edit Below This Line
//-------------------------------------------------------------------- //--------------------------------------------------------------------
$this->psr4 = array_merge($this->psr4, $psr4); $this->psr4 = array_merge($this->psr4, $psr4);
$this->classmap = array_merge($this->classmap, $classmap); $this->classmap = array_merge($this->classmap, $classmap);
unset($psr4, $classmap); unset($psr4, $classmap);
} }
//--------------------------------------------------------------------
//--------------------------------------------------------------------
} }

View File

@ -8,7 +8,14 @@
| it and display a generic error message. | it and display a generic error message.
*/ */
ini_set('display_errors', '0'); ini_set('display_errors', '0');
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); error_reporting(
E_ALL &
~E_NOTICE &
~E_DEPRECATED &
~E_STRICT &
~E_USER_NOTICE &
~E_USER_DEPRECATED
);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Cache extends BaseConfig class Cache extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Primary Handler | Primary Handler
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -13,9 +13,9 @@ class Cache extends BaseConfig
| it is not available, the $backupHandler will be used in its place. | it is not available, the $backupHandler will be used in its place.
| |
*/ */
public $handler = 'file'; public $handler = 'file';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Backup Handler | Backup Handler
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -25,9 +25,9 @@ class Cache extends BaseConfig
| always available, though that's not always practical for the app. | always available, though that's not always practical for the app.
| |
*/ */
public $backupHandler = 'dummy'; public $backupHandler = 'dummy';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cache Directory Path | Cache Directory Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -36,9 +36,9 @@ class Cache extends BaseConfig
| system. | system.
| |
*/ */
public $storePath = WRITEPATH . 'cache/'; public $storePath = WRITEPATH . 'cache/';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cache Include Query String | Cache Include Query String
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -54,9 +54,9 @@ class Cache extends BaseConfig
| of query parameters. | of query parameters.
| |
*/ */
public $cacheQueryString = false; public $cacheQueryString = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Key Prefix | Key Prefix
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -65,9 +65,9 @@ class Cache extends BaseConfig
| if you run multiple applications with the same cache engine. | if you run multiple applications with the same cache engine.
| |
*/ */
public $prefix = ''; public $prefix = '';
/* /*
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------
| Memcached settings | Memcached settings
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------
@ -77,14 +77,14 @@ class Cache extends BaseConfig
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached | See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
| |
*/ */
public $memcached = [ public $memcached = [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'port' => 11211, 'port' => 11211,
'weight' => 1, 'weight' => 1,
'raw' => false, 'raw' => false,
]; ];
/* /*
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------
| Redis settings | Redis settings
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------
@ -92,15 +92,15 @@ class Cache extends BaseConfig
| the Redis or Predis drivers. | the Redis or Predis drivers.
| |
*/ */
public $redis = [ public $redis = [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'password' => null, 'password' => null,
'port' => 6379, 'port' => 6379,
'timeout' => 0, 'timeout' => 0,
'database' => 0, 'database' => 0,
]; ];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Available Cache Handlers | Available Cache Handlers
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -109,12 +109,12 @@ class Cache extends BaseConfig
| that are listed here are allowed to be used. | that are listed here are allowed to be used.
| |
*/ */
public $validHandlers = [ public $validHandlers = [
'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class, 'dummy' => \CodeIgniter\Cache\Handlers\DummyHandler::class,
'file' => \CodeIgniter\Cache\Handlers\FileHandler::class, 'file' => \CodeIgniter\Cache\Handlers\FileHandler::class,
'memcached' => \CodeIgniter\Cache\Handlers\MemcachedHandler::class, 'memcached' => \CodeIgniter\Cache\Handlers\MemcachedHandler::class,
'predis' => \CodeIgniter\Cache\Handlers\PredisHandler::class, 'predis' => \CodeIgniter\Cache\Handlers\PredisHandler::class,
'redis' => \CodeIgniter\Cache\Handlers\RedisHandler::class, 'redis' => \CodeIgniter\Cache\Handlers\RedisHandler::class,
'wincache' => \CodeIgniter\Cache\Handlers\WincacheHandler::class, 'wincache' => \CodeIgniter\Cache\Handlers\WincacheHandler::class,
]; ];
} }

View File

@ -21,7 +21,8 @@ defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');
| The path that Composer's autoload file is expected to live. By default, | The path that Composer's autoload file is expected to live. By default,
| the vendor folder is in the Root directory, but you can customize that here. | the vendor folder is in the Root directory, but you can customize that here.
*/ */
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php'); defined('COMPOSER_PATH') ||
define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -33,11 +34,11 @@ defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.
*/ */
defined('SECOND') || define('SECOND', 1); defined('SECOND') || define('SECOND', 1);
defined('MINUTE') || define('MINUTE', 60); defined('MINUTE') || define('MINUTE', 60);
defined('HOUR') || define('HOUR', 3600); defined('HOUR') || define('HOUR', 3600);
defined('DAY') || define('DAY', 86400); defined('DAY') || define('DAY', 86400);
defined('WEEK') || define('WEEK', 604800); defined('WEEK') || define('WEEK', 604800);
defined('MONTH') || define('MONTH', 2592000); defined('MONTH') || define('MONTH', 2592000);
defined('YEAR') || define('YEAR', 31536000); defined('YEAR') || define('YEAR', 31536000);
defined('DECADE') || define('DECADE', 315360000); defined('DECADE') || define('DECADE', 315360000);
/* /*
@ -65,13 +66,13 @@ defined('DECADE') || define('DECADE', 315360000);
| http://tldp.org/LDP/abs/html/exitcodes.html | http://tldp.org/LDP/abs/html/exitcodes.html
| |
*/ */
defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code

View File

@ -16,33 +16,32 @@ use CodeIgniter\Config\BaseConfig;
*/ */
class ContentSecurityPolicy extends BaseConfig class ContentSecurityPolicy extends BaseConfig
{ {
// broadbrush CSP management // broadbrush CSP management
public $reportOnly = false; // default CSP report context public $reportOnly = false; // default CSP report context
public $reportURI = null; // URL to send violation reports to public $reportURI = null; // URL to send violation reports to
public $upgradeInsecureRequests = false; // toggle for forcing https public $upgradeInsecureRequests = false; // toggle for forcing https
// sources allowed; string or array of strings // sources allowed; string or array of strings
// Note: once you set a policy to 'none', it cannot be further restricted // Note: once you set a policy to 'none', it cannot be further restricted
public $defaultSrc = null; // will default to self if not over-ridden public $defaultSrc = null; // will default to self if not over-ridden
public $scriptSrc = 'self'; public $scriptSrc = 'self';
public $styleSrc = 'self'; public $styleSrc = 'self';
public $imageSrc = 'self'; public $imageSrc = 'self';
public $baseURI = null; // will default to self if not over-ridden public $baseURI = null; // will default to self if not over-ridden
public $childSrc = 'self'; public $childSrc = 'self';
public $connectSrc = 'self'; public $connectSrc = 'self';
public $fontSrc = null; public $fontSrc = null;
public $formAction = 'self'; public $formAction = 'self';
public $frameAncestors = null; public $frameAncestors = null;
public $mediaSrc = null; public $mediaSrc = null;
public $objectSrc = 'self'; public $objectSrc = 'self';
public $manifestSrc = null; public $manifestSrc = null;
// mime types allowed; string or array of strings // mime types allowed; string or array of strings
public $pluginTypes = null; public $pluginTypes = null;
// list of actions allowed; string or array of strings
public $sandbox = null;
// list of actions allowed; string or array of strings
public $sandbox = null;
} }

View File

@ -8,107 +8,105 @@
class Database extends \CodeIgniter\Database\Config class Database extends \CodeIgniter\Database\Config
{ {
/** /**
* The directory that holds the Migrations * The directory that holds the Migrations
* and Seeds directories. * and Seeds directories.
* *
* @var string * @var string
*/ */
public $filesPath = APPPATH . 'Database/'; public $filesPath = APPPATH . 'Database/';
/** /**
* Lets you choose which connection group to * Lets you choose which connection group to
* use if no other is specified. * use if no other is specified.
* *
* @var string * @var string
*/ */
public $defaultGroup = 'default'; public $defaultGroup = 'default';
/** /**
* The default database connection. * The default database connection.
* *
* @var array * @var array
*/ */
public $default = [ public $default = [
'DSN' => '', 'DSN' => '',
'hostname' => 'localhost', 'hostname' => 'localhost',
'username' => '', 'username' => '',
'password' => '', 'password' => '',
'database' => '', 'database' => '',
'DBDriver' => 'MySQLi', 'DBDriver' => 'MySQLi',
'DBPrefix' => '', 'DBPrefix' => '',
'pConnect' => false, 'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'), 'DBDebug' => ENVIRONMENT !== 'production',
'cacheOn' => false, 'cacheOn' => false,
'cacheDir' => '', 'cacheDir' => '',
'charset' => 'utf8', 'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci', 'DBCollat' => 'utf8_general_ci',
'swapPre' => '', 'swapPre' => '',
'encrypt' => false, 'encrypt' => false,
'compress' => false, 'compress' => false,
'strictOn' => false, 'strictOn' => false,
'failover' => [], 'failover' => [],
'port' => 3306, 'port' => 3306,
]; ];
/** /**
* This database connection is used when * This database connection is used when
* running PHPUnit database tests. * running PHPUnit database tests.
* *
* @var array * @var array
*/ */
public $tests = [ public $tests = [
'DSN' => '', 'DSN' => '',
'hostname' => '127.0.0.1', 'hostname' => '127.0.0.1',
'username' => '', 'username' => '',
'password' => '', 'password' => '',
'database' => ':memory:', 'database' => ':memory:',
'DBDriver' => 'SQLite3', 'DBDriver' => 'SQLite3',
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS 'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
'pConnect' => false, 'pConnect' => false,
'DBDebug' => (ENVIRONMENT !== 'production'), 'DBDebug' => ENVIRONMENT !== 'production',
'cacheOn' => false, 'cacheOn' => false,
'cacheDir' => '', 'cacheDir' => '',
'charset' => 'utf8', 'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci', 'DBCollat' => 'utf8_general_ci',
'swapPre' => '', 'swapPre' => '',
'encrypt' => false, 'encrypt' => false,
'compress' => false, 'compress' => false,
'strictOn' => false, 'strictOn' => false,
'failover' => [], 'failover' => [],
'port' => 3306, 'port' => 3306,
]; ];
//-------------------------------------------------------------------- //--------------------------------------------------------------------
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
// Ensure that we always set the database group to 'tests' if // Ensure that we always set the database group to 'tests' if
// we are currently running an automated test suite, so that // we are currently running an automated test suite, so that
// we don't overwrite live data on accident. // we don't overwrite live data on accident.
if (ENVIRONMENT === 'testing') if (ENVIRONMENT === 'testing') {
{ $this->defaultGroup = 'tests';
$this->defaultGroup = 'tests';
// Under Travis-CI, we can set an ENV var named 'DB_GROUP' // Under Travis-CI, we can set an ENV var named 'DB_GROUP'
// so that we can test against multiple databases. // so that we can test against multiple databases.
if ($group = getenv('DB')) if ($group = getenv('DB')) {
{ if (is_file(TESTPATH . 'travis/Database.php')) {
if (is_file(TESTPATH . 'travis/Database.php')) require TESTPATH . 'travis/Database.php';
{
require TESTPATH . 'travis/Database.php';
if (! empty($dbconfig) && array_key_exists($group, $dbconfig)) if (
{ !empty($dbconfig) &&
$this->tests = $dbconfig[$group]; array_key_exists($group, $dbconfig)
} ) {
} $this->tests = $dbconfig[$group];
} }
} }
} }
}
//-------------------------------------------------------------------- }
//--------------------------------------------------------------------
} }

View File

@ -8,26 +8,43 @@
class DocTypes class DocTypes
{ {
public $list = public $list = [
[ 'xhtml11' =>
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', 'xhtml1-strict' =>
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', 'xhtml1-trans' =>
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'html5' => '<!DOCTYPE html>', 'xhtml1-frame' =>
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', 'xhtml-basic11' =>
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">', 'html5' => '<!DOCTYPE html>',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">', 'html4-strict' =>
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', 'html4-trans' =>
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">', 'html4-frame' =>
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">', 'mathml1' =>
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">', '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">', 'mathml2' =>
]; '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' =>
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' =>
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' =>
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' =>
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' =>
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' =>
'<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' =>
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' =>
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">',
];
} }

View File

@ -5,167 +5,165 @@ use CodeIgniter\Config\BaseConfig;
class Email extends BaseConfig class Email extends BaseConfig
{ {
/**
* @var string
*/
public $fromEmail;
/** /**
* @var string * @var string
*/ */
public $fromEmail; public $fromName;
/** /**
* @var string * @var string
*/ */
public $fromName; public $recipients;
/** /**
* @var string * The "user agent"
*/ *
public $recipients; * @var string
*/
public $userAgent = 'CodeIgniter';
/** /**
* The "user agent" * The mail sending protocol: mail, sendmail, smtp
* *
* @var string * @var string
*/ */
public $userAgent = 'CodeIgniter'; public $protocol = 'mail';
/** /**
* The mail sending protocol: mail, sendmail, smtp * The server path to Sendmail.
* *
* @var string * @var string
*/ */
public $protocol = 'mail'; public $mailPath = '/usr/sbin/sendmail';
/** /**
* The server path to Sendmail. * SMTP Server Address
* *
* @var string * @var string
*/ */
public $mailPath = '/usr/sbin/sendmail'; public $SMTPHost;
/** /**
* SMTP Server Address * SMTP Username
* *
* @var string * @var string
*/ */
public $SMTPHost; public $SMTPUser;
/** /**
* SMTP Username * SMTP Password
* *
* @var string * @var string
*/ */
public $SMTPUser; public $SMTPPass;
/** /**
* SMTP Password * SMTP Port
* *
* @var string * @var integer
*/ */
public $SMTPPass; public $SMTPPort = 25;
/** /**
* SMTP Port * SMTP Timeout (in seconds)
* *
* @var integer * @var integer
*/ */
public $SMTPPort = 25; public $SMTPTimeout = 5;
/** /**
* SMTP Timeout (in seconds) * Enable persistent SMTP connections
* *
* @var integer * @var boolean
*/ */
public $SMTPTimeout = 5; public $SMTPKeepAlive = false;
/** /**
* Enable persistent SMTP connections * SMTP Encryption. Either tls or ssl
* *
* @var boolean * @var string
*/ */
public $SMTPKeepAlive = false; public $SMTPCrypto = 'tls';
/** /**
* SMTP Encryption. Either tls or ssl * Enable word-wrap
* *
* @var string * @var boolean
*/ */
public $SMTPCrypto = 'tls'; public $wordWrap = true;
/** /**
* Enable word-wrap * Character count to wrap at
* *
* @var boolean * @var integer
*/ */
public $wordWrap = true; public $wrapChars = 76;
/** /**
* Character count to wrap at * Type of mail, either 'text' or 'html'
* *
* @var integer * @var string
*/ */
public $wrapChars = 76; public $mailType = 'text';
/** /**
* Type of mail, either 'text' or 'html' * Character set (utf-8, iso-8859-1, etc.)
* *
* @var string * @var string
*/ */
public $mailType = 'text'; public $charset = 'UTF-8';
/** /**
* Character set (utf-8, iso-8859-1, etc.) * Whether to validate the email address
* *
* @var string * @var boolean
*/ */
public $charset = 'UTF-8'; public $validate = false;
/** /**
* Whether to validate the email address * Email Priority. 1 = highest. 5 = lowest. 3 = normal
* *
* @var boolean * @var integer
*/ */
public $validate = false; public $priority = 3;
/** /**
* Email Priority. 1 = highest. 5 = lowest. 3 = normal * Newline character. (Use “\r\n” to comply with RFC 822)
* *
* @var integer * @var string
*/ */
public $priority = 3; public $CRLF = "\r\n";
/** /**
* Newline character. (Use “\r\n” to comply with RFC 822) * Newline character. (Use “\r\n” to comply with RFC 822)
* *
* @var string * @var string
*/ */
public $CRLF = "\r\n"; public $newline = "\r\n";
/** /**
* Newline character. (Use “\r\n” to comply with RFC 822) * Enable BCC Batch Mode.
* *
* @var string * @var boolean
*/ */
public $newline = "\r\n"; public $BCCBatchMode = false;
/** /**
* Enable BCC Batch Mode. * Number of emails in each BCC batch
* *
* @var boolean * @var integer
*/ */
public $BCCBatchMode = false; public $BCCBatchSize = 200;
/**
* Number of emails in each BCC batch
*
* @var integer
*/
public $BCCBatchSize = 200;
/**
* Enable notify message from server
*
* @var boolean
*/
public $DSN = false;
/**
* Enable notify message from server
*
* @var boolean
*/
public $DSN = false;
} }

View File

@ -11,7 +11,7 @@ use CodeIgniter\Config\BaseConfig;
*/ */
class Encryption extends BaseConfig class Encryption extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Encryption Key Starter | Encryption Key Starter
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -21,9 +21,9 @@ class Encryption extends BaseConfig
| See the user guide for more info. | See the user guide for more info.
*/ */
public $key = ''; public $key = '';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Encryption driver to use | Encryption driver to use
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -31,6 +31,5 @@ class Encryption extends BaseConfig
| One of the supported drivers, eg 'OpenSSL' or 'Sodium'. | One of the supported drivers, eg 'OpenSSL' or 'Sodium'.
| The default driver, if you don't specify one, is 'OpenSSL'. | The default driver, if you don't specify one, is 'OpenSSL'.
*/ */
public $driver = 'OpenSSL'; public $driver = 'OpenSSL';
} }

View File

@ -20,27 +20,27 @@ use CodeIgniter\Events\Events;
*/ */
Events::on('pre_system', function () { Events::on('pre_system', function () {
if (ENVIRONMENT !== 'testing') if (ENVIRONMENT !== 'testing') {
{ while (\ob_get_level() > 0) {
while (\ob_get_level() > 0) \ob_end_flush();
{ }
\ob_end_flush();
}
\ob_start(function ($buffer) { \ob_start(function ($buffer) {
return $buffer; return $buffer;
}); });
} }
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* Debug Toolbar Listeners. * Debug Toolbar Listeners.
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* If you delete, they will no longer be collected. * If you delete, they will no longer be collected.
*/ */
if (ENVIRONMENT !== 'production') if (ENVIRONMENT !== 'production') {
{ Events::on(
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); 'DBQuery',
Services::toolbar()->respond(); 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'
} );
Services::toolbar()->respond();
}
}); });

View File

@ -8,7 +8,7 @@
class Exceptions class Exceptions
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| LOG EXCEPTIONS? | LOG EXCEPTIONS?
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -17,18 +17,18 @@ class Exceptions
| |
| Default: true | Default: true
*/ */
public $log = true; public $log = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| DO NOT LOG STATUS CODES | DO NOT LOG STATUS CODES
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Any status codes here will NOT be logged if logging is turned on. | Any status codes here will NOT be logged if logging is turned on.
| By default, only 404 (Page Not Found) exceptions are ignored. | By default, only 404 (Page Not Found) exceptions are ignored.
*/ */
public $ignoreCodes = [ 404 ]; public $ignoreCodes = [404];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Error Views Path | Error Views Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -37,5 +37,5 @@ class Exceptions
| |
| Default: APPPATH.'Views/errors' | Default: APPPATH.'Views/errors'
*/ */
public $errorViewPath = APPPATH . 'Views/errors'; public $errorViewPath = APPPATH . 'Views/errors';
} }

View File

@ -4,33 +4,33 @@ use CodeIgniter\Config\BaseConfig;
class Filters extends BaseConfig class Filters extends BaseConfig
{ {
// Makes reading things below nicer, // Makes reading things below nicer,
// and simpler to change out script that's used. // and simpler to change out script that's used.
public $aliases = [ public $aliases = [
'csrf' => \CodeIgniter\Filters\CSRF::class, 'csrf' => \CodeIgniter\Filters\CSRF::class,
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class, 'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
'honeypot' => \CodeIgniter\Filters\Honeypot::class, 'honeypot' => \CodeIgniter\Filters\Honeypot::class,
]; ];
// Always applied before every request // Always applied before every request
public $globals = [ public $globals = [
'before' => [ 'before' => [
//'honeypot' //'honeypot'
// 'csrf', // 'csrf',
], ],
'after' => [ 'after' => [
'toolbar', 'toolbar',
//'honeypot' //'honeypot'
], ],
]; ];
// Works on all of a particular HTTP method // Works on all of a particular HTTP method
// (GET, POST, etc) as BEFORE filters only // (GET, POST, etc) as BEFORE filters only
// like: 'post' => ['CSRF', 'throttle'], // like: 'post' => ['CSRF', 'throttle'],
public $methods = []; public $methods = [];
// List filter aliases and any before/after uri patterns // List filter aliases and any before/after uri patterns
// that they should run on, like: // that they should run on, like:
// 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']], // 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']],
public $filters = []; public $filters = [];
} }

View File

@ -2,5 +2,4 @@
class ForeignCharacters extends \CodeIgniter\Config\ForeignCharacters class ForeignCharacters extends \CodeIgniter\Config\ForeignCharacters
{ {
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Format extends BaseConfig class Format extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Available Response Formats | Available Response Formats
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -18,13 +18,13 @@ class Format extends BaseConfig
| method is an array. | method is an array.
| |
*/ */
public $supportedResponseFormats = [ public $supportedResponseFormats = [
'application/json', 'application/json',
'application/xml', // machine-readable XML 'application/xml', // machine-readable XML
'text/xml', // human-readable XML 'text/xml', // human-readable XML
]; ];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Formatters | Formatters
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -34,38 +34,39 @@ class Format extends BaseConfig
| can be retrieved through the getFormatter() method. | can be retrieved through the getFormatter() method.
| |
*/ */
public $formatters = [ public $formatters = [
'application/json' => \CodeIgniter\Format\JSONFormatter::class, 'application/json' => \CodeIgniter\Format\JSONFormatter::class,
'application/xml' => \CodeIgniter\Format\XMLFormatter::class, 'application/xml' => \CodeIgniter\Format\XMLFormatter::class,
'text/xml' => \CodeIgniter\Format\XMLFormatter::class, 'text/xml' => \CodeIgniter\Format\XMLFormatter::class,
]; ];
//-------------------------------------------------------------------- //--------------------------------------------------------------------
/** /**
* A Factory method to return the appropriate formatter for the given mime type. * A Factory method to return the appropriate formatter for the given mime type.
* *
* @param string $mime * @param string $mime
* *
* @return \CodeIgniter\Format\FormatterInterface * @return \CodeIgniter\Format\FormatterInterface
*/ */
public function getFormatter(string $mime) public function getFormatter(string $mime)
{ {
if (! array_key_exists($mime, $this->formatters)) if (!array_key_exists($mime, $this->formatters)) {
{ throw new \InvalidArgumentException(
throw new \InvalidArgumentException('No Formatter defined for mime type: ' . $mime); 'No Formatter defined for mime type: ' . $mime
} );
}
$class = $this->formatters[$mime]; $class = $this->formatters[$mime];
if (! class_exists($class)) if (!class_exists($class)) {
{ throw new \BadMethodCallException(
throw new \BadMethodCallException($class . ' is not a valid Formatter.'); $class . ' is not a valid Formatter.'
} );
}
return new $class(); return new $class();
} }
//--------------------------------------------------------------------
//--------------------------------------------------------------------
} }

View File

@ -4,31 +4,30 @@ use CodeIgniter\Config\BaseConfig;
class Honeypot extends BaseConfig class Honeypot extends BaseConfig
{ {
/**
* Makes Honeypot visible or not to human
*
* @var boolean
*/
public $hidden = true;
/**
* Honeypot Label Content
*
* @var string
*/
public $label = 'Fill This Field';
/** /**
* Makes Honeypot visible or not to human * Honeypot Field Name
* *
* @var boolean * @var string
*/ */
public $hidden = true; public $name = 'honeypot';
/**
* Honeypot Label Content
*
* @var string
*/
public $label = 'Fill This Field';
/** /**
* Honeypot Field Name * Honeypot HTML Template
* *
* @var string * @var string
*/ */
public $name = 'honeypot'; public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>';
/**
* Honeypot HTML Template
*
* @var string
*/
public $template = '<label>{label}</label><input type="text" name="{name}" value=""/>';
} }

View File

@ -4,28 +4,28 @@ use CodeIgniter\Config\BaseConfig;
class Images extends BaseConfig class Images extends BaseConfig
{ {
/** /**
* Default handler used if no other handler is specified. * Default handler used if no other handler is specified.
* *
* @var string * @var string
*/ */
public $defaultHandler = 'gd'; public $defaultHandler = 'gd';
/** /**
* The path to the image library. * The path to the image library.
* Required for ImageMagick, GraphicsMagick, or NetPBM. * Required for ImageMagick, GraphicsMagick, or NetPBM.
* *
* @var string * @var string
*/ */
public $libraryPath = '/usr/local/bin/convert'; public $libraryPath = '/usr/local/bin/convert';
/** /**
* The available handler classes. * The available handler classes.
* *
* @var array * @var array
*/ */
public $handlers = [ public $handlers = [
'gd' => \CodeIgniter\Images\Handlers\GDHandler::class, 'gd' => \CodeIgniter\Images\Handlers\GDHandler::class,
'imagick' => \CodeIgniter\Images\Handlers\ImageMagickHandler::class, 'imagick' => \CodeIgniter\Images\Handlers\ImageMagickHandler::class,
]; ];
} }

View File

@ -5,7 +5,7 @@ use Kint\Renderer\Renderer;
class Kint extends BaseConfig class Kint extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Kint | Kint
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -18,45 +18,45 @@ class Kint extends BaseConfig
| |
*/ */
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Global Settings | Global Settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
public $plugins = null; public $plugins = null;
public $maxDepth = 6; public $maxDepth = 6;
public $displayCalledFrom = true; public $displayCalledFrom = true;
public $expanded = false; public $expanded = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| RichRenderer Settings | RichRenderer Settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
public $richTheme = 'aante-light.css'; public $richTheme = 'aante-light.css';
public $richFolder = false; public $richFolder = false;
public $richSort = Renderer::SORT_FULL; public $richSort = Renderer::SORT_FULL;
public $richObjectPlugins = null; public $richObjectPlugins = null;
public $richTabPlugins = null; public $richTabPlugins = null;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| CLI Settings | CLI Settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
public $cliColors = true; public $cliColors = true;
public $cliForceUTF8 = false; public $cliForceUTF8 = false;
public $cliDetectWidth = true; public $cliDetectWidth = true;
public $cliMinWidth = 40; public $cliMinWidth = 40;
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Logger extends BaseConfig class Logger extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Error Logging Threshold | Error Logging Threshold
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -32,9 +32,9 @@ class Logger extends BaseConfig
| your log files will fill up very fast. | your log files will fill up very fast.
| |
*/ */
public $threshold = 3; public $threshold = 3;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Date Format for Logs | Date Format for Logs
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -43,9 +43,9 @@ class Logger extends BaseConfig
| codes to set your own date formatting | codes to set your own date formatting
| |
*/ */
public $dateFormat = 'Y-m-d H:i:s'; public $dateFormat = 'Y-m-d H:i:s';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Log Handlers | Log Handlers
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -69,64 +69,62 @@ class Logger extends BaseConfig
| the handler on top and continuing down. | the handler on top and continuing down.
| |
*/ */
public $handlers = [ public $handlers = [
//--------------------------------------------------------------------
// File Handler
//--------------------------------------------------------------------
//-------------------------------------------------------------------- 'CodeIgniter\Log\Handlers\FileHandler' => [
// File Handler /*
//-------------------------------------------------------------------- * The log levels that this handler will handle.
*/
'handles' => [
'critical',
'alert',
'emergency',
'debug',
'error',
'info',
'notice',
'warning',
],
'CodeIgniter\Log\Handlers\FileHandler' => [ /*
* The default filename extension for log files.
* An extension of '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 'log'.
*/
'fileExtension' => '',
/* /*
* The log levels that this handler will handle. * The file system permissions to be applied on newly created log files.
*/ *
'handles' => [ * IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
'critical', * integer notation (i.e. 0700, 0644, etc.)
'alert', */
'emergency', 'filePermissions' => 0644,
'debug',
'error',
'info',
'notice',
'warning',
],
/* /*
* The default filename extension for log files. * Logging Directory Path
* An extension of 'php' allows for protecting the log files via basic *
* scripting, when they are to be stored under a publicly accessible directory. * By default, logs are written to WRITEPATH . 'logs/'
* * Specify a different destination here, if desired.
* Note: Leaving it blank will default to 'log'. */
*/ 'path' => '',
'fileExtension' => '', ],
/* /**
* The file system permissions to be applied on newly created log files. * The ChromeLoggerHandler requires the use of the Chrome web browser
* * and the ChromeLogger extension. Uncomment this block to use it.
* IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal */
* integer notation (i.e. 0700, 0644, etc.) // 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [
*/ // /*
'filePermissions' => 0644, // * The log levels that this handler will handle.
// */
/* // 'handles' => ['critical', 'alert', 'emergency', 'debug',
* Logging Directory Path // 'error', 'info', 'notice', 'warning'],
* // ]
* By default, logs are written to WRITEPATH . 'logs/' ];
* Specify a different destination here, if desired.
*/
'path' => '',
],
/**
* 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'],
// ]
];
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Migrations extends BaseConfig class Migrations extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Enable/Disable Migrations | Enable/Disable Migrations
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -14,9 +14,9 @@ class Migrations extends BaseConfig
| and disable it back when you're done. | and disable it back when you're done.
| |
*/ */
public $enabled = true; public $enabled = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Migrations table | Migrations table
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -28,9 +28,9 @@ class Migrations extends BaseConfig
| will migrate up. This must be set. | will migrate up. This must be set.
| |
*/ */
public $table = 'migrations'; public $table = 'migrations';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Timestamp Format | Timestamp Format
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -45,6 +45,5 @@ class Migrations extends BaseConfig
| Y_m_d_His_ | Y_m_d_His_
| |
*/ */
public $timestampFormat = 'Y-m-d-His_'; public $timestampFormat = 'Y-m-d-His_';
} }

View File

@ -15,516 +15,365 @@
*/ */
class Mimes class Mimes
{ {
/** /**
* Map of extensions to mime types. * Map of extensions to mime types.
* *
* @var array * @var array
*/ */
public static $mimes = [ public static $mimes = [
'hqx' => [ 'hqx' => [
'application/mac-binhex40', 'application/mac-binhex40',
'application/mac-binhex', 'application/mac-binhex',
'application/x-binhex40', 'application/x-binhex40',
'application/x-mac-binhex40', 'application/x-mac-binhex40',
], ],
'cpt' => 'application/mac-compactpro', 'cpt' => 'application/mac-compactpro',
'csv' => [ 'csv' => [
'text/csv', 'text/csv',
'text/x-comma-separated-values', 'text/x-comma-separated-values',
'text/comma-separated-values', 'text/comma-separated-values',
'application/octet-stream', 'application/octet-stream',
'application/vnd.ms-excel', 'application/vnd.ms-excel',
'application/x-csv', 'application/x-csv',
'text/x-csv', 'text/x-csv',
'application/csv', 'application/csv',
'application/excel', 'application/excel',
'application/vnd.msexcel', 'application/vnd.msexcel',
'text/plain', 'text/plain',
], ],
'bin' => [ 'bin' => [
'application/macbinary', 'application/macbinary',
'application/mac-binary', 'application/mac-binary',
'application/octet-stream', 'application/octet-stream',
'application/x-binary', 'application/x-binary',
'application/x-macbinary', 'application/x-macbinary',
], ],
'dms' => 'application/octet-stream', 'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream', 'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream', 'lzh' => 'application/octet-stream',
'exe' => [ 'exe' => ['application/octet-stream', 'application/x-msdownload'],
'application/octet-stream', 'class' => 'application/octet-stream',
'application/x-msdownload', 'psd' => ['application/x-photoshop', 'image/vnd.adobe.photoshop'],
], 'so' => 'application/octet-stream',
'class' => 'application/octet-stream', 'sea' => 'application/octet-stream',
'psd' => [ 'dll' => 'application/octet-stream',
'application/x-photoshop', 'oda' => 'application/oda',
'image/vnd.adobe.photoshop', 'pdf' => [
], 'application/pdf',
'so' => 'application/octet-stream', 'application/force-download',
'sea' => 'application/octet-stream', 'application/x-download',
'dll' => 'application/octet-stream', 'binary/octet-stream',
'oda' => 'application/oda', ],
'pdf' => [ 'ai' => ['application/pdf', 'application/postscript'],
'application/pdf', 'eps' => 'application/postscript',
'application/force-download', 'ps' => 'application/postscript',
'application/x-download', 'smi' => 'application/smil',
'binary/octet-stream', 'smil' => 'application/smil',
], 'mif' => 'application/vnd.mif',
'ai' => [ 'xls' => [
'application/pdf', 'application/vnd.ms-excel',
'application/postscript', 'application/msexcel',
], 'application/x-msexcel',
'eps' => 'application/postscript', 'application/x-ms-excel',
'ps' => 'application/postscript', 'application/x-excel',
'smi' => 'application/smil', 'application/x-dos_ms_excel',
'smil' => 'application/smil', 'application/xls',
'mif' => 'application/vnd.mif', 'application/x-xls',
'xls' => [ 'application/excel',
'application/vnd.ms-excel', 'application/download',
'application/msexcel', 'application/vnd.ms-office',
'application/x-msexcel', 'application/msword',
'application/x-ms-excel', ],
'application/x-excel', 'ppt' => [
'application/x-dos_ms_excel', 'application/vnd.ms-powerpoint',
'application/xls', 'application/powerpoint',
'application/x-xls', 'application/vnd.ms-office',
'application/excel', 'application/msword',
'application/download', ],
'application/vnd.ms-office', 'pptx' => [
'application/msword', 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
], 'application/x-zip',
'ppt' => [ 'application/zip',
'application/vnd.ms-powerpoint', ],
'application/powerpoint', 'wbxml' => 'application/wbxml',
'application/vnd.ms-office', 'wmlc' => 'application/wmlc',
'application/msword', 'dcr' => 'application/x-director',
], 'dir' => 'application/x-director',
'pptx' => [ 'dxr' => 'application/x-director',
'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'dvi' => 'application/x-dvi',
'application/x-zip', 'gtar' => 'application/x-gtar',
'application/zip', 'gz' => 'application/x-gzip',
], 'gzip' => 'application/x-gzip',
'wbxml' => 'application/wbxml', 'php' => [
'wmlc' => 'application/wmlc', 'application/x-php',
'dcr' => 'application/x-director', 'application/x-httpd-php',
'dir' => 'application/x-director', 'application/php',
'dxr' => 'application/x-director', 'text/php',
'dvi' => 'application/x-dvi', 'text/x-php',
'gtar' => 'application/x-gtar', 'application/x-httpd-php-source',
'gz' => 'application/x-gzip', ],
'gzip' => 'application/x-gzip', 'php4' => 'application/x-httpd-php',
'php' => [ 'php3' => 'application/x-httpd-php',
'application/x-php', 'phtml' => 'application/x-httpd-php',
'application/x-httpd-php', 'phps' => 'application/x-httpd-php-source',
'application/php', 'js' => ['application/x-javascript', 'text/plain'],
'text/php', 'swf' => 'application/x-shockwave-flash',
'text/x-php', 'sit' => 'application/x-stuffit',
'application/x-httpd-php-source', 'tar' => 'application/x-tar',
], 'tgz' => ['application/x-tar', 'application/x-gzip-compressed'],
'php4' => 'application/x-httpd-php', 'z' => 'application/x-compress',
'php3' => 'application/x-httpd-php', 'xhtml' => 'application/xhtml+xml',
'phtml' => 'application/x-httpd-php', 'xht' => 'application/xhtml+xml',
'phps' => 'application/x-httpd-php-source', 'zip' => [
'js' => [ 'application/x-zip',
'application/x-javascript', 'application/zip',
'text/plain', 'application/x-zip-compressed',
], 'application/s-compressed',
'swf' => 'application/x-shockwave-flash', 'multipart/x-zip',
'sit' => 'application/x-stuffit', ],
'tar' => 'application/x-tar', 'rar' => [
'tgz' => [ 'application/x-rar',
'application/x-tar', 'application/rar',
'application/x-gzip-compressed', 'application/x-rar-compressed',
], ],
'z' => 'application/x-compress', 'mid' => 'audio/midi',
'xhtml' => 'application/xhtml+xml', 'midi' => 'audio/midi',
'xht' => 'application/xhtml+xml', 'mpga' => 'audio/mpeg',
'zip' => [ 'mp2' => 'audio/mpeg',
'application/x-zip', 'mp3' => ['audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'],
'application/zip', 'aif' => ['audio/x-aiff', 'audio/aiff'],
'application/x-zip-compressed', 'aiff' => ['audio/x-aiff', 'audio/aiff'],
'application/s-compressed', 'aifc' => 'audio/x-aiff',
'multipart/x-zip', 'ram' => 'audio/x-pn-realaudio',
], 'rm' => 'audio/x-pn-realaudio',
'rar' => [ 'rpm' => 'audio/x-pn-realaudio-plugin',
'application/x-rar', 'ra' => 'audio/x-realaudio',
'application/rar', 'rv' => 'video/vnd.rn-realvideo',
'application/x-rar-compressed', 'wav' => ['audio/x-wav', 'audio/wave', 'audio/wav'],
], 'bmp' => [
'mid' => 'audio/midi', 'image/bmp',
'midi' => 'audio/midi', 'image/x-bmp',
'mpga' => 'audio/mpeg', 'image/x-bitmap',
'mp2' => 'audio/mpeg', 'image/x-xbitmap',
'mp3' => [ 'image/x-win-bitmap',
'audio/mpeg', 'image/x-windows-bmp',
'audio/mpg', 'image/ms-bmp',
'audio/mpeg3', 'image/x-ms-bmp',
'audio/mp3', 'application/bmp',
], 'application/x-bmp',
'aif' => [ 'application/x-win-bitmap',
'audio/x-aiff', ],
'audio/aiff', 'gif' => 'image/gif',
], 'jpg' => ['image/jpeg', 'image/pjpeg'],
'aiff' => [ 'jpeg' => ['image/jpeg', 'image/pjpeg'],
'audio/x-aiff', 'jpe' => ['image/jpeg', 'image/pjpeg'],
'audio/aiff', 'jp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
], 'j2k' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'aifc' => 'audio/x-aiff', 'jpf' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'ram' => 'audio/x-pn-realaudio', 'jpg2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'rm' => 'audio/x-pn-realaudio', 'jpx' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'rpm' => 'audio/x-pn-realaudio-plugin', 'jpm' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'ra' => 'audio/x-realaudio', 'mj2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'rv' => 'video/vnd.rn-realvideo', 'mjp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'],
'wav' => [ 'png' => ['image/png', 'image/x-png'],
'audio/x-wav', 'tif' => 'image/tiff',
'audio/wave', 'tiff' => 'image/tiff',
'audio/wav', 'css' => ['text/css', 'text/plain'],
], 'html' => ['text/html', 'text/plain'],
'bmp' => [ 'htm' => ['text/html', 'text/plain'],
'image/bmp', 'shtml' => ['text/html', 'text/plain'],
'image/x-bmp', 'txt' => 'text/plain',
'image/x-bitmap', 'text' => 'text/plain',
'image/x-xbitmap', 'log' => ['text/plain', 'text/x-log'],
'image/x-win-bitmap', 'rtx' => 'text/richtext',
'image/x-windows-bmp', 'rtf' => 'text/rtf',
'image/ms-bmp', 'xml' => ['application/xml', 'text/xml', 'text/plain'],
'image/x-ms-bmp', 'xsl' => ['application/xml', 'text/xsl', 'text/xml'],
'application/bmp', 'mpeg' => 'video/mpeg',
'application/x-bmp', 'mpg' => 'video/mpeg',
'application/x-win-bitmap', 'mpe' => 'video/mpeg',
], 'qt' => 'video/quicktime',
'gif' => 'image/gif', 'mov' => 'video/quicktime',
'jpg' => [ 'avi' => [
'image/jpeg', 'video/x-msvideo',
'image/pjpeg', 'video/msvideo',
], 'video/avi',
'jpeg' => [ 'application/x-troff-msvideo',
'image/jpeg', ],
'image/pjpeg', 'movie' => 'video/x-sgi-movie',
], 'doc' => ['application/msword', 'application/vnd.ms-office'],
'jpe' => [ 'docx' => [
'image/jpeg', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'image/pjpeg', 'application/zip',
], 'application/msword',
'jp2' => [ 'application/x-zip',
'image/jp2', ],
'video/mj2', 'dot' => ['application/msword', 'application/vnd.ms-office'],
'image/jpx', 'dotx' => [
'image/jpm', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
], 'application/zip',
'j2k' => [ 'application/msword',
'image/jp2', ],
'video/mj2', 'xlsx' => [
'image/jpx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'image/jpm', 'application/zip',
], 'application/vnd.ms-excel',
'jpf' => [ 'application/msword',
'image/jp2', 'application/x-zip',
'video/mj2', ],
'image/jpx', 'word' => ['application/msword', 'application/octet-stream'],
'image/jpm', 'xl' => 'application/excel',
], 'eml' => 'message/rfc822',
'jpg2' => [ 'json' => ['application/json', 'text/json'],
'image/jp2', 'pem' => [
'video/mj2', 'application/x-x509-user-cert',
'image/jpx', 'application/x-pem-file',
'image/jpm', 'application/octet-stream',
], ],
'jpx' => [ 'p10' => ['application/x-pkcs10', 'application/pkcs10'],
'image/jp2', 'p12' => 'application/x-pkcs12',
'video/mj2', 'p7a' => 'application/x-pkcs7-signature',
'image/jpx', 'p7c' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
'image/jpm', 'p7m' => ['application/pkcs7-mime', 'application/x-pkcs7-mime'],
], 'p7r' => 'application/x-pkcs7-certreqresp',
'jpm' => [ 'p7s' => 'application/pkcs7-signature',
'image/jp2', 'crt' => [
'video/mj2', 'application/x-x509-ca-cert',
'image/jpx', 'application/x-x509-user-cert',
'image/jpm', 'application/pkix-cert',
], ],
'mj2' => [ 'crl' => ['application/pkix-crl', 'application/pkcs-crl'],
'image/jp2', 'der' => 'application/x-x509-ca-cert',
'video/mj2', 'kdb' => 'application/octet-stream',
'image/jpx', 'pgp' => 'application/pgp',
'image/jpm', 'gpg' => 'application/gpg-keys',
], 'sst' => 'application/octet-stream',
'mjp2' => [ 'csr' => 'application/octet-stream',
'image/jp2', 'rsa' => 'application/x-pkcs7',
'video/mj2', 'cer' => ['application/pkix-cert', 'application/x-x509-ca-cert'],
'image/jpx', '3g2' => 'video/3gpp2',
'image/jpm', '3gp' => ['video/3gp', 'video/3gpp'],
], 'mp4' => 'video/mp4',
'png' => [ 'm4a' => 'audio/x-m4a',
'image/png', 'f4v' => ['video/mp4', 'video/x-f4v'],
'image/x-png', 'flv' => 'video/x-flv',
], 'webm' => 'video/webm',
'tif' => 'image/tiff', 'aac' => 'audio/x-acc',
'tiff' => 'image/tiff', 'm4u' => 'application/vnd.mpegurl',
'css' => [ 'm3u' => 'text/plain',
'text/css', 'xspf' => 'application/xspf+xml',
'text/plain', 'vlc' => 'application/videolan',
], 'wmv' => ['video/x-ms-wmv', 'video/x-ms-asf'],
'html' => [ 'au' => 'audio/x-au',
'text/html', 'ac3' => 'audio/ac3',
'text/plain', 'flac' => 'audio/x-flac',
], 'ogg' => ['audio/ogg', 'video/ogg', 'application/ogg'],
'htm' => [ 'kmz' => [
'text/html', 'application/vnd.google-earth.kmz',
'text/plain', 'application/zip',
], 'application/x-zip',
'shtml' => [ ],
'text/html', 'kml' => [
'text/plain', 'application/vnd.google-earth.kml+xml',
], 'application/xml',
'txt' => 'text/plain', 'text/xml',
'text' => 'text/plain', ],
'log' => [ 'ics' => 'text/calendar',
'text/plain', 'ical' => 'text/calendar',
'text/x-log', 'zsh' => 'text/x-scriptzsh',
], '7zip' => [
'rtx' => 'text/richtext', 'application/x-compressed',
'rtf' => 'text/rtf', 'application/x-zip-compressed',
'xml' => [ 'application/zip',
'application/xml', 'multipart/x-zip',
'text/xml', ],
'text/plain', 'cdr' => [
], 'application/cdr',
'xsl' => [ 'application/coreldraw',
'application/xml', 'application/x-cdr',
'text/xsl', 'application/x-coreldraw',
'text/xml', 'image/cdr',
], 'image/x-cdr',
'mpeg' => 'video/mpeg', 'zz-application/zz-winassoc-cdr',
'mpg' => 'video/mpeg', ],
'mpe' => 'video/mpeg', 'wma' => ['audio/x-ms-wma', 'video/x-ms-asf'],
'qt' => 'video/quicktime', 'jar' => [
'mov' => 'video/quicktime', 'application/java-archive',
'avi' => [ 'application/x-java-application',
'video/x-msvideo', 'application/x-jar',
'video/msvideo', 'application/x-compressed',
'video/avi', ],
'application/x-troff-msvideo', 'svg' => ['image/svg+xml', 'application/xml', 'text/xml'],
], 'vcf' => 'text/x-vcard',
'movie' => 'video/x-sgi-movie', 'srt' => ['text/srt', 'text/plain'],
'doc' => [ 'vtt' => ['text/vtt', 'text/plain'],
'application/msword', 'ico' => ['image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'],
'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. * Attempts to determine the best mime type for the given file extension.
* *
* @param string $extension * @param string $extension
* *
* @return string|null The mime type found, or none if unable to determine. * @return string|null The mime type found, or none if unable to determine.
*/ */
public static function guessTypeFromExtension(string $extension) public static function guessTypeFromExtension(string $extension)
{ {
$extension = trim(strtolower($extension), '. '); $extension = trim(strtolower($extension), '. ');
if (! array_key_exists($extension, static::$mimes)) if (!array_key_exists($extension, static::$mimes)) {
{ return null;
return null; }
}
return is_array(static::$mimes[$extension]) ? static::$mimes[$extension][0] : static::$mimes[$extension]; 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. * Attempts to determine the best file extension for a given mime type.
* *
* @param string $type * @param string $type
* @param string $proposed_extension - default extension (in case there is more than one with the same mime 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. * @return string|null The extension determined, or null if unable to match.
*/ */
public static function guessExtensionFromType(string $type, ?string $proposed_extension = null) public static function guessExtensionFromType(
{ string $type,
$type = trim(strtolower($type), '. '); ?string $proposed_extension = null
) {
$type = trim(strtolower($type), '. ');
$proposed_extension = trim(strtolower($proposed_extension)); $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])) if (
{ !is_null($proposed_extension) &&
return $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) foreach (static::$mimes as $ext => $types) {
{ if (
if ((is_string($types) && $types === $type) || (is_array($types) && in_array($type, $types))) (is_string($types) && $types === $type) ||
{ (is_array($types) && in_array($type, $types))
return $ext; ) {
} return $ext;
} }
}
return null; return null;
} }
//--------------------------------------------------------------------
//--------------------------------------------------------------------
} }

View File

@ -3,7 +3,7 @@
// Cannot extend BaseConfig or looping resources occurs. // Cannot extend BaseConfig or looping resources occurs.
class Modules class Modules
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Auto-Discovery Enabled? | Auto-Discovery Enabled?
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -12,9 +12,9 @@ class Modules
| $activeExplorers below. If false, no auto-discovery will happen at all, | $activeExplorers below. If false, no auto-discovery will happen at all,
| giving a slight performance boost. | giving a slight performance boost.
*/ */
public $enabled = true; public $enabled = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Auto-Discovery Within Composer Packages Enabled? | Auto-Discovery Within Composer Packages Enabled?
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -22,9 +22,9 @@ class Modules
| If true, then auto-discovery will happen across all namespaces loaded | If true, then auto-discovery will happen across all namespaces loaded
| by Composer, as well as the namespaces configured locally. | by Composer, as well as the namespaces configured locally.
*/ */
public $discoverInComposer = true; public $discoverInComposer = true;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Auto-discover Rules | Auto-discover Rules
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -33,35 +33,29 @@ class Modules
| and used during the current application request. If it is not | and used during the current application request. If it is not
| listed here, only the base application elements will be used. | listed here, only the base application elements will be used.
*/ */
public $activeExplorers = [ public $activeExplorers = ['events', 'registrars', 'routes', 'services'];
'events',
'registrars',
'routes',
'services',
];
/** /**
* Should the application auto-discover the requested resources. * Should the application auto-discover the requested resources.
* *
* Valid values are: * Valid values are:
* - events * - events
* - registrars * - registrars
* - routes * - routes
* - services * - services
* *
* @param string $alias * @param string $alias
* *
* @return boolean * @return boolean
*/ */
public function shouldDiscover(string $alias) public function shouldDiscover(string $alias)
{ {
if (! $this->enabled) if (!$this->enabled) {
{ return false;
return false; }
}
$alias = strtolower($alias); $alias = strtolower($alias);
return in_array($alias, $this->activeExplorers); return in_array($alias, $this->activeExplorers);
} }
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Pager extends BaseConfig class Pager extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Templates | Templates
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -17,13 +17,13 @@ class Pager extends BaseConfig
| and the desired group as $pagerGroup; | and the desired group as $pagerGroup;
| |
*/ */
public $templates = [ public $templates = [
'default_full' => 'CodeIgniter\Pager\Views\default_full', 'default_full' => 'CodeIgniter\Pager\Views\default_full',
'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
'default_head' => 'CodeIgniter\Pager\Views\default_head', 'default_head' => 'CodeIgniter\Pager\Views\default_head',
]; ];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Items Per Page | Items Per Page
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -31,5 +31,5 @@ class Pager extends BaseConfig
| The default number of results shown in a single page. | The default number of results shown in a single page.
| |
*/ */
public $perPage = 20; public $perPage = 20;
} }

View File

@ -11,67 +11,68 @@
class Paths class Paths
{ {
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* SYSTEM FOLDER NAME * SYSTEM FOLDER NAME
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* This variable must contain the name of your "system" folder. * This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory * Include the path if the folder is not in the same directory
* as this file. * as this file.
*/ */
public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system'; public $systemDirectory =
__DIR__ . '/../../vendor/codeigniter4/framework/system';
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* APPLICATION FOLDER NAME * APPLICATION FOLDER NAME
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* If you want this front controller to use a different "app" * If you want this front controller to use a different "app"
* folder than the default one you can set its name here. The folder * folder than the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your getServer. If * can also be renamed or relocated anywhere on your getServer. If
* you do, use a full getServer path. For more info please see the user guide: * you do, use a full getServer path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html * http://codeigniter.com/user_guide/general/managing_apps.html
* *
* NO TRAILING SLASH! * NO TRAILING SLASH!
*/ */
public $appDirectory = __DIR__ . '/..'; public $appDirectory = __DIR__ . '/..';
/* /*
* --------------------------------------------------------------- * ---------------------------------------------------------------
* WRITABLE DIRECTORY NAME * WRITABLE DIRECTORY NAME
* --------------------------------------------------------------- * ---------------------------------------------------------------
* *
* This variable must contain the name of your "writable" directory. * This variable must contain the name of your "writable" directory.
* The writable directory allows you to group all directories that * The writable directory allows you to group all directories that
* need write permission to a single place that can be tucked away * need write permission to a single place that can be tucked away
* for maximum security, keeping it out of the app and/or * for maximum security, keeping it out of the app and/or
* system directories. * system directories.
*/ */
public $writableDirectory = __DIR__ . '/../../writable'; public $writableDirectory = __DIR__ . '/../../writable';
/* /*
* --------------------------------------------------------------- * ---------------------------------------------------------------
* TESTS DIRECTORY NAME * TESTS DIRECTORY NAME
* --------------------------------------------------------------- * ---------------------------------------------------------------
* *
* This variable must contain the name of your "tests" directory. * This variable must contain the name of your "tests" directory.
* The writable directory allows you to group all directories that * The writable directory allows you to group all directories that
* need write permission to a single place that can be tucked away * need write permission to a single place that can be tucked away
* for maximum security, keeping it out of the app and/or * for maximum security, keeping it out of the app and/or
* system directories. * system directories.
*/ */
public $testsDirectory = __DIR__ . '/../../tests'; public $testsDirectory = __DIR__ . '/../../tests';
/* /*
* --------------------------------------------------------------- * ---------------------------------------------------------------
* VIEW DIRECTORY NAME * VIEW DIRECTORY NAME
* --------------------------------------------------------------- * ---------------------------------------------------------------
* *
* This variable must contain the name of the directory that * This variable must contain the name of the directory that
* contains the view files used by your application. By * contains the view files used by your application. By
* default this is in `app/Views`. This value * default this is in `app/Views`. This value
* is used when no value is provided to `Services::renderer()`. * is used when no value is provided to `Services::renderer()`.
*/ */
public $viewDirectory = __DIR__ . '/../Views'; public $viewDirectory = __DIR__ . '/../Views';
} }

View File

@ -1,4 +1,6 @@
<?php namespace Config; <?php
namespace Config;
// Create a new instance of our RouteCollection class. // Create a new instance of our RouteCollection class.
$routes = Services::routes(); $routes = Services::routes();
@ -20,7 +22,8 @@ $routes->setDefaultMethod('index');
$routes->setTranslateURIDashes(false); $routes->setTranslateURIDashes(false);
$routes->set404Override(); $routes->set404Override();
$routes->setAutoRoute(false); $routes->setAutoRoute(false);
$routes->addPlaceholder('podcastName', '^@[a-z0-9\_]{1,191}$'); $routes->addPlaceholder('podcastSlug', '@[a-z0-9\_]{1,191}');
$routes->addPlaceholder('episodeSlug', '[a-z0-9\-]{1,191}');
/** /**
* -------------------------------------------------------------------- * --------------------------------------------------------------------
@ -30,9 +33,18 @@ $routes->addPlaceholder('podcastName', '^@[a-z0-9\_]{1,191}$');
// We get a performance increase by specifying the default // We get a performance increase by specifying the default
// route since we don't have to scan directories. // route since we don't have to scan directories.
$routes->get('/', 'Home::index'); $routes->get('/', 'Home::index', ['as' => 'home']);
$routes->add('/podcasts/create', 'Podcasts::create'); $routes->add('new-podcast', 'Podcasts::create', ['as' => 'podcasts_create']);
$routes->add('/(:podcastName)', 'Podcasts::podcastByHandle/$1');
$routes->group('(:podcastSlug)', function ($routes) {
$routes->add('/', 'Podcasts::view/$1', ['as' => 'podcasts_view']);
$routes->add('new-episode', 'Episodes::create/$1', [
'as' => 'episodes_create',
]);
$routes->add('(:episodeSlug)', 'Episodes::view/$1/$2', [
'as' => 'episodes_view',
]);
});
/** /**
* -------------------------------------------------------------------- * --------------------------------------------------------------------

View File

@ -19,14 +19,11 @@ require_once SYSTEMPATH . 'Config/Services.php';
*/ */
class Services extends CoreServices class Services extends CoreServices
{ {
// public static function example($getShared = true)
// public static function example($getShared = true) // {
// { // if ($getShared) {
// if ($getShared) // return static::getSharedInstance('example');
// { // }
// return static::getSharedInstance('example'); // return new \CodeIgniter\Example();
// } // }
//
// return new \CodeIgniter\Example();
// }
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class Toolbar extends BaseConfig class Toolbar extends BaseConfig
{ {
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Debug Toolbar | Debug Toolbar
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -16,18 +16,18 @@ class Toolbar extends BaseConfig
| toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited | toolbarMaxHistory = Number of history files, 0 for none or -1 for unlimited
| |
*/ */
public $collectors = [ public $collectors = [
\CodeIgniter\Debug\Toolbar\Collectors\Timers::class, \CodeIgniter\Debug\Toolbar\Collectors\Timers::class,
\CodeIgniter\Debug\Toolbar\Collectors\Database::class, \CodeIgniter\Debug\Toolbar\Collectors\Database::class,
\CodeIgniter\Debug\Toolbar\Collectors\Logs::class, \CodeIgniter\Debug\Toolbar\Collectors\Logs::class,
\CodeIgniter\Debug\Toolbar\Collectors\Views::class, \CodeIgniter\Debug\Toolbar\Collectors\Views::class,
// \CodeIgniter\Debug\Toolbar\Collectors\Cache::class, // \CodeIgniter\Debug\Toolbar\Collectors\Cache::class,
\CodeIgniter\Debug\Toolbar\Collectors\Files::class, \CodeIgniter\Debug\Toolbar\Collectors\Files::class,
\CodeIgniter\Debug\Toolbar\Collectors\Routes::class, \CodeIgniter\Debug\Toolbar\Collectors\Routes::class,
\CodeIgniter\Debug\Toolbar\Collectors\Events::class, \CodeIgniter\Debug\Toolbar\Collectors\Events::class,
]; ];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Max History | Max History
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -40,9 +40,9 @@ class Toolbar extends BaseConfig
| 0 (zero) to not have any history stored, or -1 for unlimited history. | 0 (zero) to not have any history stored, or -1 for unlimited history.
| |
*/ */
public $maxHistory = 20; public $maxHistory = 20;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Toolbar Views Path | Toolbar Views Path
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -50,9 +50,9 @@ class Toolbar extends BaseConfig
| MUST have a trailing slash. | MUST have a trailing slash.
| |
*/ */
public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/'; public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Max Queries | Max Queries
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -64,5 +64,5 @@ class Toolbar extends BaseConfig
| $maxQueries defines the maximum amount of queries that will be stored. | $maxQueries defines the maximum amount of queries that will be stored.
| |
*/ */
public $maxQueries = 100; public $maxQueries = 100;
} }

View File

@ -4,7 +4,7 @@ use CodeIgniter\Config\BaseConfig;
class UserAgents extends BaseConfig class UserAgents extends BaseConfig
{ {
/* /*
| ------------------------------------------------------------------- | -------------------------------------------------------------------
| USER AGENT TYPES | USER AGENT TYPES
| ------------------------------------------------------------------- | -------------------------------------------------------------------
@ -13,206 +13,206 @@ class UserAgents extends BaseConfig
| mobile device data. The array keys are used to identify the device | mobile device data. The array keys are used to identify the device
| and the array values are used to set the actual name of the item. | and the array values are used to set the actual name of the item.
*/ */
public $platforms = [ public $platforms = [
'windows nt 10.0' => 'Windows 10', 'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1', 'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8', 'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7', 'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista', 'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003', 'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP', 'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000', 'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0', 'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0', 'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT', 'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT', 'winnt' => 'Windows NT',
'windows 98' => 'Windows 98', 'windows 98' => 'Windows 98',
'win98' => 'Windows 98', 'win98' => 'Windows 98',
'windows 95' => 'Windows 95', 'windows 95' => 'Windows 95',
'win95' => 'Windows 95', 'win95' => 'Windows 95',
'windows phone' => 'Windows Phone', 'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS', 'windows' => 'Unknown Windows OS',
'android' => 'Android', 'android' => 'Android',
'blackberry' => 'BlackBerry', 'blackberry' => 'BlackBerry',
'iphone' => 'iOS', 'iphone' => 'iOS',
'ipad' => 'iOS', 'ipad' => 'iOS',
'ipod' => 'iOS', 'ipod' => 'iOS',
'os x' => 'Mac OS X', 'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac', 'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD', 'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh', 'ppc' => 'Macintosh',
'linux' => 'Linux', 'linux' => 'Linux',
'debian' => 'Debian', 'debian' => 'Debian',
'sunos' => 'Sun Solaris', 'sunos' => 'Sun Solaris',
'beos' => 'BeOS', 'beos' => 'BeOS',
'apachebench' => 'ApacheBench', 'apachebench' => 'ApacheBench',
'aix' => 'AIX', 'aix' => 'AIX',
'irix' => 'Irix', 'irix' => 'Irix',
'osf' => 'DEC OSF', 'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX', 'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD', 'netbsd' => 'NetBSD',
'bsdi' => 'BSDi', 'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD', 'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux', 'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS', 'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS', 'symbian' => 'Symbian OS',
]; ];
// The order of this array should NOT be changed. Many browsers return // The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first. // multiple browser types so we want to identify the sub-type first.
public $browsers = [ public $browsers = [
'OPR' => 'Opera', 'OPR' => 'Opera',
'Flock' => 'Flock', 'Flock' => 'Flock',
'Edge' => 'Spartan', 'Edge' => 'Spartan',
'Chrome' => 'Chrome', 'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string // Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera', 'Opera.*?Version' => 'Opera',
'Opera' => 'Opera', 'Opera' => 'Opera',
'MSIE' => 'Internet Explorer', 'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer', 'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer', 'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira', 'Shiira' => 'Shiira',
'Firefox' => 'Firefox', 'Firefox' => 'Firefox',
'Chimera' => 'Chimera', 'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix', 'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird', 'Firebird' => 'Firebird',
'Camino' => 'Camino', 'Camino' => 'Camino',
'Netscape' => 'Netscape', 'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb', 'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari', 'Safari' => 'Safari',
'Mozilla' => 'Mozilla', 'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror', 'Konqueror' => 'Konqueror',
'icab' => 'iCab', 'icab' => 'iCab',
'Lynx' => 'Lynx', 'Lynx' => 'Lynx',
'Links' => 'Links', 'Links' => 'Links',
'hotjava' => 'HotJava', 'hotjava' => 'HotJava',
'amaya' => 'Amaya', 'amaya' => 'Amaya',
'IBrowse' => 'IBrowse', 'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon', 'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser', 'Ubuntu' => 'Ubuntu Web Browser',
'Vivaldi' => 'Vivaldi', 'Vivaldi' => 'Vivaldi',
]; ];
public $mobiles = [ public $mobiles = [
// legacy array, old values commented out // legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer', 'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave', // 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini', // 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini', // 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm', // 'elaine' => 'Palm',
'palmsource' => 'Palm', 'palmsource' => 'Palm',
// 'digital paths' => 'Palm', // 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo', // 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino', // 'xiino' => 'Xiino',
'palmscape' => 'Palmscape', 'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia', // 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson', // 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry', // 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola' // 'motorola' => 'Motorola'
// Phones and Manufacturers // Phones and Manufacturers
'motorola' => 'Motorola', 'motorola' => 'Motorola',
'nokia' => 'Nokia', 'nokia' => 'Nokia',
'palm' => 'Palm', 'palm' => 'Palm',
'iphone' => 'Apple iPhone', 'iphone' => 'Apple iPhone',
'ipad' => 'iPad', 'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch', 'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson', 'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson', 'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry', 'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon', 'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo', 'blazer' => 'Treo',
'lg' => 'LG', 'lg' => 'LG',
'amoi' => 'Amoi', 'amoi' => 'Amoi',
'xda' => 'XDA', 'xda' => 'XDA',
'mda' => 'MDA', 'mda' => 'MDA',
'vario' => 'Vario', 'vario' => 'Vario',
'htc' => 'HTC', 'htc' => 'HTC',
'samsung' => 'Samsung', 'samsung' => 'Samsung',
'sharp' => 'Sharp', 'sharp' => 'Sharp',
'sie-' => 'Siemens', 'sie-' => 'Siemens',
'alcatel' => 'Alcatel', 'alcatel' => 'Alcatel',
'benq' => 'BenQ', 'benq' => 'BenQ',
'ipaq' => 'HP iPaq', 'ipaq' => 'HP iPaq',
'mot-' => 'Motorola', 'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable', 'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3', 'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita', 'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop', 'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC', 'nec-' => 'NEC',
'panasonic' => 'Panasonic', 'panasonic' => 'Panasonic',
'philips' => 'Philips', 'philips' => 'Philips',
'sagem' => 'Sagem', 'sagem' => 'Sagem',
'sanyo' => 'Sanyo', 'sanyo' => 'Sanyo',
'spv' => 'SPV', 'spv' => 'SPV',
'zte' => 'ZTE', 'zte' => 'ZTE',
'sendo' => 'Sendo', 'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi', 'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS', 'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS', 'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii', 'wii' => 'Nintendo Wii',
'open web' => 'Open Web', 'open web' => 'Open Web',
'openweb' => 'OpenWeb', 'openweb' => 'OpenWeb',
// Operating Systems // Operating Systems
'android' => 'Android', 'android' => 'Android',
'symbian' => 'Symbian', 'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS', 'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm', 'elaine' => 'Palm',
'series60' => 'Symbian S60', 'series60' => 'Symbian S60',
'windows ce' => 'Windows CE', 'windows ce' => 'Windows CE',
// Browsers // Browsers
'obigo' => 'Obigo', 'obigo' => 'Obigo',
'netfront' => 'Netfront Browser', 'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser', 'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer', 'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini', 'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini', 'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile', 'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile', 'fennec' => 'Firefox Mobile',
// Other // Other
'digital paths' => 'Digital Paths', 'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo', 'avantgo' => 'AvantGo',
'xiino' => 'Xiino', 'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder', 'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone', 'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo', 'docomo' => 'NTT DoCoMo',
'o2' => 'O2', 'o2' => 'O2',
// Fallback // Fallback
'mobile' => 'Generic Mobile', 'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile', 'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile', 'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile', 'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile', 'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile', 'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile', 'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile', 'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile', 'cellphone' => 'Generic Mobile',
]; ];
// There are hundreds of bots but these are the most common. // There are hundreds of bots but these are the most common.
public $robots = [ public $robots = [
'googlebot' => 'Googlebot', 'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot', 'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider', 'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing', 'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp', 'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo', 'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves', 'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler', 'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0', 'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos', 'lycos' => 'Lycos',
'yandex' => 'YandexBot', 'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google', 'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler', 'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google', 'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google', 'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George', 'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler', 'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12', 'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot', 'Uptimebot' => 'Uptimebot',
]; ];
} }

View File

@ -2,35 +2,35 @@
class Validation class Validation
{ {
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Setup // Setup
//-------------------------------------------------------------------- //--------------------------------------------------------------------
/** /**
* Stores the classes that contain the * Stores the classes that contain the
* rules that are available. * rules that are available.
* *
* @var array * @var array
*/ */
public $ruleSets = [ public $ruleSets = [
\CodeIgniter\Validation\Rules::class, \CodeIgniter\Validation\Rules::class,
\CodeIgniter\Validation\FormatRules::class, \CodeIgniter\Validation\FormatRules::class,
\CodeIgniter\Validation\FileRules::class, \CodeIgniter\Validation\FileRules::class,
\CodeIgniter\Validation\CreditCardRules::class, \CodeIgniter\Validation\CreditCardRules::class,
]; ];
/** /**
* Specifies the views that are used to display the * Specifies the views that are used to display the
* errors. * errors.
* *
* @var array * @var array
*/ */
public $templates = [ public $templates = [
'list' => 'CodeIgniter\Validation\Views\list', 'list' => 'CodeIgniter\Validation\Views\list',
'single' => 'CodeIgniter\Validation\Views\single', 'single' => 'CodeIgniter\Validation\Views\single',
]; ];
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Rules // Rules
//-------------------------------------------------------------------- //--------------------------------------------------------------------
} }

View File

@ -2,33 +2,33 @@
class View extends \CodeIgniter\Config\View class View extends \CodeIgniter\Config\View
{ {
/** /**
* When false, the view method will clear the data between each * When false, the view method will clear the data between each
* call. This keeps your data safe and ensures there is no accidental * call. This keeps your data safe and ensures there is no accidental
* leaking between calls, so you would need to explicitly pass the data * leaking between calls, so you would need to explicitly pass the data
* to each view. You might prefer to have the data stick around between * to each view. You might prefer to have the data stick around between
* calls so that it is available to all views. If that is the case, * calls so that it is available to all views. If that is the case,
* set $saveData to true. * set $saveData to true.
*/ */
public $saveData = true; public $saveData = true;
/** /**
* Parser Filters map a filter name with any PHP callable. When the * Parser Filters map a filter name with any PHP callable. When the
* Parser prepares a variable for display, it will chain it * Parser prepares a variable for display, it will chain it
* through the filters in the order defined, inserting any parameters. * through the filters in the order defined, inserting any parameters.
* To prevent potential abuse, all filters MUST be defined here * To prevent potential abuse, all filters MUST be defined here
* in order for them to be available for use within the Parser. * in order for them to be available for use within the Parser.
* *
* Examples: * Examples:
* { title|esc(js) } * { title|esc(js) }
* { created_on|date(Y-m-d)|esc(attr) } * { created_on|date(Y-m-d)|esc(attr) }
*/ */
public $filters = []; public $filters = [];
/** /**
* Parser Plugins provide a way to extend the functionality provided * Parser Plugins provide a way to extend the functionality provided
* by the core Parser by creating aliases that will be replaced with * by the core Parser by creating aliases that will be replaced with
* any callable. Can be single or tag pair. * any callable. Can be single or tag pair.
*/ */
public $plugins = []; public $plugins = [];
} }

View File

@ -1,4 +1,5 @@
<?php <?php
namespace App\Controllers; namespace App\Controllers;
/** /**
@ -18,29 +19,30 @@ use CodeIgniter\Controller;
class BaseController extends Controller class BaseController extends Controller
{ {
/**
* An array of helpers to be loaded automatically upon
* class instantiation. These helpers will be available
* to all other controllers that extend BaseController.
*
* @var array
*/
protected $helpers = [];
/** /**
* An array of helpers to be loaded automatically upon * Constructor.
* class instantiation. These helpers will be available */
* to all other controllers that extend BaseController. public function initController(
* \CodeIgniter\HTTP\RequestInterface $request,
* @var array \CodeIgniter\HTTP\ResponseInterface $response,
*/ \Psr\Log\LoggerInterface $logger
protected $helpers = []; ) {
// Do Not Edit This Line
/** parent::initController($request, $response, $logger);
* Constructor.
*/
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
// Do Not Edit This Line
parent::initController($request, $response, $logger);
//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------
// E.g.:
// $this->session = \Config\Services::session();
}
//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------
// E.g.:
// $this->session = \Config\Services::session();
}
} }

View File

@ -0,0 +1,113 @@
<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers;
use App\Models\EpisodeModel;
use App\Models\PodcastModel;
class Episodes extends BaseController
{
public function create($podcast_slug)
{
helper(['form', 'database', 'file']);
$episode_model = new EpisodeModel();
$podcast_model = new PodcastModel();
$podcast_name = substr($podcast_slug, 1);
$podcast = $podcast_model->where('name', $podcast_name)->first();
if (
!$this->validate([
'episode_file' =>
'uploaded[episode_file]|ext_in[episode_file,mp3,m4a]',
'title' => 'required',
'slug' => 'required',
'description' => 'required',
])
) {
$data = [
'podcast' => $podcast,
'episode_types' => field_enums(
$episode_model->prefixTable('episodes'),
'type'
),
];
echo view('episodes/create', $data);
} else {
$episode_slug = $this->request->getVar('slug');
$episode_file = $this->request->getFile('episode_file');
$episode_file_metadata = get_file_metadata($episode_file);
$episode_file_name =
$episode_slug . '.' . $episode_file->getExtension();
$episode_path = save_podcast_media(
$episode_file,
$podcast_name,
$episode_file_name
);
$image = $this->request->getFile('image');
$image_path = '';
if ($image->isValid()) {
$image_name = $episode_slug . '.' . $image->getExtension();
$image_path = save_podcast_media(
$image,
$podcast_name,
$image_name
);
}
$episode_model->save([
'podcast_id' => $podcast->id,
'title' => $this->request->getVar('title'),
'slug' => $episode_slug,
'enclosure_url' => $episode_path,
'enclosure_length' => $episode_file->getSize(),
'enclosure_type' => $episode_file_metadata['mime_type'],
'guid' => $podcast_slug . '/' . $episode_slug,
'pub_date' => $this->request->getVar('pub_date'),
'description' => $this->request->getVar('description'),
'duration' => $episode_file_metadata['playtime_seconds'],
'image' => $image_path,
'explicit' => $this->request->getVar('explicit') or false,
'episode_number' =>
$this->request->getVar('episode_number') or null,
'season_number' =>
$this->request->getVar('season_number') or null,
'type' => $this->request->getVar('type'),
'block' => $this->request->getVar('block') or false,
]);
return redirect()->to(
base_url(
route_to(
'episodes_view',
'/@' . $podcast_name,
$episode_slug
)
)
);
}
}
public function view($podcast_slug, $episode_slug)
{
$podcast_model = new PodcastModel();
$episode_model = new EpisodeModel();
$data = [
'podcast' => $podcast_model
->where('name', substr($podcast_slug, 1))
->first(),
'episode' => $episode_model->where('slug', $episode_slug)->first(),
];
return view('episodes/view.php', $data);
}
}

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers; namespace App\Controllers;
@ -6,14 +11,11 @@ use App\Models\PodcastModel;
class Home extends BaseController class Home extends BaseController
{ {
public function index() public function index()
{ {
$model = new PodcastModel(); $model = new PodcastModel();
$data = ["podcasts" => $model->findAll()]; $data = ['podcasts' => $model->findAll()];
return view('home', $data);
}
//--------------------------------------------------------------------
return view('home', $data);
}
} }

View File

@ -1,12 +1,16 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers; namespace App\Controllers;
use \CodeIgniter\Controller; use CodeIgniter\Controller;
class Migrate extends Controller class Migrate extends Controller
{ {
public function index() public function index()
{ {
$migrate = \Config\Services::migrations(); $migrate = \Config\Services::migrations();

View File

@ -1,61 +1,68 @@
<?php namespace App\Controllers; <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers;
use App\Models\CategoryModel; use App\Models\CategoryModel;
use App\Models\EpisodeModel;
use App\Models\LanguageModel; use App\Models\LanguageModel;
use App\Models\PodcastModel; use App\Models\PodcastModel;
use RuntimeException;
class Podcasts extends BaseController class Podcasts extends BaseController
{ {
public function index()
{
return view('podcast/index.php');
}
public function create() public function create()
{ {
$model = new PodcastModel(); helper(['form', 'database', 'file', 'misc']);
helper(['form', 'url']); $podcast_model = new PodcastModel();
if (!$this->validate([
'title' => 'required',
'name' => 'required|regex_match[^[a-z0-9\_]{1,191}$]',
'description' => 'required|max_length[4000]',
'image' => 'uploaded[image]|is_image[image]|ext_in[image,jpg,png]|max_dims[image,3000,3000]',
'owner_email' => 'required|valid_email|permit_empty',
'type' => 'required',
])) {
$langs = explode(',', $this->request->getServer('HTTP_ACCEPT_LANGUAGE'));
$browser_lang = '';
if (!empty($langs)) {
$browser_lang = substr($langs[0], 0, 2);
}
if (
!$this->validate([
'title' => 'required',
'name' => 'required|regex_match[^[a-z0-9\_]{1,191}$]',
'description' => 'required|max_length[4000]',
'image' =>
'uploaded[image]|is_image[image]|ext_in[image,jpg,png]|max_dims[image,3000,3000]',
'owner_email' => 'required|valid_email|permit_empty',
'type' => 'required',
])
) {
$languageModel = new LanguageModel(); $languageModel = new LanguageModel();
$categoryModel = new CategoryModel(); $categoryModel = new CategoryModel();
$data = [ $data = [
'languages' => $languageModel->findAll(), 'languages' => $languageModel->findAll(),
'categories' => $categoryModel->findAll(), 'categories' => $categoryModel->findAll(),
'browser_lang' => $browser_lang, 'browser_lang' => get_browser_language(
$this->request->getServer('HTTP_ACCEPT_LANGUAGE')
),
'podcast_types' => field_enums(
$podcast_model->prefixTable('podcasts'),
'type'
),
]; ];
echo view('podcasts/create', $data); echo view('podcasts/create', $data);
} else { } else {
$image = $this->request->getFile('image'); $image = $this->request->getFile('image');
if (!$image->isValid()) {
throw new RuntimeException($image->getErrorString() . '(' . $image->getError() . ')');
}
$podcast_name = $this->request->getVar('name'); $podcast_name = $this->request->getVar('name');
$image_name = 'cover.' . $image->getExtension(); $image_name = 'cover.' . $image->getExtension();
$image_storage_folder = 'media/' . $podcast_name . '/'; $image_path = save_podcast_media(
$image->move($image_storage_folder, $image_name); $image,
$podcast_name,
$image_name
);
$model->save([ $podcast_model->save([
'title' => $this->request->getVar('title'), 'title' => $this->request->getVar('title'),
'name' => $podcast_name, 'name' => $podcast_name,
'description' => $this->request->getVar('description'), 'description' => $this->request->getVar('description'),
'episode_description_footer' => $this->request->getVar('episode_description_footer'), 'episode_description_footer' => $this->request->getVar(
'image' => $image_storage_folder . $image_name, 'episode_description_footer'
),
'image' => $image_path,
'language' => $this->request->getVar('language'), 'language' => $this->request->getVar('language'),
'category' => $this->request->getVar('category'), 'category' => $this->request->getVar('category'),
'explicit' => $this->request->getVar('explicit') or false, 'explicit' => $this->request->getVar('explicit') or false,
@ -66,21 +73,32 @@ class Podcasts extends BaseController
'copyright' => $this->request->getVar('copyright'), 'copyright' => $this->request->getVar('copyright'),
'block' => $this->request->getVar('block') or false, 'block' => $this->request->getVar('block') or false,
'complete' => $this->request->getVar('complete') or false, 'complete' => $this->request->getVar('complete') or false,
'custom_html_head' => $this->request->getVar('custom_html_head'), 'custom_html_head' => $this->request->getVar(
'custom_html_head'
),
]); ]);
return redirect()->to(base_url('/@' . $podcast_name)); return redirect()->to(
base_url(route_to('podcasts_view', '@' . $podcast_name))
);
} }
} }
public function podcastByHandle($handle) public function view($slug)
{ {
$model = new PodcastModel(); $podcast_model = new PodcastModel();
$episode_model = new EpisodeModel();
$podcast_name = substr($handle, 1); $podcast_name = substr($slug, 1);
$data['podcast'] = $model->where('name', $podcast_name)->first(); $podcast = $podcast_model->where('name', $podcast_name)->first();
$data = [
'podcast' => $podcast,
'episodes' => $episode_model
->where('podcast_id', $podcast->id)
->findAll(),
];
return view('podcasts/view.php', $data); return view('podcasts/view', $data);
} }
} }

View File

@ -1,12 +1,19 @@
<?php <?php
/**
* Class AddCategories
* Creates categories table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations; namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddCategories extends Migration class AddCategories extends Migration
{ {
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([

View File

@ -1,12 +1,19 @@
<?php <?php
/**
* Class AddLanguages
* Creates languages table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations; namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddLanguages extends Migration class AddLanguages extends Migration
{ {
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([

View File

@ -1,12 +1,19 @@
<?php <?php
/**
* Class AddPodcasts
* Creates podcasts table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations; namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddPodcasts extends Migration class AddPodcasts extends Migration
{ {
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([
@ -20,7 +27,8 @@ class AddPodcasts extends Migration
'title' => [ 'title' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'comment' => 'The show title. Its important to have a clear, concise name for your podcast. Make your title specific. A show titled Our Community Bulletin is too vague to attract many subscribers, no matter how compelling the content. Pay close attention to the title as Apple Podcasts uses this field for search. If you include a long list of keywords in an attempt to game podcast search, your show may be removed from the Apple directory.', 'comment' =>
'The show title. Its important to have a clear, concise name for your podcast. Make your title specific. A show titled Our Community Bulletin is too vague to attract many subscribers, no matter how compelling the content. Pay close attention to the title as Apple Podcasts uses this field for search. If you include a long list of keywords in an attempt to game podcast search, your show may be removed from the Apple directory.',
], ],
'name' => [ 'name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
@ -31,81 +39,94 @@ class AddPodcasts extends Migration
'description' => [ 'description' => [
'type' => 'TEXT', 'type' => 'TEXT',
'null' => true, 'null' => true,
'comment' => 'The show description. Where description is text containing one or more sentences describing your podcast to potential listeners. The maximum amount of text allowed for this tag is 4000 characters. To include links in your description or rich HTML, adhere to the following technical guidelines: enclose all portions of your XML that contain embedded HTML in a CDATA section to prevent formatting issues, and to ensure proper link functionality.', 'comment' =>
'null' => true, 'The show description. Where description is text containing one or more sentences describing your podcast to potential listeners. The maximum amount of text allowed for this tag is 4000 characters. To include links in your description or rich HTML, adhere to the following technical guidelines: enclose all portions of your XML that contain embedded HTML in a CDATA section to prevent formatting issues, and to ensure proper link functionality.',
], ],
'image' => [ 'image' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'comment' => 'The artwork for the show. Specify your show artwork by providing a URL linking to it. Depending on their device, subscribers see your podcast artwork in varying sizes. Therefore, make sure your design is effective at both its original size and at thumbnail size. You should include a show title, brand, or source name as part of your podcast artwork. Artwork must be a minimum size of 1400 x 1400 pixels and a maximum size of 3000 x 3000 pixels, in JPEG or PNG format, 72 dpi, with appropriate file extensions (.jpg, .png), and in the RGB colorspace.', 'comment' =>
'The artwork for the show. Specify your show artwork by providing a URL linking to it. Depending on their device, subscribers see your podcast artwork in varying sizes. Therefore, make sure your design is effective at both its original size and at thumbnail size. You should include a show title, brand, or source name as part of your podcast artwork. Artwork must be a minimum size of 1400 x 1400 pixels and a maximum size of 3000 x 3000 pixels, in JPEG or PNG format, 72 dpi, with appropriate file extensions (.jpg, .png), and in the RGB colorspace.',
], ],
'language' => [ 'language' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 2, 'constraint' => 2,
'comment' => 'The language spoken on the show. Because Apple Podcasts is available in territories around the world, it is critical to specify the language of a podcast. Apple Podcasts only supports values from the ISO 639 list (two-letter language codes, with some possible modifiers, such as "en-us"). Invalid language codes will cause your feed to fail Apple validation.', 'comment' =>
'The language spoken on the show. Because Apple Podcasts is available in territories around the world, it is critical to specify the language of a podcast. Apple Podcasts only supports values from the ISO 639 list (two-letter language codes, with some possible modifiers, such as "en-us"). Invalid language codes will cause your feed to fail Apple validation.',
], ],
'category' => [ 'category' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'comment' => 'The show category information. For a complete list of categories and subcategories, see Apple Podcasts categories. Select the category that best reflects the content of your show. If available, you can also define a subcategory. Although you can specify more than one category and subcategory in your RSS feed, Apple Podcasts only recognizes the first category and subcategory. When specifying categories and subcategories, be sure to properly escape ampersands.', 'comment' =>
'The show category information. For a complete list of categories and subcategories, see Apple Podcasts categories. Select the category that best reflects the content of your show. If available, you can also define a subcategory. Although you can specify more than one category and subcategory in your RSS feed, Apple Podcasts only recognizes the first category and subcategory. When specifying categories and subcategories, be sure to properly escape ampersands.',
'null' => true, 'null' => true,
], ],
'explicit' => [ 'explicit' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
'comment' => 'The podcast parental advisory information. The explicit value can be one of the following: True: If you specify true, indicating the presence of explicit content, Apple Podcasts displays an Explicit parental advisory graphic for your podcast. Podcasts containing explicit material arent available in some Apple Podcasts territories. False: If you specify false, indicating that your podcast doesnt contain explicit language or adult content, Apple Podcasts displays a Clean parental advisory graphic for your podcast.', 'comment' =>
'The podcast parental advisory information. The explicit value can be one of the following: True: If you specify true, indicating the presence of explicit content, Apple Podcasts displays an Explicit parental advisory graphic for your podcast. Podcasts containing explicit material arent available in some Apple Podcasts territories. False: If you specify false, indicating that your podcast doesnt contain explicit language or adult content, Apple Podcasts displays a Clean parental advisory graphic for your podcast.',
], ],
'author' => [ 'author' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'comment' => 'The group responsible for creating the show. Show author most often refers to the parent company or network of a podcast, but it can also be used to identify the host(s) if none exists. Author information is especially useful if a company or organization publishes multiple podcasts. Providing this information will allow listeners to see all shows created by the same entity.', 'comment' =>
'The group responsible for creating the show. Show author most often refers to the parent company or network of a podcast, but it can also be used to identify the host(s) if none exists. Author information is especially useful if a company or organization publishes multiple podcasts. Providing this information will allow listeners to see all shows created by the same entity.',
'null' => true, 'null' => true,
], ],
'owner_name' => [ 'owner_name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'owner_name' => 'The podcast owner name. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts.', 'owner_name' =>
'The podcast owner name. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts.',
'null' => true, 'null' => true,
], ],
'owner_email' => [ 'owner_email' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'owner_email' => 'The podcast owner email address. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts. Please make sure the email address is active and monitored.', 'owner_email' =>
'The podcast owner email address. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts. Please make sure the email address is active and monitored.',
'null' => true, 'null' => true,
], ],
'type' => [ 'type' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['episodic', 'serial'], 'constraint' => ['episodic', 'serial'],
'default' => 'episodic', 'default' => 'episodic',
'comment' => 'The type of show. If your show is Serial you must use this tag. Its values can be one of the following: episodic (default). Specify episodic when episodes are intended to be consumed without any specific order. Apple Podcasts will present newest episodes first and display the publish date (required) of each episode. If organized into seasons, the newest season will be presented first - otherwise, episodes will be grouped by year published, newest first. For new subscribers, Apple Podcasts adds the newest, most recent episode in their Library. serial. Specify serial when episodes are intended to be consumed in sequential order. Apple Podcasts will present the oldest episodes first and display the episode numbers (required) of each episode. If organized into seasons, the newest season will be presented first and <itunes:episode> numbers must be given for each episode. For new subscribers, Apple Podcasts adds the first episode to their Library, or the entire current season if using seasons', 'comment' =>
'The type of show. If your show is Serial you must use this tag. Its values can be one of the following: episodic (default). Specify episodic when episodes are intended to be consumed without any specific order. Apple Podcasts will present newest episodes first and display the publish date (required) of each episode. If organized into seasons, the newest season will be presented first - otherwise, episodes will be grouped by year published, newest first. For new subscribers, Apple Podcasts adds the newest, most recent episode in their Library. serial. Specify serial when episodes are intended to be consumed in sequential order. Apple Podcasts will present the oldest episodes first and display the episode numbers (required) of each episode. If organized into seasons, the newest season will be presented first and <itunes:episode> numbers must be given for each episode. For new subscribers, Apple Podcasts adds the first episode to their Library, or the entire current season if using seasons',
], ],
'copyright' => [ 'copyright' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 1024, 'constraint' => 1024,
'comment' => 'The show copyright details. If your show is copyrighted you should use this tag.', 'comment' =>
'The show copyright details. If your show is copyrighted you should use this tag.',
'null' => true, 'null' => true,
], ],
'block' => [ 'block' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
'comment' => 'The podcast show or hide status. If you want your show removed from the Apple directory, use this tag. Specifying the <itunes:block> tag with a Yes value, prevents the entire podcast from appearing in Apple Podcasts. Specifying any value other than Yes has no effect.', 'comment' =>
'The podcast show or hide status. If you want your show removed from the Apple directory, use this tag. Specifying the <itunes:block> tag with a Yes value, prevents the entire podcast from appearing in Apple Podcasts. Specifying any value other than Yes has no effect.',
], ],
'complete' => [ 'complete' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
'comment' => 'The podcast update status. If you will never publish another episode to your show, use this tag. Specifying the <itunes:complete> tag with a Yes value indicates that a podcast is complete and you will not post any more episodes in the future. Specifying any value other than Yes has no effect.', 'comment' =>
'The podcast update status. If you will never publish another episode to your show, use this tag. Specifying the <itunes:complete> tag with a Yes value indicates that a podcast is complete and you will not post any more episodes in the future. Specifying any value other than Yes has no effect.',
], ],
'episode_description_footer' => [ 'episode_description_footer' => [
'type' => 'TEXT', 'type' => 'TEXT',
'comment' => 'The text that will be added in every episode description (show notes).', 'comment' =>
'The text that will be added in every episode description (show notes).',
'null' => true, 'null' => true,
], ],
'custom_html_head' => [ 'custom_html_head' => [
'type' => 'TEXT', 'type' => 'TEXT',
'comment' => 'The HTML code that will be added to evey page for this podcast. (You could add Google Analytics tracking code here for instance.)', 'comment' =>
'The HTML code that will be added to evey page for this podcast. (You could add Google Analytics tracking code here for instance.)',
'null' => true, 'null' => true,
], ],
'created_at' => [ 'created_at' => [

View File

@ -1,4 +1,12 @@
<?php <?php
/**
* Class AddEpisodes
* Creates episodes table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations; namespace App\Database\Migrations;
@ -31,7 +39,6 @@ class AddEpisodes extends Migration
'slug' => [ 'slug' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 191, 'constraint' => 191,
'unique' => true,
'comment' => 'Episode slug for URLs', 'comment' => 'Episode slug for URLs',
], ],
'enclosure_url' => [ 'enclosure_url' => [
@ -94,6 +101,7 @@ class AddEpisodes extends Migration
'type' => 'INT', 'type' => 'INT',
'constraint' => 10, 'constraint' => 10,
'unsigned' => true, 'unsigned' => true,
'null' => true,
'comment' => 'comment' =>
'An episode number. If all your episodes have numbers and you would like them to be ordered based on them use this tag for each one. Episode numbers are optional for <itunes:type> episodic shows, but are mandatory for serial shows. Where episode is a non-zero integer (1, 2, 3, etc.) representing your episode number.', 'An episode number. If all your episodes have numbers and you would like them to be ordered based on them use this tag for each one. Episode numbers are optional for <itunes:type> episodic shows, but are mandatory for serial shows. Where episode is a non-zero integer (1, 2, 3, etc.) representing your episode number.',
], ],
@ -127,7 +135,6 @@ class AddEpisodes extends Migration
], ],
]); ]);
$this->forge->addKey('id', true); $this->forge->addKey('id', true);
$this->forge->addKey('podcast_id', true);
$this->forge->addUniqueKey(['podcast_id', 'slug']); $this->forge->addUniqueKey(['podcast_id', 'slug']);
$this->forge->addForeignKey('podcast_id', 'podcasts', 'id'); $this->forge->addForeignKey('podcast_id', 'podcasts', 'id');
$this->forge->createTable('episodes'); $this->forge->createTable('episodes');

View File

@ -2,18 +2,18 @@
/** /**
* Class AddPlatforms * Class AddPlatforms
* Creates platforms table in database * Creates platforms table in database
* @author Benjamin Bellamy <ben@podlibre.org> *
* @copyright 2020 Podlibre * @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddPlatforms extends Migration class AddPlatforms extends Migration
{ {
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([
@ -62,7 +62,8 @@ class AddPlatforms extends Migration
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
'comment' => 'True if the platform link should be displayed by default.', 'comment' =>
'True if the platform link should be displayed by default.',
], ],
'ios_deeplink' => [ 'ios_deeplink' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
@ -74,7 +75,8 @@ class AddPlatforms extends Migration
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
'comment' => 'Android deeplinking for this platform: 0=No, 1=Manual, 2=Automatic.', 'comment' =>
'Android deeplinking for this platform: 0=No, 1=Manual, 2=Automatic.',
], ],
'logo_file_name' => [ 'logo_file_name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',

View File

@ -1,19 +1,19 @@
<?php <?php
/** /**
* Class AddPlatformsLinks * Class AddPlatformsLinks
* Creates platformlinks table in database * Creates platform_links table in database
* @author Benjamin Bellamy <ben@podlibre.org> *
* @copyright 2020 Podlibre * @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddPlatformLinks extends Migration class AddPlatformLinks extends Migration
{ {
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([

View File

@ -1,4 +1,12 @@
<?php <?php
/**
* Class CategorySeeder
* Inserts values in categories table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Seeds; namespace App\Database\Seeds;
@ -8,119 +16,785 @@ class CategorySeeder extends Seeder
{ {
public function run() public function run()
{ {
$data = array( $data = [
array('parent_id' => 0, 'id' => 0, 'code' => 'uncategorized', 'apple_category' => 'uncategorized', 'google_category' => 'uncategorized'), [
array('parent_id' => 0, 'id' => 1, 'code' => 'arts', 'apple_category' => 'Arts', 'google_category' => 'Arts'), 'parent_id' => 0,
array('parent_id' => 0, 'id' => 2, 'code' => 'business', 'apple_category' => 'Business', 'google_category' => 'Business'), 'id' => 0,
array('parent_id' => 0, 'id' => 3, 'code' => 'comedy', 'apple_category' => 'Comedy', 'google_category' => 'Comedy'), 'code' => 'uncategorized',
array('parent_id' => 0, 'id' => 4, 'code' => 'education', 'apple_category' => 'Education', 'google_category' => 'Education'), 'apple_category' => 'uncategorized',
array('parent_id' => 0, 'id' => 5, 'code' => 'fiction', 'apple_category' => 'Fiction', 'google_category' => ''), 'google_category' => 'uncategorized',
array('parent_id' => 0, 'id' => 6, 'code' => 'government', 'apple_category' => 'Government', 'google_category' => 'Government &amp; Organizations'), ],
array('parent_id' => 0, 'id' => 7, 'code' => 'health_and_fitness', 'apple_category' => 'Health &amp; Fitness', 'google_category' => 'Health'), [
array('parent_id' => 0, 'id' => 8, 'code' => 'history', 'apple_category' => 'History', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 0, 'id' => 9, 'code' => 'kids_and_family', 'apple_category' => 'Kids &amp; Family', 'google_category' => 'Kids &amp; Family'), 'id' => 1,
array('parent_id' => 0, 'id' => 10, 'code' => 'leisure', 'apple_category' => 'Leisure', 'google_category' => 'Games &amp; Hobbies'), 'code' => 'arts',
array('parent_id' => 0, 'id' => 11, 'code' => 'music', 'apple_category' => 'Music', 'google_category' => 'Music'), 'apple_category' => 'Arts',
array('parent_id' => 0, 'id' => 12, 'code' => 'news', 'apple_category' => 'News', 'google_category' => 'News &amp; Politics'), 'google_category' => 'Arts',
array('parent_id' => 0, 'id' => 13, 'code' => 'religion_and_spirituality', 'apple_category' => 'Religion &amp; Spirituality', 'google_category' => 'Religion &amp; Spirituality'), ],
array('parent_id' => 0, 'id' => 14, 'code' => 'science', 'apple_category' => 'Science', 'google_category' => 'Science &amp; Medicine'), [
array('parent_id' => 0, 'id' => 15, 'code' => 'society_and_culture', 'apple_category' => 'Society &amp; Culture', 'google_category' => 'Society &amp; Culture'), 'parent_id' => 0,
array('parent_id' => 0, 'id' => 16, 'code' => 'sports', 'apple_category' => 'Sports', 'google_category' => 'Sports &amp; Recreation'), 'id' => 2,
array('parent_id' => 0, 'id' => 17, 'code' => 'technology', 'apple_category' => 'Technology', 'google_category' => 'Technology'), 'code' => 'business',
array('parent_id' => 0, 'id' => 18, 'code' => 'true_crime', 'apple_category' => 'True Crime', 'google_category' => ''), 'apple_category' => 'Business',
array('parent_id' => 0, 'id' => 19, 'code' => 'tv_and_film', 'apple_category' => 'TV &amp; Film', 'google_category' => 'TV &amp; Film'), 'google_category' => 'Business',
array('parent_id' => 1, 'id' => 20, 'code' => 'books', 'apple_category' => 'Books', 'google_category' => ''), ],
array('parent_id' => 1, 'id' => 21, 'code' => 'design', 'apple_category' => 'Design', 'google_category' => ''), [
array('parent_id' => 1, 'id' => 22, 'code' => 'fashion_and_beauty', 'apple_category' => 'Fashion &amp; Beauty', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 1, 'id' => 23, 'code' => 'food', 'apple_category' => 'Food', 'google_category' => ''), 'id' => 3,
array('parent_id' => 1, 'id' => 24, 'code' => 'performing_arts', 'apple_category' => 'Performing Arts', 'google_category' => ''), 'code' => 'comedy',
array('parent_id' => 1, 'id' => 25, 'code' => 'visual_arts', 'apple_category' => 'Visual Arts', 'google_category' => ''), 'apple_category' => 'Comedy',
array('parent_id' => 2, 'id' => 26, 'code' => 'careers', 'apple_category' => 'Careers', 'google_category' => ''), 'google_category' => 'Comedy',
array('parent_id' => 2, 'id' => 27, 'code' => 'entrepreneurship', 'apple_category' => 'Entrepreneurship', 'google_category' => ''), ],
array('parent_id' => 2, 'id' => 28, 'code' => 'investing', 'apple_category' => 'Investing', 'google_category' => ''), [
array('parent_id' => 2, 'id' => 29, 'code' => 'management', 'apple_category' => 'Management', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 2, 'id' => 30, 'code' => 'marketing', 'apple_category' => 'Marketing', 'google_category' => ''), 'id' => 4,
array('parent_id' => 2, 'id' => 31, 'code' => 'non_profit', 'apple_category' => 'Non-Profit', 'google_category' => ''), 'code' => 'education',
array('parent_id' => 3, 'id' => 32, 'code' => 'comedy_interviews', 'apple_category' => 'Comedy Interviews', 'google_category' => ''), 'apple_category' => 'Education',
array('parent_id' => 3, 'id' => 33, 'code' => 'improv', 'apple_category' => 'Improv', 'google_category' => ''), 'google_category' => 'Education',
array('parent_id' => 3, 'id' => 34, 'code' => 'stand_up', 'apple_category' => 'Stand-Up', 'google_category' => ''), ],
array('parent_id' => 4, 'id' => 35, 'code' => 'courses', 'apple_category' => 'Courses', 'google_category' => ''), [
array('parent_id' => 4, 'id' => 36, 'code' => 'how_to', 'apple_category' => 'How To', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 4, 'id' => 37, 'code' => 'language_learning', 'apple_category' => 'Language Learning', 'google_category' => ''), 'id' => 5,
array('parent_id' => 4, 'id' => 38, 'code' => 'self_improvement', 'apple_category' => 'Self-Improvement', 'google_category' => ''), 'code' => 'fiction',
array('parent_id' => 5, 'id' => 39, 'code' => 'comedy_fiction', 'apple_category' => 'Comedy Fiction', 'google_category' => ''), 'apple_category' => 'Fiction',
array('parent_id' => 5, 'id' => 40, 'code' => 'drama', 'apple_category' => 'Drama', 'google_category' => ''), 'google_category' => '',
array('parent_id' => 5, 'id' => 41, 'code' => 'science_fiction', 'apple_category' => 'Science Fiction', 'google_category' => ''), ],
array('parent_id' => 7, 'id' => 42, 'code' => 'alternative_health', 'apple_category' => 'Alternative Health', 'google_category' => ''), [
array('parent_id' => 7, 'id' => 43, 'code' => 'fitness', 'apple_category' => 'Fitness', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 7, 'id' => 44, 'code' => 'medicine', 'apple_category' => 'Medicine', 'google_category' => ''), 'id' => 6,
array('parent_id' => 7, 'id' => 45, 'code' => 'mental_health', 'apple_category' => 'Mental Health', 'google_category' => ''), 'code' => 'government',
array('parent_id' => 7, 'id' => 46, 'code' => 'nutrition', 'apple_category' => 'Nutrition', 'google_category' => ''), 'apple_category' => 'Government',
array('parent_id' => 7, 'id' => 47, 'code' => 'sexuality', 'apple_category' => 'Sexuality', 'google_category' => ''), 'google_category' => 'Government &amp; Organizations',
array('parent_id' => 9, 'id' => 48, 'code' => 'education_for_kids', 'apple_category' => 'Education for Kids', 'google_category' => ''), ],
array('parent_id' => 9, 'id' => 49, 'code' => 'parenting', 'apple_category' => 'Parenting', 'google_category' => ''), [
array('parent_id' => 9, 'id' => 50, 'code' => 'pets_and_animals', 'apple_category' => 'Pets &amp; Animals', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 9, 'id' => 51, 'code' => 'stories_for_kids', 'apple_category' => 'Stories for Kids', 'google_category' => ''), 'id' => 7,
array('parent_id' => 10, 'id' => 52, 'code' => 'animation_and_manga', 'apple_category' => 'Animation &amp; Manga', 'google_category' => ''), 'code' => 'health_and_fitness',
array('parent_id' => 10, 'id' => 53, 'code' => 'automotive', 'apple_category' => 'Automotive', 'google_category' => ''), 'apple_category' => 'Health &amp; Fitness',
array('parent_id' => 10, 'id' => 54, 'code' => 'aviation', 'apple_category' => 'Aviation', 'google_category' => ''), 'google_category' => 'Health',
array('parent_id' => 10, 'id' => 55, 'code' => 'crafts', 'apple_category' => 'Crafts', 'google_category' => ''), ],
array('parent_id' => 10, 'id' => 56, 'code' => 'games', 'apple_category' => 'Games', 'google_category' => ''), [
array('parent_id' => 10, 'id' => 57, 'code' => 'hobbies', 'apple_category' => 'Hobbies', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 10, 'id' => 58, 'code' => 'home_and_garden', 'apple_category' => 'Home &amp; Garden', 'google_category' => ''), 'id' => 8,
array('parent_id' => 10, 'id' => 59, 'code' => 'video_games', 'apple_category' => 'Video Games', 'google_category' => ''), 'code' => 'history',
array('parent_id' => 11, 'id' => 60, 'code' => 'music_commentary', 'apple_category' => 'Music Commentary', 'google_category' => ''), 'apple_category' => 'History',
array('parent_id' => 11, 'id' => 61, 'code' => 'music_history', 'apple_category' => 'Music History', 'google_category' => ''), 'google_category' => '',
array('parent_id' => 11, 'id' => 62, 'code' => 'music_interviews', 'apple_category' => 'Music Interviews', 'google_category' => ''), ],
array('parent_id' => 12, 'id' => 63, 'code' => 'business_news', 'apple_category' => 'Business News', 'google_category' => ''), [
array('parent_id' => 12, 'id' => 64, 'code' => 'daily_news', 'apple_category' => 'Daily News', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 12, 'id' => 65, 'code' => 'entertainment_news', 'apple_category' => 'Entertainment News', 'google_category' => ''), 'id' => 9,
array('parent_id' => 12, 'id' => 66, 'code' => 'news_commentary', 'apple_category' => 'News Commentary', 'google_category' => ''), 'code' => 'kids_and_family',
array('parent_id' => 12, 'id' => 67, 'code' => 'politics', 'apple_category' => 'Politics', 'google_category' => ''), 'apple_category' => 'Kids &amp; Family',
array('parent_id' => 12, 'id' => 68, 'code' => 'sports_news', 'apple_category' => 'Sports News', 'google_category' => ''), 'google_category' => 'Kids &amp; Family',
array('parent_id' => 12, 'id' => 69, 'code' => 'tech_news', 'apple_category' => 'Tech News', 'google_category' => ''), ],
array('parent_id' => 13, 'id' => 70, 'code' => 'buddhism', 'apple_category' => 'Buddhism', 'google_category' => ''), [
array('parent_id' => 13, 'id' => 71, 'code' => 'christianity', 'apple_category' => 'Christianity', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 13, 'id' => 72, 'code' => 'hinduism', 'apple_category' => 'Hinduism', 'google_category' => ''), 'id' => 10,
array('parent_id' => 13, 'id' => 73, 'code' => 'islam', 'apple_category' => 'Islam', 'google_category' => ''), 'code' => 'leisure',
array('parent_id' => 13, 'id' => 74, 'code' => 'judaism', 'apple_category' => 'Judaism', 'google_category' => ''), 'apple_category' => 'Leisure',
array('parent_id' => 13, 'id' => 75, 'code' => 'religion', 'apple_category' => 'Religion', 'google_category' => ''), 'google_category' => 'Games &amp; Hobbies',
array('parent_id' => 13, 'id' => 76, 'code' => 'spirituality', 'apple_category' => 'Spirituality', 'google_category' => ''), ],
array('parent_id' => 14, 'id' => 77, 'code' => 'astronomy', 'apple_category' => 'Astronomy', 'google_category' => ''), [
array('parent_id' => 14, 'id' => 78, 'code' => 'chemistry', 'apple_category' => 'Chemistry', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 14, 'id' => 79, 'code' => 'earth_sciences', 'apple_category' => 'Earth Sciences', 'google_category' => ''), 'id' => 11,
array('parent_id' => 14, 'id' => 80, 'code' => 'life_sciences', 'apple_category' => 'Life Sciences', 'google_category' => ''), 'code' => 'music',
array('parent_id' => 14, 'id' => 81, 'code' => 'mathematics', 'apple_category' => 'Mathematics', 'google_category' => ''), 'apple_category' => 'Music',
array('parent_id' => 14, 'id' => 82, 'code' => 'natural_sciences', 'apple_category' => 'Natural Sciences', 'google_category' => ''), 'google_category' => 'Music',
array('parent_id' => 14, 'id' => 83, 'code' => 'nature', 'apple_category' => 'Nature', 'google_category' => ''), ],
array('parent_id' => 14, 'id' => 84, 'code' => 'physics', 'apple_category' => 'Physics', 'google_category' => ''), [
array('parent_id' => 14, 'id' => 85, 'code' => 'social_sciences', 'apple_category' => 'Social Sciences', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 15, 'id' => 86, 'code' => 'documentary', 'apple_category' => 'Documentary', 'google_category' => ''), 'id' => 12,
array('parent_id' => 15, 'id' => 87, 'code' => 'personal_journals', 'apple_category' => 'Personal Journals', 'google_category' => ''), 'code' => 'news',
array('parent_id' => 15, 'id' => 88, 'code' => 'philosophy', 'apple_category' => 'Philosophy', 'google_category' => ''), 'apple_category' => 'News',
array('parent_id' => 15, 'id' => 89, 'code' => 'places_and_travel', 'apple_category' => 'Places &amp; Travel', 'google_category' => ''), 'google_category' => 'News &amp; Politics',
array('parent_id' => 15, 'id' => 90, 'code' => 'relationships', 'apple_category' => 'Relationships', 'google_category' => ''), ],
array('parent_id' => 16, 'id' => 91, 'code' => 'baseball', 'apple_category' => 'Baseball', 'google_category' => ''), [
array('parent_id' => 16, 'id' => 92, 'code' => 'basketball', 'apple_category' => 'Basketball', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 16, 'id' => 93, 'code' => 'cricket', 'apple_category' => 'Cricket', 'google_category' => ''), 'id' => 13,
array('parent_id' => 16, 'id' => 94, 'code' => 'fantasy_sports', 'apple_category' => 'Fantasy Sports', 'google_category' => ''), 'code' => 'religion_and_spirituality',
array('parent_id' => 16, 'id' => 95, 'code' => 'football', 'apple_category' => 'Football', 'google_category' => ''), 'apple_category' => 'Religion &amp; Spirituality',
array('parent_id' => 16, 'id' => 96, 'code' => 'golf', 'apple_category' => 'Golf', 'google_category' => ''), 'google_category' => 'Religion &amp; Spirituality',
array('parent_id' => 16, 'id' => 97, 'code' => 'hockey', 'apple_category' => 'Hockey', 'google_category' => ''), ],
array('parent_id' => 16, 'id' => 98, 'code' => 'rugby', 'apple_category' => 'Rugby', 'google_category' => ''), [
array('parent_id' => 16, 'id' => 99, 'code' => 'running', 'apple_category' => 'Running', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 16, 'id' => 100, 'code' => 'soccer', 'apple_category' => 'Soccer', 'google_category' => ''), 'id' => 14,
array('parent_id' => 16, 'id' => 101, 'code' => 'swimming', 'apple_category' => 'Swimming', 'google_category' => ''), 'code' => 'science',
array('parent_id' => 16, 'id' => 102, 'code' => 'tennis', 'apple_category' => 'Tennis', 'google_category' => ''), 'apple_category' => 'Science',
array('parent_id' => 16, 'id' => 103, 'code' => 'volleyball', 'apple_category' => 'Volleyball', 'google_category' => ''), 'google_category' => 'Science &amp; Medicine',
array('parent_id' => 16, 'id' => 104, 'code' => 'wilderness', 'apple_category' => 'Wilderness', 'google_category' => ''), ],
array('parent_id' => 16, 'id' => 105, 'code' => 'wrestling', 'apple_category' => 'Wrestling', 'google_category' => ''), [
array('parent_id' => 19, 'id' => 106, 'code' => 'after_shows', 'apple_category' => 'After Shows', 'google_category' => ''), 'parent_id' => 0,
array('parent_id' => 19, 'id' => 107, 'code' => 'film_history', 'apple_category' => 'Film History', 'google_category' => ''), 'id' => 15,
array('parent_id' => 19, 'id' => 108, 'code' => 'film_interviews', 'apple_category' => 'Film Interviews', 'google_category' => ''), 'code' => 'society_and_culture',
array('parent_id' => 19, 'id' => 109, 'code' => 'film_reviews', 'apple_category' => 'Film Reviews', 'google_category' => ''), 'apple_category' => 'Society &amp; Culture',
array('parent_id' => 19, 'id' => 110, 'code' => 'tv_reviews', 'apple_category' => 'TV Reviews', 'google_category' => ''), 'google_category' => 'Society &amp; Culture',
); ],
[
'parent_id' => 0,
'id' => 16,
'code' => 'sports',
'apple_category' => 'Sports',
'google_category' => 'Sports &amp; Recreation',
],
[
'parent_id' => 0,
'id' => 17,
'code' => 'technology',
'apple_category' => 'Technology',
'google_category' => 'Technology',
],
[
'parent_id' => 0,
'id' => 18,
'code' => 'true_crime',
'apple_category' => 'True Crime',
'google_category' => '',
],
[
'parent_id' => 0,
'id' => 19,
'code' => 'tv_and_film',
'apple_category' => 'TV &amp; Film',
'google_category' => 'TV &amp; Film',
],
[
'parent_id' => 1,
'id' => 20,
'code' => 'books',
'apple_category' => 'Books',
'google_category' => '',
],
[
'parent_id' => 1,
'id' => 21,
'code' => 'design',
'apple_category' => 'Design',
'google_category' => '',
],
[
'parent_id' => 1,
'id' => 22,
'code' => 'fashion_and_beauty',
'apple_category' => 'Fashion &amp; Beauty',
'google_category' => '',
],
[
'parent_id' => 1,
'id' => 23,
'code' => 'food',
'apple_category' => 'Food',
'google_category' => '',
],
[
'parent_id' => 1,
'id' => 24,
'code' => 'performing_arts',
'apple_category' => 'Performing Arts',
'google_category' => '',
],
[
'parent_id' => 1,
'id' => 25,
'code' => 'visual_arts',
'apple_category' => 'Visual Arts',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 26,
'code' => 'careers',
'apple_category' => 'Careers',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 27,
'code' => 'entrepreneurship',
'apple_category' => 'Entrepreneurship',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 28,
'code' => 'investing',
'apple_category' => 'Investing',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 29,
'code' => 'management',
'apple_category' => 'Management',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 30,
'code' => 'marketing',
'apple_category' => 'Marketing',
'google_category' => '',
],
[
'parent_id' => 2,
'id' => 31,
'code' => 'non_profit',
'apple_category' => 'Non-Profit',
'google_category' => '',
],
[
'parent_id' => 3,
'id' => 32,
'code' => 'comedy_interviews',
'apple_category' => 'Comedy Interviews',
'google_category' => '',
],
[
'parent_id' => 3,
'id' => 33,
'code' => 'improv',
'apple_category' => 'Improv',
'google_category' => '',
],
[
'parent_id' => 3,
'id' => 34,
'code' => 'stand_up',
'apple_category' => 'Stand-Up',
'google_category' => '',
],
[
'parent_id' => 4,
'id' => 35,
'code' => 'courses',
'apple_category' => 'Courses',
'google_category' => '',
],
[
'parent_id' => 4,
'id' => 36,
'code' => 'how_to',
'apple_category' => 'How To',
'google_category' => '',
],
[
'parent_id' => 4,
'id' => 37,
'code' => 'language_learning',
'apple_category' => 'Language Learning',
'google_category' => '',
],
[
'parent_id' => 4,
'id' => 38,
'code' => 'self_improvement',
'apple_category' => 'Self-Improvement',
'google_category' => '',
],
[
'parent_id' => 5,
'id' => 39,
'code' => 'comedy_fiction',
'apple_category' => 'Comedy Fiction',
'google_category' => '',
],
[
'parent_id' => 5,
'id' => 40,
'code' => 'drama',
'apple_category' => 'Drama',
'google_category' => '',
],
[
'parent_id' => 5,
'id' => 41,
'code' => 'science_fiction',
'apple_category' => 'Science Fiction',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 42,
'code' => 'alternative_health',
'apple_category' => 'Alternative Health',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 43,
'code' => 'fitness',
'apple_category' => 'Fitness',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 44,
'code' => 'medicine',
'apple_category' => 'Medicine',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 45,
'code' => 'mental_health',
'apple_category' => 'Mental Health',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 46,
'code' => 'nutrition',
'apple_category' => 'Nutrition',
'google_category' => '',
],
[
'parent_id' => 7,
'id' => 47,
'code' => 'sexuality',
'apple_category' => 'Sexuality',
'google_category' => '',
],
[
'parent_id' => 9,
'id' => 48,
'code' => 'education_for_kids',
'apple_category' => 'Education for Kids',
'google_category' => '',
],
[
'parent_id' => 9,
'id' => 49,
'code' => 'parenting',
'apple_category' => 'Parenting',
'google_category' => '',
],
[
'parent_id' => 9,
'id' => 50,
'code' => 'pets_and_animals',
'apple_category' => 'Pets &amp; Animals',
'google_category' => '',
],
[
'parent_id' => 9,
'id' => 51,
'code' => 'stories_for_kids',
'apple_category' => 'Stories for Kids',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 52,
'code' => 'animation_and_manga',
'apple_category' => 'Animation &amp; Manga',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 53,
'code' => 'automotive',
'apple_category' => 'Automotive',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 54,
'code' => 'aviation',
'apple_category' => 'Aviation',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 55,
'code' => 'crafts',
'apple_category' => 'Crafts',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 56,
'code' => 'games',
'apple_category' => 'Games',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 57,
'code' => 'hobbies',
'apple_category' => 'Hobbies',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 58,
'code' => 'home_and_garden',
'apple_category' => 'Home &amp; Garden',
'google_category' => '',
],
[
'parent_id' => 10,
'id' => 59,
'code' => 'video_games',
'apple_category' => 'Video Games',
'google_category' => '',
],
[
'parent_id' => 11,
'id' => 60,
'code' => 'music_commentary',
'apple_category' => 'Music Commentary',
'google_category' => '',
],
[
'parent_id' => 11,
'id' => 61,
'code' => 'music_history',
'apple_category' => 'Music History',
'google_category' => '',
],
[
'parent_id' => 11,
'id' => 62,
'code' => 'music_interviews',
'apple_category' => 'Music Interviews',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 63,
'code' => 'business_news',
'apple_category' => 'Business News',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 64,
'code' => 'daily_news',
'apple_category' => 'Daily News',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 65,
'code' => 'entertainment_news',
'apple_category' => 'Entertainment News',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 66,
'code' => 'news_commentary',
'apple_category' => 'News Commentary',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 67,
'code' => 'politics',
'apple_category' => 'Politics',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 68,
'code' => 'sports_news',
'apple_category' => 'Sports News',
'google_category' => '',
],
[
'parent_id' => 12,
'id' => 69,
'code' => 'tech_news',
'apple_category' => 'Tech News',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 70,
'code' => 'buddhism',
'apple_category' => 'Buddhism',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 71,
'code' => 'christianity',
'apple_category' => 'Christianity',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 72,
'code' => 'hinduism',
'apple_category' => 'Hinduism',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 73,
'code' => 'islam',
'apple_category' => 'Islam',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 74,
'code' => 'judaism',
'apple_category' => 'Judaism',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 75,
'code' => 'religion',
'apple_category' => 'Religion',
'google_category' => '',
],
[
'parent_id' => 13,
'id' => 76,
'code' => 'spirituality',
'apple_category' => 'Spirituality',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 77,
'code' => 'astronomy',
'apple_category' => 'Astronomy',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 78,
'code' => 'chemistry',
'apple_category' => 'Chemistry',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 79,
'code' => 'earth_sciences',
'apple_category' => 'Earth Sciences',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 80,
'code' => 'life_sciences',
'apple_category' => 'Life Sciences',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 81,
'code' => 'mathematics',
'apple_category' => 'Mathematics',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 82,
'code' => 'natural_sciences',
'apple_category' => 'Natural Sciences',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 83,
'code' => 'nature',
'apple_category' => 'Nature',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 84,
'code' => 'physics',
'apple_category' => 'Physics',
'google_category' => '',
],
[
'parent_id' => 14,
'id' => 85,
'code' => 'social_sciences',
'apple_category' => 'Social Sciences',
'google_category' => '',
],
[
'parent_id' => 15,
'id' => 86,
'code' => 'documentary',
'apple_category' => 'Documentary',
'google_category' => '',
],
[
'parent_id' => 15,
'id' => 87,
'code' => 'personal_journals',
'apple_category' => 'Personal Journals',
'google_category' => '',
],
[
'parent_id' => 15,
'id' => 88,
'code' => 'philosophy',
'apple_category' => 'Philosophy',
'google_category' => '',
],
[
'parent_id' => 15,
'id' => 89,
'code' => 'places_and_travel',
'apple_category' => 'Places &amp; Travel',
'google_category' => '',
],
[
'parent_id' => 15,
'id' => 90,
'code' => 'relationships',
'apple_category' => 'Relationships',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 91,
'code' => 'baseball',
'apple_category' => 'Baseball',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 92,
'code' => 'basketball',
'apple_category' => 'Basketball',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 93,
'code' => 'cricket',
'apple_category' => 'Cricket',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 94,
'code' => 'fantasy_sports',
'apple_category' => 'Fantasy Sports',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 95,
'code' => 'football',
'apple_category' => 'Football',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 96,
'code' => 'golf',
'apple_category' => 'Golf',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 97,
'code' => 'hockey',
'apple_category' => 'Hockey',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 98,
'code' => 'rugby',
'apple_category' => 'Rugby',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 99,
'code' => 'running',
'apple_category' => 'Running',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 100,
'code' => 'soccer',
'apple_category' => 'Soccer',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 101,
'code' => 'swimming',
'apple_category' => 'Swimming',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 102,
'code' => 'tennis',
'apple_category' => 'Tennis',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 103,
'code' => 'volleyball',
'apple_category' => 'Volleyball',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 104,
'code' => 'wilderness',
'apple_category' => 'Wilderness',
'google_category' => '',
],
[
'parent_id' => 16,
'id' => 105,
'code' => 'wrestling',
'apple_category' => 'Wrestling',
'google_category' => '',
],
[
'parent_id' => 19,
'id' => 106,
'code' => 'after_shows',
'apple_category' => 'After Shows',
'google_category' => '',
],
[
'parent_id' => 19,
'id' => 107,
'code' => 'film_history',
'apple_category' => 'Film History',
'google_category' => '',
],
[
'parent_id' => 19,
'id' => 108,
'code' => 'film_interviews',
'apple_category' => 'Film Interviews',
'google_category' => '',
],
[
'parent_id' => 19,
'id' => 109,
'code' => 'film_reviews',
'apple_category' => 'Film Reviews',
'google_category' => '',
],
[
'parent_id' => 19,
'id' => 110,
'code' => 'tv_reviews',
'apple_category' => 'TV Reviews',
'google_category' => '',
],
];
$this->db->table('categories')->insertBatch($data); $this->db->table('categories')->insertBatch($data);
} }

View File

@ -1,9 +1,19 @@
<?php <?php
/**
* Class LanguageSeeder
* Inserts values in languages table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
/** /**
* From https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes * From https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
* (cc) Creative Commons Attribution-ShareAlike 3.0 * (cc) Creative Commons Attribution-ShareAlike 3.0
* 2020-06-07 * 2020-06-07
*/ */
namespace App\Database\Seeds; namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder; use CodeIgniter\Database\Seeder;
@ -12,192 +22,615 @@ class LanguageSeeder extends Seeder
{ {
public function run() public function run()
{ {
$data = array( $data = [
array('code'=>'aa','name'=>'Afar','native_name'=>'Afaraf'), ['code' => 'aa', 'name' => 'Afar', 'native_name' => 'Afaraf'],
array('code'=>'ab','name'=>'Abkhazian','native_name'=>'аҧсуа бызшәа, аҧсшәа'), [
array('code'=>'ae','name'=>'Avestan','native_name'=>'avesta'), 'code' => 'ab',
array('code'=>'af','name'=>'Afrikaans','native_name'=>'Afrikaans'), 'name' => 'Abkhazian',
array('code'=>'ak','name'=>'Akan','native_name'=>'Akan'), 'native_name' => 'аҧсуа бызшәа, аҧсшәа',
array('code'=>'am','name'=>'Amharic','native_name'=>'አማርኛ'), ],
array('code'=>'an','name'=>'Aragonese','native_name'=>'aragonés'), ['code' => 'ae', 'name' => 'Avestan', 'native_name' => 'avesta'],
array('code'=>'ar','name'=>'Arabic','native_name'=>'العربية'), [
array('code'=>'as','name'=>'Assamese','native_name'=>'অসমীয়া'), 'code' => 'af',
array('code'=>'av','name'=>'Avaric','native_name'=>'авар мацӀ, магӀарул мацӀ'), 'name' => 'Afrikaans',
array('code'=>'ay','name'=>'Aymara','native_name'=>'aymar aru'), 'native_name' => 'Afrikaans',
array('code'=>'az','name'=>'Azerbaijani','native_name'=>'azərbaycan dili'), ],
array('code'=>'ba','name'=>'Bashkir','native_name'=>'башҡорт теле'), ['code' => 'ak', 'name' => 'Akan', 'native_name' => 'Akan'],
array('code'=>'be','name'=>'Belarusian','native_name'=>'беларуская мова'), ['code' => 'am', 'name' => 'Amharic', 'native_name' => 'አማርኛ'],
array('code'=>'bg','name'=>'Bulgarian','native_name'=>'български език'), [
array('code'=>'bh','name'=>'Bihari languages','native_name'=>'भोजपुरी'), 'code' => 'an',
array('code'=>'bi','name'=>'Bislama','native_name'=>'Bislama'), 'name' => 'Aragonese',
array('code'=>'bm','name'=>'Bambara','native_name'=>'bamanankan'), 'native_name' => 'aragonés',
array('code'=>'bn','name'=>'Bengali','native_name'=>'বাংলা'), ],
array('code'=>'bo','name'=>'Tibetan','native_name'=>'བོད་ཡིག'), ['code' => 'ar', 'name' => 'Arabic', 'native_name' => 'العربية'],
array('code'=>'br','name'=>'Breton','native_name'=>'brezhoneg'), ['code' => 'as', 'name' => 'Assamese', 'native_name' => 'অসমীয়া'],
array('code'=>'bs','name'=>'Bosnian','native_name'=>'bosanski jezik'), [
array('code'=>'ca','name'=>'Catalan, Valencian','native_name'=>'català, valencià'), 'code' => 'av',
array('code'=>'ce','name'=>'Chechen','native_name'=>'нохчийн мотт'), 'name' => 'Avaric',
array('code'=>'ch','name'=>'Chamorro','native_name'=>'Chamoru'), 'native_name' => 'авар мацӀ, магӀарул мацӀ',
array('code'=>'co','name'=>'Corsican','native_name'=>'corsu, lingua corsa'), ],
array('code'=>'cr','name'=>'Cree','native_name'=>'ᓀᐦᐃᔭᐍᐏᐣ'), ['code' => 'ay', 'name' => 'Aymara', 'native_name' => 'aymar aru'],
array('code'=>'cs','name'=>'Czech','native_name'=>'čeština, český jazyk'), [
array('code'=>'cu','name'=>'Church Slavic, Old Slavonic, Church Slavonic, Old Bulgarian, Old Church Slavonic','native_name'=>'ѩзыкъ словѣньскъ'), 'code' => 'az',
array('code'=>'cv','name'=>'Chuvash','native_name'=>'чӑваш чӗлхи'), 'name' => 'Azerbaijani',
array('code'=>'cy','name'=>'Welsh','native_name'=>'Cymraeg'), 'native_name' => 'azərbaycan dili',
array('code'=>'da','name'=>'Danish','native_name'=>'dansk'), ],
array('code'=>'de','name'=>'German','native_name'=>'Deutsch'), [
array('code'=>'dv','name'=>'Divehi, Dhivehi, Maldivian','native_name'=>'ދިވެހި'), 'code' => 'ba',
array('code'=>'dz','name'=>'Dzongkha','native_name'=>'རྫོང་ཁ'), 'name' => 'Bashkir',
array('code'=>'ee','name'=>'Ewe','native_name'=>'Eʋegbe'), 'native_name' => 'башҡорт теле',
array('code'=>'el','name'=>'Greek, Modern (1453)','native_name'=>'ελληνικά'), ],
array('code'=>'en','name'=>'English','native_name'=>'English'), [
array('code'=>'eo','name'=>'Esperanto','native_name'=>'Esperanto'), 'code' => 'be',
array('code'=>'es','name'=>'Spanish, Castilian','native_name'=>'Español'), 'name' => 'Belarusian',
array('code'=>'et','name'=>'Estonian','native_name'=>'eesti, eesti keel'), 'native_name' => 'беларуская мова',
array('code'=>'eu','name'=>'Basque','native_name'=>'euskara, euskera'), ],
array('code'=>'fa','name'=>'Persian','native_name'=>'فارسی'), [
array('code'=>'ff','name'=>'Fulah','native_name'=>'Fulfulde, Pulaar, Pular'), 'code' => 'bg',
array('code'=>'fi','name'=>'Finnish','native_name'=>'suomi, suomen kieli'), 'name' => 'Bulgarian',
array('code'=>'fj','name'=>'Fijian','native_name'=>'vosa Vakaviti'), 'native_name' => 'български език',
array('code'=>'fo','name'=>'Faroese','native_name'=>'føroyskt'), ],
array('code'=>'fr','name'=>'French','native_name'=>'français, langue française'), [
array('code'=>'fy','name'=>'Western Frisian','native_name'=>'Frysk'), 'code' => 'bh',
array('code'=>'ga','name'=>'Irish','native_name'=>'Gaeilge'), 'name' => 'Bihari languages',
array('code'=>'gd','name'=>'Gaelic, Scottish Gaelic','native_name'=>'Gàidhlig'), 'native_name' => 'भोजपुरी',
array('code'=>'gl','name'=>'Galician','native_name'=>'Galego'), ],
array('code'=>'gn','name'=>'Guarani','native_name'=>'Avañe\'ẽ'), ['code' => 'bi', 'name' => 'Bislama', 'native_name' => 'Bislama'],
array('code'=>'gu','name'=>'Gujarati','native_name'=>'ગુજરાતી'), [
array('code'=>'gv','name'=>'Manx','native_name'=>'Gaelg, Gailck'), 'code' => 'bm',
array('code'=>'ha','name'=>'Hausa','native_name'=>'(Hausa) هَوُسَ'), 'name' => 'Bambara',
array('code'=>'he','name'=>'Hebrew','native_name'=>'עברית'), 'native_name' => 'bamanankan',
array('code'=>'hi','name'=>'Hindi','native_name'=>'हिन्दी, हिंदी'), ],
array('code'=>'ho','name'=>'Hiri Motu','native_name'=>'Hiri Motu'), ['code' => 'bn', 'name' => 'Bengali', 'native_name' => 'বাংলা'],
array('code'=>'hr','name'=>'Croatian','native_name'=>'hrvatski jezik'), ['code' => 'bo', 'name' => 'Tibetan', 'native_name' => 'བོད་ཡིག'],
array('code'=>'ht','name'=>'Haitian, Haitian Creole','native_name'=>'Kreyòl ayisyen'), ['code' => 'br', 'name' => 'Breton', 'native_name' => 'brezhoneg'],
array('code'=>'hu','name'=>'Hungarian','native_name'=>'magyar'), [
array('code'=>'hy','name'=>'Armenian','native_name'=>'Հայերեն'), 'code' => 'bs',
array('code'=>'hz','name'=>'Herero','native_name'=>'Otjiherero'), 'name' => 'Bosnian',
array('code'=>'ia','name'=>'Interlingua (International Auxiliary Language Association)','native_name'=>'Interlingua'), 'native_name' => 'bosanski jezik',
array('code'=>'id','name'=>'Indonesian','native_name'=>'Bahasa Indonesia'), ],
array('code'=>'ie','name'=>'Interlingue, Occidental','native_name'=>'(originally:) Occidental, (after WWII:) Interlingue'), [
array('code'=>'ig','name'=>'Igbo','native_name'=>'Asụsụ Igbo'), 'code' => 'ca',
array('code'=>'ii','name'=>'Sichuan Yi, Nuosu','native_name'=>'ꆈꌠ꒿ Nuosuhxop'), 'name' => 'Catalan, Valencian',
array('code'=>'ik','name'=>'Inupiaq','native_name'=>'Iñupiaq, Iñupiatun'), 'native_name' => 'català, valencià',
array('code'=>'io','name'=>'Ido','native_name'=>'Ido'), ],
array('code'=>'is','name'=>'Icelandic','native_name'=>'Íslenska'), [
array('code'=>'it','name'=>'Italian','native_name'=>'Italiano'), 'code' => 'ce',
array('code'=>'iu','name'=>'Inuktitut','native_name'=>'ᐃᓄᒃᑎᑐᑦ'), 'name' => 'Chechen',
array('code'=>'ja','name'=>'Japanese','native_name'=>'日本語 (にほんご)'), 'native_name' => 'нохчийн мотт',
array('code'=>'jv','name'=>'Javanese','native_name'=>'ꦧꦱꦗꦮ, Basa Jawa'), ],
array('code'=>'ka','name'=>'Georgian','native_name'=>'ქართული'), ['code' => 'ch', 'name' => 'Chamorro', 'native_name' => 'Chamoru'],
array('code'=>'kg','name'=>'Kongo','native_name'=>'Kikongo'), [
array('code'=>'ki','name'=>'Kikuyu, Gikuyu','native_name'=>'Gĩkũyũ'), 'code' => 'co',
array('code'=>'kj','name'=>'Kuanyama, Kwanyama','native_name'=>'Kuanyama'), 'name' => 'Corsican',
array('code'=>'kk','name'=>'Kazakh','native_name'=>'қазақ тілі'), 'native_name' => 'corsu, lingua corsa',
array('code'=>'kl','name'=>'Kalaallisut, Greenlandic','native_name'=>'kalaallisut, kalaallit oqaasii'), ],
array('code'=>'km','name'=>'Central Khmer','native_name'=>'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ'), ['code' => 'cr', 'name' => 'Cree', 'native_name' => 'ᓀᐦᐃᔭᐍᐏᐣ'],
array('code'=>'kn','name'=>'Kannada','native_name'=>'ಕನ್ನಡ'), [
array('code'=>'ko','name'=>'Korean','native_name'=>'한국어'), 'code' => 'cs',
array('code'=>'kr','name'=>'Kanuri','native_name'=>'Kanuri'), 'name' => 'Czech',
array('code'=>'ks','name'=>'Kashmiri','native_name'=>'कश्मीरी, كشميري‎'), 'native_name' => 'čeština, český jazyk',
array('code'=>'ku','name'=>'Kurdish','native_name'=>'Kurdî, کوردی‎'), ],
array('code'=>'kv','name'=>'Komi','native_name'=>'коми кыв'), [
array('code'=>'kw','name'=>'Cornish','native_name'=>'Kernewek'), 'code' => 'cu',
array('code'=>'ky','name'=>'Kirghiz, Kyrgyz','native_name'=>'Кыргызча, Кыргыз тили'), 'name' =>
array('code'=>'la','name'=>'Latin','native_name'=>'latine, lingua latina'), 'Church Slavic, Old Slavonic, Church Slavonic, Old Bulgarian, Old Church Slavonic',
array('code'=>'lb','name'=>'Luxembourgish, Letzeburgesch','native_name'=>'Lëtzebuergesch'), 'native_name' => 'ѩзыкъ словѣньскъ',
array('code'=>'lg','name'=>'Ganda','native_name'=>'Luganda'), ],
array('code'=>'li','name'=>'Limburgan, Limburger, Limburgish','native_name'=>'Limburgs'), [
array('code'=>'ln','name'=>'Lingala','native_name'=>'Lingála'), 'code' => 'cv',
array('code'=>'lo','name'=>'Lao','native_name'=>'ພາສາລາວ'), 'name' => 'Chuvash',
array('code'=>'lt','name'=>'Lithuanian','native_name'=>'lietuvių kalba'), 'native_name' => 'чӑваш чӗлхи',
array('code'=>'lu','name'=>'Luba-Katanga','native_name'=>'Kiluba'), ],
array('code'=>'lv','name'=>'Latvian','native_name'=>'latviešu valoda'), ['code' => 'cy', 'name' => 'Welsh', 'native_name' => 'Cymraeg'],
array('code'=>'mg','name'=>'Malagasy','native_name'=>'fiteny malagasy'), ['code' => 'da', 'name' => 'Danish', 'native_name' => 'dansk'],
array('code'=>'mh','name'=>'Marshallese','native_name'=>'Kajin M̧ajeļ'), ['code' => 'de', 'name' => 'German', 'native_name' => 'Deutsch'],
array('code'=>'mi','name'=>'Maori','native_name'=>'te reo Māori'), [
array('code'=>'mk','name'=>'Macedonian','native_name'=>'македонски јазик'), 'code' => 'dv',
array('code'=>'ml','name'=>'Malayalam','native_name'=>'മലയാളം'), 'name' => 'Divehi, Dhivehi, Maldivian',
array('code'=>'mn','name'=>'Mongolian','native_name'=>'Монгол хэл'), 'native_name' => 'ދިވެހި',
array('code'=>'mr','name'=>'Marathi','native_name'=>'मराठी'), ],
array('code'=>'ms','name'=>'Malay','native_name'=>'Bahasa Melayu, بهاس ملايو‎'), ['code' => 'dz', 'name' => 'Dzongkha', 'native_name' => 'རྫོང་ཁ'],
array('code'=>'mt','name'=>'Maltese','native_name'=>'Malti'), ['code' => 'ee', 'name' => 'Ewe', 'native_name' => 'Eʋegbe'],
array('code'=>'my','name'=>'Burmese','native_name'=>'ဗမာစာ'), [
array('code'=>'na','name'=>'Nauru','native_name'=>'Dorerin Naoero'), 'code' => 'el',
array('code'=>'nb','name'=>'Norwegian Bokmål','native_name'=>'Norsk Bokmål'), 'name' => 'Greek, Modern (1453)',
array('code'=>'nd','name'=>'North Ndebele','native_name'=>'isiNdebele'), 'native_name' => 'ελληνικά',
array('code'=>'ne','name'=>'Nepali','native_name'=>'नेपाली'), ],
array('code'=>'ng','name'=>'Ndonga','native_name'=>'Owambo'), ['code' => 'en', 'name' => 'English', 'native_name' => 'English'],
array('code'=>'nl','name'=>'Dutch, Flemish','native_name'=>'Nederlands, Vlaams'), [
array('code'=>'nn','name'=>'Norwegian Nynorsk','native_name'=>'Norsk Nynorsk'), 'code' => 'eo',
array('code'=>'no','name'=>'Norwegian','native_name'=>'Norsk'), 'name' => 'Esperanto',
array('code'=>'nr','name'=>'South Ndebele','native_name'=>'isiNdebele'), 'native_name' => 'Esperanto',
array('code'=>'nv','name'=>'Navajo, Navaho','native_name'=>'Diné bizaad'), ],
array('code'=>'ny','name'=>'Chichewa, Chewa, Nyanja','native_name'=>'chiCheŵa, chinyanja'), [
array('code'=>'oc','name'=>'Occitan','native_name'=>'occitan, lenga dòc'), 'code' => 'es',
array('code'=>'oj','name'=>'Ojibwa','native_name'=>'ᐊᓂᔑᓈᐯᒧᐎᓐ'), 'name' => 'Spanish, Castilian',
array('code'=>'om','name'=>'Oromo','native_name'=>'Afaan Oromoo'), 'native_name' => 'Español',
array('code'=>'or','name'=>'Oriya','native_name'=>'ଓଡ଼ିଆ'), ],
array('code'=>'os','name'=>'Ossetian, Ossetic','native_name'=>'ирон æвзаг'), [
array('code'=>'pa','name'=>'Punjabi, Panjabi','native_name'=>'ਪੰਜਾਬੀ, پنجابی‎'), 'code' => 'et',
array('code'=>'pi','name'=>'Pali','native_name'=>'पालि, पाळि'), 'name' => 'Estonian',
array('code'=>'pl','name'=>'Polish','native_name'=>'język polski, polszczyzna'), 'native_name' => 'eesti, eesti keel',
array('code'=>'ps','name'=>'Pashto, Pushto','native_name'=>'پښتو'), ],
array('code'=>'pt','name'=>'Portuguese','native_name'=>'Português'), [
array('code'=>'qu','name'=>'Quechua','native_name'=>'Runa Simi, Kichwa'), 'code' => 'eu',
array('code'=>'rm','name'=>'Romansh','native_name'=>'Rumantsch Grischun'), 'name' => 'Basque',
array('code'=>'rn','name'=>'Rundi','native_name'=>'Ikirundi'), 'native_name' => 'euskara, euskera',
array('code'=>'ro','name'=>'Romanian, Moldavian, Moldovan','native_name'=>'Română'), ],
array('code'=>'ru','name'=>'Russian','native_name'=>'русский'), ['code' => 'fa', 'name' => 'Persian', 'native_name' => 'فارسی'],
array('code'=>'rw','name'=>'Kinyarwanda','native_name'=>'Ikinyarwanda'), [
array('code'=>'sa','name'=>'Sanskrit','native_name'=>'संस्कृतम्'), 'code' => 'ff',
array('code'=>'sc','name'=>'Sardinian','native_name'=>'sardu'), 'name' => 'Fulah',
array('code'=>'sd','name'=>'Sindhi','native_name'=>'सिन्धी, سنڌي، سندھی‎'), 'native_name' => 'Fulfulde, Pulaar, Pular',
array('code'=>'se','name'=>'Northern Sami','native_name'=>'Davvisámegiella'), ],
array('code'=>'sg','name'=>'Sango','native_name'=>'yângâ tî sängö'), [
array('code'=>'si','name'=>'Sinhala, Sinhalese','native_name'=>'සිංහල'), 'code' => 'fi',
array('code'=>'sk','name'=>'Slovak','native_name'=>'Slovenčina, Slovenský Jazyk'), 'name' => 'Finnish',
array('code'=>'sl','name'=>'Slovenian','native_name'=>'Slovenski Jezik, Slovenščina'), 'native_name' => 'suomi, suomen kieli',
array('code'=>'sm','name'=>'Samoan','native_name'=>'gagana fa\'a Samoa'), ],
array('code'=>'sn','name'=>'Shona','native_name'=>'chiShona'), [
array('code'=>'so','name'=>'Somali','native_name'=>'Soomaaliga, af Soomaali'), 'code' => 'fj',
array('code'=>'sq','name'=>'Albanian','native_name'=>'Shqip'), 'name' => 'Fijian',
array('code'=>'sr','name'=>'Serbian','native_name'=>'српски језик'), 'native_name' => 'vosa Vakaviti',
array('code'=>'ss','name'=>'Swati','native_name'=>'SiSwati'), ],
array('code'=>'st','name'=>'Southern Sotho','native_name'=>'Sesotho'), ['code' => 'fo', 'name' => 'Faroese', 'native_name' => 'føroyskt'],
array('code'=>'su','name'=>'Sundanese','native_name'=>'Basa Sunda'), [
array('code'=>'sv','name'=>'Swedish','native_name'=>'Svenska'), 'code' => 'fr',
array('code'=>'sw','name'=>'Swahili','native_name'=>'Kiswahili'), 'name' => 'French',
array('code'=>'ta','name'=>'Tamil','native_name'=>'தமிழ்'), 'native_name' => 'français, langue française',
array('code'=>'te','name'=>'Telugu','native_name'=>'తెలుగు'), ],
array('code'=>'tg','name'=>'Tajik','native_name'=>'тоҷикӣ, toçikī, تاجیکی‎'), [
array('code'=>'th','name'=>'Thai','native_name'=>'ไทย'), 'code' => 'fy',
array('code'=>'ti','name'=>'Tigrinya','native_name'=>'ትግርኛ'), 'name' => 'Western Frisian',
array('code'=>'tk','name'=>'Turkmen','native_name'=>'Türkmen, Түркмен'), 'native_name' => 'Frysk',
array('code'=>'tl','name'=>'Tagalog','native_name'=>'Wikang Tagalog'), ],
array('code'=>'tn','name'=>'Tswana','native_name'=>'Setswana'), ['code' => 'ga', 'name' => 'Irish', 'native_name' => 'Gaeilge'],
array('code'=>'to','name'=>'Tonga (Tonga Islands)','native_name'=>'Faka Tonga'), [
array('code'=>'tr','name'=>'Turkish','native_name'=>'Türkçe'), 'code' => 'gd',
array('code'=>'ts','name'=>'Tsonga','native_name'=>'Xitsonga'), 'name' => 'Gaelic, Scottish Gaelic',
array('code'=>'tt','name'=>'Tatar','native_name'=>'татар теле, tatar tele'), 'native_name' => 'Gàidhlig',
array('code'=>'tw','name'=>'Twi','native_name'=>'Twi'), ],
array('code'=>'ty','name'=>'Tahitian','native_name'=>'Reo Tahiti'), ['code' => 'gl', 'name' => 'Galician', 'native_name' => 'Galego'],
array('code'=>'ug','name'=>'Uighur, Uyghur','native_name'=>'ئۇيغۇرچە‎, Uyghurche'), ['code' => 'gn', 'name' => 'Guarani', 'native_name' => 'Avañe\'ẽ'],
array('code'=>'uk','name'=>'Ukrainian','native_name'=>'Українська'), ['code' => 'gu', 'name' => 'Gujarati', 'native_name' => 'ગુજરાતી'],
array('code'=>'ur','name'=>'Urdu','native_name'=>'اردو'), [
array('code'=>'uz','name'=>'Uzbek','native_name'=>'Oʻzbek, Ўзбек, أۇزبېك‎'), 'code' => 'gv',
array('code'=>'ve','name'=>'Venda','native_name'=>'Tshivenḓa'), 'name' => 'Manx',
array('code'=>'vi','name'=>'Vietnamese','native_name'=>'Tiếng Việt'), 'native_name' => 'Gaelg, Gailck',
array('code'=>'vo','name'=>'Volapük','native_name'=>'Volapük'), ],
array('code'=>'wa','name'=>'Walloon','native_name'=>'Walon'), [
array('code'=>'wo','name'=>'Wolof','native_name'=>'Wollof'), 'code' => 'ha',
array('code'=>'xh','name'=>'Xhosa','native_name'=>'isiXhosa'), 'name' => 'Hausa',
array('code'=>'yi','name'=>'Yiddish','native_name'=>'ייִדיש'), 'native_name' => '(Hausa) هَوُسَ',
array('code'=>'yo','name'=>'Yoruba','native_name'=>'Yorùbá'), ],
array('code'=>'za','name'=>'Zhuang, Chuang','native_name'=>'Saɯ cueŋƅ, Saw cuengh'), ['code' => 'he', 'name' => 'Hebrew', 'native_name' => 'עברית'],
array('code'=>'zh','name'=>'Chinese','native_name'=>'中文 (Zhōngwén), 汉语, 漢語'), [
array('code'=>'zu','name'=>'Zulu','native_name'=>'isiZulu'), 'code' => 'hi',
); 'name' => 'Hindi',
'native_name' => 'हिन्दी, हिंदी',
],
[
'code' => 'ho',
'name' => 'Hiri Motu',
'native_name' => 'Hiri Motu',
],
[
'code' => 'hr',
'name' => 'Croatian',
'native_name' => 'hrvatski jezik',
],
[
'code' => 'ht',
'name' => 'Haitian, Haitian Creole',
'native_name' => 'Kreyòl ayisyen',
],
['code' => 'hu', 'name' => 'Hungarian', 'native_name' => 'magyar'],
['code' => 'hy', 'name' => 'Armenian', 'native_name' => 'Հայերեն'],
['code' => 'hz', 'name' => 'Herero', 'native_name' => 'Otjiherero'],
[
'code' => 'ia',
'name' =>
'Interlingua (International Auxiliary Language Association)',
'native_name' => 'Interlingua',
],
[
'code' => 'id',
'name' => 'Indonesian',
'native_name' => 'Bahasa Indonesia',
],
[
'code' => 'ie',
'name' => 'Interlingue, Occidental',
'native_name' =>
'(originally:) Occidental, (after WWII:) Interlingue',
],
['code' => 'ig', 'name' => 'Igbo', 'native_name' => 'Asụsụ Igbo'],
[
'code' => 'ii',
'name' => 'Sichuan Yi, Nuosu',
'native_name' => 'ꆈꌠ꒿ Nuosuhxop',
],
[
'code' => 'ik',
'name' => 'Inupiaq',
'native_name' => 'Iñupiaq, Iñupiatun',
],
['code' => 'io', 'name' => 'Ido', 'native_name' => 'Ido'],
[
'code' => 'is',
'name' => 'Icelandic',
'native_name' => 'Íslenska',
],
['code' => 'it', 'name' => 'Italian', 'native_name' => 'Italiano'],
['code' => 'iu', 'name' => 'Inuktitut', 'native_name' => 'ᐃᓄᒃᑎᑐᑦ'],
[
'code' => 'ja',
'name' => 'Japanese',
'native_name' => '日本語 (にほんご)',
],
[
'code' => 'jv',
'name' => 'Javanese',
'native_name' => 'ꦧꦱꦗꦮ, Basa Jawa',
],
['code' => 'ka', 'name' => 'Georgian', 'native_name' => 'ქართული'],
['code' => 'kg', 'name' => 'Kongo', 'native_name' => 'Kikongo'],
[
'code' => 'ki',
'name' => 'Kikuyu, Gikuyu',
'native_name' => 'Gĩkũyũ',
],
[
'code' => 'kj',
'name' => 'Kuanyama, Kwanyama',
'native_name' => 'Kuanyama',
],
['code' => 'kk', 'name' => 'Kazakh', 'native_name' => 'қазақ тілі'],
[
'code' => 'kl',
'name' => 'Kalaallisut, Greenlandic',
'native_name' => 'kalaallisut, kalaallit oqaasii',
],
[
'code' => 'km',
'name' => 'Central Khmer',
'native_name' => 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ',
],
['code' => 'kn', 'name' => 'Kannada', 'native_name' => 'ಕನ್ನಡ'],
['code' => 'ko', 'name' => 'Korean', 'native_name' => '한국어'],
['code' => 'kr', 'name' => 'Kanuri', 'native_name' => 'Kanuri'],
[
'code' => 'ks',
'name' => 'Kashmiri',
'native_name' => 'कश्मीरी, كشميري‎',
],
[
'code' => 'ku',
'name' => 'Kurdish',
'native_name' => 'Kurdî, کوردی‎',
],
['code' => 'kv', 'name' => 'Komi', 'native_name' => 'коми кыв'],
['code' => 'kw', 'name' => 'Cornish', 'native_name' => 'Kernewek'],
[
'code' => 'ky',
'name' => 'Kirghiz, Kyrgyz',
'native_name' => 'Кыргызча, Кыргыз тили',
],
[
'code' => 'la',
'name' => 'Latin',
'native_name' => 'latine, lingua latina',
],
[
'code' => 'lb',
'name' => 'Luxembourgish, Letzeburgesch',
'native_name' => 'Lëtzebuergesch',
],
['code' => 'lg', 'name' => 'Ganda', 'native_name' => 'Luganda'],
[
'code' => 'li',
'name' => 'Limburgan, Limburger, Limburgish',
'native_name' => 'Limburgs',
],
['code' => 'ln', 'name' => 'Lingala', 'native_name' => 'Lingála'],
['code' => 'lo', 'name' => 'Lao', 'native_name' => 'ພາສາລາວ'],
[
'code' => 'lt',
'name' => 'Lithuanian',
'native_name' => 'lietuvių kalba',
],
[
'code' => 'lu',
'name' => 'Luba-Katanga',
'native_name' => 'Kiluba',
],
[
'code' => 'lv',
'name' => 'Latvian',
'native_name' => 'latviešu valoda',
],
[
'code' => 'mg',
'name' => 'Malagasy',
'native_name' => 'fiteny malagasy',
],
[
'code' => 'mh',
'name' => 'Marshallese',
'native_name' => 'Kajin M̧ajeļ',
],
[
'code' => 'mi',
'name' => 'Maori',
'native_name' => 'te reo Māori',
],
[
'code' => 'mk',
'name' => 'Macedonian',
'native_name' => 'македонски јазик',
],
['code' => 'ml', 'name' => 'Malayalam', 'native_name' => 'മലയാളം'],
[
'code' => 'mn',
'name' => 'Mongolian',
'native_name' => 'Монгол хэл',
],
['code' => 'mr', 'name' => 'Marathi', 'native_name' => 'मराठी'],
[
'code' => 'ms',
'name' => 'Malay',
'native_name' => 'Bahasa Melayu, بهاس ملايو‎',
],
['code' => 'mt', 'name' => 'Maltese', 'native_name' => 'Malti'],
['code' => 'my', 'name' => 'Burmese', 'native_name' => 'ဗမာစာ'],
[
'code' => 'na',
'name' => 'Nauru',
'native_name' => 'Dorerin Naoero',
],
[
'code' => 'nb',
'name' => 'Norwegian Bokmål',
'native_name' => 'Norsk Bokmål',
],
[
'code' => 'nd',
'name' => 'North Ndebele',
'native_name' => 'isiNdebele',
],
['code' => 'ne', 'name' => 'Nepali', 'native_name' => 'नेपाली'],
['code' => 'ng', 'name' => 'Ndonga', 'native_name' => 'Owambo'],
[
'code' => 'nl',
'name' => 'Dutch, Flemish',
'native_name' => 'Nederlands, Vlaams',
],
[
'code' => 'nn',
'name' => 'Norwegian Nynorsk',
'native_name' => 'Norsk Nynorsk',
],
['code' => 'no', 'name' => 'Norwegian', 'native_name' => 'Norsk'],
[
'code' => 'nr',
'name' => 'South Ndebele',
'native_name' => 'isiNdebele',
],
[
'code' => 'nv',
'name' => 'Navajo, Navaho',
'native_name' => 'Diné bizaad',
],
[
'code' => 'ny',
'name' => 'Chichewa, Chewa, Nyanja',
'native_name' => 'chiCheŵa, chinyanja',
],
[
'code' => 'oc',
'name' => 'Occitan',
'native_name' => 'occitan, lenga dòc',
],
['code' => 'oj', 'name' => 'Ojibwa', 'native_name' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ'],
[
'code' => 'om',
'name' => 'Oromo',
'native_name' => 'Afaan Oromoo',
],
['code' => 'or', 'name' => 'Oriya', 'native_name' => 'ଓଡ଼ିଆ'],
[
'code' => 'os',
'name' => 'Ossetian, Ossetic',
'native_name' => 'ирон æвзаг',
],
[
'code' => 'pa',
'name' => 'Punjabi, Panjabi',
'native_name' => 'ਪੰਜਾਬੀ, پنجابی‎',
],
['code' => 'pi', 'name' => 'Pali', 'native_name' => 'पालि, पाळि'],
[
'code' => 'pl',
'name' => 'Polish',
'native_name' => 'język polski, polszczyzna',
],
[
'code' => 'ps',
'name' => 'Pashto, Pushto',
'native_name' => 'پښتو',
],
[
'code' => 'pt',
'name' => 'Portuguese',
'native_name' => 'Português',
],
[
'code' => 'qu',
'name' => 'Quechua',
'native_name' => 'Runa Simi, Kichwa',
],
[
'code' => 'rm',
'name' => 'Romansh',
'native_name' => 'Rumantsch Grischun',
],
['code' => 'rn', 'name' => 'Rundi', 'native_name' => 'Ikirundi'],
[
'code' => 'ro',
'name' => 'Romanian, Moldavian, Moldovan',
'native_name' => 'Română',
],
['code' => 'ru', 'name' => 'Russian', 'native_name' => 'русский'],
[
'code' => 'rw',
'name' => 'Kinyarwanda',
'native_name' => 'Ikinyarwanda',
],
[
'code' => 'sa',
'name' => 'Sanskrit',
'native_name' => 'संस्कृतम्',
],
['code' => 'sc', 'name' => 'Sardinian', 'native_name' => 'sardu'],
[
'code' => 'sd',
'name' => 'Sindhi',
'native_name' => 'सिन्धी, سنڌي، سندھی‎',
],
[
'code' => 'se',
'name' => 'Northern Sami',
'native_name' => 'Davvisámegiella',
],
[
'code' => 'sg',
'name' => 'Sango',
'native_name' => 'yângâ tî sängö',
],
[
'code' => 'si',
'name' => 'Sinhala, Sinhalese',
'native_name' => 'සිංහල',
],
[
'code' => 'sk',
'name' => 'Slovak',
'native_name' => 'Slovenčina, Slovenský Jazyk',
],
[
'code' => 'sl',
'name' => 'Slovenian',
'native_name' => 'Slovenski Jezik, Slovenščina',
],
[
'code' => 'sm',
'name' => 'Samoan',
'native_name' => 'gagana fa\'a Samoa',
],
['code' => 'sn', 'name' => 'Shona', 'native_name' => 'chiShona'],
[
'code' => 'so',
'name' => 'Somali',
'native_name' => 'Soomaaliga, af Soomaali',
],
['code' => 'sq', 'name' => 'Albanian', 'native_name' => 'Shqip'],
[
'code' => 'sr',
'name' => 'Serbian',
'native_name' => 'српски језик',
],
['code' => 'ss', 'name' => 'Swati', 'native_name' => 'SiSwati'],
[
'code' => 'st',
'name' => 'Southern Sotho',
'native_name' => 'Sesotho',
],
[
'code' => 'su',
'name' => 'Sundanese',
'native_name' => 'Basa Sunda',
],
['code' => 'sv', 'name' => 'Swedish', 'native_name' => 'Svenska'],
['code' => 'sw', 'name' => 'Swahili', 'native_name' => 'Kiswahili'],
['code' => 'ta', 'name' => 'Tamil', 'native_name' => 'தமிழ்'],
['code' => 'te', 'name' => 'Telugu', 'native_name' => 'తెలుగు'],
[
'code' => 'tg',
'name' => 'Tajik',
'native_name' => 'тоҷикӣ, toçikī, تاجیکی‎',
],
['code' => 'th', 'name' => 'Thai', 'native_name' => 'ไทย'],
['code' => 'ti', 'name' => 'Tigrinya', 'native_name' => 'ትግርኛ'],
[
'code' => 'tk',
'name' => 'Turkmen',
'native_name' => 'Türkmen, Түркмен',
],
[
'code' => 'tl',
'name' => 'Tagalog',
'native_name' => 'Wikang Tagalog',
],
['code' => 'tn', 'name' => 'Tswana', 'native_name' => 'Setswana'],
[
'code' => 'to',
'name' => 'Tonga (Tonga Islands)',
'native_name' => 'Faka Tonga',
],
['code' => 'tr', 'name' => 'Turkish', 'native_name' => 'Türkçe'],
['code' => 'ts', 'name' => 'Tsonga', 'native_name' => 'Xitsonga'],
[
'code' => 'tt',
'name' => 'Tatar',
'native_name' => 'татар теле, tatar tele',
],
['code' => 'tw', 'name' => 'Twi', 'native_name' => 'Twi'],
[
'code' => 'ty',
'name' => 'Tahitian',
'native_name' => 'Reo Tahiti',
],
[
'code' => 'ug',
'name' => 'Uighur, Uyghur',
'native_name' => 'ئۇيغۇرچە‎, Uyghurche',
],
[
'code' => 'uk',
'name' => 'Ukrainian',
'native_name' => 'Українська',
],
['code' => 'ur', 'name' => 'Urdu', 'native_name' => 'اردو'],
[
'code' => 'uz',
'name' => 'Uzbek',
'native_name' => 'Oʻzbek, Ўзбек, أۇزبېك‎',
],
['code' => 've', 'name' => 'Venda', 'native_name' => 'Tshivenḓa'],
[
'code' => 'vi',
'name' => 'Vietnamese',
'native_name' => 'Tiếng Việt',
],
['code' => 'vo', 'name' => 'Volapük', 'native_name' => 'Volapük'],
['code' => 'wa', 'name' => 'Walloon', 'native_name' => 'Walon'],
['code' => 'wo', 'name' => 'Wolof', 'native_name' => 'Wollof'],
['code' => 'xh', 'name' => 'Xhosa', 'native_name' => 'isiXhosa'],
['code' => 'yi', 'name' => 'Yiddish', 'native_name' => 'ייִדיש'],
['code' => 'yo', 'name' => 'Yoruba', 'native_name' => 'Yorùbá'],
[
'code' => 'za',
'name' => 'Zhuang, Chuang',
'native_name' => 'Saɯ cueŋƅ, Saw cuengh',
],
[
'code' => 'zh',
'name' => 'Chinese',
'native_name' => '中文 (Zhōngwén), 汉语, 漢語',
],
['code' => 'zu', 'name' => 'Zulu', 'native_name' => 'isiZulu'],
];
$this->db->table('languages')->insertBatch($data); $this->db->table('languages')->insertBatch($data);
} }

View File

@ -1,8 +1,8 @@
<?php <?php
/** /**
* Class PlatformsSeeder * Class PlatformsSeeder
* Insert values in platforms table in database * Inserts values in platforms table in database
* @author Benjamin Bellamy <ben@podlibre.org> *
* @copyright 2020 Podlibre * @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
@ -16,32 +16,319 @@ class PlatformSeeder extends Seeder
{ {
public function run() public function run()
{ {
$data = array( $data = [
array('name' => 'Apple Podcasts', 'home_url' => 'https://www.apple.com/itunes/podcasts/', 'submit_url' => 'https://podcastsconnect.apple.com/my-podcasts/new-feed', 'iosapp_url' => 'https://apps.apple.com/app/apple-podcasts/id525463029', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 1, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'ApplePodcasts.png'), [
array('name' => 'Blubrry', 'home_url' => 'https://www.blubrry.com/', 'submit_url' => 'https://www.blubrry.com/addpodcast.php', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'blubrry.png'), 'name' => 'Apple Podcasts',
array('name' => 'Castbox', 'home_url' => 'https://castbox.fm/', 'submit_url' => 'https://helpcenter.castbox.fm/portal/kb/articles/submit-my-podcast', 'iosapp_url' => 'https://apps.apple.com/app/castbox-the-podcast-app/id1243410543', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=fm.castbox.audiobook.radio.podcast&hl=fr', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Castbox.png'), 'home_url' => 'https://www.apple.com/itunes/podcasts/',
array('name' => 'Castro', 'home_url' => 'http://castro.fm/', 'submit_url' => '', 'iosapp_url' => 'https://apps.apple.com/app/apple-store/id1080840241?ign-mpt=uo%3D4', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'Castro.png'), 'submit_url' =>
array('name' => 'Chartable', 'home_url' => 'https://chartable.com/', 'submit_url' => 'https://chartable.com/podcasts/submit', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'Chartable.png'), 'https://podcastsconnect.apple.com/my-podcasts/new-feed',
array('name' => 'Deezer', 'home_url' => 'https://www.deezer.com/', 'submit_url' => 'https://podcasters.deezer.com/submission', 'iosapp_url' => 'https://apps.apple.com/app/deezer-music-podcast-player/id292738169', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=deezer.android.app', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Deezer.png'), 'iosapp_url' =>
array('name' => 'Google Podcasts', 'home_url' => 'https://podcasts.google.com/about', 'submit_url' => 'https://search.google.com/search-console/about', 'iosapp_url' => '', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.google.android.apps.podcasts', 'comment' => '', 'display_by_default' => 1, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'GooglePodcasts.png'), 'https://apps.apple.com/app/apple-podcasts/id525463029',
array('name' => 'Ivoox', 'home_url' => 'https://www.ivoox.com/', 'submit_url' => '', 'iosapp_url' => 'https://apps.apple.com/app/apple-store/id542673545', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.ivoox.app', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'ivoox.png'), 'androidapp_url' => '',
array('name' => 'ListenNotes', 'home_url' => 'https://www.listennotes.com/', 'submit_url' => 'https://www.listennotes.com/submit/', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'ListenNotes.png'), 'comment' => '',
'display_by_default' => 1,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'ApplePodcasts.png',
],
[
'name' => 'Blubrry',
'home_url' => 'https://www.blubrry.com/',
'submit_url' => 'https://www.blubrry.com/addpodcast.php',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'blubrry.png',
],
[
'name' => 'Castbox',
'home_url' => 'https://castbox.fm/',
'submit_url' =>
'https://helpcenter.castbox.fm/portal/kb/articles/submit-my-podcast',
'iosapp_url' =>
'https://apps.apple.com/app/castbox-the-podcast-app/id1243410543',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=fm.castbox.audiobook.radio.podcast&hl=fr',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 2,
'logo_file_name' => 'Castbox.png',
],
[
'name' => 'Castro',
'home_url' => 'http://castro.fm/',
'submit_url' => '',
'iosapp_url' =>
'https://apps.apple.com/app/apple-store/id1080840241?ign-mpt=uo%3D4',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'Castro.png',
],
[
'name' => 'Chartable',
'home_url' => 'https://chartable.com/',
'submit_url' => 'https://chartable.com/podcasts/submit',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'Chartable.png',
],
[
'name' => 'Deezer',
'home_url' => 'https://www.deezer.com/',
'submit_url' => 'https://podcasters.deezer.com/submission',
'iosapp_url' =>
'https://apps.apple.com/app/deezer-music-podcast-player/id292738169',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=deezer.android.app',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 2,
'logo_file_name' => 'Deezer.png',
],
[
'name' => 'Google Podcasts',
'home_url' => 'https://podcasts.google.com/about',
'submit_url' =>
'https://search.google.com/search-console/about',
'iosapp_url' => '',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.google.android.apps.podcasts',
'comment' => '',
'display_by_default' => 1,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'GooglePodcasts.png',
],
[
'name' => 'Ivoox',
'home_url' => 'https://www.ivoox.com/',
'submit_url' => '',
'iosapp_url' =>
'https://apps.apple.com/app/apple-store/id542673545',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.ivoox.app',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'ivoox.png',
],
[
'name' => 'ListenNotes',
'home_url' => 'https://www.listennotes.com/',
'submit_url' => 'https://www.listennotes.com/submit/',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'ListenNotes.png',
],
//array('name' => 'Majelan', 'home_url' => 'https://www.majelan.com/', 'submit_url' => 'https://support.majelan.com/article/64-how-to-add-my-podcast-on-majelan', 'iosapp_url' => 'https://apps.apple.com/app/majelan-best-audio-stories/id1443711081', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.majelanapp', 'comment' => 'Uses public podcasts indexes. Send a DM if you are not listed.', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Majelan.png'), // https://aide.majelan.com/article/130-pourquoi-nouvelle-application-7-juillet //array('name' => 'Majelan', 'home_url' => 'https://www.majelan.com/', 'submit_url' => 'https://support.majelan.com/article/64-how-to-add-my-podcast-on-majelan', 'iosapp_url' => 'https://apps.apple.com/app/majelan-best-audio-stories/id1443711081', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.majelanapp', 'comment' => 'Uses public podcasts indexes. Send a DM if you are not listed.', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Majelan.png'), // https://aide.majelan.com/article/130-pourquoi-nouvelle-application-7-juillet
array('name' => 'Mytuner', 'home_url' => 'https://mytuner-radio.com/', 'submit_url' => 'https://mytuner-radio.com/broadcasters/', 'iosapp_url' => 'https://apps.apple.com/app/apple-store/id520502858', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.appgeneration.itunerfree', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'myTuner.png'), [
array('name' => 'Overcast', 'home_url' => 'https://overcast.fm/', 'submit_url' => 'https://overcast.fm/podcasterinfo', 'iosapp_url' => 'https://apps.apple.com/us/app/overcast-podcast-player/id888422857', 'androidapp_url' => '', 'comment' => 'Overcast uses Apple Podcasts index, no podcast submission needed.', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'Overcast.png'), 'name' => 'Mytuner',
array('name' => 'Player.Fm', 'home_url' => 'https://player.fm/', 'submit_url' => 'https://player.fm/importer/feed', 'iosapp_url' => 'https://apps.apple.com/app/podcast-app-by-player-fm/id940568467', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=fm.player', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'PlayerFM.png'), 'home_url' => 'https://mytuner-radio.com/',
array('name' => 'Pocketcasts', 'home_url' => 'https://www.pocketcasts.com/', 'submit_url' => 'https://www.pocketcasts.com/submit/', 'iosapp_url' => 'https://apps.apple.com/app/pocket-casts/id414834813', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=au.com.shiftyjelly.pocketcasts', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'PocketCasts.png'), 'submit_url' => 'https://mytuner-radio.com/broadcasters/',
array('name' => 'Podbean', 'home_url' => 'https://www.podbean.com/', 'submit_url' => 'https://www.podbean.com/site/submitPodcast', 'iosapp_url' => 'https://apps.apple.com/app/apple-store/id973361050', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.podbean.app.podcast', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Podbean.png'), 'iosapp_url' =>
array('name' => 'Podcastland', 'home_url' => 'https://podcastland.com/', 'submit_url' => '', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => 'Uses Apple Podcasts index.', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'PodcastLand.png'), 'https://apps.apple.com/app/apple-store/id520502858',
array('name' => 'Podcastrepublic', 'home_url' => 'https://www.podcastrepublic.net/', 'submit_url' => 'https://www.podcastrepublic.net/for-podcast-publisher', 'iosapp_url' => '', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.itunestoppodcastplayer.app', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'PodcastRepublic.png'), 'androidapp_url' =>
array('name' => 'Podchaser', 'home_url' => 'https://www.podchaser.com/', 'submit_url' => 'https://www.podchaser.com/creators/edit', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'Podchaser.png'), 'https://play.google.com/store/apps/details?id=com.appgeneration.itunerfree',
array('name' => 'Podtail', 'home_url' => 'https://podtail.com/', 'submit_url' => 'https://podtail.com/about/faq/', 'iosapp_url' => '', 'androidapp_url' => '', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 0, 'logo_file_name' => 'Podtail.png'), 'comment' => '',
array('name' => 'Radiopublic', 'home_url' => 'https://radiopublic.com/', 'submit_url' => 'https://podcasters.radiopublic.com/signup', 'iosapp_url' => 'https://apps.apple.com/app/radiopublic-free-podcasts/id1113752736', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.radiopublic.android', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'RadioPublic.png'), 'display_by_default' => 0,
array('name' => 'Spotify', 'home_url' => 'https://www.spotify.com/', 'submit_url' => 'https://podcasters.spotify.com/submit', 'iosapp_url' => 'https://apps.apple.com/app/spotify-music/id324684580', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.spotify.music', 'comment' => '', 'display_by_default' => 1, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'Spotify.png'), 'ios_deeplink' => 0,
array('name' => 'Spreaker', 'home_url' => 'https://www.spreaker.com/', 'submit_url' => 'https://www.spreaker.com/cms/shows/rss-import', 'iosapp_url' => 'https://apps.apple.com/app/spreaker-podcast-radio/id388449677', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.spreaker.android', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'Spreaker.png'), 'android_deeplink' => 1,
array('name' => 'Stitcher', 'home_url' => 'https://www.stitcher.com/', 'submit_url' => 'https://www.stitcher.com/content-providers', 'iosapp_url' => 'https://apps.apple.com/app/id288087905', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=com.stitcher.app', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 1, 'logo_file_name' => 'Stitcher.png'), 'logo_file_name' => 'myTuner.png',
array('name' => 'TuneIn', 'home_url' => 'https://tunein.com/', 'submit_url' => 'https://help.tunein.com/contact/add-podcast-S19TR3Sdf', 'iosapp_url' => 'https://apps.apple.com/app/tunein-radio/id418987775', 'androidapp_url' => 'https://play.google.com/store/apps/details?id=tunein.player', 'comment' => '', 'display_by_default' => 0, 'ios_deeplink' => 0, 'android_deeplink' => 2, 'logo_file_name' => 'TuneIn.png'), ],
); [
'name' => 'Overcast',
'home_url' => 'https://overcast.fm/',
'submit_url' => 'https://overcast.fm/podcasterinfo',
'iosapp_url' =>
'https://apps.apple.com/us/app/overcast-podcast-player/id888422857',
'androidapp_url' => '',
'comment' =>
'Overcast uses Apple Podcasts index, no podcast submission needed.',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'Overcast.png',
],
[
'name' => 'Player.Fm',
'home_url' => 'https://player.fm/',
'submit_url' => 'https://player.fm/importer/feed',
'iosapp_url' =>
'https://apps.apple.com/app/podcast-app-by-player-fm/id940568467',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=fm.player',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'PlayerFM.png',
],
[
'name' => 'Pocketcasts',
'home_url' => 'https://www.pocketcasts.com/',
'submit_url' => 'https://www.pocketcasts.com/submit/',
'iosapp_url' =>
'https://apps.apple.com/app/pocket-casts/id414834813',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=au.com.shiftyjelly.pocketcasts',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'PocketCasts.png',
],
[
'name' => 'Podbean',
'home_url' => 'https://www.podbean.com/',
'submit_url' => 'https://www.podbean.com/site/submitPodcast',
'iosapp_url' =>
'https://apps.apple.com/app/apple-store/id973361050',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.podbean.app.podcast',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 2,
'logo_file_name' => 'Podbean.png',
],
[
'name' => 'Podcastland',
'home_url' => 'https://podcastland.com/',
'submit_url' => '',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => 'Uses Apple Podcasts index.',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'PodcastLand.png',
],
[
'name' => 'Podcastrepublic',
'home_url' => 'https://www.podcastrepublic.net/',
'submit_url' =>
'https://www.podcastrepublic.net/for-podcast-publisher',
'iosapp_url' => '',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.itunestoppodcastplayer.app',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'PodcastRepublic.png',
],
[
'name' => 'Podchaser',
'home_url' => 'https://www.podchaser.com/',
'submit_url' => 'https://www.podchaser.com/creators/edit',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'Podchaser.png',
],
[
'name' => 'Podtail',
'home_url' => 'https://podtail.com/',
'submit_url' => 'https://podtail.com/about/faq/',
'iosapp_url' => '',
'androidapp_url' => '',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 0,
'logo_file_name' => 'Podtail.png',
],
[
'name' => 'Radiopublic',
'home_url' => 'https://radiopublic.com/',
'submit_url' => 'https://podcasters.radiopublic.com/signup',
'iosapp_url' =>
'https://apps.apple.com/app/radiopublic-free-podcasts/id1113752736',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.radiopublic.android',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'RadioPublic.png',
],
[
'name' => 'Spotify',
'home_url' => 'https://www.spotify.com/',
'submit_url' => 'https://podcasters.spotify.com/submit',
'iosapp_url' =>
'https://apps.apple.com/app/spotify-music/id324684580',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.spotify.music',
'comment' => '',
'display_by_default' => 1,
'ios_deeplink' => 0,
'android_deeplink' => 2,
'logo_file_name' => 'Spotify.png',
],
[
'name' => 'Spreaker',
'home_url' => 'https://www.spreaker.com/',
'submit_url' => 'https://www.spreaker.com/cms/shows/rss-import',
'iosapp_url' =>
'https://apps.apple.com/app/spreaker-podcast-radio/id388449677',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.spreaker.android',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'Spreaker.png',
],
[
'name' => 'Stitcher',
'home_url' => 'https://www.stitcher.com/',
'submit_url' => 'https://www.stitcher.com/content-providers',
'iosapp_url' => 'https://apps.apple.com/app/id288087905',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=com.stitcher.app',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 1,
'logo_file_name' => 'Stitcher.png',
],
[
'name' => 'TuneIn',
'home_url' => 'https://tunein.com/',
'submit_url' =>
'https://help.tunein.com/contact/add-podcast-S19TR3Sdf',
'iosapp_url' =>
'https://apps.apple.com/app/tunein-radio/id418987775',
'androidapp_url' =>
'https://play.google.com/store/apps/details?id=tunein.player',
'comment' => '',
'display_by_default' => 0,
'ios_deeplink' => 0,
'android_deeplink' => 2,
'logo_file_name' => 'TuneIn.png',
],
];
$this->db->table('platforms')->insertBatch($data); $this->db->table('platforms')->insertBatch($data);
} }
} }

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Entities; namespace App\Entities;

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Entities; namespace App\Entities;

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Entities; namespace App\Entities;
@ -8,6 +13,6 @@ class Language extends Entity
{ {
protected $casts = [ protected $casts = [
'code' => 'string', 'code' => 'string',
'native_name' => 'string' 'native_name' => 'string',
]; ];
} }

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Entities; namespace App\Entities;

View File

@ -0,0 +1,33 @@
<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
/**
* Get all possible enum values for a table field
*
* @param string $table
* @param string $field
*
* @return array $enums
*/
function field_enums($table = '', $field = '')
{
$enums = [];
if ($table == '' || $field == '') {
return $enums;
}
$db = \Config\Database::connect();
preg_match_all(
"/'(.*?)'/",
$db->query("SHOW COLUMNS FROM {$table} LIKE '{$field}'")->getRow()
->Type,
$matches
);
foreach ($matches[1] as $value) {
$enums[$value] = $value;
}
return $enums;
}

View File

@ -0,0 +1,53 @@
<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
use JamesHeinrich\GetID3\GetID3;
/**
* Saves a file to the corresponding podcast folder in `public/media`
*
* @param UploadedFile $file
* @param string $podcast_name
* @param string $file_name
*
* @return string The absolute path of the file
*/
function save_podcast_media($file, $podcast_name, $file_name)
{
$image_storage_folder = 'media/' . $podcast_name . '/';
// overwrite file if already existing
$file->move($image_storage_folder, $file_name, true);
return $image_storage_folder . $file_name;
}
/**
* Gets audio file metadata and ID3 info
*
* @param UploadedFile $file
*
* @return array
*/
function get_file_metadata($file)
{
if (!$file->isValid()) {
throw new RuntimeException(
$file->getErrorString() . '(' . $file->getError() . ')'
);
}
$getID3 = new GetID3();
$FileInfo = $getID3->analyze($file);
return [
'cover_picture' => $FileInfo['comments']['picture'][0]['data'],
'filesize' => $FileInfo['filesize'],
'mime_type' => $FileInfo['mime_type'],
'playtime_seconds' => $FileInfo['playtime_seconds'],
];
}

View File

@ -0,0 +1,23 @@
<?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
/**
* Gets the browser default language using the request header key `HTTP_ACCEPT_LANGUAGE`
*
* @param mixed $http_accept_language
*
* @return string|null ISO 639-1 language code or null
*/
function get_browser_language($http_accept_language)
{
$langs = explode(',', $http_accept_language);
if (!empty($langs)) {
return substr($langs[0], 0, 2);
}
return null;
}

View File

@ -0,0 +1,24 @@
<?
return [
'create' => 'Add an episode',
'form' => [
'file' => 'Audio file',
'title' => 'Title',
'slug' => 'Slug',
'description' => 'Description',
'pub_date' => 'Publication date',
'image' => 'Image',
'explicit' => 'Explicit',
'type' => [
'label' => 'Type',
'full' => 'Full',
'trailer' => 'Trailer',
'bonus' => 'Bonus',
],
'episode_number' => 'Episode number',
'season_number' => 'Season number',
'block' => 'Block',
'submit' => 'Create episode',
]
];

View File

@ -1,6 +1,6 @@
<? <?
return [ return [
"all_podcasts" => "All podcasts", 'all_podcasts' => 'All podcasts',
"no_podcast" => "No podcast found" 'no_podcast' => 'No podcast found',
]; ];

View File

@ -1,8 +1,8 @@
<? <?
return [ return [
"create" => "Create a Podcast", 'create' => 'Create a Podcast',
"form" => [ 'form' => [
'title' => 'Title', 'title' => 'Title',
'name' => 'Name', 'name' => 'Name',
'description' => 'Description', 'description' => 'Description',
@ -138,4 +138,6 @@ return [
'film_reviews' => 'Film Reviews', 'film_reviews' => 'Film Reviews',
'tv_reviews' => 'TV Reviews', 'tv_reviews' => 'TV Reviews',
], ],
'list_of_episodes' => 'List of episodes',
'no_episode' => 'No episode found'
]; ];

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Models; namespace App\Models;
@ -9,9 +14,7 @@ class CategoryModel extends Model
protected $table = 'categories'; protected $table = 'categories';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = ['apple_category', 'google_category'];
'apple_category', 'google_category',
];
protected $returnType = 'App\Entities\Category'; protected $returnType = 'App\Entities\Category';
protected $useSoftDeletes = false; protected $useSoftDeletes = false;

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Models; namespace App\Models;
@ -10,8 +15,9 @@ class EpisodeModel extends Model
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = [
'slug', 'podcast_id',
'title', 'title',
'slug',
'enclosure_url', 'enclosure_url',
'enclosure_length', 'enclosure_length',
'enclosure_type', 'enclosure_type',

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Models; namespace App\Models;
@ -9,9 +14,7 @@ class LanguageModel extends Model
protected $table = 'languages'; protected $table = 'languages';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = ['code', 'native_name'];
'code', 'native_name'
];
protected $returnType = 'App\Entities\Language'; protected $returnType = 'App\Entities\Language';
protected $useSoftDeletes = false; protected $useSoftDeletes = false;

View File

@ -2,7 +2,7 @@
/** /**
* Class PlatformLinkModel * Class PlatformLinkModel
* Model for platform links table in database * Model for platform links table in database
* @author Benjamin Bellamy <ben@podlibre.org> *
* @copyright 2020 Podlibre * @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
@ -28,4 +28,4 @@ class PlatformLinkModel extends Model
protected $useSoftDeletes = false; protected $useSoftDeletes = false;
protected $useTimestamps = true; protected $useTimestamps = true;
} }

View File

@ -2,7 +2,7 @@
/** /**
* Class PlatformModel * Class PlatformModel
* Model for platforms table in database * Model for platforms table in database
* @author Benjamin Bellamy <ben@podlibre.org> *
* @copyright 2020 Podlibre * @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
@ -33,4 +33,4 @@ class PlatformModel extends Model
protected $useSoftDeletes = false; protected $useSoftDeletes = false;
protected $useTimestamps = true; protected $useTimestamps = true;
} }

View File

@ -1,4 +1,9 @@
<?php <?php
/**
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Models; namespace App\Models;
@ -10,6 +15,7 @@ class PodcastModel extends Model
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = [
'id',
'title', 'title',
'name', 'name',
'description', 'description',

View File

View File

@ -0,0 +1,92 @@
<?= $this->extend('layouts/default') ?>
<?= $this->section('content') ?>
<h1 class="mb-6 text-xl"><?= lang('Episodes.create') ?></h1>
<div class="mb-8">
<?= \Config\Services::validation()->listErrors() ?>
</div>
<?= form_open_multipart(route_to('episodes_create', '@' . $podcast->name), [
'method' => 'post',
'class' => 'flex flex-col max-w-md',
]) ?>
<?= csrf_field() ?>
<div class="flex flex-col mb-4">
<label for="episode_file"><?= lang('Episodes.form.file') ?></label>
<input type="file" class="form-input" id="episode_file" name="episode_file" required accept=".mp3,.m4a" />
</div>
<div class="flex flex-col mb-4">
<label for="title"><?= lang('Episodes.form.title') ?></label>
<input type="text" class="form-input" id="title" name="title" required />
</div>
<div class="flex flex-col mb-4">
<label for="slug"><?= lang('Episodes.form.slug') ?></label>
<input type="text" class="form-input" id="slug" name="slug" required />
</div>
<div class="flex flex-col mb-4">
<label for="description"><?= lang('Episodes.form.description') ?></label>
<textarea class="form-textarea" id="description" name="description" required></textarea>
</div>
<div class="flex flex-col mb-4">
<label for="pub_date"><?= lang('Episodes.form.pub_date') ?></label>
<input type="date" class="form-input" id="pub_date" name="pub_date" value="<?= date(
'Y-m-d'
) ?>" />
</div>
<div class="flex flex-col mb-4">
<label for="image"><?= lang('Episodes.form.image') ?></label>
<input type="file" class="form-input" id="image" name="image" accept=".jpg,.jpeg,.png" />
</div>
<div class="flex flex-col mb-4">
<label for="episode_number"><?= lang(
'Episodes.form.episode_number'
) ?></label>
<input type="number" class="form-input" id="episode_number" name="episode_number"
<?= $podcast->type == 'serial' ? 'required' : '' ?> />
</div>
<div class="flex flex-col mb-4">
<label for="season_number"><?= lang(
'Episodes.form.season_number'
) ?></label>
<input type="number" class="form-input" id="season_number" name="season_number" />
</div>
<div class="inline-flex items-center mb-4">
<input type="checkbox" id="explicit" name="explicit" class="form-checkbox" />
<label for="explicit" class="pl-2"><?= lang(
'Episodes.form.explicit'
) ?></label>
</div>
<fieldset class="flex flex-col mb-4">
<legend><?= lang('Episodes.form.type.label') ?></legend>
<?php foreach ($episode_types as $type): ?>
<label for="<?= $type ?>" class="inline-flex items-center">
<input type="radio" class="form-radio" value="<?= $type ?>" id="<?= $type ?>" name="type" required />
<span class="ml-2"><?= lang('Episodes.form.type.' . $type) ?></span>
</label>
<?php endforeach; ?>
</fieldset>
<div class="inline-flex items-center mb-4">
<input type="checkbox" id="block" name="block" class="form-checkbox" />
<label for="block" class="pl-2"><?= lang('Episodes.form.block') ?></label>
</div>
<button type="submit" name="submit" class="self-end px-4 py-2 bg-gray-200"><?= lang(
'Episodes.form.submit'
) ?></button>
<?= form_close() ?>
<?= $this->endSection() ?>

View File

@ -0,0 +1,16 @@
<?= $this->extend('layouts/default') ?>
<?= $this->section('content') ?>
<h1 class="text-xl"><?= $episode->title ?></h1>
<img src="<?= base_url(
$episode->image ? $episode->image : $podcast->image
) ?>" alt="Episode cover" class="object-cover w-40 h-40 mb-6" />
<audio controls>
<source src="<?= base_url(
$episode->enclosure_url
) ?>" type="<?= $episode->enclosure_type ?>">
Your browser does not support the audio tag.
</audio>
<?= $this->endSection() ?>

View File

@ -2,21 +2,23 @@
<?= $this->section('content') ?> <?= $this->section('content') ?>
<h1 class="mb-2 text-xl"><?= lang("Home.all_podcasts") ?> (<?= count($podcasts) ?>)</h1> <h1 class="mb-2 text-xl"><?= lang('Home.all_podcasts') ?> (<?= count(
$podcasts
) ?>)</h1>
<section class="flex flex-wrap"> <section class="flex flex-wrap">
<?php if ($podcasts) : ?> <?php if ($podcasts): ?>
<?php foreach ($podcasts as $podcast) : ?> <?php foreach ($podcasts as $podcast): ?>
<a href="/@<?= $podcast->name ?>"> <a href="<?= route_to('podcasts_view', '@' . $podcast->name) ?>">
<article class="w-48 p-2 mb-4 mr-4 border shadow-sm hover:bg-gray-100 hover:shadow"> <article class="w-48 p-2 mb-4 mr-4 border shadow-sm hover:bg-gray-100 hover:shadow">
<img alt="<?= $podcast->title ?>" src="<?= $podcast->image ?>" class="object-cover w-full h-40 mb-2" /> <img alt="<?= $podcast->title ?>" src="<?= $podcast->image ?>" class="object-cover w-full h-40 mb-2" />
<h2 class="font-semibold leading-tight"><?= $podcast->title ?></h2> <h2 class="font-semibold leading-tight"><?= $podcast->title ?></h2>
<p class="text-gray-600">@<?= $podcast->name ?></p> <p class="text-gray-600">@<?= $podcast->name ?></p>
</article> </article>
</a> </a>
<?php endforeach ?> <?php endforeach; ?>
<?php else : ?> <?php else: ?>
<p class="italic"><?= lang("Home.no_podcast") ?></p> <p class="italic"><?= lang('Home.no_podcast') ?></p>
<?php endif ?> <?php endif; ?>
</section> </section>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -13,9 +13,11 @@
<body class="flex flex-col min-h-screen mx-auto"> <body class="flex flex-col min-h-screen mx-auto">
<header class="border-b"> <header class="border-b">
<div class="container flex items-center justify-between px-2 py-4 mx-auto"> <div class="container flex items-center justify-between px-2 py-4 mx-auto">
<a href="/" class="text-2xl">Castopod</a> <a href="<?= route_to('home') ?>" class="text-2xl">Castopod</a>
<nav> <nav>
<a class="px-4 py-2 border hover:bg-gray-100" href="/podcasts/create">New podcast</a> <a class="px-4 py-2 border hover:bg-gray-100" href="<?= route_to(
'podcasts_create'
) ?>">New podcast</a>
</nav> </nav>
</div> </div>
</header> </header>
@ -23,6 +25,6 @@
<?= $this->renderSection('content') ?> <?= $this->renderSection('content') ?>
</main> </main>
<footer class="container px-2 py-4 mx-auto text-sm text-right border-t"> <footer class="container px-2 py-4 mx-auto text-sm text-right border-t">
Powered by <a class="underline hover:no-underline" href="https://code.podlibre.org/podlibre/castopod">Castopod</a>, a <a class="underline hover:no-underline" href="https://podlibre.org/">Podlibre</a> initiative. Powered by <a class="underline hover:no-underline" href="https://castopod.org">Castopod</a>, a <a class="underline hover:no-underline" href="https://podlibre.org/">Podlibre</a> initiative.
</footer> </footer>
</body> </body>

View File

@ -2,109 +2,127 @@
<?= $this->section('content') ?> <?= $this->section('content') ?>
<h1 class="mb-6 text-xl"><?= lang("Podcasts.create") ?></h1> <h1 class="mb-6 text-xl"><?= lang('Podcasts.create') ?></h1>
<!-- <div class="mb-8"> <div class="mb-8">
\Config\Services::validation()->listErrors() <?= \Config\Services::validation()->listErrors() ?>
</div> --> </div>
<?= form_open_multipart('podcasts/create', ["method" => "post", "class" => "flex flex-col max-w-md"]) ?> <?= form_open_multipart(base_url(route_to('podcasts_create')), [
'method' => 'post',
'class' => 'flex flex-col max-w-md',
]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="title"><?= lang("Podcasts.form.title") ?></label> <label for="title"><?= lang('Podcasts.form.title') ?></label>
<input type="text" class="form-input" id="title" name="title" required /> <input type="text" class="form-input" id="title" name="title" required />
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="name"><?= lang("Podcasts.form.name") ?></label> <label for="name"><?= lang('Podcasts.form.name') ?></label>
<input type="text" class="form-input" id="name" name="name" required /> <input type="text" class="form-input" id="name" name="name" required />
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="description"><?= lang("Podcasts.form.description") ?></label> <label for="description"><?= lang('Podcasts.form.description') ?></label>
<textarea class="form-textarea" id="description" name="description" required></textarea> <textarea class="form-textarea" id="description" name="description" required></textarea>
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="episode_description_footer"><?= lang("Podcasts.form.episode_description_footer") ?></label> <label for="episode_description_footer"><?= lang(
'Podcasts.form.episode_description_footer'
) ?></label>
<textarea class="form-textarea" id="episode_description_footer" name="episode_description_footer"></textarea> <textarea class="form-textarea" id="episode_description_footer" name="episode_description_footer"></textarea>
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="image"><?= lang("Podcasts.form.image") ?></label> <label for="image"><?= lang('Podcasts.form.image') ?></label>
<input type="file" class="form-input" id="image" name="image" required /> <input type="file" class="form-input" id="image" name="image" required />
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="language"><?= lang("Podcasts.form.language") ?></label> <label for="language"><?= lang('Podcasts.form.language') ?></label>
<select id="language" name="language" autocomplete="off" class="form-select" required> <select id="language" name="language" autocomplete="off" class="form-select" required>
<?php foreach ($languages as $language) : ?> <?php foreach ($languages as $language): ?>
<option <?= ($language->code == $browser_lang) ? "selected='selected'" : "" ?> value="<?= $language->code ?>"><?= $language->native_name ?></option> <option <?= $language->code == $browser_lang
<?php endforeach ?> ? "selected='selected'"
: '' ?> value="<?= $language->code ?>"><?= $language->native_name ?></option>
<?php endforeach; ?>
</select> </select>
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="category"><?= lang("Podcasts.form.category") ?></label> <label for="category"><?= lang('Podcasts.form.category') ?></label>
<select id="category" name="category" class="form-select" required> <select id="category" name="category" class="form-select" required>
<?php foreach ($categories as $category) : ?> <?php foreach ($categories as $category): ?>
<option value="<?= $category->code ?>"><?= lang("Podcasts.category_options." . $category->code) ?></option> <option value="<?= $category->code ?>"><?= lang(
<?php endforeach ?> 'Podcasts.category_options.' . $category->code
) ?></option>
<?php endforeach; ?>
</select> </select>
</div> </div>
<div class="inline-flex items-center mb-4"> <div class="inline-flex items-center mb-4">
<input type="checkbox" id="explicit" name="explicit" class="form-checkbox" /> <input type="checkbox" id="explicit" name="explicit" class="form-checkbox" />
<label for="explicit" class="pl-2"><?= lang("Podcasts.form.explicit") ?></label> <label for="explicit" class="pl-2"><?= lang(
'Podcasts.form.explicit'
) ?></label>
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="author"><?= lang("Podcasts.form.author") ?></label> <label for="author"><?= lang('Podcasts.form.author') ?></label>
<input type="text" class="form-input" id="author" name="author" /> <input type="text" class="form-input" id="author" name="author" />
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="owner_name"><?= lang("Podcasts.form.owner_name") ?></label> <label for="owner_name"><?= lang('Podcasts.form.owner_name') ?></label>
<input type="text" class="form-input" id="owner_name" name="owner_name" /> <input type="text" class="form-input" id="owner_name" name="owner_name" />
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="owner_email"><?= lang("Podcasts.form.owner_email") ?></label> <label for="owner_email"><?= lang('Podcasts.form.owner_email') ?></label>
<input type="email" class="form-input" id="owner_email" name="owner_email" required /> <input type="email" class="form-input" id="owner_email" name="owner_email" required />
</div> </div>
<fieldset class="mb-4"> <fieldset class="flex flex-col mb-4">
<legend><?= lang("Podcasts.form.type.label") ?></legend> <legend><?= lang('Podcasts.form.type.label') ?></legend>
<input type="radio" class="form-radio" value="episodic" id="episodic" name="type" checked="checked" /> <?php foreach ($podcast_types as $type): ?>
<label for="episodic"><?= lang("Podcasts.form.type.episodic") ?></label><br /> <label for="<?= $type ?>" class="inline-flex items-center">
<input type="radio" class="form-radio" value="<?= $type ?>" id="<?= $type ?>" name="type" required />
<input type="radio" class="form-radio" value="serial" id="serial" name="type" /> <span class="ml-2"><?= lang('Podcasts.form.type.' . $type) ?></span>
<label for="serial"><?= lang("Podcasts.form.type.serial") ?></label><br /> </label>
<?php endforeach; ?>
</fieldset> </fieldset>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="copyright"><?= lang("Podcasts.form.copyright") ?></label> <label for="copyright"><?= lang('Podcasts.form.copyright') ?></label>
<input type="text" class="form-input" id="copyright" name="copyright" /> <input type="text" class="form-input" id="copyright" name="copyright" />
</div> </div>
<div class="inline-flex items-center mb-4"> <div class="inline-flex items-center mb-4">
<input type="checkbox" id="block" name="block" class="form-checkbox" /> <input type="checkbox" id="block" name="block" class="form-checkbox" />
<label for="block" class="pl-2"><?= lang("Podcasts.form.block") ?></label> <label for="block" class="pl-2"><?= lang('Podcasts.form.block') ?></label>
</div> </div>
<div class="inline-flex items-center mb-4"> <div class="inline-flex items-center mb-4">
<input type="checkbox" id="complete" name="complete" class="form-checkbox" /> <input type="checkbox" id="complete" name="complete" class="form-checkbox" />
<label for="complete" class="pl-2"><?= lang("Podcasts.form.complete") ?></label> <label for="complete" class="pl-2"><?= lang(
'Podcasts.form.complete'
) ?></label>
</div> </div>
<div class="flex flex-col mb-4"> <div class="flex flex-col mb-4">
<label for="custom_html_head"><?= esc(lang("Podcasts.form.custom_html_head")) ?></label> <label for="custom_html_head"><?= esc(
lang('Podcasts.form.custom_html_head')
) ?></label>
<textarea class="form-textarea" id="custom_html_head" name="custom_html_head"></textarea> <textarea class="form-textarea" id="custom_html_head" name="custom_html_head"></textarea>
</div> </div>
<button type="submit" name="submit" class="self-end px-4 py-2 bg-gray-200"><?= lang("Podcasts.form.submit") ?></button> <button type="submit" name="submit" class="self-end px-4 py-2 bg-gray-200"><?= lang(
'Podcasts.form.submit'
) ?></button>
<?= form_close() ?> <?= form_close() ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,7 +1,46 @@
<?= $this->extend('layouts/default') ?> <?= $this->extend('layouts/default') ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<h1 class="text-xl"><?= $podcast->title ?></h1> <header class="py-4 border-b">
<img src="<?= base_url($podcast->image) ?>" alt="Podcast cover" /> <h1 class="text-2xl"><?= $podcast->title ?></h1>
<img src="<?= base_url(
$podcast->image
) ?>" alt="Podcast cover" class="w-40 h-40 mb-6" />
<a class="inline-flex px-4 py-2 border hover:bg-gray-100" href="<?= route_to(
'episodes_create',
'@' . $podcast->name
) ?>">New Episode</a>
</header>
<?= $this->endSection() ?> <section class="flex flex-col py-4">
<h2 class="mb-4 text-xl"><?= lang(
'Podcasts.list_of_episodes'
) ?> (<?= count($episodes) ?>)</h2>
<?php if ($episodes): ?>
<?php foreach ($episodes as $episode): ?>
<article class="flex w-full max-w-lg p-4 mb-4 border shadow">
<img src="<?= base_url(
$episode->image ? $episode->image : $podcast->image
) ?>" alt="<?= $episode->title ?>" class="w-32 h-32 mr-4" />
<div class="flex flex-col flex-1">
<a href="<?= route_to(
'episodes_view',
'@' . $podcast->name,
$episode->slug
) ?>">
<h3 class="text-xl font-semibold underline hover:no-underline"><?= $episode->title ?></h3>
</a>
<audio controls class="mt-auto">
<source src="<?= $episode->enclosure_url ?>" type="<?= $episode->enclosure_type ?>">
Your browser does not support the audio tag.
</audio>
</div>
</article>
<?php endforeach; ?>
<?php else: ?>
<p class="italic"><?= lang('Podcasts.no_episode') ?></p>
<?php endif; ?>
</section>
<?= $this->endSection() ?>

View File

@ -1,14 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>403 Forbidden</title>
</head>
<head> <body>
<title>403 Forbidden</title> <p>Directory access is forbidden.</p>
</head> </body>
</html>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

224
builds
View File

@ -1,6 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
define('LATEST_RELEASE', '^4.0'); define('LATEST_RELEASE', '^4.0');
define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4'); define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
@ -15,10 +14,9 @@ define('GITHUB_URL', 'https://github.com/codeigniter4/codeigniter4');
*/ */
// Determine the requested stability // Determine the requested stability
if (empty($argv[1]) || ! in_array($argv[1], ['release', 'development'])) if (empty($argv[1]) || !in_array($argv[1], ['release', 'development'])) {
{ echo 'Usage: php builds [release|development]' . PHP_EOL;
echo 'Usage: php builds [release|development]' . PHP_EOL; exit();
exit;
} }
$dev = $argv[1] == 'development'; $dev = $argv[1] == 'development';
@ -29,135 +27,127 @@ $modified = [];
// Composer.json // Composer.json
$file = __DIR__ . DIRECTORY_SEPARATOR . 'composer.json'; $file = __DIR__ . DIRECTORY_SEPARATOR . 'composer.json';
if (is_file($file)) if (is_file($file)) {
{ // Make sure we can read it
// Make sure we can read it if ($contents = file_get_contents($file)) {
if ($contents = file_get_contents($file)) if ($array = json_decode($contents, true)) {
{ // Development
if ($array = json_decode($contents, true)) if ($dev) {
{ // Set 'minimum-stability'
// Development $array['minimum-stability'] = 'dev';
if ($dev) $array['prefer-stable'] = true;
{
// Set 'minimum-stability'
$array['minimum-stability'] = 'dev';
$array['prefer-stable'] = true;
// Make sure the repo is configured // Make sure the repo is configured
if (! isset($array['repositories'])) if (!isset($array['repositories'])) {
{ $array['repositories'] = [];
$array['repositories'] = []; }
}
// Check for the CodeIgniter repo // Check for the CodeIgniter repo
$found = false; $found = false;
foreach ($array['repositories'] as $repository) foreach ($array['repositories'] as $repository) {
{ if ($repository['url'] == GITHUB_URL) {
if ($repository['url'] == GITHUB_URL) $found = true;
{ break;
$found = true; }
break; }
}
}
// Add the repo if it was not found // Add the repo if it was not found
if (! $found) if (!$found) {
{ $array['repositories'][] = [
$array['repositories'][] = [ 'type' => 'vcs',
'type' => 'vcs', 'url' => GITHUB_URL,
'url' => GITHUB_URL, ];
]; }
}
// Define the "require" // Define the "require"
$array['require']['codeigniter4/codeigniter4'] = 'dev-develop'; $array['require']['codeigniter4/codeigniter4'] = 'dev-develop';
unset($array['require']['codeigniter4/framework']); unset($array['require']['codeigniter4/framework']);
} }
// Release // Release
else else {
{ // Clear 'minimum-stability'
// Clear 'minimum-stability' unset($array['minimum-stability']);
unset($array['minimum-stability']);
// If the repo is configured then clear it // If the repo is configured then clear it
if (isset($array['repositories'])) if (isset($array['repositories'])) {
{ // Check for the CodeIgniter repo
// Check for the CodeIgniter repo foreach ($array['repositories'] as $i => $repository) {
foreach ($array['repositories'] as $i => $repository) if ($repository['url'] == GITHUB_URL) {
{ unset($array['repositories'][$i]);
if ($repository['url'] == GITHUB_URL) break;
{ }
unset($array['repositories'][$i]); }
break; if (empty($array['repositories'])) {
} unset($array['repositories']);
} }
if (empty($array['repositories'])) }
{
unset($array['repositories']);
}
}
// Define the "require" // Define the "require"
$array['require']['codeigniter4/framework'] = LATEST_RELEASE; $array['require']['codeigniter4/framework'] = LATEST_RELEASE;
unset($array['require']['codeigniter4/codeigniter4']); unset($array['require']['codeigniter4/codeigniter4']);
} }
// Write out a new composer.json // Write out a new composer.json
file_put_contents($file, json_encode($array, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES) . PHP_EOL); file_put_contents(
$modified[] = $file; $file,
} json_encode(
else $array,
{ JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
echo 'Warning: Unable to decode composer.json! Skipping...' . PHP_EOL; ) . PHP_EOL
} );
} $modified[] = $file;
else } else {
{ echo 'Warning: Unable to decode composer.json! Skipping...' .
echo 'Warning: Unable to read composer.json! Skipping...' . PHP_EOL; PHP_EOL;
} }
} else {
echo 'Warning: Unable to read composer.json! Skipping...' . PHP_EOL;
}
} }
// Paths config and PHPUnit XMLs // Paths config and PHPUnit XMLs
$files = [ $files = [
__DIR__ . DIRECTORY_SEPARATOR . 'app/Config/Paths.php', __DIR__ . DIRECTORY_SEPARATOR . 'app/Config/Paths.php',
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist', __DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist',
__DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml', __DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml',
]; ];
foreach ($files as $file) foreach ($files as $file) {
{ if (is_file($file)) {
if (is_file($file)) $contents = file_get_contents($file);
{
$contents = file_get_contents($file);
// Development // Development
if ($dev) if ($dev) {
{ $contents = str_replace(
$contents = str_replace('vendor/codeigniter4/framework', 'vendor/codeigniter4/codeigniter4', $contents); 'vendor/codeigniter4/framework',
} 'vendor/codeigniter4/codeigniter4',
$contents
);
}
// Release // Release
else else {
{ $contents = str_replace(
$contents = str_replace('vendor/codeigniter4/codeigniter4', 'vendor/codeigniter4/framework', $contents); 'vendor/codeigniter4/codeigniter4',
} 'vendor/codeigniter4/framework',
$contents
);
}
file_put_contents($file, $contents); file_put_contents($file, $contents);
$modified[] = $file; $modified[] = $file;
} }
} }
if (empty($modified)) if (empty($modified)) {
{ echo 'No files modified' . PHP_EOL;
echo 'No files modified' . PHP_EOL; } else {
} echo 'The following files were modified:' . PHP_EOL;
else foreach ($modified as $file) {
{ echo " * {$file}" . PHP_EOL;
echo 'The following files were modified:' . PHP_EOL; }
foreach ($modified as $file) echo 'Run `composer update` to sync changes with your vendor folder' .
{ PHP_EOL;
echo " * {$file}" . PHP_EOL;
}
echo 'Run `composer update` to sync changes with your vendor folder' . PHP_EOL;
} }

View File

@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] } module.exports = { extends: ["@commitlint/config-conventional"] };

View File

@ -1,31 +1,32 @@
{ {
"name": "codeigniter4/appstarter", "name": "podlibre/castopod",
"type": "project", "type": "project",
"description": "CodeIgniter4 starter app", "description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://codeigniter.com", "homepage": "https://castopod.org",
"license": "MIT", "license": "AGPL-3.0-or-later",
"require": { "require": {
"php": ">=7.2", "php": ">=7.2",
"codeigniter4/framework": "^4" "codeigniter4/framework": "^4",
}, "james-heinrich/getid3": "~2.0.0-dev"
"require-dev": { },
"mikey179/vfsstream": "1.6.*", "require-dev": {
"phpunit/phpunit": "8.5.*" "mikey179/vfsstream": "1.6.*",
}, "phpunit/phpunit": "8.5.*"
"autoload-dev": { },
"psr-4": { "autoload-dev": {
"Tests\\Support\\": "tests/_support" "psr-4": {
} "Tests\\Support\\": "tests/_support"
}, }
"scripts": { },
"test": "phpunit", "scripts": {
"post-update-cmd": [ "test": "phpunit",
"@composer dump-autoload" "post-update-cmd": [
] "@composer dump-autoload"
}, ]
"support": { },
"forum": "http://forum.codeigniter.com/", "support": {
"source": "https://github.com/codeigniter4/CodeIgniter4", "forum": "http://forum.codeigniter.com/",
"slack": "https://codeigniterchat.slack.com" "source": "https://github.com/codeigniter4/CodeIgniter4",
} "slack": "https://codeigniterchat.slack.com"
}
} }

87
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8c49469ea6df972381be63807c7e127d", "content-hash": "a524161e65f809ee6dcfd5f842f4031c",
"packages": [ "packages": [
{ {
"name": "codeigniter4/framework", "name": "codeigniter4/framework",
@ -50,6 +50,87 @@
"homepage": "https://codeigniter.com", "homepage": "https://codeigniter.com",
"time": "2020-05-01T05:01:20+00:00" "time": "2020-05-01T05:01:20+00:00"
}, },
{
"name": "james-heinrich/getid3",
"version": "2.0.x-dev",
"source": {
"type": "git",
"url": "https://github.com/JamesHeinrich/getID3.git",
"reference": "8cf765ec4c42ed732993a9aa60b638ee398df154"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JamesHeinrich/getID3/zipball/8cf765ec4c42ed732993a9aa60b638ee398df154",
"reference": "8cf765ec4c42ed732993a9aa60b638ee398df154",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9 || ^1.0",
"phpunit/phpunit": "^4.8|^5.0"
},
"suggest": {
"ext-SimpleXML": "SimpleXML extension is required to analyze RIFF/WAV/BWF audio files (also requires `ext-libxml`).",
"ext-com_dotnet": "COM extension is required when loading files larger than 2GB on Windows.",
"ext-ctype": "ctype extension is required when loading files larger than 2GB on 32-bit PHP (also on 64-bit PHP on Windows) or executing `getid3_lib::CopyTagsToComments`.",
"ext-dba": "DBA extension is required to use the DBA database as a cache storage.",
"ext-exif": "EXIF extension is required for graphic modules.",
"ext-iconv": "iconv extension is required to work with different character sets (when `ext-mbstring` is not available).",
"ext-json": "JSON extension is required to analyze Apple Quicktime videos.",
"ext-libxml": "libxml extension is required to analyze RIFF/WAV/BWF audio files.",
"ext-mbstring": "mbstring extension is required to work with different character sets.",
"ext-mysql": "MySQL extension is required to use the MySQL database as a cache storage (deprecated in PHP 5.5, removed in PHP >= 7.0, use `ext-mysqli` instead).",
"ext-mysqli": "MySQLi extension is required to use the MySQL database as a cache storage.",
"ext-rar": "RAR extension is required for RAR archive module.",
"ext-sqlite3": "SQLite3 extension is required to use the SQLite3 database as a cache storage.",
"ext-xml": "XML extension is required for graphic modules to analyze the XML metadata.",
"ext-zlib": "Zlib extension is required for archive modules and compressed metadata."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"JamesHeinrich\\GetID3\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-1.0-or-later",
"LGPL-3.0-only",
"MPL-2.0"
],
"authors": [
{
"name": "James Heinrich",
"email": "info@getid3.org",
"homepage": "https://github.com/JamesHeinrich",
"role": "Developer"
},
{
"name": "Craig Duncan",
"email": "git@duncanc.co.uk",
"homepage": "https://github.com/duncan3dc",
"role": "Developer"
}
],
"description": "Extract and write useful information to/from popular multimedia file formats",
"homepage": "https://www.getid3.org/",
"keywords": [
"audio",
"codecs",
"id3",
"metadata",
"tags",
"video"
],
"time": "2019-07-22T12:33:16+00:00"
},
{ {
"name": "kint-php/kint", "name": "kint-php/kint",
"version": "3.3", "version": "3.3",
@ -1876,7 +1957,9 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {
"james-heinrich/getid3": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {

627
package-lock.json generated
View File

@ -410,6 +410,17 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@prettier/plugin-php": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.14.2.tgz",
"integrity": "sha512-sG713Vb/eKtlB4rsL1+7mDD85jC2cjop8z/LE2QZHBtbopemfa4okEha01fgCqMaLJ80NBwGP9SZIwY9MR/w6w==",
"dev": true,
"requires": {
"linguist-languages": "^7.5.1",
"mem": "^6.0.1",
"php-parser": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5"
}
},
"@tailwindcss/custom-forms": { "@tailwindcss/custom-forms": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/custom-forms/-/custom-forms-0.2.1.tgz", "resolved": "https://registry.npmjs.org/@tailwindcss/custom-forms/-/custom-forms-0.2.1.tgz",
@ -478,6 +489,22 @@
"integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==",
"dev": true "dev": true
}, },
"aggregate-error": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz",
"integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==",
"dev": true,
"requires": {
"clean-stack": "^2.0.0",
"indent-string": "^4.0.0"
}
},
"ansi-colors": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
"integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==",
"dev": true
},
"ansi-escapes": { "ansi-escapes": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
@ -572,6 +599,12 @@
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"dev": true "dev": true
}, },
"astral-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
"integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
"dev": true
},
"at-least-node": { "at-least-node": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@ -987,6 +1020,12 @@
} }
} }
}, },
"clean-stack": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"dev": true
},
"cli-cursor": { "cli-cursor": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
@ -996,6 +1035,50 @@
"restore-cursor": "^2.0.0" "restore-cursor": "^2.0.0"
} }
}, },
"cli-truncate": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz",
"integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==",
"dev": true,
"requires": {
"slice-ansi": "^3.0.0",
"string-width": "^4.2.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"string-width": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
}
}
},
"cli-width": { "cli-width": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz",
@ -1259,6 +1342,28 @@
"parse-json": "^4.0.0" "parse-json": "^4.0.0"
} }
}, },
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"dependencies": {
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"css-unit-converter": { "css-unit-converter": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.2.tgz", "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.2.tgz",
@ -1465,6 +1570,24 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true "dev": true
}, },
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"dev": true,
"requires": {
"once": "^1.4.0"
}
},
"enquirer": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz",
"integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==",
"dev": true,
"requires": {
"ansi-colors": "^3.2.1"
}
},
"error-ex": { "error-ex": {
"version": "1.3.2", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
@ -1494,6 +1617,40 @@
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true "dev": true
}, },
"execa": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz",
"integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0",
"get-stream": "^5.0.0",
"human-signals": "^1.1.1",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.0",
"onetime": "^5.1.0",
"signal-exit": "^3.0.2",
"strip-final-newline": "^2.0.0"
},
"dependencies": {
"mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true
},
"onetime": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz",
"integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==",
"dev": true,
"requires": {
"mimic-fn": "^2.1.0"
}
}
}
},
"expand-brackets": { "expand-brackets": {
"version": "2.1.4", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@ -1827,12 +1984,27 @@
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true "dev": true
}, },
"get-own-enumerable-property-symbols": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"dev": true
},
"get-stdin": { "get-stdin": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz",
"integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==",
"dev": true "dev": true
}, },
"get-stream": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz",
"integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==",
"dev": true,
"requires": {
"pump": "^3.0.0"
}
},
"get-value": { "get-value": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@ -2010,6 +2182,12 @@
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
"dev": true "dev": true
}, },
"human-signals": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
"integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==",
"dev": true
},
"husky": { "husky": {
"version": "4.2.5", "version": "4.2.5",
"resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz",
@ -2336,6 +2514,18 @@
"isobject": "^3.0.1" "isobject": "^3.0.1"
} }
}, },
"is-regexp": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz",
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
"dev": true
},
"is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
"dev": true
},
"is-text-path": { "is-text-path": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz",
@ -2424,6 +2614,172 @@
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
"dev": true "dev": true
}, },
"linguist-languages": {
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.9.0.tgz",
"integrity": "sha512-saKTpS7BH8vOOwzrZNTkFL/DuT2JN7cg6oHWY8nAjt89+pV1qFcpbjEEcZdAv9ogc4DcxVFHkXmjeyU/DiFHQw==",
"dev": true
},
"lint-staged": {
"version": "10.2.9",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.9.tgz",
"integrity": "sha512-ziRAuXEqvJLSXg43ezBpHxRW8FOJCXISaXU//BWrxRrp5cBdRkIx7g5IsB3OI45xYGE0S6cOacfekSjDyDKF2g==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"cli-truncate": "2.1.0",
"commander": "^5.1.0",
"cosmiconfig": "^6.0.0",
"debug": "^4.1.1",
"dedent": "^0.7.0",
"enquirer": "^2.3.5",
"execa": "^4.0.1",
"listr2": "^2.1.0",
"log-symbols": "^4.0.0",
"micromatch": "^4.0.2",
"normalize-path": "^3.0.0",
"please-upgrade-node": "^3.2.0",
"string-argv": "0.3.1",
"stringify-object": "^3.3.0"
},
"dependencies": {
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"cosmiconfig": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.1.0",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.7.2"
}
},
"debug": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"import-fresh": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"log-symbols": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz",
"integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==",
"dev": true,
"requires": {
"chalk": "^4.0.0"
}
},
"micromatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
"integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.0.5"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"parse-json": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
"integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-better-errors": "^1.0.1",
"lines-and-columns": "^1.1.6"
}
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
}
}
},
"listr2": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/listr2/-/listr2-2.1.3.tgz",
"integrity": "sha512-6oy3QhrZAlJGrG8oPcRp1hix1zUpb5AvyvZ5je979HCyf48tIj3Hn1TG5+rfyhz30t7HfySH/OIaVbwrI2kruA==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"cli-truncate": "^2.1.0",
"figures": "^3.2.0",
"indent-string": "^4.0.0",
"log-update": "^4.0.0",
"p-map": "^4.0.0",
"rxjs": "^6.5.5",
"through": "^2.3.8"
},
"dependencies": {
"figures": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
"integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
"dev": true,
"requires": {
"escape-string-regexp": "^1.0.5"
}
}
}
},
"load-json-file": { "load-json-file": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
@ -2524,6 +2880,111 @@
} }
} }
}, },
"log-update": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz",
"integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==",
"dev": true,
"requires": {
"ansi-escapes": "^4.3.0",
"cli-cursor": "^3.1.0",
"slice-ansi": "^4.0.0",
"wrap-ansi": "^6.2.0"
},
"dependencies": {
"ansi-escapes": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz",
"integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==",
"dev": true,
"requires": {
"type-fest": "^0.11.0"
}
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"cli-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
"integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
"dev": true,
"requires": {
"restore-cursor": "^3.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"mimic-fn": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
"dev": true
},
"onetime": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz",
"integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==",
"dev": true,
"requires": {
"mimic-fn": "^2.1.0"
}
},
"restore-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
"integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
"dev": true,
"requires": {
"onetime": "^5.1.0",
"signal-exit": "^3.0.2"
}
},
"slice-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
"integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
}
},
"type-fest": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz",
"integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==",
"dev": true
}
}
},
"longest": { "longest": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz",
@ -2540,6 +3001,15 @@
"signal-exit": "^3.0.0" "signal-exit": "^3.0.0"
} }
}, },
"map-age-cleaner": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
"dev": true,
"requires": {
"p-defer": "^1.0.0"
}
},
"map-cache": { "map-cache": {
"version": "0.2.2", "version": "0.2.2",
"resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
@ -2561,6 +3031,24 @@
"object-visit": "^1.0.0" "object-visit": "^1.0.0"
} }
}, },
"mem": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/mem/-/mem-6.1.0.tgz",
"integrity": "sha512-RlbnLQgRHk5lwqTtpEkBTQ2ll/CG/iB+J4Hy2Wh97PjgZgXgWJWrFF+XXujh3UUVLvR4OOTgZzcWMMwnehlEUg==",
"dev": true,
"requires": {
"map-age-cleaner": "^0.1.3",
"mimic-fn": "^3.0.0"
},
"dependencies": {
"mimic-fn": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.0.0.tgz",
"integrity": "sha512-PiVO95TKvhiwgSwg1IdLYlCTdul38yZxZMIcnDSFIBUm4BNZha2qpQ4GpJ++15bHoKDtrW2D69lMfFwdFYtNZQ==",
"dev": true
}
}
},
"meow": { "meow": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
@ -2753,6 +3241,12 @@
"integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==",
"dev": true "dev": true
}, },
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true
},
"merge2": { "merge2": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@ -2946,6 +3440,15 @@
"integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==", "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==",
"dev": true "dev": true
}, },
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
"path-key": "^3.0.0"
}
},
"num2fraction": { "num2fraction": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz",
@ -3037,6 +3540,12 @@
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true "dev": true
}, },
"p-defer": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
"dev": true
},
"p-limit": { "p-limit": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@ -3055,6 +3564,15 @@
"p-limit": "^2.2.0" "p-limit": "^2.2.0"
} }
}, },
"p-map": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
"dev": true,
"requires": {
"aggregate-error": "^3.0.0"
}
},
"p-try": { "p-try": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
@ -3112,6 +3630,12 @@
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true "dev": true
}, },
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"path-parse": { "path-parse": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
@ -3124,6 +3648,11 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true "dev": true
}, },
"php-parser": {
"version": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5",
"from": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5",
"dev": true
},
"picomatch": { "picomatch": {
"version": "2.2.2", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
@ -3491,6 +4020,12 @@
"integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==",
"dev": true "dev": true
}, },
"prettier": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
"dev": true
},
"pretty-hrtime": { "pretty-hrtime": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
@ -3503,6 +4038,16 @@
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true "dev": true
}, },
"pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"purgecss": { "purgecss": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/purgecss/-/purgecss-2.2.1.tgz", "resolved": "https://registry.npmjs.org/purgecss/-/purgecss-2.2.1.tgz",
@ -3889,6 +4434,21 @@
} }
} }
}, },
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"signal-exit": { "signal-exit": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@ -3910,6 +4470,50 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true "dev": true
}, },
"slice-ansi": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz",
"integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
}
}
},
"snapdragon": { "snapdragon": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@ -4131,6 +4735,12 @@
} }
} }
}, },
"string-argv": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz",
"integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==",
"dev": true
},
"string-width": { "string-width": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@ -4161,6 +4771,17 @@
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
} }
}, },
"stringify-object": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz",
"integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==",
"dev": true,
"requires": {
"get-own-enumerable-property-symbols": "^3.0.0",
"is-obj": "^1.0.1",
"is-regexp": "^1.0.0"
}
},
"strip-ansi": { "strip-ansi": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
@ -4184,6 +4805,12 @@
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true "dev": true
}, },
"strip-final-newline": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true
},
"strip-indent": { "strip-indent": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",

View File

@ -16,20 +16,27 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^8.3.5", "@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4", "@commitlint/config-conventional": "^8.3.4",
"@prettier/plugin-php": "^0.14.2",
"@tailwindcss/custom-forms": "^0.2.1", "@tailwindcss/custom-forms": "^0.2.1",
"cz-conventional-changelog": "^3.2.0", "cz-conventional-changelog": "^3.2.0",
"husky": "^4.2.5", "husky": "^4.2.5",
"lint-staged": "^10.2.9",
"postcss-cli": "^7.1.1", "postcss-cli": "^7.1.1",
"prettier": "2.0.5",
"tailwindcss": "^1.4.6" "tailwindcss": "^1.4.6"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
} }
}, },
"lint-staged": {
"*.{js,css,md,php}": "prettier --write"
},
"config": { "config": {
"commitizen": { "commitizen": {
"path": "cz-conventional-changelog" "path": "cz-conventional-changelog"
} }
} }
} }

View File

@ -1,6 +1,3 @@
module.exports = { module.exports = {
plugins: [ plugins: [require("tailwindcss"), require("autoprefixer")],
require('tailwindcss'), };
require('autoprefixer'),
]
}

View File

@ -2,9 +2,11 @@
// Valid PHP Version? // Valid PHP Version?
$minPHPVersion = '7.2'; $minPHPVersion = '7.2';
if (phpversion() < $minPHPVersion) if (phpversion() < $minPHPVersion) {
{ die(
die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " . phpversion()); "Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " .
phpversion()
);
} }
unset($minPHPVersion); unset($minPHPVersion);

14
spark
View File

@ -1,6 +1,5 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* CodeIgniter command-line tools * CodeIgniter command-line tools
@ -24,9 +23,10 @@ define('SPARKED', true);
*/ */
// Refuse to run when called from php-cgi // Refuse to run when called from php-cgi
if (substr(php_sapi_name(), 0, 3) === 'cgi') if (substr(php_sapi_name(), 0, 3) === 'cgi') {
{ die(
die("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n"); "The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n"
);
} }
// Path to the front controller // Path to the front controller
@ -55,7 +55,7 @@ $console->showHeader();
// fire off the command in the main framework. // fire off the command in the main framework.
$response = $console->run(); $response = $console->run();
if ($response->getStatusCode() >= 300) if ($response->getStatusCode() >= 300) {
{ exit($response->getStatusCode());
exit($response->getStatusCode());
} }

View File

@ -4,5 +4,5 @@ module.exports = {
extend: {}, extend: {},
}, },
variants: {}, variants: {},
plugins: [require('@tailwindcss/custom-forms')], plugins: [require("@tailwindcss/custom-forms")],
} };