Commit f266d3fd by Phạm Văn Đoan

init dự án

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/academy-lms.iml" filepath="$PROJECT_DIR$/.idea/academy-lms.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('xmlrpc', 'pagination');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url','file','form','security','string','inflector','directory','download','user','multi_language', 'common', 'pagination');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array('user_model', 'crud_model', 'video_model', 'email_model', 'payment_model', 'lazyloaddata_model' => 'lazyload', 'api_model');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system. The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
| always be used to set the mode correctly.
|
*/
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'academy_lms',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!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-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.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">'
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
| -------------------------------------------------------------------
| This file contains an array of foreign characters for transliteration
| conversion used by the Text helper
|
*/
$foreign_characters = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/hooks.html
|
*/
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Memcached settings
| -------------------------------------------------------------------------
| Your Memcached servers can be specified below.
|
| See: https://codeigniter.com/user_guide/libraries/caching.html#memcached
|
*/
$config = array(
'default' => array(
'hostname' => '127.0.0.1',
'port' => '11211',
'weight' => '1',
),
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| https://codeigniter.com/user_guide/general/profiling.html
|
*/
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'home';
$route['404_override'] = 'home/page_not_found';
$route['translate_uri_dashes'] = FALSE;
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
| -------------------------------------------------------------------
| This file contains four arrays of user agent data. It is used by the
| User Agent Class to help identify browser, platform, robot, and
| 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.
*/
$platforms = array(
'windows nt 10.0' => 'Windows 10',
'windows nt 6.3' => 'Windows 8.1',
'windows nt 6.2' => 'Windows 8',
'windows nt 6.1' => 'Windows 7',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.1' => 'Windows XP',
'windows nt 5.0' => 'Windows 2000',
'windows nt 4.0' => 'Windows NT 4.0',
'winnt4.0' => 'Windows NT 4.0',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows phone' => 'Windows Phone',
'windows' => 'Unknown Windows OS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'iphone' => 'iOS',
'ipad' => 'iOS',
'ipod' => 'iOS',
'os x' => 'Mac OS X',
'ppc mac' => 'Power PC Mac',
'freebsd' => 'FreeBSD',
'ppc' => 'Macintosh',
'linux' => 'Linux',
'debian' => 'Debian',
'sunos' => 'Sun Solaris',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'gnu' => 'GNU/Linux',
'unix' => 'Unknown Unix OS',
'symbian' => 'Symbian OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(
'OPR' => 'Opera',
'Flock' => 'Flock',
'Edge' => 'Edge',
'Chrome' => 'Chrome',
// Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string
'Opera.*?Version' => 'Opera',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Trident.* rv' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Safari' => 'Safari',
'Mozilla' => 'Mozilla',
'Konqueror' => 'Konqueror',
'icab' => 'iCab',
'Lynx' => 'Lynx',
'Links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Maxthon' => 'Maxthon',
'Ubuntu' => 'Ubuntu Web Browser'
);
$mobiles = array(
// legacy array, old values commented out
'mobileexplorer' => 'Mobile Explorer',
// 'openwave' => 'Open Wave',
// 'opera mini' => 'Opera Mini',
// 'operamini' => 'Opera Mini',
// 'elaine' => 'Palm',
'palmsource' => 'Palm',
// 'digital paths' => 'Palm',
// 'avantgo' => 'Avantgo',
// 'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
// 'nokia' => 'Nokia',
// 'ericsson' => 'Ericsson',
// 'blackberry' => 'BlackBerry',
// 'motorola' => 'Motorola'
// Phones and Manufacturers
'motorola' => 'Motorola',
'nokia' => 'Nokia',
'palm' => 'Palm',
'iphone' => 'Apple iPhone',
'ipad' => 'iPad',
'ipod' => 'Apple iPod Touch',
'sony' => 'Sony Ericsson',
'ericsson' => 'Sony Ericsson',
'blackberry' => 'BlackBerry',
'cocoon' => 'O2 Cocoon',
'blazer' => 'Treo',
'lg' => 'LG',
'amoi' => 'Amoi',
'xda' => 'XDA',
'mda' => 'MDA',
'vario' => 'Vario',
'htc' => 'HTC',
'samsung' => 'Samsung',
'sharp' => 'Sharp',
'sie-' => 'Siemens',
'alcatel' => 'Alcatel',
'benq' => 'BenQ',
'ipaq' => 'HP iPaq',
'mot-' => 'Motorola',
'playstation portable' => 'PlayStation Portable',
'playstation 3' => 'PlayStation 3',
'playstation vita' => 'PlayStation Vita',
'hiptop' => 'Danger Hiptop',
'nec-' => 'NEC',
'panasonic' => 'Panasonic',
'philips' => 'Philips',
'sagem' => 'Sagem',
'sanyo' => 'Sanyo',
'spv' => 'SPV',
'zte' => 'ZTE',
'sendo' => 'Sendo',
'nintendo dsi' => 'Nintendo DSi',
'nintendo ds' => 'Nintendo DS',
'nintendo 3ds' => 'Nintendo 3DS',
'wii' => 'Nintendo Wii',
'open web' => 'Open Web',
'openweb' => 'OpenWeb',
// Operating Systems
'android' => 'Android',
'symbian' => 'Symbian',
'SymbianOS' => 'SymbianOS',
'elaine' => 'Palm',
'series60' => 'Symbian S60',
'windows ce' => 'Windows CE',
// Browsers
'obigo' => 'Obigo',
'netfront' => 'Netfront Browser',
'openwave' => 'Openwave Browser',
'mobilexplorer' => 'Mobile Explorer',
'operamini' => 'Opera Mini',
'opera mini' => 'Opera Mini',
'opera mobi' => 'Opera Mobile',
'fennec' => 'Firefox Mobile',
// Other
'digital paths' => 'Digital Paths',
'avantgo' => 'AvantGo',
'xiino' => 'Xiino',
'novarra' => 'Novarra Transcoder',
'vodafone' => 'Vodafone',
'docomo' => 'NTT DoCoMo',
'o2' => 'O2',
// Fallback
'mobile' => 'Generic Mobile',
'wireless' => 'Generic Mobile',
'j2me' => 'Generic Mobile',
'midp' => 'Generic Mobile',
'cldc' => 'Generic Mobile',
'up.link' => 'Generic Mobile',
'up.browser' => 'Generic Mobile',
'smartphone' => 'Generic Mobile',
'cellphone' => 'Generic Mobile'
);
// There are hundreds of bots but these are the most common.
$robots = array(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'baiduspider' => 'Baiduspider',
'bingbot' => 'Bing',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'ask jeeves' => 'Ask Jeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
'yandex' => 'YandexBot',
'mediapartners-google' => 'MediaPartners Google',
'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
'adsbot-google' => 'AdsBot Google',
'feedfetcher-google' => 'Feedfetcher Google',
'curious george' => 'Curious George',
'ia_archiver' => 'Alexa Crawler',
'MJ12bot' => 'Majestic-12',
'Uptimebot' => 'Uptimebot'
);
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/*
* @author : Creativeitem
* date : 07 october, 2018
* Academy
* http://codecanyon.net/user/Creativeitem
* http://support.creativeitem.com
*/
ini_set('max_execution_time', 0);
ini_set('memory_limit','2048M');
class Install extends CI_Controller {
public function index() {
if ($this->router->default_controller == 'install') {
redirect(site_url('install/step0'), 'refresh');
}
redirect(site_url('login'), 'refresh');
}
function step0() {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'step0';
$this->load->view('install/index', $page_data);
}
function step1() {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
$page_data['page_name'] = 'step1';
$this->load->view('install/index', $page_data);
}
function step2($param1 = '', $param2 = '') {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
if ($param1 == 'error') {
$page_data['error'] = 'Purchase Code Verification Failed';
}
$page_data['page_name'] = 'step2';
$this->load->view('install/index', $page_data);
}
function validate_purchase_code() {
$purchase_code = $this->input->post('purchase_code');
$validation_response = TRUE;
if ($validation_response == true) {
// keeping the purchase code in users session
session_start();
$_SESSION['purchase_code'] = $purchase_code;
$_SESSION['purchase_code_verified'] = 1;
//move to step 3
redirect(site_url('install/step3'), 'refresh');
} else {
//remain on step 2 and show error
session_start();
$_SESSION['purchase_code_verified'] = 0;
redirect(site_url('install/step2/error'), 'refresh');
}
}
function step3($param1 = '', $param2 = '') {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
$this->check_purchase_code_verification();
if ($param1 == 'error_con_fail') {
$page_data['error_con_fail'] = 'Error establishing a database conenction using your provided information. Please
recheck hostname, username, password and try again with correct information';
}
if ($param1 == 'error_nodb') {
$page_data['error_con_fail'] = 'The database you are trying to use for the application does not exist. Please create
the database first';
}
if ($param1 == 'configure_database') {
$hostname = $this->input->post('hostname');
$username = $this->input->post('username');
$password = $this->input->post('password');
$dbname = $this->input->post('dbname');
// check db connection using the above credentials
$db_connection = $this->check_database_connection($hostname, $username, $password, $dbname);
if ($db_connection == 'failed') {
redirect(site_url('install/step3/error_con_fail'), 'refresh');
} else if ($db_connection == 'db_not_exist') {
redirect(site_url('install/step3/error_nodb'), 'refresh');
} else {
// proceed to step 4
session_start();
$_SESSION['hostname'] = $hostname;
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
$_SESSION['dbname'] = $dbname;
redirect(site_url('install/step4'), 'refresh');
}
}
$page_data['page_name'] = 'step3';
$this->load->view('install/index', $page_data);
}
function check_purchase_code_verification() {
if ($_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') {
//return 'running_locally';
} else {
session_start();
if (!isset($_SESSION['purchase_code_verified']))
redirect(site_url('install/step2'), 'refresh');
else if ($_SESSION['purchase_code_verified'] == 0)
redirect(site_url('install/step2'), 'refresh');
}
}
function check_database_connection($hostname, $username, $password, $dbname) {
$link = mysqli_connect($hostname, $username, $password, $dbname);
if (!$link) {
mysqli_close($link);
return 'failed';
}
$db_selected = mysqli_select_db($link, $dbname);
if (!$db_selected) {
mysqli_close($link);
return "db_not_exist";
}
mysqli_close($link);
return 'success';
}
function step4($param1 = '') {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
if ($param1 == 'confirm_install') {
// write database.php
$this->configure_database();
// run sql
$this->run_blank_sql();
// redirect to admin creation page
redirect(site_url('install/finalizing_setup'), 'refresh');
}
$page_data['page_name'] = 'step4';
$this->load->view('install/index', $page_data);
}
function configure_database() {
// write database.php
$data_db = file_get_contents('./application/config/database.php');
session_start();
$data_db = str_replace('db_name', $_SESSION['dbname'], $data_db);
$data_db = str_replace('db_user', $_SESSION['username'], $data_db);
$data_db = str_replace('db_pass', $_SESSION['password'], $data_db);
$data_db = str_replace('db_host', $_SESSION['hostname'], $data_db);
file_put_contents('./application/config/database.php', $data_db);
}
function run_blank_sql() {
$this->load->database();
// Set line to collect lines that wrap
$templine = '';
// Read in entire file
$lines = file('./uploads/install.sql');
// Loop through each line
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '')
continue;
// Add this line to the current templine we are creating
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query so can process this templine
if (substr(trim($line), -1, 1) == ';') {
// Perform the query
$this->db->query($templine);
// Reset temp variable to empty
$templine = '';
}
}
}
function finalizing_setup($param1 = '', $param2 = '') {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
if ($param1 == 'setup_admin') {
$admin_data['first_name'] = html_escape($this->input->post('first_name'));
$admin_data['last_name'] = html_escape($this->input->post('last_name'));
$admin_data['email'] = html_escape($this->input->post('email'));
$admin_data['password'] = sha1($this->input->post('password'));
$social_links = array(
'facebook' => "",
'twitter' => "",
'linkedin' => ""
);
$admin_data['social_links'] = json_encode($social_links);
$admin_data['role_id'] = 1;
$admin_data['status'] = 1;
$this->load->database();
$this->db->insert('users', $admin_data);
$data['value'] = $this->input->post('system_name');
$this->db->where('key', 'system_name');
$this->db->update('settings', $data);
redirect(site_url('install/success'), 'refresh');
}
$page_data['page_name'] = 'finalizing_setup';
$this->load->view('install/index', $page_data);
}
function success($param1 = '') {
if ($this->router->default_controller != 'install') {
redirect(site_url('login'), 'refresh');
}
if ($param1 == 'login') {
$this->configure_routes();
redirect(site_url('login'), 'refresh');
}
$this->load->database();
$admin_email = $this->db->get_where('users', array('id' => 1))->row()->email;
session_start();
if (isset($_SESSION['purchase_code'])) {
$data['value'] = $_SESSION['purchase_code'];
$this->db->where('key', 'purchase_code');
$this->db->update('settings', $data);
}
session_destroy();
$page_data['admin_email'] = $admin_email;
$page_data['page_name'] = 'success';
$this->load->view('install/index', $page_data);
}
function configure_routes() {
// write routes.php
$data_routes = file_get_contents('./application/config/routes.php');
$data_routes = str_replace('install', 'home', $data_routes);
file_put_contents('./application/config/routes.php', $data_routes);
}
}
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends CI_Controller {
public function __construct()
{
parent::__construct();
// Your own constructor code
$this->load->database();
$this->load->library('session');
/*cache control*/
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');
}
public function index() {
if ($this->session->userdata('admin_login')) {
redirect(site_url('admin'), 'refresh');
}elseif ($this->session->userdata('user_login')) {
redirect(site_url('user'), 'refresh');
}else {
redirect(site_url('home/login'), 'refresh');
}
}
public function validate_login($from = "") {
$email = $this->input->post('email');
$password = $this->input->post('password');
$credential = array('email' => $email, 'password' => sha1($password), 'status' => 1);
// Checking login credential for admin
$query = $this->db->get_where('users', $credential);
if ($query->num_rows() > 0) {
$row = $query->row();
$this->session->set_userdata('user_id', $row->id);
$this->session->set_userdata('role_id', $row->role_id);
$this->session->set_userdata('role', get_user_role('user_role', $row->id));
$this->session->set_userdata('name', $row->first_name.' '.$row->last_name);
$this->session->set_flashdata('flash_message', get_phrase('welcome').' '.$row->first_name.' '.$row->last_name);
if ($row->role_id == 1) {
$this->session->set_userdata('admin_login', '1');
redirect(site_url('admin/dashboard'), 'refresh');
}else if($row->role_id == 2){
$this->session->set_userdata('user_login', '1');
redirect(site_url('home'), 'refresh');
}
}else {
$this->session->set_flashdata('error_message',get_phrase('invalid_login_credentials'));
redirect(site_url('home/login'), 'refresh');
}
}
public function register() {
$data['first_name'] = html_escape($this->input->post('first_name'));
$data['last_name'] = html_escape($this->input->post('last_name'));
$data['email'] = html_escape($this->input->post('email'));
$data['password'] = sha1($this->input->post('password'));
$verification_code = md5(rand(100000000, 200000000));
$data['verification_code'] = $verification_code;
if (get_settings('student_email_verification') == 'enable') {
$data['status'] = 0;
}else {
$data['status'] = 1;
}
$data['wishlist'] = json_encode(array());
$data['watch_history'] = json_encode(array());
$data['date_added'] = strtotime(date("Y-m-d H:i:s"));
$social_links = array(
'facebook' => "",
'twitter' => "",
'linkedin' => ""
);
$data['social_links'] = json_encode($social_links);
$data['role_id'] = 2;
// Add paypal keys
$paypal_info = array();
$paypal['production_client_id'] = "";
array_push($paypal_info, $paypal);
$data['paypal_keys'] = json_encode($paypal_info);
// Add Stripe keys
$stripe_info = array();
$stripe_keys = array(
'public_live_key' => "",
'secret_live_key' => ""
);
array_push($stripe_info, $stripe_keys);
$data['stripe_keys'] = json_encode($stripe_info);
$validity = $this->user_model->check_duplication('on_create', $data['email']);
if ($validity) {
$user_id = $this->user_model->register_user($data);
/*$this->session->set_userdata('user_login', '1');
$this->session->set_userdata('user_id', $user_id);
$this->session->set_userdata('role_id', 2);
$this->session->set_userdata('role', get_user_role('user_role', 2));
$this->session->set_userdata('name', $data['first_name'].' '.$data['last_name']);*/
if (get_settings('student_email_verification') == 'enable') {
$this->email_model->send_email_verification_mail($data['email'], $verification_code);
$this->session->set_flashdata('flash_message', get_phrase('your_registration_has_been_successfully_done').'. '.get_phrase('please_check_your_mail_inbox_to_verify_your_email_address').'.');
}else {
$this->session->set_flashdata('flash_message', get_phrase('your_registration_has_been_successfully_done'));
}
}else {
$this->session->set_flashdata('error_message', get_phrase('email_duplication'));
}
redirect(site_url('home'), 'refresh');
}
public function logout($from = "") {
//destroy sessions of specific userdata. We've done this for not removing the cart session
$this->session_destroy();
redirect(site_url('home/login'), 'refresh');
}
public function session_destroy() {
$this->session->unset_userdata('user_id');
$this->session->unset_userdata('role_id');
$this->session->unset_userdata('role');
$this->session->unset_userdata('name');
if ($this->session->userdata('admin_login') == 1) {
$this->session->unset_userdata('admin_login');
}else {
$this->session->unset_userdata('user_login');
}
}
function forgot_password($from = "") {
$email = $this->input->post('email');
//resetting user password here
$new_password = substr( md5( rand(100000000,20000000000) ) , 0,7);
// Checking credential for admin
$query = $this->db->get_where('users' , array('email' => $email));
if ($query->num_rows() > 0)
{
$this->db->where('email' , $email);
$this->db->update('users' , array('password' => sha1($new_password)));
// send new password to user email
$this->email_model->password_reset_email($new_password, $email);
$this->session->set_flashdata('flash_message', get_phrase('please_check_your_email_for_new_password'));
if ($from == 'backend') {
redirect(site_url('login'), 'refresh');
}else {
redirect(site_url('home'), 'refresh');
}
}else {
$this->session->set_flashdata('error_message', get_phrase('password_reset_failed'));
if ($from == 'backend') {
redirect(site_url('login'), 'refresh');
}else {
redirect(site_url('home'), 'refresh');
}
}
}
public function verify_email_address($verification_code = "") {
$user_details = $this->db->get_where('users', array('verification_code' => $verification_code));
if($user_details->num_rows() == 0) {
$this->session->set_flashdata('error_message', get_phrase('email_duplication'));
}else {
$user_details = $user_details->row_array();
$updater = array(
'status' => 1
);
$this->db->where('id', $user_details['id']);
$this->db->update('users', $updater);
$this->session->set_flashdata('flash_message', get_phrase('congratulations').'!'.get_phrase('your_email_address_has_been_successfully_verified').'.');
}
redirect(site_url('home'), 'refresh');
}
}
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
* @author : Creativeitem
* date : 14 september, 2017
* Ekattor School Management System Pro
* http://codecanyon.net/user/Creativeitem
* http://support.creativeitem.com
*/
class Modal extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('session');
/*cache control*/
$this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
}
function popup($page_name = '' , $param2 = '' , $param3 = '', $param4 = '', $param5 = '', $param6 = '', $param7 = '')
{
$logged_in_user_role = strtolower($this->session->userdata('role'));
$page_data['param2'] = $param2;
$page_data['param3'] = $param3;
$page_data['param4'] = $param4;
$page_data['param5'] = $param5;
$page_data['param6'] = $param6;
$page_data['param7'] = $param7;
$this->load->view( 'backend/'.$logged_in_user_role.'/'.$page_name.'.php' ,$page_data);
}
}
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/*
* @author : Creativeitem
* date : 7 October, 2018
* Academy
* http://codecanyon.net/user/Creativeitem
* http://support.creativeitem.com
*/
class Updater extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('session');
/*cache control*/
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');
}
/***default functin, redirects to login page if no admin logged in yet***/
public function index()
{
if ($this->session->userdata('admin_login') != 1)
redirect(site_url('login'), 'refresh');
if ($this->session->userdata('admin_login') == 1)
redirect(site_url('admin/dashboard'), 'refresh');
}
/***** UPDATE PRODUCT *****/
function update($task = '', $purchase_code = '')
{
if ($this->session->userdata('admin_login') != 1)
redirect(base_url(), 'refresh');
// Create update directory.
$dir = 'update';
if (!is_dir($dir))
mkdir($dir, 0777, true);
$zipped_file_name = $_FILES["file_name"]["name"];
$path = 'update/' . $zipped_file_name;
move_uploaded_file($_FILES["file_name"]["tmp_name"], $path);
// Unzip uploaded update file and remove zip file.
$zip = new ZipArchive;
$res = $zip->open($path);
if ($res === TRUE) {
$zip->extractTo('update');
$zip->close();
unlink($path);
}
$unzipped_file_name = substr($zipped_file_name, 0, -4);
$str = file_get_contents('./update/' . $unzipped_file_name . '/update_config.json');
$json = json_decode($str, true);
// Run php modifications
require './update/' . $unzipped_file_name . '/update_script.php';
// Create new directories.
if (!empty($json['directory'])) {
foreach ($json['directory'] as $directory) {
if (!is_dir($directory['name']))
mkdir($directory['name'], 0777, true);
}
}
// Create/Replace new files.
if (!empty($json['files'])) {
foreach ($json['files'] as $file)
copy($file['root_directory'], $file['update_directory']);
}
$this->session->set_flashdata('flash_message', get_phrase('product_updated_successfully'));
redirect(site_url('admin/system_settings'));
}
}
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
if (! function_exists('get_settings')) {
function get_settings($key = '') {
$CI =& get_instance();
$CI->load->database();
$CI->db->where('key', $key);
$result = $CI->db->get('settings')->row()->value;
return $result;
}
}
if (! function_exists('currency')) {
function currency($price = "") {
$CI =& get_instance();
$CI->load->database();
if ($price != "") {
$CI->db->where('key', 'system_currency');
$currency_code = $CI->db->get('settings')->row()->value;
$CI->db->where('code', $currency_code);
$symbol = $CI->db->get('currency')->row()->symbol;
$CI->db->where('key', 'currency_position');
$position = $CI->db->get('settings')->row()->value;
if ($position == 'right') {
return $price.$symbol;
}elseif ($position == 'right-space') {
return $price.' '.$symbol;
}elseif ($position == 'left') {
return $symbol.$price;
}elseif ($position == 'left-space') {
return $symbol.' '.$price;
}
}
}
}
if (! function_exists('currency_code_and_symbol')) {
function currency_code_and_symbol($type = "") {
$CI =& get_instance();
$CI->load->database();
$CI->db->where('key', 'system_currency');
$currency_code = $CI->db->get('settings')->row()->value;
$CI->db->where('code', $currency_code);
$symbol = $CI->db->get('currency')->row()->symbol;
if ($type == "") {
return $symbol;
}else {
return $currency_code;
}
}
}
if (! function_exists('get_frontend_settings')) {
function get_frontend_settings($key = '') {
$CI =& get_instance();
$CI->load->database();
$CI->db->where('key', $key);
$result = $CI->db->get('frontend_settings')->row()->value;
return $result;
}
}
if ( ! function_exists('slugify'))
{
function slugify($text) {
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
$text = trim($text, '-');
$text = strtolower($text);
//$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
return 'n-a';
return $text;
}
}
if ( ! function_exists('get_video_extension'))
{
// Checks if a video is youtube, vimeo or any other
function get_video_extension($url) {
if (strpos($url, '.mp4') > 0) {
return 'mp4';
} elseif (strpos($url, '.webm') > 0) {
return 'webm';
} else {
return 'unknown';
}
}
}
if ( ! function_exists('ellipsis'))
{
// Checks if a video is youtube, vimeo or any other
function ellipsis($long_string, $max_character = 30) {
$short_string = strlen($long_string) > $max_character ? substr($long_string, 0, $max_character)."..." : $long_string;
return $short_string;
}
}
// This function helps us to decode the theme configuration json file and return that array to us
if ( ! function_exists('themeConfiguration'))
{
function themeConfiguration($theme, $key = "")
{
$themeConfigs = [];
if (file_exists('assets/frontend/'.$theme.'/config/theme-config.json')) {
$themeConfigs = file_get_contents('assets/frontend/'.$theme.'/config/theme-config.json');
$themeConfigs = json_decode($themeConfigs, true);
if ($key != "") {
if (array_key_exists($key, $themeConfigs)) {
return $themeConfigs[$key];
} else {
return false;
}
}else {
return $themeConfigs;
}
} else {
return false;
}
}
}
// Human readable time
if ( ! function_exists('readable_time_for_humans')){
function readable_time_for_humans($duration) {
if ($duration) {
$duration_array = explode(':', $duration);
$hour = $duration_array[0];
$minute = $duration_array[1];
$second = $duration_array[2];
if ($hour > 0) {
$duration = $hour.' '.get_phrase('hr').' '.$minute.' '.get_phrase('min');
}elseif ($minute > 0) {
if ($second > 0) {
$duration = ($minute+1).' '.get_phrase('min');
}else{
$duration = $minute.' '.get_phrase('min');
}
}elseif ($second > 0){
$duration = $second.' '.get_phrase('sec');
}else {
$duration = '00:00';
}
}else {
$duration = '00:00';
}
return $duration;
}
}
if ( ! function_exists('trimmer'))
{
function trimmer($text) {
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
$text = trim($text, '-');
$text = strtolower($text);
$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
return 'n-a';
return $text;
}
}
if ( ! function_exists('lesson_progress'))
{
function lesson_progress($lesson_id = "", $user_id = "") {
$CI =& get_instance();
$CI->load->database();
if ($user_id == "") {
$user_id = $CI->session->userdata('user_id');
}
$user_details = $CI->user_model->get_all_user($user_id)->row_array();
$watch_history_array = json_decode($user_details['watch_history'], true);
for ($i = 0; $i < count($watch_history_array); $i++) {
$watch_history_for_each_lesson = $watch_history_array[$i];
if ($watch_history_for_each_lesson['lesson_id'] == $lesson_id) {
return $watch_history_for_each_lesson['progress'];
}
}
return 0;
}
}
if ( ! function_exists('course_progress'))
{
function course_progress($course_id = "", $user_id = "") {
$CI =& get_instance();
$CI->load->database();
if ($user_id == "") {
$user_id = $CI->session->userdata('user_id');
}
$user_details = $CI->user_model->get_all_user($user_id)->row_array();
// this array will contain all the completed lessons from different different courses by a user
$completed_lessons_ids = array();
// this variable will contain number of completed lessons for a certain course. Like for this one the course_id
$lesson_completed = 0;
// User's watch history
$watch_history_array = json_decode($user_details['watch_history'], true);
// desired course's lessons
$lessons_for_that_course = $CI->crud_model->get_lessons('course', $course_id);
// total number of lessons for that course
$total_number_of_lessons = $lessons_for_that_course->num_rows();
// arranging completed lesson ids
for ($i = 0; $i < count($watch_history_array); $i++) {
$watch_history_for_each_lesson = $watch_history_array[$i];
if ($watch_history_for_each_lesson['progress'] == 1) {
array_push($completed_lessons_ids, $watch_history_for_each_lesson['lesson_id']);
}
}
foreach ($lessons_for_that_course->result_array() as $row) {
if (in_array($row['id'], $completed_lessons_ids)) {
$lesson_completed++;
}
}
// calculate the percantage of progress
$course_progress = ($lesson_completed / $total_number_of_lessons) * 100;
return $course_progress;
}
}
// ------------------------------------------------------------------------
/* End of file common_helper.php */
/* Location: ./system/helpers/common.php */
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// This function helps us to get the translated phrase from the file. If it does not exist this function will save the phrase and by default it will have the same form as given
if ( ! function_exists('get_phrase'))
{
function get_phrase($phrase = '') {
$CI =& get_instance();
$CI->load->database();
$language_code = $CI->db->get_where('settings' , array('key' => 'language'))->row()->value;
$key = strtolower(preg_replace('/\s+/', '_', $phrase));
$langArray = openJSONFile($language_code);
if (array_key_exists($key, $langArray)) {
} else {
$langArray[$key] = ucfirst(str_replace('_', ' ', $key));
$jsonData = json_encode($langArray, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
file_put_contents(APPPATH.'language/'.$language_code.'.json', stripslashes($jsonData));
}
return $langArray[$key];
}
}
// This function helps us to decode the language json and return that array to us
if ( ! function_exists('openJSONFile'))
{
function openJSONFile($code)
{
$jsonString = [];
if (file_exists(APPPATH.'language/'.$code.'.json')) {
$jsonString = file_get_contents(APPPATH.'language/'.$code.'.json');
$jsonString = json_decode($jsonString, true);
}
return $jsonString;
}
}
// This function helps us to create a new json file for new language
if ( ! function_exists('saveDefaultJSONFile'))
{
function saveDefaultJSONFile($language_code){
$language_code = strtolower($language_code);
if(file_exists(APPPATH.'language/'.$language_code.'.json')){
$newLangFile = APPPATH.'language/'.$language_code.'.json';
$enLangFile = APPPATH.'language/english.json';
copy($enLangFile, $newLangFile);
}else {
$fp = fopen(APPPATH.'language/'.$language_code.'.json', 'w');
$newLangFile = APPPATH.'language/'.$language_code.'.json';
$enLangFile = APPPATH.'language/english.json';
copy($enLangFile, $newLangFile);
fclose($fp);
}
}
}
// This function helps us to update a phrase inside the language file.
if ( ! function_exists('saveJSONFile'))
{
function saveJSONFile($language_code, $updating_key, $updating_value){
$jsonString = [];
if(file_exists(APPPATH.'language/'.$language_code.'.json')){
$jsonString = file_get_contents(APPPATH.'language/'.$language_code.'.json');
$jsonString = json_decode($jsonString, true);
$jsonString[$updating_key] = $updating_value;
}else {
$jsonString[$updating_key] = $updating_value;
}
$jsonData = json_encode($jsonString, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
file_put_contents(APPPATH.'language/'.$language_code.'.json', stripslashes($jsonData));
}
}
// ------------------------------------------------------------------------
/* End of file language_helper.php */
/* Location: ./system/helpers/language_helper.php */
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! function_exists('pagintaion'))
{
function pagintaion($total_rows, $per_page_item){
$config['per_page'] = $per_page_item;
$config['num_links'] = 2;
$config['total_rows'] = $total_rows;
$config['full_tag_open'] = '<ul class="pagination justify-content-center">';
$config['full_tag_close'] = '</ul>';
$config['prev_link'] = '<i class="fas fa-chevron-left"></i>';
$config['prev_tag_open'] = '<li class="page-item">';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = '<i class="fas fa-chevron-right"></i>';
$config['next_tag_open'] = '<li class="page-item">';
$config['next_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="page-item active disabled"> <span class="page-link">';
$config['cur_tag_close'] = '</span></li>';
$config['num_tag_open'] = '<li class="page-item">';
$config['num_tag_close'] = '</li>';
$config['first_tag_open'] = '<li class="page-item">';
$config['first_tag_close'] = '</li>';
$config['last_tag_open'] = '<li class="page-item">';
$config['last_tag_close'] = '</li>';
return $config;
}
}
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
if ( ! function_exists('get_user_role'))
{
function get_user_role($type = "", $user_id = '') {
$CI =& get_instance();
$CI->load->database();
$role_id = $CI->db->get_where('users' , array('id' => $user_id))->row()->role_id;
$user_role = $CI->db->get_where('role' , array('id' => $role_id))->row()->name;
if ($type == "user_role") {
return $user_role;
}else {
return $role_id;
}
}
}
if ( ! function_exists('is_purchased'))
{
function is_purchased($course_id = "") {
$CI =& get_instance();
$CI->load->library('session');
$CI->load->database();
if ($CI->session->userdata('user_login')) {
$enrolled_history = $CI->db->get_where('enrol' , array('user_id' => $CI->session->userdata('user_id'), 'course_id' => $course_id))->num_rows();
if ($enrolled_history > 0) {
return true;
}else {
return false;
}
}else {
return false;
}
}
}
// ------------------------------------------------------------------------
/* End of file user_helper.php */
/* Location: ./system/helpers/user_helper.php */
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
{
"language_deleted_successfully": "Language deleted successfully",
"multi_language_settings": "Multi language settings",
"admin": "Admin",
"welcome": "Welcome",
"my_account": "My account",
"settings": "Settings",
"logout": "Logout",
"visit_website": "Visit website",
"navigation": "Navigation",
"dashboard": "Dashboard",
"categories": "Categories",
"add_new_category": "Add new category",
"courses": "Courses",
"students": "Students",
"enrolment": "Enrolment",
"enrol_history": "Enrol history",
"enrol_a_student": "Enrol a student",
"report": "Report",
"admin_revenue": "Admin revenue",
"instructor_revenue": "Instructor revenue",
"message": "Message",
"system_settings": "System settings",
"website_settings": "Website settings",
"payment_settings": "Payment settings",
"instructor_settings": "Instructor settings",
"language_settings": "Language settings",
"smtp_settings": "Smtp settings",
"theme_settings": "Theme settings",
"about": "About",
"mobile_app": "Mobile app",
"manage_language": "Manage language",
"language_list": "Language list",
"add_phrase": "Add phrase",
"add_language": "Add language",
"language": "Language",
"option": "Option",
"edit_phrase": "Edit phrase",
"delete_language": "Delete language",
"add_new_phrase": "Add new phrase",
"save": "Save",
"add_new_language": "Add new language",
"no_special_character_or_space_is_allowed": "No special character or space is allowed",
"valid_examples": "Valid examples",
"phrase_updated": "Phrase updated",
"this_year": "This year",
"active_course": "Active course",
"pending_course": "Pending course",
"heads_up": "Heads up",
"congratulations": "Congratulations",
"oh_snap": "Oh snap",
"please_fill_all_the_required_fields": "Please fill all the required fields",
"close": "Close",
"are_you_sure": "Are you sure",
"cancel": "Cancel",
"continue": "Continue"
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
<?php
/*
* English language
*/
$lang['text_rest_invalid_api_key'] = 'Invalid API key %s'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Invalid credentials';
$lang['text_rest_ip_denied'] = 'IP denied';
$lang['text_rest_ip_unauthorized'] = 'IP unauthorized';
$lang['text_rest_unauthorized'] = 'Unauthorized';
$lang['text_rest_ajax_only'] = 'Only AJAX requests are allowed';
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';
$lang['text_rest_unknown_method'] = 'Unknown method';
$lang['text_rest_unsupported'] = 'Unsupported protocol';
{
"language_deleted_successfully": "Language deleted successfully",
"multi_language_settings": "Multi language settings",
"admin": "Admin",
"welcome": "Welcome",
"my_account": "My account",
"settings": "Settings",
"logout": "Logout",
"visit_website": "Visit website",
"navigation": "Navigation",
"dashboard": "Dashboard",
"categories": "Categories",
"add_new_category": "Add new category",
"courses": "Courses",
"students": "Students",
"enrolment": "Enrolment",
"enrol_history": "Enrol history",
"enrol_a_student": "Enrol a student",
"report": "Report",
"admin_revenue": "Admin revenue",
"instructor_revenue": "Instructor revenue",
"message": "Message",
"system_settings": "System settings",
"website_settings": "Website settings",
"payment_settings": "Payment settings",
"instructor_settings": "Instructor settings",
"language_settings": "Language settings",
"smtp_settings": "Smtp settings",
"theme_settings": "Theme settings",
"about": "About",
"mobile_app": "Mobile app",
"manage_language": "Manage language",
"language_list": "Language list",
"add_phrase": "Add phrase",
"add_language": "Add language",
"language": "Language",
"option": "Option",
"edit_phrase": "Edit phrase",
"delete_language": "Delete language",
"add_new_phrase": "Add new phrase",
"save": "Save",
"add_new_language": "Add new language",
"no_special_character_or_space_is_allowed": "No special character or space is allowed",
"valid_examples": "Valid examples",
"phrase_updated": "Phrase updated",
"this_year": "This year",
"active_course": "Active course",
"pending_course": "Pending course",
"heads_up": "Heads up",
"congratulations": "Congratulations",
"oh_snap": "Oh snap",
"please_fill_all_the_required_fields": "Please fill all the required fields",
"close": "Close",
"are_you_sure": "Are you sure",
"cancel": "Cancel",
"continue": "Continue",
"language_added_successfully": "Language added successfully"
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
The MIT License
Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Stripe PHP bindings
[![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php)
[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php)
[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master)
You can sign up for a Stripe account at https://stripe.com.
## Requirements
PHP 5.4.0 and later.
## Composer
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
```bash
composer require stripe/stripe-php
```
To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
```php
require_once('vendor/autoload.php');
```
## Manual Installation
If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file.
```php
require_once('/path/to/stripe-php/init.php');
```
## Dependencies
The bindings require the following extensions in order to work properly:
- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer
- [`json`](https://secure.php.net/manual/en/book.json.php)
- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String)
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
## Getting Started
Simple usage looks like:
```php
\Stripe\Stripe::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_189fqt2eZvKYlo2CTGBeg6Uq']);
echo $charge;
```
## Documentation
Please see https://stripe.com/docs/api for up-to-date documentation.
## Legacy Version Support
### PHP 5.3
If you are using PHP 5.3, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses.
### PHP 5.2
If you are using PHP 5.2, you can download v1.18.0 ([zip](https://github.com/stripe/stripe-php/archive/v1.18.0.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v1.18.0.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses.
This legacy version may be included via `require_once("/path/to/stripe-php/lib/Stripe.php");`, and used like:
```php
Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$charge = Stripe_Charge::create(array('source' => 'tok_XXXXXXXX', 'amount' => 2000, 'currency' => 'usd'));
echo $charge;
```
## Custom Request Timeouts
*NOTE:* We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic.
To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient.
```php
// set up your tweaked Curl client
$curl = new \Stripe\HttpClient\CurlClient();
$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT
$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT
echo $curl->getTimeout(); // 10
echo $curl->getConnectTimeout(); // 5
// tell Stripe to use the tweaked client
\Stripe\ApiRequestor::setHttpClient($curl);
// use the Stripe API client as you normally would
```
## Custom cURL Options (e.g. proxies)
Need to set a proxy for your requests? Pass in the requisite `CURLOPT_*` array to the CurlClient constructor, using the same syntax as `curl_stopt_array()`. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here.
```php
// set up your tweaked Curl client
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']);
// tell Stripe to use the tweaked client
\Stripe\ApiRequestor::setHttpClient($curl);
```
Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent.
### Configuring a Logger
The library does minimal logging, but it can be configured
with a [`PSR-3` compatible logger][psr3] so that messages
end up there instead of `error_log`:
```php
\Stripe\Stripe::setLogger($logger);
```
### Accessing response data
You can access the data from the last API response on any object via `getLastResponse()`.
```php
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_visa']);
echo $charge->getLastResponse()->headers['Request-Id'];
```
### SSL / TLS compatibility issues
Stripe's API now requires that [all connections use TLS 1.2](https://stripe.com/blog/upgrading-tls). Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an `invalid_request_error` with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at [https://stripe.com/blog/upgrading-tls](https://stripe.com/blog/upgrading-tls).".
The recommended course of action is to [upgrade your cURL and OpenSSL packages](https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php) so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the `CURLOPT_SSLVERSION` option to either `CURL_SSLVERSION_TLSv1` or `CURL_SSLVERSION_TLSv1_2`:
```php
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]);
\Stripe\ApiRequestor::setHttpClient($curl);
```
### Per-request Configuration
For apps that need to use multiple keys during the lifetime of a process, like
one that uses [Stripe Connect][connect], it's also possible to set a
per-request key and/or account:
```php
\Stripe\Charge::all([], [
'api_key' => 'sk_test_...',
'stripe_account' => 'acct_...'
]);
\Stripe\Charge::retrieve("ch_18atAXCdGbJFKhCuBAa4532Z", [
'api_key' => 'sk_test_...',
'stripe_account' => 'acct_...'
]);
```
### Configuring CA Bundles
By default, the library will use its own internal bundle of known CA
certificates, but it's possible to configure your own:
```php
\Stripe\Stripe::setCABundlePath("path/to/ca/bundle");
```
### Configuring Automatic Retries
The library can be configured to automatically retry requests that fail due to
an intermittent network problem:
```php
\Stripe\Stripe::setMaxNetworkRetries(2);
```
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
retries are safe.
## Development
Get [Composer][composer]. For example, on Mac OS:
```bash
brew install composer
```
Install dependencies:
```bash
composer install
```
The test suite depends on [stripe-mock], so make sure to fetch and run it from a
background terminal ([stripe-mock's README][stripe-mock] also contains
instructions for installing via Homebrew and other methods):
```bash
go get -u github.com/stripe/stripe-mock
stripe-mock
```
Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:
```bash
./vendor/bin/phpunit
```
Or to run an individual test file:
```bash
./vendor/bin/phpunit tests/UtilTest.php
```
Update bundled CA certificates from the [Mozilla cURL release][curl]:
```bash
./update_certs.php
```
## Attention plugin developers
Are you writing a plugin that integrates Stripe and embeds our library? Then please use the `setAppInfo` function to identify your plugin. For example:
```php
\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info");
```
The method should be called once, before any request is sent to the API. The second and third parameters are optional.
### SSL / TLS configuration option
See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`.
[composer]: https://getcomposer.org/
[connect]: https://stripe.com/connect
[curl]: http://curl.haxx.se/docs/caextract.html
[psr3]: http://www.php-fig.org/psr/psr-3/
[idempotency-keys]: https://stripe.com/docs/api/php#idempotent_requests
[stripe-mock]: https://github.com/stripe/stripe-mock
#!/usr/bin/env php
<?php
chdir(dirname(__FILE__));
$autoload = (int)$argv[1];
$returnStatus = null;
if (!$autoload) {
// Modify composer to not autoload Stripe
$composer = json_decode(file_get_contents('composer.json'), true);
unset($composer['autoload']);
unset($composer['require-dev']['squizlabs/php_codesniffer']);
file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT));
}
passthru('composer update', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
if ($autoload) {
// Only run CS on 1 of the 2 environments
passthru(
'./vendor/bin/phpcs --standard=PSR2 -n lib tests *.php',
$returnStatus
);
if ($returnStatus !== 0) {
exit(1);
}
}
$config = $autoload ? 'phpunit.xml' : 'phpunit.no_autoload.xml';
passthru("./vendor/bin/phpunit -c $config", $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
{
"name": "stripe/stripe-php",
"description": "Stripe PHP Library",
"keywords": [
"stripe",
"payment processing",
"api"
],
"homepage": "https://stripe.com/",
"license": "MIT",
"authors": [
{
"name": "Stripe and contributors",
"homepage": "https://github.com/stripe/stripe-php/contributors"
}
],
"require": {
"php": ">=5.4.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"php-coveralls/php-coveralls": "1.*",
"squizlabs/php_codesniffer": "~2.0",
"symfony/process": "~2.8"
},
"autoload": {
"psr-4": { "Stripe\\" : "lib/" }
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
// Stripe singleton
require(dirname(__FILE__) . '/lib/Stripe.php');
// Utilities
require(dirname(__FILE__) . '/lib/Util/AutoPagingIterator.php');
require(dirname(__FILE__) . '/lib/Util/CaseInsensitiveArray.php');
require(dirname(__FILE__) . '/lib/Util/LoggerInterface.php');
require(dirname(__FILE__) . '/lib/Util/DefaultLogger.php');
require(dirname(__FILE__) . '/lib/Util/RandomGenerator.php');
require(dirname(__FILE__) . '/lib/Util/RequestOptions.php');
require(dirname(__FILE__) . '/lib/Util/Set.php');
require(dirname(__FILE__) . '/lib/Util/Util.php');
// HttpClient
require(dirname(__FILE__) . '/lib/HttpClient/ClientInterface.php');
require(dirname(__FILE__) . '/lib/HttpClient/CurlClient.php');
// Errors
require(dirname(__FILE__) . '/lib/Error/Base.php');
require(dirname(__FILE__) . '/lib/Error/Api.php');
require(dirname(__FILE__) . '/lib/Error/ApiConnection.php');
require(dirname(__FILE__) . '/lib/Error/Authentication.php');
require(dirname(__FILE__) . '/lib/Error/Card.php');
require(dirname(__FILE__) . '/lib/Error/Idempotency.php');
require(dirname(__FILE__) . '/lib/Error/InvalidRequest.php');
require(dirname(__FILE__) . '/lib/Error/Permission.php');
require(dirname(__FILE__) . '/lib/Error/RateLimit.php');
require(dirname(__FILE__) . '/lib/Error/SignatureVerification.php');
// OAuth errors
require(dirname(__FILE__) . '/lib/Error/OAuth/OAuthBase.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidClient.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidGrant.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidRequest.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/InvalidScope.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/UnsupportedGrantType.php');
require(dirname(__FILE__) . '/lib/Error/OAuth/UnsupportedResponseType.php');
// API operations
require(dirname(__FILE__) . '/lib/ApiOperations/All.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Create.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Delete.php');
require(dirname(__FILE__) . '/lib/ApiOperations/NestedResource.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Request.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Retrieve.php');
require(dirname(__FILE__) . '/lib/ApiOperations/Update.php');
// Plumbing
require(dirname(__FILE__) . '/lib/ApiResponse.php');
require(dirname(__FILE__) . '/lib/RequestTelemetry.php');
require(dirname(__FILE__) . '/lib/StripeObject.php');
require(dirname(__FILE__) . '/lib/ApiRequestor.php');
require(dirname(__FILE__) . '/lib/ApiResource.php');
require(dirname(__FILE__) . '/lib/SingletonApiResource.php');
// Stripe API Resources
require(dirname(__FILE__) . '/lib/Account.php');
require(dirname(__FILE__) . '/lib/AccountLink.php');
require(dirname(__FILE__) . '/lib/AlipayAccount.php');
require(dirname(__FILE__) . '/lib/ApplePayDomain.php');
require(dirname(__FILE__) . '/lib/ApplicationFee.php');
require(dirname(__FILE__) . '/lib/ApplicationFeeRefund.php');
require(dirname(__FILE__) . '/lib/Balance.php');
require(dirname(__FILE__) . '/lib/BalanceTransaction.php');
require(dirname(__FILE__) . '/lib/BankAccount.php');
require(dirname(__FILE__) . '/lib/BitcoinReceiver.php');
require(dirname(__FILE__) . '/lib/BitcoinTransaction.php');
require(dirname(__FILE__) . '/lib/Capability.php');
require(dirname(__FILE__) . '/lib/Card.php');
require(dirname(__FILE__) . '/lib/Charge.php');
require(dirname(__FILE__) . '/lib/Checkout/Session.php');
require(dirname(__FILE__) . '/lib/Collection.php');
require(dirname(__FILE__) . '/lib/CountrySpec.php');
require(dirname(__FILE__) . '/lib/Coupon.php');
require(dirname(__FILE__) . '/lib/CreditNote.php');
require(dirname(__FILE__) . '/lib/Customer.php');
require(dirname(__FILE__) . '/lib/Discount.php');
require(dirname(__FILE__) . '/lib/Dispute.php');
require(dirname(__FILE__) . '/lib/EphemeralKey.php');
require(dirname(__FILE__) . '/lib/Event.php');
require(dirname(__FILE__) . '/lib/ExchangeRate.php');
require(dirname(__FILE__) . '/lib/File.php');
require(dirname(__FILE__) . '/lib/FileLink.php');
require(dirname(__FILE__) . '/lib/FileUpload.php');
require(dirname(__FILE__) . '/lib/Invoice.php');
require(dirname(__FILE__) . '/lib/InvoiceItem.php');
require(dirname(__FILE__) . '/lib/InvoiceLineItem.php');
require(dirname(__FILE__) . '/lib/IssuerFraudRecord.php');
require(dirname(__FILE__) . '/lib/Issuing/Authorization.php');
require(dirname(__FILE__) . '/lib/Issuing/Card.php');
require(dirname(__FILE__) . '/lib/Issuing/CardDetails.php');
require(dirname(__FILE__) . '/lib/Issuing/Cardholder.php');
require(dirname(__FILE__) . '/lib/Issuing/Dispute.php');
require(dirname(__FILE__) . '/lib/Issuing/Transaction.php');
require(dirname(__FILE__) . '/lib/LoginLink.php');
require(dirname(__FILE__) . '/lib/Order.php');
require(dirname(__FILE__) . '/lib/OrderItem.php');
require(dirname(__FILE__) . '/lib/OrderReturn.php');
require(dirname(__FILE__) . '/lib/PaymentIntent.php');
require(dirname(__FILE__) . '/lib/PaymentMethod.php');
require(dirname(__FILE__) . '/lib/Payout.php');
require(dirname(__FILE__) . '/lib/Person.php');
require(dirname(__FILE__) . '/lib/Plan.php');
require(dirname(__FILE__) . '/lib/Product.php');
require(dirname(__FILE__) . '/lib/Radar/EarlyFraudWarning.php');
require(dirname(__FILE__) . '/lib/Radar/ValueList.php');
require(dirname(__FILE__) . '/lib/Radar/ValueListItem.php');
require(dirname(__FILE__) . '/lib/Recipient.php');
require(dirname(__FILE__) . '/lib/RecipientTransfer.php');
require(dirname(__FILE__) . '/lib/Refund.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportRun.php');
require(dirname(__FILE__) . '/lib/Reporting/ReportType.php');
require(dirname(__FILE__) . '/lib/Review.php');
require(dirname(__FILE__) . '/lib/SKU.php');
require(dirname(__FILE__) . '/lib/Sigma/ScheduledQueryRun.php');
require(dirname(__FILE__) . '/lib/Source.php');
require(dirname(__FILE__) . '/lib/SourceTransaction.php');
require(dirname(__FILE__) . '/lib/Subscription.php');
require(dirname(__FILE__) . '/lib/SubscriptionItem.php');
require(dirname(__FILE__) . '/lib/SubscriptionSchedule.php');
require(dirname(__FILE__) . '/lib/SubscriptionScheduleRevision.php');
require(dirname(__FILE__) . '/lib/TaxId.php');
require(dirname(__FILE__) . '/lib/TaxRate.php');
require(dirname(__FILE__) . '/lib/Terminal/ConnectionToken.php');
require(dirname(__FILE__) . '/lib/Terminal/Location.php');
require(dirname(__FILE__) . '/lib/Terminal/Reader.php');
require(dirname(__FILE__) . '/lib/ThreeDSecure.php');
require(dirname(__FILE__) . '/lib/Token.php');
require(dirname(__FILE__) . '/lib/Topup.php');
require(dirname(__FILE__) . '/lib/Transfer.php');
require(dirname(__FILE__) . '/lib/TransferReversal.php');
require(dirname(__FILE__) . '/lib/UsageRecord.php');
require(dirname(__FILE__) . '/lib/UsageRecordSummary.php');
// OAuth
require(dirname(__FILE__) . '/lib/OAuth.php');
// Webhooks
require(dirname(__FILE__) . '/lib/Webhook.php');
require(dirname(__FILE__) . '/lib/WebhookEndpoint.php');
require(dirname(__FILE__) . '/lib/WebhookSignature.php');
<?php
namespace Stripe;
/**
* Class AccountLink
*
* @property string $object
* @property int $created
* @property int $expires_at
* @property string $url
*
* @package Stripe
*/
class AccountLink extends ApiResource
{
const OBJECT_NAME = "account_link";
use ApiOperations\Create;
}
<?php
namespace Stripe;
/**
* Class AlipayAccount
*
* @package Stripe
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
*/
class AlipayAccount extends ApiResource
{
const OBJECT_NAME = "alipay_account";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
} else {
$msg = "Alipay accounts cannot be accessed without a customer ID.";
throw new Error\InvalidRequest($msg, null);
}
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Error\InvalidRequest
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Alipay accounts cannot be accessed without a customer ID. " .
"Retrieve an Alipay account using \$customer->sources->retrieve('alipay_account_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Error\InvalidRequest
*
* @deprecated Alipay accounts are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/alipay
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Alipay accounts cannot be accessed without a customer ID. " .
"Call save() on \$customer->sources->retrieve('alipay_account_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for listable resources. Adds a `all()` static method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait All
{
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return \Stripe\Collection of ApiResources
*/
public static function all($params = null, $opts = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
if (!is_a($obj, 'Stripe\\Collection')) {
$class = get_class($obj);
$message = "Expected type \"Stripe\\Collection\", got \"$class\" instead";
throw new \Stripe\Error\Api($message);
}
$obj->setLastResponse($response);
$obj->setRequestParams($params);
return $obj;
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for creatable resources. Adds a `create()` static method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Create
{
/**
* @param array|null $params
* @param array|string|null $options
*
* @return static The created resource.
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for deletable resources. Adds a `delete()` method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Delete
{
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return static The deleted resource.
*/
public function delete($params = null, $opts = null)
{
self::_validateParams($params);
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for resources that have nested resources.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait NestedResource
{
/**
* @param string $method
* @param string $url
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _nestedResourceOperation($method, $url, $params = null, $options = null)
{
self::_validateParams($params);
list($response, $opts) = static::_staticRequest($method, $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param string $id
* @param string $nestedPath
* @param string|null $nestedId
*
* @return string
*/
protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null)
{
$url = static::resourceUrl($id) . $nestedPath;
if ($nestedId !== null) {
$url .= "/$nestedId";
}
return $url;
}
/**
* @param string $id
* @param string $nestedPath
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null)
{
$url = static::_nestedResourceUrl($id, $nestedPath);
return self::_nestedResourceOperation('post', $url, $params, $options);
}
/**
* @param string $id
* @param string $nestedPath
* @param string|null $nestedId
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
{
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
return self::_nestedResourceOperation('get', $url, $params, $options);
}
/**
* @param string $id
* @param string $nestedPath
* @param string|null $nestedId
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
{
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
return self::_nestedResourceOperation('post', $url, $params, $options);
}
/**
* @param string $id
* @param string $nestedPath
* @param string|null $nestedId
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null)
{
$url = static::_nestedResourceUrl($id, $nestedPath, $nestedId);
return self::_nestedResourceOperation('delete', $url, $params, $options);
}
/**
* @param string $id
* @param string $nestedPath
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\StripeObject
*/
protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null)
{
$url = static::_nestedResourceUrl($id, $nestedPath);
return self::_nestedResourceOperation('get', $url, $params, $options);
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for resources that need to make API requests.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Request
{
/**
* @param array|null|mixed $params The list of parameters to validate
*
* @throws \Stripe\Error\Api if $params exists and is not an array
*/
protected static function _validateParams($params = null)
{
if ($params && !is_array($params)) {
$message = "You must pass an array as the first argument to Stripe API "
. "method calls. (HINT: an example call to create a charge "
. "would be: \"Stripe\\Charge::create(['amount' => 100, "
. "'currency' => 'usd', 'source' => 'tok_1234'])\")";
throw new \Stripe\Error\Api($message);
}
}
/**
* @param string $method HTTP method ('get', 'post', etc.)
* @param string $url URL for the request
* @param array $params list of parameters for the request
* @param array|string|null $options
*
* @return array tuple containing (the JSON response, $options)
*/
protected function _request($method, $url, $params = [], $options = null)
{
$opts = $this->_opts->merge($options);
list($resp, $options) = static::_staticRequest($method, $url, $params, $opts);
$this->setLastResponse($resp);
return [$resp->json, $options];
}
/**
* @param string $method HTTP method ('get', 'post', etc.)
* @param string $url URL for the request
* @param array $params list of parameters for the request
* @param array|string|null $options
*
* @return array tuple containing (the JSON response, $options)
*/
protected static function _staticRequest($method, $url, $params, $options)
{
$opts = \Stripe\Util\RequestOptions::parse($options);
$baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
$requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl);
list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers);
$opts->discardNonPersistentHeaders();
return [$response, $opts];
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for retrievable resources. Adds a `retrieve()` static method to the
* class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Retrieve
{
/**
* @param array|string $id The ID of the API resource to retrieve,
* or an options array containing an `id` key.
* @param array|string|null $opts
*
* @return static
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}
<?php
namespace Stripe\ApiOperations;
/**
* Trait for updatable resources. Adds an `update()` static method and a
* `save()` method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Update
{
/**
* @param string $id The ID of the resource to update.
* @param array|null $params
* @param array|string|null $opts
*
* @return static The updated resource.
*/
public static function update($id, $params = null, $opts = null)
{
self::_validateParams($params);
$url = static::resourceUrl($id);
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param array|string|null $opts
*
* @return static The saved resource.
*/
public function save($opts = null)
{
$params = $this->serializeParameters();
if (count($params) > 0) {
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
}
return $this;
}
}
<?php
namespace Stripe;
/**
* Class ApiResource
*
* @package Stripe
*/
abstract class ApiResource extends StripeObject
{
use ApiOperations\Request;
/**
* @return \Stripe\Util\Set A list of fields that can be their own type of
* API resource (say a nested card under an account for example), and if
* that resource is set, it should be transmitted to the API on a create or
* update. Doing so is not the default behavior because API resources
* should normally be persisted on their own RESTful endpoints.
*/
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set();
}
return $savedNestedResources;
}
/**
* @var boolean A flag that can be set a behavior that will cause this
* resource to be encoded and sent up along with an update of its parent
* resource. This is usually not desirable because resources are updated
* individually on their own endpoints, but there are certain cases,
* replacing a customer's source for example, where this is allowed.
*/
public $saveWithParent = false;
public function __set($k, $v)
{
parent::__set($k, $v);
$v = $this->$k;
if ((static::getSavedNestedResources()->includes($k)) &&
($v instanceof ApiResource)) {
$v->saveWithParent = true;
}
return $v;
}
/**
* @return ApiResource The refreshed resource.
*/
public function refresh()
{
$requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl());
$url = $this->instanceUrl();
list($response, $this->_opts->apiKey) = $requestor->request(
'get',
$url,
$this->_retrieveOptions,
$this->_opts->headers
);
$this->setLastResponse($response);
$this->refreshFrom($response->json, $this->_opts);
return $this;
}
/**
* @return string The base URL for the given class.
*/
public static function baseUrl()
{
return Stripe::$apiBase;
}
/**
* @return string The endpoint URL for the given class.
*/
public static function classUrl()
{
// Replace dots with slashes for namespaced resources, e.g. if the object's name is
// "foo.bar", then its URL will be "/v1/foo/bars".
$base = str_replace('.', '/', static::OBJECT_NAME);
return "/v1/${base}s";
}
/**
* @return string The instance endpoint URL for the given class.
*/
public static function resourceUrl($id)
{
if ($id === null) {
$class = get_called_class();
$message = "Could not determine which URL to request: "
. "$class instance has invalid ID: $id";
throw new Error\InvalidRequest($message, null);
}
$id = Util\Util::utf8($id);
$base = static::classUrl();
$extn = urlencode($id);
return "$base/$extn";
}
/**
* @return string The full API URL for this API resource.
*/
public function instanceUrl()
{
return static::resourceUrl($this['id']);
}
}
<?php
namespace Stripe;
/**
* Class ApiResponse
*
* @package Stripe
*/
class ApiResponse
{
public $headers;
public $body;
public $json;
public $code;
/**
* @param string $body
* @param integer $code
* @param array|null $headers
* @param array|null $json
*
* @return obj An APIResponse
*/
public function __construct($body, $code, $headers, $json)
{
$this->body = $body;
$this->code = $code;
$this->headers = $headers;
$this->json = $json;
}
}
<?php
namespace Stripe;
/**
* Class ApplePayDomain
*
* @package Stripe
*/
class ApplePayDomain extends ApiResource
{
const OBJECT_NAME = "apple_pay_domain";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return '/v1/apple_pay/domains';
}
}
<?php
namespace Stripe;
/**
* Class ApplicationFee
*
* @property string $id
* @property string $object
* @property string $account
* @property int $amount
* @property int $amount_refunded
* @property string $application
* @property string $balance_transaction
* @property string $charge
* @property int $created
* @property string $currency
* @property bool $livemode
* @property string $originating_transaction
* @property bool $refunded
* @property Collection $refunds
*
* @package Stripe
*/
class ApplicationFee extends ApiResource
{
const OBJECT_NAME = "application_fee";
use ApiOperations\All;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
const PATH_REFUNDS = '/refunds';
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return ApplicationFee The refunded application fee.
*/
public function refund($params = null, $opts = null)
{
$this->refunds->create($params, $opts);
$this->refresh();
return $this;
}
/**
* @param string|null $id The ID of the application fee on which to create the refund.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApplicationFeeRefund
*/
public static function createRefund($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee to which the refund belongs.
* @param array|null $refundId The ID of the refund to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApplicationFeeRefund
*/
public static function retrieveRefund($id, $refundId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee to which the refund belongs.
* @param array|null $refundId The ID of the refund to update.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApplicationFeeRefund
*/
public static function updateRefund($id, $refundId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts);
}
/**
* @param string|null $id The ID of the application fee on which to retrieve the refunds.
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection The list of refunds.
*/
public static function allRefunds($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts);
}
}
<?php
namespace Stripe;
/**
* Class ApplicationFeeRefund
*
* @property string $id
* @property string $object
* @property int $amount
* @property string $balance_transaction
* @property int $created
* @property string $currency
* @property string $fee
* @property StripeObject $metadata
*
* @package Stripe
*/
class ApplicationFeeRefund extends ApiResource
{
const OBJECT_NAME = "fee_refund";
use ApiOperations\Update {
save as protected _save;
}
/**
* @return string The API URL for this Stripe refund.
*/
public function instanceUrl()
{
$id = $this['id'];
$fee = $this['fee'];
if (!$id) {
throw new Error\InvalidRequest(
"Could not determine which URL to request: " .
"class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$fee = Util\Util::utf8($fee);
$base = ApplicationFee::classUrl();
$feeExtn = urlencode($fee);
$extn = urlencode($id);
return "$base/$feeExtn/refunds/$extn";
}
/**
* @param array|string|null $opts
*
* @return ApplicationFeeRefund The saved refund.
*/
public function save($opts = null)
{
return $this->_save($opts);
}
}
<?php
namespace Stripe;
/**
* Class Balance
*
* @property string $object
* @property array $available
* @property array $connect_reserved
* @property bool $livemode
* @property array $pending
*
* @package Stripe
*/
class Balance extends SingletonApiResource
{
const OBJECT_NAME = "balance";
/**
* @param array|string|null $opts
*
* @return Balance
*/
public static function retrieve($opts = null)
{
return self::_singletonRetrieve($opts);
}
}
<?php
namespace Stripe;
/**
* Class BalanceTransaction
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $available_on
* @property int $created
* @property string $currency
* @property string $description
* @property float $exchange_rate
* @property int $fee
* @property mixed $fee_details
* @property int $net
* @property string $source
* @property string $status
* @property string $type
*
* @package Stripe
*/
class BalanceTransaction extends ApiResource
{
const OBJECT_NAME = "balance_transaction";
use ApiOperations\All;
use ApiOperations\Retrieve;
/**
* Possible string representations of the type of balance transaction.
* @link https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-type
*/
const TYPE_ADJUSTMENT = 'adjustment';
const TYPE_ADVANCE = 'advance';
const TYPE_ADVANCE_FUNDING = 'advance_funding';
const TYPE_APPLICATION_FEE = 'application_fee';
const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
const TYPE_CHARGE = 'charge';
const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
const TYPE_ISSUING_TRANSACTION = 'issuing_transaction';
const TYPE_PAYMENT = 'payment';
const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund';
const TYPE_PAYMENT_REFUND = 'payment_refund';
const TYPE_PAYOUT = 'payout';
const TYPE_PAYOUT_CANCEL = 'payout_cancel';
const TYPE_PAYOUT_FAILURE = 'payout_failure';
const TYPE_REFUND = 'refund';
const TYPE_REFUND_FAILURE = 'refund_failure';
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
const TYPE_RESERVED_FUNDS = 'reserved_funds';
const TYPE_STRIPE_FEE = 'stripe_fee';
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
const TYPE_TAX_FEE = 'tax_fee';
const TYPE_TOPUP = 'topup';
const TYPE_TOPUP_REVERSAL = 'topup_reversal';
const TYPE_TRANSFER = 'transfer';
const TYPE_TRANSFER_CANCEL = 'transfer_cancel';
const TYPE_TRANSFER_FAILURE = 'transfer_failure';
const TYPE_TRANSFER_REFUND = 'transfer_refund';
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return "/v1/balance/history";
}
}
<?php
namespace Stripe;
/**
* Class BankAccount
*
* @property string $id
* @property string $object
* @property string $account
* @property string $account_holder_name
* @property string $account_holder_type
* @property string $bank_name
* @property string $country
* @property string $currency
* @property string $customer
* @property bool $default_for_currency
* @property string $fingerprint
* @property string $last4
* @property StripeObject $metadata
* @property string $routing_number
* @property string $status
*
* @package Stripe
*/
class BankAccount extends ApiResource
{
const OBJECT_NAME = "bank_account";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* Possible string representations of the bank verification status.
* @link https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status
*/
const STATUS_NEW = 'new';
const STATUS_VALIDATED = 'validated';
const STATUS_VERIFIED = 'verified';
const STATUS_VERIFICATION_FAILED = 'verification_failed';
const STATUS_ERRORED = 'errored';
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
} elseif ($this['account']) {
$base = Account::classUrl();
$parent = $this['account'];
$path = 'external_accounts';
} else {
$msg = "Bank accounts cannot be accessed without a customer ID or account ID.";
throw new Error\InvalidRequest($msg, null);
}
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Bank accounts cannot be accessed without a customer ID or account ID. " .
"Retrieve a bank account using \$customer->sources->retrieve('bank_account_id') or " .
"\$account->external_accounts->retrieve('bank_account_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Bank accounts cannot be accessed without a customer ID or account ID. " .
"Call save() on \$customer->sources->retrieve('bank_account_id') or " .
"\$account->external_accounts->retrieve('bank_account_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @return BankAccount The verified bank account.
*/
public function verify($params = null, $options = null)
{
$url = $this->instanceUrl() . '/verify';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
}
<?php
namespace Stripe;
/**
* Class BitcoinReceiver
*
* @package Stripe
*
* @deprecated Bitcoin receivers are deprecated. Please use the sources API instead.
* @link https://stripe.com/docs/sources/bitcoin
*/
class BitcoinReceiver extends ApiResource
{
const OBJECT_NAME = "bitcoin_receiver";
use ApiOperations\All;
use ApiOperations\Retrieve;
/**
* @return string The class URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public static function classUrl()
{
return "/v1/bitcoin/receivers";
}
/**
* @return string The instance URL for this resource. It needs to be special
* cased because it doesn't fit into the standard resource pattern.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
} else {
$base = BitcoinReceiver::classUrl();
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$extn";
}
}
}
<?php
namespace Stripe;
/**
* Class BitcoinTransaction
*
* @package Stripe
*/
class BitcoinTransaction extends ApiResource
{
const OBJECT_NAME = "bitcoin_transaction";
}
<?php
namespace Stripe;
/**
* Class Capability
*
* @package Stripe
*
* @property string $id
* @property string $object
* @property string $account
* @property bool $requested
* @property int $requested_at
* @property mixed $requirements
* @property string $status
*/
class Capability extends ApiResource
{
const OBJECT_NAME = "capability";
use ApiOperations\Update;
/**
* Possible string representations of a capability's status.
* @link https://stripe.com/docs/api/capabilities/object#capability_object-status
*/
const STATUS_ACTIVE = 'active';
const STATUS_INACTIVE = 'inactive';
const STATUS_PENDING = 'pending';
const STATUS_UNREQUESTED = 'unrequested';
/**
* @return string The API URL for this Stripe account reversal.
*/
public function instanceUrl()
{
$id = $this['id'];
$account = $this['account'];
if (!$id) {
throw new Error\InvalidRequest(
"Could not determine which URL to request: " .
"class instance has invalid ID: $id",
null
);
}
$id = Util\Util::utf8($id);
$account = Util\Util::utf8($account);
$base = Account::classUrl();
$accountExtn = urlencode($account);
$extn = urlencode($id);
return "$base/$accountExtn/capabilities/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Capabilities cannot be accessed without an account ID. " .
"Retrieve a Capability using \$account->retrieveCapability('acap_123') instead.";
throw new Error\InvalidRequest($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Capabilities cannot be accessed without an account ID. " .
"Update a Capability using \$account->updateCapability('acap_123') instead.";
throw new Error\InvalidRequest($msg, null);
}
}
<?php
namespace Stripe;
/**
* Class Card
*
* @property string $id
* @property string $object
* @property string $account
* @property string $address_city
* @property string $address_country
* @property string $address_line1
* @property string $address_line1_check
* @property string $address_line2
* @property string $address_state
* @property string $address_zip
* @property string $address_zip_check
* @property string[] $available_payout_methods
* @property string $brand
* @property string $country
* @property string $currency
* @property string $customer
* @property string $cvc_check
* @property bool $default_for_currency
* @property string $dynamic_last4
* @property int $exp_month
* @property int $exp_year
* @property string $fingerprint
* @property string $funding
* @property string $last4
* @property StripeObject $metadata
* @property string $name
* @property string $recipient
* @property string $tokenization_method
*
* @package Stripe
*/
class Card extends ApiResource
{
const OBJECT_NAME = "card";
use ApiOperations\Delete;
use ApiOperations\Update;
/**
* Possible string representations of the CVC check status.
* @link https://stripe.com/docs/api/cards/object#card_object-cvc_check
*/
const CVC_CHECK_FAIL = 'fail';
const CVC_CHECK_PASS = 'pass';
const CVC_CHECK_UNAVAILABLE = 'unavailable';
const CVC_CHECK_UNCHECKED = 'unchecked';
/**
* Possible string representations of the funding of the card.
* @link https://stripe.com/docs/api/cards/object#card_object-funding
*/
const FUNDING_CREDIT = 'credit';
const FUNDING_DEBIT = 'debit';
const FUNDING_PREPAID = 'prepaid';
const FUNDING_UNKNOWN = 'unknown';
/**
* Possible string representations of the tokenization method when using Apple Pay or Google Pay.
* @link https://stripe.com/docs/api/cards/object#card_object-tokenization_method
*/
const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay';
const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay';
/**
* @return string The instance URL for this resource. It needs to be special
* cased because cards are nested resources that may belong to different
* top-level resources.
*/
public function instanceUrl()
{
if ($this['customer']) {
$base = Customer::classUrl();
$parent = $this['customer'];
$path = 'sources';
} elseif ($this['account']) {
$base = Account::classUrl();
$parent = $this['account'];
$path = 'external_accounts';
} elseif ($this['recipient']) {
$base = Recipient::classUrl();
$parent = $this['recipient'];
$path = 'cards';
} else {
$msg = "Cards cannot be accessed without a customer ID, account ID or recipient ID.";
throw new Error\InvalidRequest($msg, null);
}
$parentExtn = urlencode(Util\Util::utf8($parent));
$extn = urlencode(Util\Util::utf8($this['id']));
return "$base/$parentExtn/$path/$extn";
}
/**
* @param array|string $_id
* @param array|string|null $_opts
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function retrieve($_id, $_opts = null)
{
$msg = "Cards cannot be accessed without a customer, recipient or account ID. " .
"Retrieve a card using \$customer->sources->retrieve('card_id'), " .
"\$recipient->cards->retrieve('card_id'), or " .
"\$account->external_accounts->retrieve('card_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
/**
* @param string $_id
* @param array|null $_params
* @param array|string|null $_options
*
* @throws \Stripe\Error\InvalidRequest
*/
public static function update($_id, $_params = null, $_options = null)
{
$msg = "Cards cannot be accessed without a customer, recipient or account ID. " .
"Call save() on \$customer->sources->retrieve('card_id'), " .
"\$recipient->cards->retrieve('card_id'), or " .
"\$account->external_accounts->retrieve('card_id') instead.";
throw new Error\InvalidRequest($msg, null);
}
}
<?php
namespace Stripe;
/**
* Class Charge
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $amount_refunded
* @property string $application
* @property string $application_fee
* @property int $application_fee_amount
* @property string $balance_transaction
* @property mixed $billing_details
* @property bool $captured
* @property int $created
* @property string $currency
* @property string $customer
* @property string $description
* @property string $destination
* @property string $dispute
* @property string $failure_code
* @property string $failure_message
* @property mixed $fraud_details
* @property string $invoice
* @property bool $livemode
* @property StripeObject $metadata
* @property string $on_behalf_of
* @property string $order
* @property mixed $outcome
* @property bool $paid
* @property string $payment_intent
* @property string $payment_method
* @property mixed $payment_method_details
* @property string $receipt_email
* @property string $receipt_number
* @property string $receipt_url
* @property bool $refunded
* @property Collection $refunds
* @property string $review
* @property mixed $shipping
* @property mixed $source
* @property string $source_transfer
* @property string $statement_descriptor
* @property string $status
* @property string $transfer
* @property mixed $transfer_data
* @property string $transfer_group
*
* @package Stripe
*/
class Charge extends ApiResource
{
const OBJECT_NAME = "charge";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of decline codes.
* These strings are applicable to the decline_code property of the \Stripe\Error\Card exception.
* @link https://stripe.com/docs/declines/codes
*/
const DECLINED_APPROVE_WITH_ID = 'approve_with_id';
const DECLINED_CALL_ISSUER = 'call_issuer';
const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported';
const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded';
const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported';
const DECLINED_DO_NOT_HONOR = 'do_not_honor';
const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again';
const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction';
const DECLINED_EXPIRED_CARD = 'expired_card';
const DECLINED_FRAUDULENT = 'fraudulent';
const DECLINED_GENERIC_DECLINE = 'generic_decline';
const DECLINED_INCORRECT_NUMBER = 'incorrect_number';
const DECLINED_INCORRECT_CVC = 'incorrect_cvc';
const DECLINED_INCORRECT_PIN = 'incorrect_pin';
const DECLINED_INCORRECT_ZIP = 'incorrect_zip';
const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds';
const DECLINED_INVALID_ACCOUNT = 'invalid_account';
const DECLINED_INVALID_AMOUNT = 'invalid_amount';
const DECLINED_INVALID_CVC = 'invalid_cvc';
const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
const DECLINED_INVALID_NUMBER = 'invalid_number';
const DECLINED_INVALID_PIN = 'invalid_pin';
const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available';
const DECLINED_LOST_CARD = 'lost_card';
const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist';
const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available';
const DECLINED_NO_ACTION_TAKEN = 'no_action_taken';
const DECLINED_NOT_PERMITTED = 'not_permitted';
const DECLINED_PICKUP_CARD = 'pickup_card';
const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded';
const DECLINED_PROCESSING_ERROR = 'processing_error';
const DECLINED_REENTER_TRANSACTION = 'reenter_transaction';
const DECLINED_RESTRICTED_CARD = 'restricted_card';
const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations';
const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization';
const DECLINED_SECURITY_VIOLATION = 'security_violation';
const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed';
const DECLINED_STOLEN_CARD = 'stolen_card';
const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order';
const DECLINED_TESTMODE_DECLINE = 'testmode_decline';
const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed';
const DECLINED_TRY_AGAIN_LATER = 'try_again_later';
const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded';
/**
* Possible string representations of the status of the charge.
* @link https://stripe.com/docs/api/charges/object#charge_object-status
*/
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
/**
* @param array|null $params
* @param array|string|null $options
*
* @return Charge The refunded charge.
*/
public function refund($params = null, $options = null)
{
$url = $this->instanceUrl() . '/refund';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @return Charge The captured charge.
*/
public function capture($params = null, $options = null)
{
$url = $this->instanceUrl() . '/capture';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|null $params
* @param array|string|null $options
*
* @deprecated Use the `save` method on the Dispute object
*
* @return array The updated dispute.
*/
public function updateDispute($params = null, $options = null)
{
$url = $this->instanceUrl() . '/dispute';
list($response, $opts) = $this->_request('post', $url, $params, $options);
$this->refreshFrom(['dispute' => $response], $opts, true);
return $this->dispute;
}
/**
* @param array|string|null $options
*
* @deprecated Use the `close` method on the Dispute object
*
* @return Charge The updated charge.
*/
public function closeDispute($options = null)
{
$url = $this->instanceUrl() . '/dispute/close';
list($response, $opts) = $this->_request('post', $url, null, $options);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|string|null $opts
*
* @return Charge The updated charge.
*/
public function markAsFraudulent($opts = null)
{
$params = ['fraud_details' => ['user_report' => 'fraudulent']];
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param array|string|null $opts
*
* @return Charge The updated charge.
*/
public function markAsSafe($opts = null)
{
$params = ['fraud_details' => ['user_report' => 'safe']];
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}
<?php
namespace Stripe\Checkout;
/**
* Class Session
*
* @property string $id
* @property string $object
* @property string $cancel_url
* @property string $client_reference_id
* @property string $customer
* @property string $customer_email
* @property mixed $display_items
* @property bool $livemode
* @property string $payment_intent
* @property string[] $payment_method_types
* @property string $subscription
* @property string $success_url
*
* @package Stripe
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = "checkout.session";
use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;
}
<?php
namespace Stripe;
/**
* Class Collection
*
* @property string $object
* @property string $url
* @property bool $has_more
* @property mixed $data
*
* @package Stripe
*/
class Collection extends StripeObject implements \IteratorAggregate
{
const OBJECT_NAME = "list";
use ApiOperations\Request;
protected $_requestParams = [];
/**
* @return string The base URL for the given class.
*/
public static function baseUrl()
{
return Stripe::$apiBase;
}
public function setRequestParams($params)
{
$this->_requestParams = $params;
}
public function all($params = null, $opts = null)
{
list($url, $params) = $this->extractPathAndUpdateParams($params);
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$this->_requestParams = $params;
return Util\Util::convertToStripeObject($response, $opts);
}
public function create($params = null, $opts = null)
{
list($url, $params) = $this->extractPathAndUpdateParams($params);
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->_requestParams = $params;
return Util\Util::convertToStripeObject($response, $opts);
}
public function retrieve($id, $params = null, $opts = null)
{
list($url, $params) = $this->extractPathAndUpdateParams($params);
$id = Util\Util::utf8($id);
$extn = urlencode($id);
list($response, $opts) = $this->_request(
'get',
"$url/$extn",
$params,
$opts
);
$this->_requestParams = $params;
return Util\Util::convertToStripeObject($response, $opts);
}
/**
* @return \ArrayIterator An iterator that can be used to iterate
* across objects in the current page.
*/
public function getIterator()
{
return new \ArrayIterator($this->data);
}
/**
* @return Util\AutoPagingIterator An iterator that can be used to iterate
* across all objects across all pages. As page boundaries are
* encountered, the next page will be fetched automatically for
* continued iteration.
*/
public function autoPagingIterator()
{
return new Util\AutoPagingIterator($this, $this->_requestParams);
}
private function extractPathAndUpdateParams($params)
{
$url = parse_url($this->url);
if (!isset($url['path'])) {
throw new Error\Api("Could not parse list url into parts: $url");
}
if (isset($url['query'])) {
// If the URL contains a query param, parse it out into $params so they
// don't interact weirdly with each other.
$query = [];
parse_str($url['query'], $query);
$params = array_merge($params ?: [], $query);
}
return [$url['path'], $params];
}
}
<?php
namespace Stripe;
/**
* Class CountrySpec
*
* @property string $id
* @property string $object
* @property string $default_currency
* @property mixed $supported_bank_account_currencies
* @property string[] $supported_payment_currencies
* @property string[] $supported_payment_methods
* @property string[] $supported_transfer_countries
* @property mixed $verification_fields
*
* @package Stripe
*/
class CountrySpec extends ApiResource
{
const OBJECT_NAME = "country_spec";
use ApiOperations\All;
use ApiOperations\Retrieve;
}
<?php
namespace Stripe;
/**
* Class Coupon
*
* @property string $id
* @property string $object
* @property int $amount_off
* @property int $created
* @property string $currency
* @property string $duration
* @property int $duration_in_months
* @property bool $livemode
* @property int $max_redemptions
* @property StripeObject $metadata
* @property string $name
* @property float $percent_off
* @property int $redeem_by
* @property int $times_redeemed
* @property bool $valid
*
* @package Stripe
*/
class Coupon extends ApiResource
{
const OBJECT_NAME = "coupon";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}
<?php
namespace Stripe;
/**
* Class CreditNote
*
* @property string $id
* @property string $object
* @property int $amount
* @property int $created
* @property string $currency
* @property string $customer
* @property string $invoice
* @property bool $livemode
* @property string $memo
* @property StripeObject $metadata
* @property string $number
* @property string $pdf
* @property string $reason
* @property string $refund
* @property string $status
* @property string $type
*
* @package Stripe
*/
class CreditNote extends ApiResource
{
const OBJECT_NAME = "credit_note";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the credit note reason.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-reason
*/
const REASON_DUPLICATE = 'duplicate';
const REASON_FRAUDULENT = 'fraudulent';
const REASON_ORDER_CHANGE = 'order_change';
const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory';
/**
* Possible string representations of the credit note status.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
*/
const STATUS_ISSUED = 'issued';
const STATUS_VOID = 'void';
/**
* Possible string representations of the credit note type.
* @link https://stripe.com/docs/api/credit_notes/object#credit_note_object-status
*/
const TYPE_POST_PAYMENT = 'post_payment';
const TYPE_PRE_PAYMENT = 'pre_payment';
/**
* @param array|null $params
* @param array|string|null $opts
*
* @return CreditNote The voided credit note.
*/
public function voidCreditNote($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/void';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}
<?php
namespace Stripe;
/**
* Class Customer
*
* @property string $id
* @property string $object
* @property int $account_balance
* @property mixed $address
* @property string $created
* @property string $currency
* @property string $default_source
* @property bool $delinquent
* @property string $description
* @property Discount $discount
* @property string $email
* @property string $invoice_prefix
* @property mixed $invoice_settings
* @property bool $livemode
* @property StripeObject $metadata
* @property string $name
* @property string $phone
* @property string[] preferred_locales
* @property mixed $shipping
* @property Collection $sources
* @property Collection $subscriptions
* @property string $tax_exempt
* @property Collection $tax_ids
*
* @package Stripe
*/
class Customer extends ApiResource
{
const OBJECT_NAME = "customer";
use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Delete;
use ApiOperations\NestedResource;
use ApiOperations\Retrieve;
use ApiOperations\Update;
/**
* Possible string representations of the customer's type of tax exemption.
* @link https://stripe.com/docs/api/customers/object#customer_object-tax_exempt
*/
const TAX_EXEMPT_NONE = 'none';
const TAX_EXEMPT_EXEMPT = 'exempt';
const TAX_EXEMPT_REVERSE = 'reverse';
public static function getSavedNestedResources()
{
static $savedNestedResources = null;
if ($savedNestedResources === null) {
$savedNestedResources = new Util\Set([
'source',
]);
}
return $savedNestedResources;
}
const PATH_SOURCES = '/sources';
const PATH_TAX_IDS = '/tax_ids';
/**
* @param array|null $params
*
* @return InvoiceItem The resulting invoice item.
*/
public function addInvoiceItem($params = null)
{
$params = $params ?: [];
$params['customer'] = $this->id;
$ii = InvoiceItem::create($params, $this->_opts);
return $ii;
}
/**
* @param array|null $params
*
* @return array An array of the customer's Invoices.
*/
public function invoices($params = null)
{
$params = $params ?: [];
$params['customer'] = $this->id;
$invoices = Invoice::all($params, $this->_opts);
return $invoices;
}
/**
* @param array|null $params
*
* @return array An array of the customer's InvoiceItems.
*/
public function invoiceItems($params = null)
{
$params = $params ?: [];
$params['customer'] = $this->id;
$iis = InvoiceItem::all($params, $this->_opts);
return $iis;
}
/**
* @param array|null $params
*
* @return array An array of the customer's Charges.
*/
public function charges($params = null)
{
$params = $params ?: [];
$params['customer'] = $this->id;
$charges = Charge::all($params, $this->_opts);
return $charges;
}
/**
* @param array|null $params
*
* @return Subscription The updated subscription.
*/
public function updateSubscription($params = null)
{
$url = $this->instanceUrl() . '/subscription';
list($response, $opts) = $this->_request('post', $url, $params);
$this->refreshFrom(['subscription' => $response], $opts, true);
return $this->subscription;
}
/**
* @param array|null $params
*
* @return Subscription The cancelled subscription.
*/
public function cancelSubscription($params = null)
{
$url = $this->instanceUrl() . '/subscription';
list($response, $opts) = $this->_request('delete', $url, $params);
$this->refreshFrom(['subscription' => $response], $opts, true);
return $this->subscription;
}
/**
* @return Customer The updated customer.
*/
public function deleteDiscount()
{
$url = $this->instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url);
$this->refreshFrom(['discount' => null], $opts, true);
}
/**
* @param string|null $id The ID of the customer on which to create the source.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function createSource($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function retrieveSource($id, $sourceId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to update.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function updateSource($id, $sourceId, $params = null, $opts = null)
{
return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the source belongs.
* @param string|null $sourceId The ID of the source to delete.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function deleteSource($id, $sourceId, $params = null, $opts = null)
{
return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to retrieve the sources.
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection The list of sources.
*/
public static function allSources($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to create the tax id.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function createTaxId($id, $params = null, $opts = null)
{
return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the tax id belongs.
* @param string|null $taxIdId The ID of the tax id to retrieve.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null)
{
return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer to which the tax id belongs.
* @param string|null $taxIdId The ID of the tax id to delete.
* @param array|null $params
* @param array|string|null $opts
*
* @return ApiResource
*/
public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null)
{
return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts);
}
/**
* @param string|null $id The ID of the customer on which to retrieve the tax ids.
* @param array|null $params
* @param array|string|null $opts
*
* @return Collection The list of tax ids.
*/
public static function allTaxIds($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment