Initial Commit

This commit is contained in:
2019-11-21 12:25:31 +01:00
commit f4aabcb9b1
13959 changed files with 787761 additions and 0 deletions

View File

@@ -0,0 +1 @@
Deny from all

View File

@@ -0,0 +1 @@
Deny from all

View File

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

View File

@@ -0,0 +1,116 @@
<?php if ( ! defined('BASEPATH')) 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. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
$autoload['libraries'] = array('database', 'data');
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url', 'language', 'option', 'trace', 'general', 'images', 'filesystem', 'update', 'form', 'plugin');
/*
| -------------------------------------------------------------------
| 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('revslider', 'language');
/*
| -------------------------------------------------------------------
| 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('model1', 'model2');
|
*/
$autoload['model'] = array();
/* End of file autoload.php */
/* Location: ./application/config/autoload.php */

View File

@@ -0,0 +1,366 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = '[BASE_URL]';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'RS_';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
if (defined('RS_CI_LOGS')) {
$config['log_threshold'] = RS_CI_LOGS;
}
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = '[ENCRYPTION_KEY]';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_cookie_name' = the name you want for the cookie
| 'sess_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'sess_expire_on_close' = Whether to cause the session to expire automatically
| when the browser window is closed
| 'sess_encrypt_cookie' = Whether to encrypt the cookie
| 'sess_use_database' = Whether to save the session data to a database
| 'sess_table_name' = The name of the session database table
| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'revslider_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = TRUE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_rs_token';
$config['csrf_cookie_name'] = 'csrf_rs_cookie';
$config['csrf_expire'] = 7200;
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or 'gmt'. This pref tells the system whether to use
| your server's local time as the master 'now' reference, or convert it to
| GMT. See the 'date helper' page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = '';
/* End of file config.php */
/* Location: ./application/config/config.php */

View File

@@ -0,0 +1,366 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = 'https://www.light-domotique.fr/revslider/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'RS_';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = TRUE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
if (defined('RS_CI_LOGS')) {
$config['log_threshold'] = RS_CI_LOGS;
}
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = 'c4351ff8f0ff90986ba2e316016d3dabce6a3ea2dba28aa66d1893ff650a6b6b3381f618312cf1ad8f6acadf1aae52c599f605425708b20a0f12a9b891aa54e460ce8c2168ff1d6b90c9a6f7f972d458d6bc3cac28d1dcebbe1535ef83330015fca7fc24d03f5b521afd3a10ca5ce6d5e84aa0a9b861cac9f732a1d7122dd913';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_cookie_name' = the name you want for the cookie
| 'sess_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'sess_expire_on_close' = Whether to cause the session to expire automatically
| when the browser window is closed
| 'sess_encrypt_cookie' = Whether to encrypt the cookie
| 'sess_use_database' = Whether to save the session data to a database
| 'sess_table_name' = The name of the session database table
| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'revslider_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = TRUE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_rs_token';
$config['csrf_cookie_name'] = 'csrf_rs_cookie';
$config['csrf_expire'] = 7200;
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or 'gmt'. This pref tells the system whether to use
| your server's local time as the master 'now' reference, or convert it to
| GMT. See the 'date helper' page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = '';
/* End of file config.php */
/* Location: ./application/config/config.php */

View File

@@ -0,0 +1,58 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| 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.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/**
* Revslider related constants
*/
define('ABSPATH', APPPATH . 'libraries' . DIRECTORY_SEPARATOR);
define('RS_PLUGIN_PATH', FCPATH . 'revslider/');
define('RS_PLUGIN_FILE_PATH', FCPATH . 'revslider/');
define('WP_PLUGIN_DIR', 'plugins/');
define('RS_IMAGE_PATH_COMMON', 'media');
define('RS_THUMB_FOLDER', 'thumb');
define('ARRAY_A', 'ARRAY_A');
define('WPINC', 'WPINC');
/* End of file constants.php */
/* Location: ./application/config/constants.php */

View File

@@ -0,0 +1,69 @@
<?php if ( ! defined('BASEPATH')) 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
| -------------------------------------------------------------------
|
| ['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 type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record 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
| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = '[DB_HOSTNAME]';
$db['default']['username'] = '[DB_USERNAME]';
$db['default']['password'] = '[DB_PASSWORD]';
$db['default']['database'] = '[DB_NAME]';
$db['default']['dbdriver'] = '[DB_DRIVER]';
$db['default']['dbprefix'] = '[DB_PREFIX]';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */

View File

@@ -0,0 +1,69 @@
<?php if ( ! defined('BASEPATH')) 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
| -------------------------------------------------------------------
|
| ['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 type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record 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
| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'beaheadfwhsofian';
$db['default']['password'] = 'Cerbonnus34';
$db['default']['database'] = 'beaheadfwhsofian';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'revslider_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */

View File

@@ -0,0 +1,69 @@
<?php if ( ! defined('BASEPATH')) 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
| -------------------------------------------------------------------
|
| ['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 type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record 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
| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'protabac_dev';
$db['default']['password'] = 'qsjNo_MU3';
$db['default']['database'] = 'protabac_dev';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'revslider_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */

View File

@@ -0,0 +1,15 @@
<?php if ( ! defined('BASEPATH')) 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">',
'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">'
);
/* End of file doctypes.php */
/* Location: ./application/config/doctypes.php */

View File

@@ -0,0 +1,64 @@
<?php if ( ! defined('BASEPATH')) 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',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'D',
'/ð|ď|đ/' => 'd',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř/' => 'R',
'/ŕ|ŗ|ř/' => 'r',
'/Ś|Ŝ|Ş|Š/' => 'S',
'/ś|ŝ|ş|š|ſ/' => 's',
'/Ţ|Ť|Ŧ/' => 'T',
'/ţ|ť|ŧ/' => 't',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
'/Ý|Ÿ|Ŷ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
);
/* End of file foreign_chars.php */
/* Location: ./application/config/foreign_chars.php */

View File

@@ -0,0 +1,21 @@
<?php if ( ! defined('BASEPATH')) 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:
|
| http://codeigniter.com/user_guide/general/hooks.html
|
*/
$hook['post_controller_constructor'][] = array(
'class' => 'Https',
'function' => 'trigger_https',
'filename' => 'https.php',
'filepath' => 'hooks'
);
/* End of file hooks.php */
/* Location: ./application/config/hooks.php */

View File

@@ -0,0 +1,7 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
//For view all the languages go to the folder ./assets/image_crud/languages/
$config['image_crud_default_language'] = 'english';
/* End of file image_crud.php */
/* Location: ./application/config/image_crud.php */

View File

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

View File

@@ -0,0 +1,116 @@
<?php if ( ! defined('BASEPATH')) 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. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
$autoload['libraries'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url', 'language', 'option', 'general', 'images');
/*
| -------------------------------------------------------------------
| 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('revslider', 'language');
/*
| -------------------------------------------------------------------
| 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('model1', 'model2');
|
*/
$autoload['model'] = array();
/* End of file autoload.php */
/* Location: ./application/config/autoload.php */

View File

@@ -0,0 +1,362 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/
$config['base_url'] = '';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO' Default - auto detects
| 'PATH_INFO' Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI' Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'RS_';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd'; // experimental not currently in use
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Session class you
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = 'OVU#yTybEQE#e4uviJYZU6ObIviQyFIW';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_cookie_name' = the name you want for the cookie
| 'sess_expiration' = the number of SECONDS you want the session to last.
| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
| 'sess_expire_on_close' = Whether to cause the session to expire automatically
| when the browser window is closed
| 'sess_encrypt_cookie' = Whether to encrypt the cookie
| 'sess_use_database' = Whether to save the session data to a database
| 'sess_table_name' = The name of the session database table
| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
|
*/
$config['sess_cookie_name'] = 'rs_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'rs_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
|
*/
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = TRUE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
*/
$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_rs_token';
$config['csrf_cookie_name'] = 'csrf_rs_cookie';
$config['csrf_expire'] = 7200;
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or 'gmt'. This pref tells the system whether to use
| your server's local time as the master 'now' reference, or convert it to
| GMT. See the 'date helper' page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = '';
/* End of file config.php */
/* Location: ./application/config/config.php */

View File

@@ -0,0 +1,69 @@
<?php if ( ! defined('BASEPATH')) 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
| -------------------------------------------------------------------
|
| ['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 type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record 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
| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
*/
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'revslider_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */

View File

@@ -0,0 +1,54 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| IONIZE LANGUAGES
| -------------------------------------------------------------------
| Contains the available languages definitions for the front-end.
| Auto-generated by Ionizes Language administration.
| Changes made in this file will be overwritten by languages save in Ionize.
|
|
*/
// Default admin language code
$config['default_admin_lang'] = 'en';
// Default language code
// This code depends on the language defined through the Ionize admin panel
// and will never change during the request process
$config['default_lang_code'] = 'en_US';
// Default Translation Language Code
$config['default_translation_lang_code'] = 'en';
// Used language code
// Dynamically changed by the Router depending on the browser, cookie or asked URL
// By default, Ionize set it to the default lang code.
$config['detected_lang_code'] = 'en';
// Available languages
// Languages set through Ionize. Includes offline languages
$config['available_languages'] = array(
'de_DE' => 'German',
'en_US' => 'English',
'fr_FR' => 'French',
'hu_HU' => 'Hungarian',
'it_IT' => 'Italian',
'pl_PL' => 'Polish',
'pt_BR' => 'Portuguese',
'ru_RU' => 'Russian',
'zh_CN' => 'Chinese'
);
// Online languages
// Languages set online through Ionize.
$config['online_languages'] = array(
'en' => 'English'
);
/* End of file language.php */
/* Auto generated by Language Administration on : 2012.08.23 13:02:39 */
/* Location: ./application/config/language.php */

View File

@@ -0,0 +1,41 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->latest() 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/';
/* End of file migration.php */
/* Location: ./application/config/migration.php */

View File

@@ -0,0 +1,106 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
$mimes = array( 'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),
'class' => 'application/octet-stream',
'psd' => 'application/x-photoshop',
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/x-download'),
'ai' => 'application/postscript',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),
'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'),
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => 'application/x-javascript',
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'),
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
'bmp' => array('image/bmp', 'image/x-windows-bmp'),
'gif' => 'image/gif',
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => 'text/css',
'html' => 'text/html',
'htm' => 'text/html',
'shtml' => 'text/html',
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => array('text/plain', 'text/x-log'),
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => 'text/xml',
'xsl' => 'text/xml',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => array('application/json', 'text/json')
);
/* End of file mimes.php */
/* Location: ./application/config/mimes.php */

View File

@@ -0,0 +1,17 @@
<?php if ( ! defined('BASEPATH')) 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:
|
| http://codeigniter.com/user_guide/general/profiling.html
|
*/
/* End of file profiler.php */
/* Location: ./application/config/profiler.php */

View File

@@ -0,0 +1,15 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Version information
*/
$config['salt_length'] = 8;
$config['rs_image_sizes'] = array(
'gallery' => array('width' => 270, 'height' => 220),
'thumbnail' => array('width' => 150, 'height' => 150),
'medium' => array('width' => 300, 'height' => 200),
'large' => array('width' => 1024, 'height' => 682),
'post-thumbnail' => array('width' => 825, 'height' => 510)
);

View File

@@ -0,0 +1,46 @@
<?php if ( ! defined('BASEPATH')) 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:
|
| http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two 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 what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/
$route['default_controller'] = "admin";
$route['404_override'] = '';
/* End of file routes.php */
/* Location: ./application/config/routes.php */

View File

@@ -0,0 +1,66 @@
<?php if ( ! defined('BASEPATH')) 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 simileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| http://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', 'excaim'),
':question:' => array('question.gif', '19', '19', 'question') // no comma after last item
);
/* End of file smileys.php */
/* Location: ./application/config/smileys.php */

View File

@@ -0,0 +1,178 @@
<?php if ( ! defined('BASEPATH')) 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 6.0' => 'Windows Longhorn',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'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' => 'Unknown Windows OS',
'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'
);
// 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(
'Flock' => 'Flock',
'Chrome' => 'Chrome',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => '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'
);
$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",
'hiptop' => "Danger Hiptop",
'nec-' => "NEC",
'panasonic' => "Panasonic",
'philips' => "Philips",
'sagem' => "Sagem",
'sanyo' => "Sanyo",
'spv' => "SPV",
'zte' => "ZTE",
'sendo' => "Sendo",
// Operating Systems
'symbian' => "Symbian",
'SymbianOS' => "SymbianOS",
'elaine' => "Palm",
'palm' => "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",
// 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',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos'
);
/* End of file user_agents.php */
/* Location: ./application/config/user_agents.php */

View File

@@ -0,0 +1,183 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
class Account extends RS_Controller {
/**
* Constructor
*/
public function __construct() {
parent::__construct();
force_config_ssl();
}
/**
* Index Page for this controller.
*/
public function index() {
$this->login();
}
/**
* Login page
*/
public function login()
{
$data = $this->session->userdata('data');
$data['error'] = $this->session->userdata('error');
$this->session->unset_userdata('error');
if ( !isset($data['username']))
{
$data = array(
'username' => '',
'password' => '',
'error' => '',
);
}
$this->load->view('account/html', array(
'version' => RevSliderGlobals::SLIDER_REVISION,
'view_html' => $this->load->view('account/login', $data, TRUE)
));
}
/**
* Login action
*/
public function login_action()
{
$data = array(
'username' => $this->input->post('username'),
'password' => $this->input->post('password'),
);
if ( !empty($data['username']) && !empty($data['password']) ) {
$this->load->model('user_model', 'user');
$user = $this->user->login($data['username'], $data['password']);
if ( $user ) {
$this->session->set_userdata('user_id', $user['id']);
redirect( 'page=revslider' );
die();
}
}
$this->session->set_userdata('data', $data);
$this->session->set_userdata('error', __('Incorrect login details. Please try again.') );
redirect('c=account&m=login');
die();
}
/**
* Logout action
*/
public function logout_action() {
$this->session->unset_userdata('user_id');
$this->session->set_userdata('error', __('You have been logged out. Bye.') );
redirect( 'c=account&m=login' );
}
/**
* Recover password action
*/
public function recover_password_action() {
$data = array(
'email' => $this->input->post('email')
);
$this->load->model('user_model', 'user');
$user = $this->user->check_email($data['email']);
if ( $user ) {
$this->load->library('SaltCellar');
$token = SaltCellar::getSalt();
$this->load->model('option_model', 'Option');
$tokenData = array(
'id' => $user['id'],
'token' => $token,
'date' => time()
);
$this->Option->update_option('password_reset_token', $tokenData);
$resetUrl = site_url('c=account&m=reset_password&token=' . urlencode($token));
$this->load->library('email');
$this->email->from('mail@' . $this->input->server('server_name'), __('Slider Revolution') );
$this->email->to($user['email']);
$this->email->subject( __('Slider Revolution password recovery service') );
$this->email->message( __('Open this url or copy/paste it to new browser tab to reset your password: ') . $resetUrl);
$this->email->send();
$this->session->set_userdata('error', __('Password reset link been sent to your email.'));
redirect( 'c=account&m=login');
} else {
$this->session->set_userdata('error', __('No user exists with this email. Please try again.') );
redirect( 'c=account&m=recover_password');
}
}
/**
* Recover password page
*/
public function recover_password() {
$data = array(
'email' => '',
'error' => $this->session->userdata('error')
);
$this->session->unset_userdata('error');
$this->load->view('account/html', array(
'version' => RevSliderGlobals::SLIDER_REVISION,
'view_html' => $this->load->view('account/recover_password', $data, TRUE)
));
}
/**
* Reset password action
*/
public function reset_password() {
$this->load->model('option_model', 'Option');
$tokenData = unserialize($this->Option->get_option('password_reset_token'));
if (isset($tokenData['token']) && $tokenData['token'] == $this->input->get('token')) {
$this->load->library('SaltCellar');
$password = SaltCellar::getSalt(8, 16);
$this->load->model('user_model', 'User');
$user = $this->User->get($tokenData['id']);
$user['user_id'] = $user['id'];
$user['password'] = $password;
$user['confirm_password'] = $password;
$this->User->update($user);
$this->load->library('email');
$this->email->from('mail@' . $this->input->server('server_name'), __('Slider Revolution') );
$this->email->to($user['email']);
$this->email->subject( __('Slider Revolution password recovery service') );
$this->email->message( __('Your new password is: ') . $password);
$this->email->send();
$this->Option->update_option('password_reset_token', false);
$this->session->set_userdata('error', __('New password have been sent to your email.'));
} else {
$this->session->set_userdata('error', __('Invalid or expired token used.') );
}
redirect( 'c=account&m=login');
}
}

View File

@@ -0,0 +1,434 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
//include frameword files
require_once(RS_PLUGIN_PATH . 'includes/framework/include-framework.php');
//include bases
require_once($folderIncludes . 'base.class.php');
require_once($folderIncludes . 'elements-base.class.php');
require_once($folderIncludes . 'base-admin.class.php');
require_once($folderIncludes . 'base-front.class.php');
//include product files
require_once(RS_PLUGIN_PATH . 'includes/globals.class.php');
require_once(RS_PLUGIN_PATH . 'includes/operations.class.php');
require_once(RS_PLUGIN_PATH . 'includes/slider.class.php');
require_once(RS_PLUGIN_PATH . 'includes/output.class.php');
require_once(RS_PLUGIN_PATH . 'includes/slide.class.php');
require_once(RS_PLUGIN_PATH . 'includes/navigation.class.php');
require_once(RS_PLUGIN_PATH . 'includes/object-library.class.php');
require_once(RS_PLUGIN_PATH . 'includes/template.class.php');
require_once(RS_PLUGIN_PATH . 'includes/external-sources.class.php');
require_once(RS_PLUGIN_PATH . 'includes/tinybox.class.php');
require_once(RS_PLUGIN_PATH . 'includes/extension.class.php');
//load front part
require_once(RS_PLUGIN_PATH . 'public/revslider-front.class.php');
// load admin part
require_once(RS_PLUGIN_PATH . 'includes/framework/update.class.php');
require_once(RS_PLUGIN_PATH . 'includes/framework/newsletter.class.php');
require_once(RS_PLUGIN_PATH . 'admin/revslider-admin.class.php');
// slider version
$revSliderVersion = RevSliderGlobals::SLIDER_REVISION;
$wp_version = 'NA';
$revslider_screens = array();
$revslider_fonts = array();
class Admin extends RS_Controller {
private $_revSliderAdmin;
/**
* Constructor
*/
public function __construct() {
global $wpdb;
parent::__construct();
force_config_ssl();
$this->load->model('wpdb_model', 'WPDB');
$wpdb = $this->WPDB;
// refresh servers list
$rslb = new RevSliderLoadBalancer();
$rslb->refresh_server_list($this->input->get('rs_refresh_server'));
$this->_revSliderAdmin = new RevSliderAdmin();
add_action('plugins_loaded', array( 'RevSliderFront', 'createDBTables' )); //add update checks
add_action('plugins_loaded', array( 'RevSliderPluginUpdate', 'do_update_checks' )); //add update checks
// temporary force no admin to load plugins as for frontend
if ($this->input->get('client_action') == 'preview_slider' && $this->input->get('only_markup') == 'true') {
forceNoAdmin(true);
}
do_action('plugins_loaded');
forceNoAdmin(false);
/**
* Fires before the administration menu loads in the admin.
* Added for compatibility with WP plugins that use this action
* to add admin menu items and to register its own pages
*/
do_action('admin_menu');
}
/**
* Admin pages
*/
public function index() {
$revSliderAdmin = $this->_revSliderAdmin;
$revSliderAdmin->onAddScripts();
ob_start();
$page = $this->input->get('page');
switch ($page) {
case 'rev_addon' :
$addon_admin = new Rev_addon_Admin( 'rev_addon', RevSliderGlobals::SLIDER_REVISION );
$addon_admin->display_plugin_admin_page();
break;
default :
//check if we are plugin
$page_hook = '';
$plugin_file = $page.'/'.$page.'.php';
if ( is_plugin_active( $plugin_file ) ) {
$page_hook = get_plugin_page_hook($page, $page);
}
if ( $page_hook ) {
do_action( $page_hook );
} else {
$revSliderAdmin::adminPages();
}
break;
}
$adminPage = ob_get_contents();
ob_end_clean();
do_action('admin_enqueue_scripts', 'toplevel_page_revslider');
$headerData = array(
'cssIncludes' => array(
base_url() . 'assets/css/admin/wp-admin.min.css',
base_url() . 'assets/css/admin/color-picker.min.css',
base_url() . 'assets/css/admin/farbtastic.css',
base_url() . 'assets/css/includes/dashicons.min.css',
base_url() . 'assets/css/includes/admin-bar.min.css',
base_url() . 'assets/css/includes/buttons.min.css',
base_url() . 'assets/css/includes/wp-auth-check.min.css',
base_url() . 'assets/css/includes/media-views.min.css',
base_url() . 'assets/css/includes/jquery-ui-dialog.min.css',
base_url() . 'assets/css/rs-separate.css',
base_url() . 'assets/image_crud/css/fineuploader.css',
base_url() . 'assets/image_crud/css/photogallery.css',
base_url() . 'assets/image_crud/css/colorbox.css',
base_url() . 'assets/js/includes/mediaelement/mediaelementplayer.min.css',
base_url() . 'assets/js/includes/mediaelement/wp-mediaelement.css',
base_url() . 'assets/js/includes/imgareaselect/imgareaselect.css'
),
'jsIncludes' => array(
base_url() . 'assets/js/includes/jquery/jquery.js',
base_url() . 'assets/js/includes/jquery/jquery-migrate.min.js',
base_url() . 'assets/js/includes/utils.min.js',
base_url() . 'assets/js/includes/plupload/plupload.full.min.js',
base_url() . 'assets/js/includes/json2.min.js',
'//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
base_url() . 'assets/js/farbtastic/my-farbtastic.js',
base_url() . 'assets/js/dropdownchecklist/ui.dropdownchecklist-1.4-min.js',
base_url() . 'assets/js/gallery.js',
base_url() . 'assets/js/language.js',
base_url() . 'assets/js/edit_account.js',
base_url() . 'assets/js/navigation.js',
base_url() . 'assets/js/updater.js',
base_url() . 'assets/image_crud/js/fineuploader-3.2.min.js',
base_url() . 'assets/image_crud/js/jquery.colorbox-min.js',
base_url() . 'assets/js/includes/underscore.min.js',
base_url() . 'assets/js/includes/wp-util.min.js',
base_url() . 'assets/js/includes/iris.min.js',
base_url() . 'assets/js/includes/color-picker.min.js'
),
'adminHead' => do_action('admin_head'),
'localizeScripts' => $this->data->get('localize_scripts'),
'inlineStyles' => $this->data->get('inline_styles', array())
);
foreach ($this->data->get('styles', array()) as $style) {
if ( ! check_for_jquery_addon() && strpos($style, 'revslider/public/assets') !== false) {
$style = str_replace('revslider/public/assets', 'assets', $style);
}
$headerData['cssIncludes'][] = $style;
}
foreach ($this->data->get('scripts', array()) as $script) {
if ( ! check_for_jquery_addon() && strpos($script, 'revslider/public/assets') !== false) {
$script = str_replace('revslider/public/assets', 'assets', $script);
}
$headerData['jsIncludes'][] = $script;
}
$this->load->model('user_model', 'User');
$navigationData = array(
'user' => $this->User->get( $this->session->userdata('user_id') ),
'export_button' => false
);
if ($this->input->get('view') == 'slider' || $this->input->get('view') == 'slide')
{
$headerData['jsIncludes'][] = base_url() . 'assets/js/navigation.js';
$navigationData['export_button'] = true;
}
echo $this->load->view('admin/header', $headerData, TRUE);
echo $this->load->view('admin/navigation', $navigationData, TRUE);
echo $adminPage;
echo $this->load->view('admin/footer', array(), TRUE);
}
/**
* Ajax calls
*/
public function ajax(){
$ajaxAction = $this->input->post('action');
if ($ajaxAction && $ajaxAction !== 'revslider_ajax_action') {
$this->admin_ajax($ajaxAction);
} else {
$action = $this->input->post('client_action');
if(RS_DEMO){
switch($action){
case 'update_account':
case 'download_addon':
case 'deactivate_addon':
$action = 'demomode';
break;
}
}
switch ($action) {
case 'update_account' :
$this->_update_account_action();
break;
case 'download_addon' :
$this->_download_addon();
break;
case 'deactivate_addon' :
$this->_deactivate_addon();
break;
default:
$revSliderAdmin = $this->_revSliderAdmin;
$revSliderAdmin::onAjaxAction();
break;
}
}
}
/**
* Admin ajax actions
*
* @param $action string
*/
public function admin_ajax($action = '') {
$action = 'wp_ajax_' . ($action ? $action : $this->input->get('action'));
echo do_action($action);
}
/**
* Edit account dialog
*/
public function edit_account() {
$this->load->model('user_model', 'User');
$data = array('user' => $this->User->get( $this->session->userdata('user_id') ));
$this->load->view('admin/edit_account_dialog', $data);
}
/**
* Update account action
*/
private function _update_account_action() {
$data = $this->input->post('data');
$this->load->model('user_model', 'User');
$response = $this->User->update($data);
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo json_encode($response);
die();
}
/**
* Update application
*/
public function update() {
$revSliderAdmin = $this->_revSliderAdmin;
global $wp_version;
dmp(__('Checking for new version...'));
$upgrade = new RevSliderUpdate( GlobalsRevSlider::SLIDER_REVISION );
$update = $upgrade->_retrieve_update_info();
if (isset($update->full->version) && version_compare(RevSliderGlobals::SLIDER_REVISION, $update->full->version, '<')) {
dmp(__('New version found!'));
$upload_dir = wp_upload_dir();
$upload_path = DIRECTORY_SEPARATOR . 'update' . DIRECTORY_SEPARATOR;
if(wp_mkdir_p($upload_dir['basedir'].$upload_path)) {
dmp(__('Downloading updates...'));
$request = wp_remote_post($update->full->download_link, array(
'timeout' => 45,
'method' => 'GET'
));
if( ! is_wp_error($request)) {
if($response = $request['body']) {
if($response !== 'invalid'){
dmp(__('Updates downloaded!'));
//add stream as a zip file
$file = $upload_dir['basedir'] . $upload_path . $update->full->file_name;
wp_mkdir_p(dirname($file));
$ret = @file_put_contents( $file, $response );
if($ret !== false) {
dmp(__('Installing updates...'));
// Lets extract
if (unzip_file($file, $upload_dir['basedir'] . $upload_path) === true) {
unlink($file);
$file_info = pathinfo($update->full->file_name);
$update_path = basename($update->full->file_name,'.'.$file_info['extension']);
recurse_move($upload_dir['basedir'] . $upload_path . $update_path, FCPATH);
rmdir($upload_dir['basedir'] . $upload_path);
$message = __('Updates are installed! Redirecting...');
} else {
$error = __('Invalid ZIP archive or no library installed');
}
} else {
$error = __('Not possible to save updates to updates folder. Please check permissions.');
}
} else {
$error = __('Invalid updates response.');
}
} else {
$error = __('Problem with getting update response.');
}
} else {
$error = __('Failed to download updates.');
}
} else {
$error = __('Not possible to write to updates folder. Please check permissions.');
}
} else {
$error = __('No updates found to download');
}
$viewBack = RevSliderAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDERS);
if (isset($error)) {
dmp("<b>Error: ".$error."</b>");
echo RevSliderFunctions::getHtmlLink($viewBack, __("Go Back",'revslider'));
} else {
dmp(__($message, 'revslider'));
echo "<script>location.href='$viewBack'</script>";
}
}
/**
* Upload and install addon
*/
public function upload_addon() {
$this->load->library('updater');
$response = $this->updater->upload_addon();
//handle error
$viewBack = RevSliderAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDERS);
if($response["success"] == false){
$message = $response["error"];
dmp("<b>Error: ".$message."</b>");
echo RevSliderFunctions::getHtmlLink($viewBack, __("Go Back",'revslider'));
}
else{ //handle success, js redirect.
dmp(__("Addon Install Success, redirecting...",'revslider'));
echo "<script>location.href='$viewBack'</script>";
}
exit();
}
/**
* Download and install addon
*/
private function _download_addon() {
$this->load->library('updater');
$response = $this->updater->download_addon();
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo json_encode($response);
die();
}
/**
* Deactivate addon
*/
private function _deactivate_addon() {
$this->load->library('updater');
$response = $this->updater->deactivate_addon();
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo json_encode($response);
die();
}
/**
* Update addon
*/
public function update_addon() {
$addonAdmin = new Rev_addon_Admin('rev_addon', RevSliderGlobals::SLIDER_REVISION);
$addonMessage = $addonAdmin->update_plugin();
dmp($addonMessage . ' ' . __("Redirecting...",'revslider'));
echo "<script>location.href='" . site_url('page=rev_addon') . "'</script>";
exit();
}
}

View File

@@ -0,0 +1,155 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
//include framework files
require_once(RS_PLUGIN_PATH . 'includes/framework/include-framework.php');
//include bases
require_once($folderIncludes . 'base.class.php');
require_once($folderIncludes . 'elements-base.class.php');
require_once($folderIncludes . 'base-admin.class.php');
require_once($folderIncludes . 'base-front.class.php');
//include product files
require_once(RS_PLUGIN_PATH . 'includes/globals.class.php');
require_once(RS_PLUGIN_PATH . 'includes/operations.class.php');
require_once(RS_PLUGIN_PATH . 'includes/slider.class.php');
require_once(RS_PLUGIN_PATH . 'includes/output.class.php');
require_once(RS_PLUGIN_PATH . 'includes/slide.class.php');
require_once(RS_PLUGIN_PATH . 'includes/navigation.class.php');
require_once(RS_PLUGIN_PATH . 'includes/object-library.class.php');
require_once(RS_PLUGIN_PATH . 'includes/template.class.php');
require_once(RS_PLUGIN_PATH . 'includes/external-sources.class.php');
require_once(RS_PLUGIN_PATH . 'includes/tinybox.class.php');
require_once(RS_PLUGIN_PATH . 'includes/extension.class.php');
require_once(RS_PLUGIN_PATH . 'public/revslider-front.class.php');
// slider version
$revSliderVersion = RevSliderGlobals::SLIDER_REVISION;
$wp_version = 'NA';
$revslider_screens = array();
$revslider_fonts = array();
class Embed extends CI_Controller {
/**
* Constructor
*/
public function __construct() {
global $wpdb;
parent::__construct();
if ( !defined('RS_IMAGE_PATH') ) {
define('RS_IMAGE_PATH', RS_IMAGE_PATH_COMMON);
define('RS_THUMB_PATH', RS_IMAGE_PATH . '/' . RS_THUMB_FOLDER);
define('WP_CONTENT_DIR', RS_IMAGE_PATH);
}
force_config_ssl();
$this->load->model('wpdb_model', 'WPDB');
$wpdb = $this->WPDB;
$this->load->library('plugin');
$this->_loadPlugins();
}
/**
* Get embed code
*/
public function index() {
$key = $this->input->post('key');
$alias = $this->input->post('alias');
if ($key === FALSE || empty($alias)) {
exit();
}
$revSliderFront = new RevSliderFront();
RevSliderFront::onAddScripts();
$content = '';
if ($key == 0) {
$custom_css = RevSliderOperations::getStaticCss();
$custom_css = RevSliderCssParser::compress_css($custom_css);
$content .= '<style type="text/css">' . $custom_css . '</style>' . "\n";
}
ob_start();
RevSliderOutput::setSerial($key);
$slider = RevSliderOutput::putSlider($alias);
$content .= ob_get_contents();
ob_clean();
ob_end_clean();
ob_start();
$revSliderFront::load_icon_fonts();
$revSliderFront::add_setREVStartSize();
$content = ob_get_contents() . $content;
ob_clean();
ob_end_clean();
do_action('wp_enqueue_scripts');
$assets = array();
foreach (self::get_instance()->data->get('styles', array()) as $style) {
$assets[] = array(
'file' => force_ssl($style),
'include' => '<link rel="stylesheet" href="' . force_ssl($style) . '" type="text/css" media="all" />'
);
}
foreach (self::get_instance()->data->get('scripts', array()) as $script) {
$assets[] = array(
'file' => force_ssl($script),
'include' => '<script type="text/javascript" src="' . force_ssl($script) . '"></script>'
);
}
if(!empty($slider)){
// Do not output Slider if we are on mobile
$disable_on_mobile = $slider->getParam("disable_on_mobile","off");
if($disable_on_mobile == 'on'){
$mobile = (strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()) ? true : false;
if($mobile) return false;
}
$show_alternate = $slider->getParam("show_alternative_type","off");
if($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8'){
if(strstr($_SERVER['HTTP_USER_AGENT'],'Android') || strstr($_SERVER['HTTP_USER_AGENT'],'webOS') || strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||strstr($_SERVER['HTTP_USER_AGENT'],'iPod') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad') || strstr($_SERVER['HTTP_USER_AGENT'],'Windows Phone') || wp_is_mobile()){
$show_alternate_image = $slider->getParam("show_alternate_image","");
$content = '<img class="tp-slider-alternative-image" src="'.$show_alternate_image.'" data-no-retina>';
}
}
}
$data = array(
'assets' => $assets,
'slider' => $content
);
echo json_encode($data);
}
/**
* Load plugins
*/
private function _loadPlugins() {
foreach ($this->plugin->getActivePlugins() as $plugin) {
if (file_exists(FCPATH . WP_PLUGIN_DIR . $plugin)) {
include FCPATH . WP_PLUGIN_DIR . $plugin;
}
}
do_action('plugins_loaded');
}
}

View File

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

View File

@@ -0,0 +1,66 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
class Media extends RS_Controller {
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->load->library('image_CRUD');
}
/**
* Load gallery dialog
*/
public function index()
{
$image_crud = new image_CRUD();
$image_crud->set_primary_key_field('id');
$image_crud->set_url_field('url');
$image_crud->set_table('images')
->set_ordering_field('id')
->set_ordering_direction('desc')
->set_image_path( RS_IMAGE_PATH )
->set_thumbnail_prefix( RS_THUMB_FOLDER . '/gallery' );
try {
$output = $image_crud->render();
}
catch (Exception $e) {
echo json_encode((object)array('success' => false, 'responseProperty' => $e->getMessage()));
die();
}
//$output = $image_crud->render();
$this->load->view('media/gallery_dialog', $output);
}
/**
* Get thumbnail
*/
public function image() {
$img = $this->input->get('img');
$w = $this->input->get('w');
$h = $this->input->get('h');
$t = $this->input->get('t');
$image = wp_get_attachment_image_src($img, 'full');
if ($image)
{
redirect($image[0]);
}
}
}

View File

@@ -0,0 +1,127 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(RS_PLUGIN_PATH . 'includes/globals.class.php');
include_once APPPATH . "libraries/Gettext/autoloader.php";
use Gettext\Translator;
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
class RS_Controller extends CI_Controller {
public $translator;
/**
* Constructor
*/
public function __construct() {
// No cache headers
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
parent::__construct();
// Check the database settings
if (defined('ENVIRONMENT') && ENVIRONMENT == 'install') {
redirect(base_url().'install/');
}
// check if admin user exists
$this->load->model('user_model', 'User');
if ( ! $this->User->exists()) {
redirect(base_url().'install/');
}
force_config_ssl();
$this->load->library('session');
//include plugins
$this->_includePlugins();
//set image path if not set yet by plugins
if ( !defined('RS_IMAGE_PATH') ) {
define('RS_IMAGE_PATH', RS_IMAGE_PATH_COMMON);
define('RS_THUMB_PATH', RS_IMAGE_PATH . '/' . RS_THUMB_FOLDER);
define('WP_CONTENT_DIR', RS_IMAGE_PATH);
}
// define product slug
define('RS_PLUGIN_SLUG', apply_filters('set_revslider_slug', 'visual-editor'));
// Check for user session
if ( ! $this->session->userdata('user_id') ) {
if ($this->input->is_ajax_request()) {
$response = array(
'success' => true,
'message' => __('Your session has expired. Please log in again.'),
'is_redirect' => true,
'redirect_url' => site_url('c=account&m=login')
);
header('Content-Type: application/json');
echo json_encode($response);
die();
}
if ($this->input->post('client_action') == 'preview_slider') {
$response = '<html><body><script type="text/javascript">parent.location.reload()</script></body></html>';
header('Content-Type: text/html');
echo $response;
die();
}
$controller = $this->router->fetch_class();
if ( 'account' != $controller ) {
redirect('c=account&m=login');
}
}
// Set language
if ($this->input->get('lang')) {
set_language($this->input->get('lang'));
}
// Set translation
$translations = Gettext\Translations::fromPoFile(RS_PLUGIN_PATH . 'languages/revslider-' . get_language() . '.po');
$this->translator = new Translator();
$this->translator->loadTranslations($translations);
}
/**
* include plugins
*/
private function _includePlugins() {
$this->load->library('plugin');
do_action('plugins_included_before');
// temporary force no admin to load plugins as for frontend
/* if ($this->input->get('client_action') == 'preview_slider' && $this->input->get('only_markup') == 'true') {
forceNoAdmin(true);
}*/
foreach ($this->plugin->getActivePlugins() as $plugin) {
if (file_exists(FCPATH . WP_PLUGIN_DIR . $plugin)) {
include FCPATH . WP_PLUGIN_DIR . $plugin;
}
}
//forceNoAdmin(false);
do_action('plugins_included_after');
}
}

View File

@@ -0,0 +1,31 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
class RS_Security extends CI_Security {
public function csrf_verify() {
if ( ! (isset($_GET['c']) && $_GET['c'] == 'account'))
{
return $this;
}
return parent::csrf_verify();
}
public function xss_clean($str, $is_image = FALSE) {
if ( ! (isset($_GET['c']) && $_GET['c'] == 'account'))
{
return $str;
}
return parent::xss_clean($str, $is_image);
}
}

View File

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

View File

@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>404 Page Not Found</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #fff;
background-color: #e74c3c;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
h2 {
font-size: 19px;
font-weight: normal;
margin: 14px 0;
padding: 12px 15px 12px 15px;
}
h3 {
font-size: 16px;
font-weight: normal;
margin: 12px 0;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
ul {
margin-bottom: 30px;
}
li {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>

View File

@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Database Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #fff;
background-color: #e74c3c;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
h2 {
font-size: 19px;
font-weight: normal;
margin: 14px 0;
padding: 12px 15px 12px 15px;
}
h3 {
font-size: 16px;
font-weight: normal;
margin: 12px 0;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
ul {
margin-bottom: 30px;
}
li {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
<h2>How to fix it?</h2>
<ul>
<li>
<h3>Check server status</h3>
<p>Check if MySQL server is up and running. You can do it in cPanel/WHM of your server or by executing "<strong>mysqladmin status</strong>" command via SSH.</p>
</li>
<li>
<h3>Check that user is correct</h3>
<p>
Double check thay all database settings (hostname, database, user, password) are spcified correctly. Make sure database user have appropriate access privelegies for your database.
You can check and modify this settings in Database section of your servers cPanel/WHM.
</p>
</li>
<li>
<h3>Try to remove config files and run reinstall</h3>
<p>
Locate and remove following configuration files on your server:<br />
"<strong>./application/config/config.php</strong>"<br />
"<strong>./application/config/database.php</strong>"<br />
Open url of your Slider Editor in browser to start over installation process.
</p>
</li>
</ul>
</div>
</body>
</html>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #fff;
background-color: #e74c3c;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
h2 {
font-size: 19px;
font-weight: normal;
margin: 14px 0;
padding: 12px 15px 12px 15px;
}
h3 {
font-size: 16px;
font-weight: normal;
margin: 12px 0;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
ul {
margin-bottom: 30px;
}
li {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<style type="text/css">
.rs_php_error {
background-color: #fff;
margin: 10px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
border:1px solid #990000;
}
.rs_php_error h1 {
color: #fff;
background-color: #e74c3c;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
.rs_php_error p,
.rs_php_error pre {
margin: 12px 15px 12px 15px;
}
.rs_php_error pre {
white-space: pre-line;
}
.rs_php_error h2 {
font-size: 19px;
font-weight: normal;
margin: 14px 0;
padding: 12px 15px 12px 15px;
}
.rs_php_error h3 {
font-size: 16px;
font-weight: normal;
margin: 12px 0;
}
.rs_php_error ul {
margin-bottom: 30px;
}
.rs_php_error li {
margin-bottom: 20px;
}
</style>
<div class="rs_php_error">
<h1>A PHP Error was encountered</h1>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
<?php
if (class_exists('RevSliderOperations') && RevSliderOperations::getGeneralSettingsOptionValue('enable_error_backtrace', 'off') != 'off') {
echo '<pre>';
@debug_print_backtrace();
echo '</pre>';
}
?>
<h2>How to fix it?</h2>
<ul>
<li>
<h3>Check PHP version</h3>
<p>Check if PHP version of your server is up to date. PHP version 5.3 or greater is required. You can check version using "<strong>phpversion()</strong>" PHP function on webserver or by executing "<strong>php --version</strong>" via SSH.</p>
</li>
<li>
<h3>Check if Safe Mode disabled in PHP</h3>
<p>
Safe mode needs to be disabled. You can check if it is so by viewing output of "<strong>phpinfo()</strong>" PHP command on your webserver.
</p>
</li>
<li>
<h3>Check code integrity</h3>
<p>
Make sure all code files are uploaded to your webserver and was not modified. If some files are missing or corrupted reupload of code files can fix it.
</p>
</li>
</ul>
</div>

View File

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

View File

@@ -0,0 +1,151 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
if( ! function_exists('WP_Filesystem'))
{
/**
* Init filesystem class
*/
function WP_Filesystem() {
global $wp_filesystem;
$ci = &get_instance();
$ci->load->library('filesystem');
$wp_filesystem = $ci->filesystem;
return true;
}
}
if( ! function_exists('unzip_file'))
{
/**
* Unzip file
*
* @param string $file
* @param string $path
* @return boolean
*/
function unzip_file($file, $path) {
// make sure it have trailing slash
$path = rtrim(str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if ( ! wp_mkdir_p($path)) return false;
if (class_exists('ZipArchive') && RevSliderOperations::getGeneralSettingsOptionValue('force_pclzip', 'off') == 'off') {
$zip = new ZipArchive;
$zipResult = $zip->open($file, ZIPARCHIVE::CREATE);
if ($zipResult === true) {
for($i = 0; $i < $zip->numFiles; $i++) {
$fileName = $zip->getNameIndex($i);
$fileInfo = pathinfo($fileName);
if (strpos($fileName, '_') !== 0 && strpos($fileName, '.') !== 0 && strpos($fileInfo['basename'], '_') !== 0 && strpos($fileInfo['basename'], '.') !== 0) {
if ($fileInfo['dirname'] !== '.' && ! file_exists($path.$fileInfo['dirname'])) {
$parts = explode('/', $fileInfo['dirname']);
$dirPath = $path;
foreach ($parts as $part) {
$dirPath .= $part . DIRECTORY_SEPARATOR;
wp_mkdir_p($dirPath);
}
}
if (substr($fileName, -1) !== '/' && substr($fileName, -1) !== '\\') {
$targetFile = $path.str_replace('//', DIRECTORY_SEPARATOR, $fileName);
file_put_contents($targetFile, $zip->getFromName($fileName));
updatePermissions($targetFile);
}
}
}
$zip->close();
}
} else {
include_once APPPATH . "libraries/pclzip.lib.php";
$pclZip = new PclZip($file);
$list = $pclZip->listContent();
if ($list) {
for ($i=0; $i<sizeof($list); $i++) {
$fileInfo = $list[$i];
$fileName = $fileInfo['filename'];
if (strpos($fileName, '_') !== 0 && strpos($fileName, '.') !== 0 && strpos($fileName, '/_') === FALSE && strpos($fileName, '/.') === FALSE) {
if ($fileInfo['folder']) {
if ( ! file_exists($path.$fileName)) {
wp_mkdir_p($path.$fileName);
}
} elseif ( ! file_exists($path . dirname($fileName))) {
$parts = explode('/', dirname($fileName));
$dirPath = $path;
foreach ($parts as $part) {
$dirPath .= $part . DIRECTORY_SEPARATOR;
wp_mkdir_p($dirPath);
}
}
$extract = $pclZip->extract(PCLZIP_OPT_BY_INDEX, $fileInfo['index'], PCLZIP_OPT_EXTRACT_AS_STRING);
if ( ! $fileInfo['folder'] && $extract && isset($extract[0]['content'])) {
$targetFile = $path.$fileName;
file_put_contents($targetFile, $extract[0]['content']);
updatePermissions($targetFile);
}
}
}
}
$zipResult = count($list) !== 0;
}
return $zipResult;
}
}
if( ! function_exists('recurse_move'))
{
/**
* Move files recursively
*
* @param string $src
* @param string $dst
*/
function recurse_move($src, $dst) {
$src = rtrim($src,'/\\');
$dst = rtrim($dst,'/\\');
$dir = opendir($src);
wp_mkdir_p($dst);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) )
{
recurse_move($src . '/' . $file,$dst . '/' . $file);
}
else
{
rename($src . '/' . $file,$dst . '/' . $file);
updatePermissions($dst . '/' . $file);
}
}
}
closedir($dir);
rmdir($src);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,255 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
/**
* Get image url by id and size
*
* @param int Image id
* @param string Size type
* @return string
*/
if( ! function_exists('wp_get_attachment_image_src'))
{
function wp_get_attachment_image_src($attachment_id, $size='thumbnail')
{
if ( $image = image_downsize($attachment_id, $size) )
return $image;
else
return false;
}
}
if( ! function_exists('image_downsize')) {
/**
* Resize image by id and preset size
*
* @param int $id
* @param string $size
* @return mixed
*/
function image_downsize($id, $size = 'medium') {
$ci = &get_instance();
$ci->load->model('image_model', 'Image');
$imageUrl = $ci->Image->getUrl($id);
if ( ! $imageUrl) {
return false;
}
if ($size == 'full') {
if ( ! file_exists(FCPATH . RS_IMAGE_PATH . '/' . $imageUrl) || ! $size = getimagesize(FCPATH . RS_IMAGE_PATH . '/' . $imageUrl)){
return false;
}
$resultUrl = base_url() . RS_IMAGE_PATH . '/' . $imageUrl;
$width = $size[0];
$height = $size[1];
} else {
$sizes = $ci->config->item('rs_image_sizes');
$targetSize = isset($sizes[$size]) ? $sizes[$size] : reset($sizes);
$width = $targetSize['width'];
$height = $targetSize['height'];
$resultUrl = image_resize(FCPATH . RS_IMAGE_PATH . '/' . $imageUrl, $width, $height);
}
return array( $resultUrl, $width, $height );
}
}
/**
* Resize image
*
* @param string Image url
* @param int Width
* @param int Height
* @param boolean Is crop
* @param boolean Is single
* @param boolean Is upscale
* @return string
*/
if( ! function_exists('image_resize')) {
function image_resize($url, $width = null, $height = null, $crop = null, $single = true, $upscale = false) {
$ci = &get_instance();
$arrImagePath = explode('/', $url);
$imageFile = array_pop($arrImagePath);
$thumbUrl = RS_THUMB_PATH . '/' . $width . 'x' . $height . '_' . $imageFile;
if ( ! file_exists(FCPATH . $thumbUrl) || ! getimagesize(FCPATH . $thumbUrl))
{
$ci->load->library('image_moo');
$ci->image_moo->load( image_url_to_path($url) );
if ($crop)
{
$ci->image_moo->resize_crop($width, $height);
}
else
{
$ci->image_moo->resize($width, $height);
}
$ci->image_moo->save(FCPATH . $thumbUrl, true);
if ($ci->image_moo->errors) {
return false;
}
}
return base_url() . $thumbUrl;
}
}
/**
* Alias for Resize Image
*/
if( ! function_exists('rev_aq_resize'))
{
function rev_aq_resize($url, $width = null, $height = null, $crop = null, $single = true, $upscale = false)
{
return image_resize($url, $width, $height, $crop, $single, $upscale);
}
}
/**
* Insert new image
*
* @param array Data
* @param string Image
* @return int Id
*/
if( ! function_exists('wp_insert_attachment'))
{
function wp_insert_attachment($data, $image) {
$ci = &get_instance();
$ci->load->model('image_model', 'Image');
return $ci->Image->insert($image);
}
}
/**
* Get image path by id
*
* @param int $attachment_id
* @return string
*/
if( ! function_exists('get_attached_file'))
{
function get_attached_file($attachment_id) {
$ci = &get_instance();
$ci->load->model('image_model', 'Image');
$imageUrl = $ci->Image->getUrl($attachment_id);
if ( ! $imageUrl)
{
return false;
}
return FCPATH . 'media/' . $imageUrl;
}
}
/**
* Get image id by url
*
* @param string $url
* @return int
*/
if( ! function_exists('get_image_id_by_url'))
{
function get_image_id_by_url($url) {
$ci = &get_instance();
$ci->load->model('image_model', 'Image');
$id = $ci->Image->getId($url);
if ( ! $id)
{
return false;
}
return $id;
}
}
if( ! function_exists('attachment_url_to_postid'))
{
function attachment_url_to_postid($url) {
return get_image_id_by_url($url);
}
}
if( ! function_exists('image_url_to_path')) {
/**
* Convert image url to path
*
* @param string
* @return string
*/
function image_url_to_path($url) {
$baseUrl = base_url() . RS_IMAGE_PATH . '/';
$basePath = FCPATH . RS_IMAGE_PATH . '/';
if (strpos($url, $baseUrl) === false && strpos($url, $basePath) === false) {
return $url;
}
$image = str_replace(array($baseUrl, $basePath), '', $url);
$path = $basePath . $image;
return $path;
}
}
/**
* For compatiblity
*/
if( ! function_exists('wp_generate_attachment_metadata'))
{
function wp_generate_attachment_metadata() {
return FALSE;
}
}
if( ! function_exists('wp_update_attachment_metadata'))
{
function wp_update_attachment_metadata() {
return FALSE;
}
}
if( ! function_exists('wp_get_attachment_metadata'))
{
function wp_get_attachment_metadata() {
return FALSE;
}
}
if( ! function_exists('get_intermediate_image_sizes'))
{
function get_intermediate_image_sizes() {
return array();
}
}
if( ! function_exists('get_the_title'))
{
function get_the_title($id) {
return '';
}
}

View File

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

View File

@@ -0,0 +1,84 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
/**
* Get translated string
*
* @param string $string
* @return string
*/
if( ! function_exists('__'))
{
function __($string = '')
{
$ci = &get_instance();
if ( ! isset($ci->translator))
{
return $string;
}
return $ci->translator->gettext($string);
}
}
/**
* Output translation string
*
* @param string $string
*/
if( ! function_exists('_e'))
{
function _e($string = '')
{
echo __($string);
}
}
/**
* Set current language
*
* @param string Languag
*/
if( ! function_exists('set_language'))
{
function set_language($lang) {
$ci = &get_instance();
if (array_key_exists($lang, $ci->config->item('available_languages'))) {
if (isset($ci->session)) $ci->session->set_userdata('language', $lang);
update_option('language', $lang);
}
}
}
/**
* Get current language
*
* @return string Languag
*/
if( ! function_exists('get_language'))
{
function get_language() {
$ci = &get_instance();
$lang = isset($ci->session) ? $ci->session->userdata('language') : '';
if ( ! $lang) {
$lang = get_option('language', $ci->config->item('default_lang_code'));
}
if ( ! array_key_exists($lang, $ci->config->item('available_languages'))) {
$lang = $ci->config->item('default_lang_code');
}
return $lang;
}
}

View File

@@ -0,0 +1,91 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
if( ! function_exists('get_option')) {
/**
* Get option
*
* @param string Handle
* @param string Default value
* @return string Option value
*/
function get_option($handle, $default = false) {
$ci = &get_instance();
$ci->load->model('option_model', 'Option');
if ($value = $ci->Option->get_option($handle)) {
if ((strpos($value, 'a:') !== false
|| strpos($value, 's:') !== false
|| strpos($value, 'O:') !== false
|| strpos($value, 'i:') !== false
|| strpos($value, 'b:') !== false)
&& (($unserializedValue = @unserialize($value)) !== false || $value == 'b:0;')) {
$value = $unserializedValue;
}
return $value;
} else {
return $default;
}
}
}
if( ! function_exists('update_option')) {
/**
* Update option
*
* @param string $handle
* @param string value
*/
function update_option($handle, $option = '') {
$ci = &get_instance();
$ci->load->model('option_model', 'Option');
$ci->Option->update_option($handle, $option);
}
}
if( ! function_exists('add_option')) {
/**
* Add option
*
* @param string $handle
* @param string value
*/
function add_option($handle, $option = '', $deprecated = '', $autoload = 'yes') {
update_option($handle, $option);
return true;
}
}
if( ! function_exists('delete_option')) {
/**
* Delete option
*
* @param string $handle
*/
function delete_option($handle) {
$ci = &get_instance();
$ci->load->model('option_model', 'Option');
$ci->Option->delete_option($handle);
}
}

View File

@@ -0,0 +1,182 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2016. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
if( ! function_exists('is_plugin_active')) {
/**
* Checks if addon activated
*
* @param string $plugin
* @return boolean
*/
function is_plugin_active($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->isPluginActive($plugin);
}
}
if( ! function_exists('is_plugin_inactive')) {
/**
* Checks if addon not activated
*
* @param string $plugin
* @return boolean
*/
function is_plugin_inactive($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return ! $_ci->plugin->isPluginActive($plugin);
}
}
if( ! function_exists('activate_plugin')) {
/**
* Activate plugin
*
* @param string $plugin
* @return boolean
*/
function activate_plugin($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->activatePlugin($plugin);
}
}
if( ! function_exists('deactivate_plugins')) {
/**
* Deactivate plugin
*
* @param string $plugin
* @return boolean
*/
function deactivate_plugins($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->deactivatePlugin($plugin);
}
}
if( ! function_exists('get_plugins')) {
/**
* Get plugins
*
* return boolean
*/
function get_plugins() {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->getPlugins();
}
}
if( ! function_exists('plugins_url')) {
/**
* Get plugins url
*
* @param string $file
* @param string $plugin
* @return string
*/
function plugins_url($file, $plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->pluginUrl($plugin) . '/' . $file;
}
}
if( ! function_exists('plugin_dir_url')) {
/**
* Get plugin dir url
*
* @param string $plugin
* @return string
*/
function plugin_dir_url($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->pluginUrl($plugin) . '/';
}
}
if( ! function_exists('plugin_dir_path')) {
/**
* Get plugin dir path
*
* @param string $plugin
* @return string
*/
function plugin_dir_path($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->pluginDir($plugin);
}
}
if( ! function_exists('plugin_basename')) {
/**
* Get plugin name
*
* @param string $plugin
* @return string
*/
function plugin_basename($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->pluginName($plugin);
}
}
if( ! function_exists('update_plugin')) {
/**
* Update plugin
*
* @param string $plugin
* @return boolean
*/
function update_plugin($plugin) {
$_ci = &get_instance();
$_ci->load->library('plugin');
return $_ci->plugin->updatePlugin($plugin);
}
}

View File

@@ -0,0 +1,32 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if( ! function_exists('trace')) {
function trace($var) {
echo('<pre>');
print_r($var);
echo('</pre>');
}
}
if( ! function_exists('callback_export')) {
function callback_export($callback) {
if (is_string($callback)) {
$export = $callback;
} elseif (is_array($callback)) {
$temp = array();
foreach ($callback as $part) {
if (is_object($part)) {
$temp[] = get_class($part);
} else {
$temp[] = $part;
}
}
$export = implode('->', $temp);
} elseif (is_object($callback)) {
$export = get_class($callback);
} else {
$export = var_export($callback, true);
}
return $export;
}
}

View File

@@ -0,0 +1,349 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Nwdthemes Standalone Slider Revolution
*
* @package StandaloneRevslider
* @author Nwdthemes <mail@nwdthemes.com>
* @link http://nwdthemes.com/
* @copyright Copyright (c) 2015. Nwdthemes
* @license http://themeforest.net/licenses/terms/regular
*/
if( ! function_exists('check_for_jquery_addon'))
{
/**
* Checks if jQuery editor addon installed and have correct version
*
* return boolean
*/
function check_for_jquery_addon() {
$ci = &get_instance();
$ci->load->library('updater');
$result = $ci->updater->check_jquery_addon();
return $result['success'];
}
}
if( ! function_exists('get_jquery_addon_message'))
{
/**
* Get message about jQuery addon
*
* return string
*/
function get_jquery_addon_message() {
$ci = &get_instance();
$ci->load->library('updater');
$result = $ci->updater->check_jquery_addon();
return isset($result['message']) ? $result['message'] : '';
}
}
if( ! function_exists('is_jquery_addon_activated')) {
/**
* Checks if jQuery editor addon activated
*
* return boolean
*/
function is_jquery_addon_activated() {
return get_option('jquery-plugin-code', '') && get_option('jquery-plugin-code-activated', 'false') == 'true';
}
}
if( ! function_exists('is_jquery_addon_temp_activated')) {
/**
* Checks if jQuery editor addon temporary activated
*
* return boolean
*/
function is_jquery_addon_temp_activated() {
return get_option('jquery-plugin-code', '') && get_option('jquery-plugin-temp-active', 'false') == 'true';
}
}
if( ! function_exists('dbDelta'))
{
/**
* Execute DB updates
*
* @param string $queries
* @param boolean $execute
* @return array
*/
function dbDelta( $queries = '', $execute = true ) {
global $wpdb;
if ( in_array( $queries, array( '', 'all', 'blog', 'global', 'ms_global' ), true ) )
$queries = wp_get_db_schema( $queries );
// Separate individual queries into an array
if ( !is_array($queries) ) {
$queries = explode( ';', $queries );
$queries = array_filter( $queries );
}
/**
* Filter the dbDelta SQL queries.
*
* @since 3.3.0
*
* @param array $queries An array of dbDelta SQL queries.
*/
$queries = apply_filters( 'dbdelta_queries', $queries );
$cqueries = array(); // Creation Queries
$iqueries = array(); // Insertion Queries
$for_update = array();
// Create a tablename index for an array ($cqueries) of queries
foreach($queries as $qry) {
if ( preg_match( "|CREATE TABLE ([^ ]*)|", $qry, $matches ) ) {
$cqueries[ trim( $matches[1], '`' ) ] = $qry;
$for_update[$matches[1]] = 'Created table '.$matches[1];
} elseif ( preg_match( "|CREATE DATABASE ([^ ]*)|", $qry, $matches ) ) {
array_unshift( $cqueries, $qry );
} elseif ( preg_match( "|INSERT INTO ([^ ]*)|", $qry, $matches ) ) {
$iqueries[] = $qry;
} elseif ( preg_match( "|UPDATE ([^ ]*)|", $qry, $matches ) ) {
$iqueries[] = $qry;
} else {
// Unrecognized query type
}
}
/**
* Filter the dbDelta SQL queries for creating tables and/or databases.
*
* Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE".
*
* @since 3.3.0
*
* @param array $cqueries An array of dbDelta create SQL queries.
*/
$cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
/**
* Filter the dbDelta SQL queries for inserting or updating.
*
* Queries filterable via this hook contain "INSERT INTO" or "UPDATE".
*
* @since 3.3.0
*
* @param array $iqueries An array of dbDelta insert or update SQL queries.
*/
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
$global_tables = $wpdb->tables( 'global' );
foreach ( $cqueries as $table => $qry ) {
// Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
if ( in_array( $table, $global_tables ) && ! wp_should_upgrade_global_tables() ) {
unset( $cqueries[ $table ], $for_update[ $table ] );
continue;
}
// Fetch the table column structure from the database
$suppress = $wpdb->suppress_errors();
$searchTables = $wpdb->get_results("SHOW TABLES LIKE '{$table}';");
$tablefields = $searchTables ? $wpdb->get_results("DESCRIBE {$table};") : false;
$wpdb->suppress_errors( $suppress );
if ( ! $tablefields )
continue;
// Clear the field and index arrays.
$cfields = $indices = array();
// Get all of the field names in the query from between the parentheses.
preg_match("|\((.*)\)|ms", $qry, $match2);
$qryline = trim($match2[1]);
// Separate field lines into an array.
$flds = explode("\n", $qryline);
// For every field line specified in the query.
foreach ($flds as $fld) {
// Extract the field name.
preg_match("|^([^ ]*)|", trim($fld), $fvals);
$fieldname = trim( $fvals[1], '`' );
// Verify the found field name.
$validfield = true;
switch (strtolower($fieldname)) {
case '':
case 'primary':
case 'index':
case 'fulltext':
case 'unique':
case 'key':
$validfield = false;
$indices[] = trim(trim($fld), ", \n");
break;
}
$fld = trim($fld);
// If it's a valid field, add it to the field array.
if ($validfield) {
$cfields[strtolower($fieldname)] = trim($fld, ", \n");
}
}
// For every field in the table.
foreach ($tablefields as $tablefield) {
$tablefield = (object) $tablefield;
// If the table field exists in the field array ...
if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
// Get the field type from the query.
preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
$fieldtype = $matches[1];
// Is actual field type different from the field type in query?
if ($tablefield->Type != $fieldtype) {
// Add a query to change the column type
$_query = "ALTER TABLE {$table} CHANGE COLUMN `{$tablefield->Field}` " . $cfields[strtolower($tablefield->Field)];
$cqueries[] = str_replace(" {$tablefield->Field} ", " `{$tablefield->Field}` ", $_query);
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
}
// Get the default value from the array
// todo: Remove this?
//echo "{$cfields[strtolower($tablefield->Field)]}<br>";
if (preg_match("| DEFAULT '(.*?)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
$default_value = $matches[1];
if ($tablefield->Default != $default_value) {
// Add a query to change the column's default value
$cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'";
$for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
}
}
// Remove the field from the array (so it's not added).
unset($cfields[strtolower($tablefield->Field)]);
} else {
// This field exists in the table, but not in the creation queries?
}
}
// For every remaining field specified for the table.
foreach ($cfields as $fieldname => $fielddef) {
// Push a query line into $cqueries that adds the field to that table.
$cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
$for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname;
}
// Index stuff goes here. Fetch the table index structure from the database.
$tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");
if ($tableindices) {
// Clear the index array.
$index_ary = array();
// For every index in the table.
foreach ($tableindices as $tableindex) {
$tableindex = (object) $tableindex;
// Add the index to the index data array.
$keyname = $tableindex->Key_name;
$index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
$index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
}
// For each actual index in the index array.
foreach ($index_ary as $index_name => $index_data) {
// Build a create string to compare to the query.
$index_string = '';
if ($index_name == 'PRIMARY') {
$index_string .= 'PRIMARY ';
} elseif ( $index_data['unique'] ) {
$index_string .= 'UNIQUE ';
}
$index_string .= 'KEY ';
if ($index_name != 'PRIMARY') {
$index_string .= $index_name;
}
$index_columns = '';
// For each column in the index.
foreach ($index_data['columns'] as $column_data) {
if ($index_columns != '') $index_columns .= ',';
// Add the field to the column list string.
$index_columns .= $column_data['fieldname'];
if ($column_data['subpart'] != '') {
$index_columns .= '('.$column_data['subpart'].')';
}
}
// The alternative index string doesn't care about subparts
$alt_index_columns = preg_replace( '/\([^)]*\)/', '', $index_columns );
// Add the column list to the index create string.
$index_strings = array(
"$index_string ($index_columns)",
"$index_string ($alt_index_columns)",
);
foreach( $index_strings as $index_string ) {
if ( ! ( ( $aindex = array_search( $index_string, $indices ) ) === false ) ) {
unset( $indices[ $aindex ] );
break;
// todo: Remove this?
//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
}
}
// todo: Remove this?
//else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n";
}
}
// For every remaining index specified for the table.
foreach ( (array) $indices as $index ) {
// Push a query line into $cqueries that adds the index to that table.
$cqueries[] = "ALTER TABLE {$table} ADD $index";
$for_update[] = 'Added index ' . $table . ' ' . $index;
}
// Remove the original table creation query from processing.
unset( $cqueries[ $table ], $for_update[ $table ] );
}
$allqueries = array_merge($cqueries, $iqueries);
if ($execute) {
foreach ($allqueries as $query) {
$wpdb->query($query);
}
}
return $for_update;
}
}
// For compatibility
if( ! function_exists('wp_should_upgrade_global_tables')) {
function wp_should_upgrade_global_tables() {
return false;
}
}
if( ! function_exists('wp_get_db_schema')) {
function wp_get_db_schema($queries = array()) {
return $queries;
}
}

View File

@@ -0,0 +1,6 @@
<?php
class Https {
public function trigger_https() {
force_config_ssl();
}
}

View File

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

View File

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

View File

@@ -0,0 +1,23 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
use Illuminate\Filesystem\Filesystem;
use Illuminate\View\Compilers\BladeCompiler;
/**
* Class to get gettext strings from blade.php files returning arrays
*/
class Blade extends Extractor implements ExtractorInterface
{
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
$bladeCompiler = new BladeCompiler(new Filesystem(), null);
$string = $bladeCompiler->compileString($string);
return PhpCode::fromString($string, $translations, $file);
}
}

View File

@@ -0,0 +1,89 @@
<?php
namespace Gettext\Extractors;
use Exception;
use InvalidArgumentException;
use Gettext\Translations;
abstract class Extractor
{
/**
* Extract the translations from a file
*
* @param array|string $file A path of a file or files
* @param null|Translations $translations The translations instance to append the new translations.
*
* @return Translations
*/
public static function fromFile($file, Translations $translations = null)
{
if ($translations === null) {
$translations = new Translations();
}
foreach (self::getFiles($file) as $file) {
static::fromString(self::readFile($file), $translations, $file);
}
return $translations;
}
/**
* Checks and returns all files
*
* @param string|array $file The file/s
*
* @return array The file paths
*/
protected static function getFiles($file)
{
if (empty($file)) {
throw new InvalidArgumentException('There is not any file defined');
}
if (is_string($file)) {
if (!is_file($file)) {
throw new InvalidArgumentException("'$file' is not a valid file");
}
if (!is_readable($file)) {
throw new InvalidArgumentException("'$file' is not a readable file");
}
return array($file);
}
if (is_array($file)) {
$files = array();
foreach ($file as $f) {
$files = array_merge($files, self::getFiles($f));
}
return $files;
}
throw new InvalidArgumentException('The first argumet must be string or array');
}
/**
* Reads and returns the content of a file
*
* @param string $file
*
* @return string
*/
protected static function readFile($file)
{
$length = filesize($file);
if (!($fd = fopen($file, 'rb'))) {
throw new Exception("Cannot read the file '$file', probably permissions");
}
$content = $length ? fread($fd, $length) : '';
fclose($fd);
return $content;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
interface ExtractorInterface
{
/**
* Extract the translations from a file
*
* @param array|string $file A path of a file or files
* @param null|Translations $translations The translations instance to append the new translations.
*
* @return Translations
*/
public static function fromFile($file, Translations $translations = null);
/**
* Parses a string and append the translations found in the Translations instance
*
* @param string $string
* @param Translations|null $translations
* @param string $file The file path to insert the reference
*
* @return Translations
*/
public static function fromString($string, Translations $translations = null, $file = '');
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
/**
* Class to get gettext strings from json files
*/
class Jed extends PhpArray implements ExtractorInterface
{
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
$content = json_decode($string);
return PhpArray::handleArray($content, $translations);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
use Gettext\Utils\JsFunctionsScanner;
/**
* Class to get gettext strings from javascript files
*/
class JsCode extends Extractor implements ExtractorInterface
{
public static $functions = array(
'__' => '__',
'n__' => 'n__',
'p__' => 'p__',
);
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
$functions = new JsFunctionsScanner($string);
$functions->saveGettextFunctions(self::$functions, $translations, $file);
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
/**
* Class to get gettext strings from plain json
*/
class JsonDictionary extends Extractor implements ExtractorInterface
{
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
if (($entries = json_decode($string, true))) {
foreach ($entries as $original => $translation) {
$translations->insert(null, $original)->setTranslation($translation);
}
}
return $translations;
}
}

View File

@@ -0,0 +1,125 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
use Gettext\Utils\StringReader;
/**
* Class to get gettext strings from .mo files
*/
class Mo extends Extractor implements ExtractorInterface
{
const MAGIC1 = -1794895138;
const MAGIC2 = -569244523;
const MAGIC3 = 2500072158;
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
$stream = new StringReader($string);
$magic = self::readInt($stream, 'V');
if (($magic === self::MAGIC1) || ($magic === self::MAGIC3)) { //to make sure it works for 64-bit platforms
$byteOrder = 'V'; //low endian
} elseif ($magic === (self::MAGIC2 & 0xFFFFFFFF)) {
$byteOrder = 'N'; //big endian
} else {
throw new \Exception('Not MO file');
}
self::readInt($stream, $byteOrder);
$total = self::readInt($stream, $byteOrder); //total string count
$originals = self::readInt($stream, $byteOrder); //offset of original table
$tran = self::readInt($stream, $byteOrder); //offset of translation table
$stream->seekto($originals);
$table_originals = self::readIntArray($stream, $byteOrder, $total * 2);
$stream->seekto($tran);
$table_translations = self::readIntArray($stream, $byteOrder, $total * 2);
for ($i = 0; $i < $total; $i++) {
$stream->seekto($table_originals[$i * 2 + 2]);
$original = $stream->read($table_originals[$i * 2 + 1]);
$stream->seekto($table_translations[$i * 2 + 2]);
$translated = $stream->read($table_translations[$i * 2 + 1]);
if ($original === '') {
// Headers
foreach (explode("\n", $translated) as $headerLine) {
if ($headerLine !== '') {
$headerChunks = preg_split('/:\s*/', $headerLine, 2);
$translations->setHeader($headerChunks[0], isset($headerChunks[1]) ? $headerChunks[1] : '');
}
}
} else {
$chunks = explode("\x04", $original, 2);
if (isset($chunks[1])) {
$context = $chunks[0];
$original = $chunks[1];
} else {
$context = '';
}
$chunks = explode("\x00", $original, 2);
if (isset($chunks[1])) {
$original = $chunks[0];
$plural = $chunks[1];
} else {
$plural = '';
}
$translation = $translations->insert($context, $original, $plural);
if ($translated !== '') {
if ($plural === '') {
$translation->setTranslation($translated);
} else {
foreach (explode("\x00", $translated) as $pluralIndex => $pluralValue) {
if ($pluralIndex === 0) {
$translation->setTranslation($pluralValue);
} else {
$translation->setPluralTranslation($pluralValue, $pluralIndex - 1);
}
}
}
}
}
}
return $translations;
}
/**
* @param StringReader $stream
* @param string $byteOrder
*/
private static function readInt(StringReader $stream, $byteOrder)
{
if (($read = $stream->read(4)) === false) {
return false;
}
$read = unpack($byteOrder, $read);
return array_shift($read);
}
/**
* @param StringReader $stream
* @param string $byteOrder
* @param int $count
*/
private static function readIntArray(StringReader $stream, $byteOrder, $count)
{
return unpack($byteOrder.$count, $stream->read(4 * $count));
}
}

View File

@@ -0,0 +1,74 @@
<?php
namespace Gettext\Extractors;
use Exception;
use Gettext\Translations;
/**
* Class to get gettext strings from php files returning arrays
*/
class PhpArray extends Extractor implements ExtractorInterface
{
/**
* Extract the translations from a file
*
* @param array|string $file A path of a file or files
* @param null|Translations $translations The translations instance to append the new translations.
*
* @return Translations
*/
public static function fromFile($file, Translations $translations = null)
{
if ($translations === null) {
$translations = new Translations();
}
foreach (self::getFiles($file) as $file) {
self::handleArray(include($file), $translations);
}
return $translations;
}
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
throw new Exception("PhpArray::fromString() cannot be called. Use PhpArray::fromFile()");
}
/**
* Handle an array of translations and append to the Translations instance
*
* @param array $content
* @param Translations $translations
*/
public static function handleArray(array $content, Translations $translations)
{
$content = $content['messages'];
$translations_info = isset($content['']) ? $content[''] : null;
unset($content['']);
if (isset($translations_info['domain'])) {
$translations->setDomain($translations_info['domain']);
}
$context_glue = '\u0004';
foreach ($content as $key => $message) {
$key = explode($context_glue, $key);
$context = isset($key[1]) ? array_shift($key) : '';
$original = array_shift($key);
$plural = array_shift($message);
$translation = array_shift($message);
$plural_translation = array_shift($message);
$entry = $translations->insert($context, $original, $plural);
$entry->setTranslation($translation);
$entry->setPluralTranslation($plural_translation);
}
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
use Gettext\Utils\PhpFunctionsScanner;
/**
* Class to get gettext strings from php files returning arrays
*/
class PhpCode extends Extractor implements ExtractorInterface
{
public static $functions = array(
'__' => '__',
'__e' => '__',
'n__' => 'n__',
'n__e' => 'n__',
'p__' => 'p__',
'p__e' => 'p__',
);
/**
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
$functions = new PhpFunctionsScanner($string);
$functions->saveGettextFunctions(self::$functions, $translations, $file);
}
}

View File

@@ -0,0 +1,224 @@
<?php
namespace Gettext\Extractors;
use Gettext\Translations;
use Gettext\Translation;
/**
* Class to get gettext strings from php files returning arrays
*/
class Po extends Extractor implements ExtractorInterface
{
/**
* Parses a .po file and append the translations found in the Translations instance
*
* {@inheritDoc}
*/
public static function fromString($string, Translations $translations = null, $file = '')
{
if ($translations === null) {
$translations = new Translations();
}
$lines = explode("\n", $string);
$i = 0;
$translation = new Translation('', '');
for ($n = count($lines); $i < $n; $i++) {
$line = trim($lines[$i]);
$line = self::fixMultiLines($line, $lines, $i);
if ($line === '') {
if ($translation->is('', '')) {
self::parseHeaders($translation->getTranslation(), $translations);
} elseif ($translation->hasOriginal()) {
$translations[] = $translation;
}
$translation = new Translation('', '');
continue;
}
$splitLine = preg_split('/\s+/', $line, 2);
$key = $splitLine[0];
$data = isset($splitLine[1]) ? $splitLine[1] : '';
switch ($key) {
case '#':
$translation->addComment($data);
$append = null;
break;
case '#.':
$translation->addExtractedComment($data);
$append = null;
break;
case '#,':
foreach (array_map('trim', explode(',', trim($data))) as $value) {
$translation->addFlag($value);
}
$append = null;
break;
case '#:':
foreach (preg_split('/\s+/', trim($data)) as $value) {
if (preg_match('/^(.+)(:(\d*))?$/U', $value, $matches)) {
$translation->addReference($matches[1], isset($matches[3]) ? $matches[3] : null);
}
}
$append = null;
break;
case 'msgctxt':
$translation = $translation->getClone(self::clean($data));
$append = 'Context';
break;
case 'msgid':
$translation = $translation->getClone(null, self::clean($data));
$append = 'Original';
break;
case 'msgid_plural':
$translation->setPlural(self::clean($data));
$append = 'Plural';
break;
case 'msgstr':
case 'msgstr[0]':
$translation->setTranslation(self::clean($data));
$append = 'Translation';
break;
case 'msgstr[1]':
$translation->setPluralTranslation(self::clean($data), 0);
$append = 'PluralTranslation';
break;
default:
if (strpos($key, 'msgstr[') === 0) {
$translation->setPluralTranslation(self::clean($data), intval(substr($key, 7, -1)) - 1);
$append = 'PluralTranslation';
break;
}
if (isset($append)) {
if ($append === 'Context') {
$translation = $translation->getClone($translation->getContext()."\n".self::clean($data));
break;
}
if ($append === 'Original') {
$translation = $translation->getClone(null, $translation->getOriginal()."\n".self::clean($data));
break;
}
if ($append === 'PluralTranslation') {
$key = count($translation->getPluralTranslation()) - 1;
$translation->setPluralTranslation($translation->getPluralTranslation($key)."\n".self::clean($data), $key);
break;
}
$getMethod = 'get'.$append;
$setMethod = 'set'.$append;
$translation->$setMethod($translation->$getMethod()."\n".self::clean($data));
}
break;
}
}
if ($translation->hasOriginal() && !in_array($translation, iterator_to_array($translations))) {
$translations[] = $translation;
}
return $translations;
}
/**
* Checks if it is a header definition line. Useful for distguishing between header definitions
* and possible continuations of a header entry
*
* @param string $line Line to parse
* @return boolean
*/
private static function isHeaderDefinition($line)
{
return (bool) preg_match('/^[\w-]+:/', $line);
}
/**
* Parse the po headers
*
* @param string $headers
* @param Translations $translations
*
* @return boolean
*/
private static function parseHeaders($headers, Translations $translations)
{
$headers = explode("\n", $headers);
$currentHeader = null;
foreach ($headers as $line) {
$line = self::clean($line);
if (self::isHeaderDefinition($line)) {
$header = array_map('trim', explode(':', $line, 2));
$currentHeader = $header[0];
$translations->setHeader($currentHeader, $header[1]);
} else {
$entry = $translations->getHeader($currentHeader);
$translations->setHeader($currentHeader, $entry.$line);
}
}
}
/**
* Cleans the strings. Removes quotes, "\n", "\t", etc
*
* @param string $str
*
* @return string
*/
private static function clean($str)
{
if (!$str) {
return '';
}
if ($str[0] === '"') {
$str = substr($str, 1, -1);
}
return str_replace(array('\\n', '\\"', '\\t', '\\\\'), array("\n", '"', "\t", '\\'), $str);
}
/**
* Gets one string from multiline strings
*
* @param string $line
* @param array $lines
* @param integer &$i
*
* @return string
*/
private static function fixMultiLines($line, array $lines, &$i)
{
for ($j = $i; $j<count($lines); $j++) {
if (substr($line, -1, 1) == '"'
&& isset($lines[$j+1])
&& substr(trim($lines[$j+1]), 0, 1) == '"'
) {
$line = substr($line, 0, -1).substr(trim($lines[$j+1]), 1);
} else {
$i = $j;
break;
}
}
return $line;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
abstract class Generator
{
/**
* Saves the translations in a file
*
* @param Translations $translations
* @param string $file
*
* @return boolean
*/
public static function toFile(Translations $translations, $file)
{
$content = static::toString($translations);
if (file_put_contents($file, $content) === false) {
return false;
}
return true;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
interface GeneratorInterface
{
/**
* Saves the translations in a file
*
* @param Translations $translations
* @param string $file
*
* @return boolean
*/
public static function toFile(Translations $translations, $file);
/**
* Generates a string with the translations ready to save in a file
*
* @param Translations $translations
*
* @return string
*/
public static function toString(Translations $translations);
}

View File

@@ -0,0 +1,17 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
class Jed extends Generator implements GeneratorInterface
{
/**
* {@parentDoc}
*/
public static function toString(Translations $translations)
{
$array = PhpArray::toArray($translations);
return json_encode($array);
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
class JsonDictionary extends Generator implements GeneratorInterface
{
/**
* {@parentDoc}
*/
public static function toString(Translations $translations)
{
$array = PhpArray::toArray($translations);
//for a simple json translation dictionary, one domain is supported
$values = current($array);
// remove meta / header data
if (array_key_exists('', $values)) {
unset($values['']);
}
//map to a simple json dictionary (no plurals)
return json_encode(
array_filter(
array_map(function ($val) {
return $val[1];
}, $values)
)
);
}
}

View File

@@ -0,0 +1,131 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
class Mo extends Generator implements GeneratorInterface
{
public static $includeEmptyTranslations = false;
/**
* {@parentDoc}
*/
public static function toString(Translations $translations)
{
$array = array();
$headers = '';
foreach ($translations->getHeaders() as $headerName => $headerValue) {
$headers .= "$headerName: $headerValue\n";
}
if ($headers !== '') {
$array[''] = $headers;
}
foreach ($translations as $translation) {
if (!$translation->hasTranslation() && !static::$includeEmptyTranslations) {
continue;
}
if ($translation->hasContext()) {
$originalString = $translation->getContext()."\x04".$translation->getOriginal();
} else {
$originalString = $translation->getOriginal();
}
$array[$originalString] = $translation;
}
ksort($array);
$numEntries = count($array);
$originalsTable = '';
$translationsTable = '';
$originalsIndex = array();
$translationsIndex = array();
foreach ($array as $originalString => $translation) {
if (is_string($translation)) {
// Headers
$translationString = $translation;
} else {
/* @var $translation \Gettext\Translation */
if ($translation->hasPlural()) {
$originalString .= "\x00".$translation->getPlural();
}
$translationString = $translation->getTranslation();
if ($translation->hasPluralTranslation()) {
$translationString .= "\x00".implode("\x00", $translation->getPluralTranslation());
}
}
$originalsIndex[] = array('relativeOffset' => strlen($originalsTable), 'length' => strlen($originalString));
$originalsTable .= $originalString."\x00";
$translationsIndex[] = array('relativeOffset' => strlen($translationsTable), 'length' => strlen($translationString));
$translationsTable .= $translationString."\x00";
}
// Offset of table with the original strings index: right after the header (which is 7 words)
$originalsIndexOffset = 7 * 4;
// Size of table with the original strings index
$originalsIndexSize = $numEntries * (4 + 4);
// Offset of table with the translation strings index: right after the original strings index table
$translationsIndexOffset = $originalsIndexOffset + $originalsIndexSize;
// Size of table with the translation strings index
$translationsIndexSize = $numEntries * (4 + 4);
// Hashing table starts after the header and after the index table
$originalsStringsOffset = $translationsIndexOffset + $translationsIndexSize;
// Translations start after the keys
$translationsStringsOffset = $originalsStringsOffset + strlen($originalsTable);
// Let's generate the .mo file binary data
$mo = '';
// Magic number
$mo .= pack('L', 0x950412de);
// File format revision
$mo .= pack('L', 0);
// Number of strings
$mo .= pack('L', $numEntries);
// Offset of table with original strings
$mo .= pack('L', $originalsIndexOffset);
// Offset of table with translation strings
$mo .= pack('L', $translationsIndexOffset);
// Size of hashing table: we don't use it.
$mo .= pack('L', 0);
// Offset of hashing table: it would start right after the translations index table
$mo .= pack('L', $translationsIndexOffset + $translationsIndexSize);
// Write the lengths & offsets of the original strings
foreach ($originalsIndex as $info) {
$mo .= pack('L', $info['length']);
$mo .= pack('L', $originalsStringsOffset + $info['relativeOffset']);
}
// Write the lengths & offsets of the translated strings
foreach ($translationsIndex as $info) {
$mo .= pack('L', $info['length']);
$mo .= pack('L', $translationsStringsOffset + $info['relativeOffset']);
}
// Write original strings
$mo .= $originalsTable;
// Write translation strings
$mo .= $translationsTable;
return $mo;
}
}

View File

@@ -0,0 +1,63 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
class PhpArray extends Generator implements GeneratorInterface
{
/**
* {@inheritDoc}
*/
public static function toString(Translations $translations)
{
$array = self::toArray($translations);
return '<?php return '.var_export($array, true).'; ?>';
}
/**
* Generates an array with the translations
*
* @param Translations $translations
*
* @return array
*/
public static function toArray(Translations $translations)
{
$array = array();
$context_glue = "\004";
foreach ($translations as $translation) {
$key = ($translation->hasContext() ? $translation->getContext().$context_glue : '').$translation->getOriginal();
$entry = array($translation->getPlural(), $translation->getTranslation());
if ($translation->hasPluralTranslation()) {
$entry = array_merge($entry, $translation->getPluralTranslation());
}
$array[$key] = $entry;
}
$domain = $translations->getDomain() ?: 'messages';
$lang = $translations->getLanguage() ?: 'en';
$fullArray = array(
$domain => array(
'' => array(
'domain' => $domain,
'lang' => $lang,
'plural-forms' => 'nplurals=2; plural=(n != 1);',
),
),
);
if ($translations->getHeader('Plural-Forms') !== null) {
$fullArray[$domain]['']['plural-forms'] = $translations->getHeader('Plural-Forms');
}
$fullArray[$domain] = array_merge($fullArray[$domain], $array);
return $fullArray;
}
}

View File

@@ -0,0 +1,127 @@
<?php
namespace Gettext\Generators;
use Gettext\Translations;
class Po extends Generator implements GeneratorInterface
{
/**
* {@parentDoc}
*/
public static function toString(Translations $translations)
{
$lines = array('msgid ""', 'msgstr ""');
$headers = $translations->getHeaders();
$headers['PO-Revision-Date'] = date('c');
foreach ($headers as $name => $value) {
$lines[] = '"'.$name.': '.$value.'\\n"';
}
$lines[] = '';
//Translations
foreach ($translations as $translation) {
if ($translation->hasComments()) {
foreach ($translation->getComments() as $comment) {
$lines[] = '# '.$comment;
}
}
if ($translation->hasExtractedComments()) {
foreach ($translation->getExtractedComments() as $comment) {
$lines[] = '#. '.$comment;
}
}
if ($translation->hasReferences()) {
foreach ($translation->getReferences() as $reference) {
$lines[] = '#: '.$reference[0].(!is_null($reference[1]) ? ':'.$reference[1] : null);
}
}
if ($translation->hasFlags()) {
$lines[] = '#, '.implode(',', $translation->getFlags());
}
if ($translation->hasContext()) {
$lines[] = 'msgctxt '.self::quote($translation->getContext());
}
self::addLines($lines, 'msgid', $translation->getOriginal());
if ($translation->hasPlural()) {
self::addLines($lines, 'msgid_plural', $translation->getPlural());
self::addLines($lines, 'msgstr[0]', $translation->getTranslation());
foreach ($translation->getPluralTranslation() as $k => $v) {
self::addLines($lines, 'msgstr['.($k + 1).']', $v);
}
} else {
self::addLines($lines, 'msgstr', $translation->getTranslation());
}
$lines[] = '';
}
return implode("\n", $lines);
}
/**
* Escapes and adds double quotes to a string
*
* @param string $string
*
* @return string
*/
private static function quote($string)
{
return '"'.str_replace(array('\\', "\r", "\n", "\t", '"'), array('\\\\', '', '\n', '\t', '\\"'), $string).'"';
}
/**
* Escapes and adds double quotes to a string
*
* @param string $string
*
* @return string
*/
private static function multilineQuote($string)
{
$lines = explode("\n", $string);
$last = count($lines) - 1;
foreach ($lines as $k => $line) {
if ($k === $last) {
$lines[$k] = self::quote($line);
} else {
$lines[$k] = self::quote($line."\n");
}
}
return $lines;
}
/**
* Add one or more lines depending whether the string is multiline or not
*
* @param array &$lines
* @param string $name
* @param string $value
*/
private static function addLines(array &$lines, $name, $value)
{
$newLines = self::multilineQuote($value);
if (count($newLines) === 1) {
$lines[] = $name.' '.$newLines[0];
} else {
$lines[] = $name.' ""';
foreach ($newLines as $line) {
$lines[] = $line;
}
}
}
}

View File

@@ -0,0 +1,478 @@
<?php
namespace Gettext;
/**
* Class to manage a translation string
*/
class Translation
{
protected $context;
protected $original;
protected $translation = '';
protected $plural;
protected $pluralTranslation = array();
protected $references = array();
protected $comments = array();
protected $extractedComments = array();
protected $flags = array();
protected $translationCount;
/**
* Generates the id of a translation (context + glue + original)
*
* @param string $context
* @param string $original
*
* @return string
*/
public static function generateId($context, $original)
{
return "{$context}\004{$original}";
}
/**
* Construct
*
* @param string $context The context of the translation
* @param string $original The original string
* @param string $plural The original plural string
*/
public function __construct($context, $original, $plural = '')
{
$this->context = (string) $context;
$this->original = (string) $original;
$this->setPlural($plural);
}
/**
* Clones this translation
*
* @param null|string $context Optional new context
* @param null|string $original Optional new original
*/
public function getClone($context = null, $original = null)
{
$new = clone $this;
if ($context !== null) {
$new->context = (string) $context;
}
if ($original !== null) {
$new->original = (string) $original;
}
return $new;
}
/**
* Returns the id of this translation
*
* @return string
*/
public function getId()
{
return static::generateId($this->context, $this->original);
}
/**
* Checks whether the translation matches with the arguments
*
* @param string $context
* @param string $original
*
* @return boolean
*/
public function is($context, $original = '')
{
return (($this->context === $context) && ($this->original === $original)) ? true : false;
}
/**
* Gets the original string
*
* @return string
*/
public function getOriginal()
{
return $this->original;
}
/**
* Checks if the original string is empty or not
*
* @return boolean
*/
public function hasOriginal()
{
return ($this->original !== '') ? true : false;
}
/**
* Sets the translation string
*
* @param string $translation
*/
public function setTranslation($translation)
{
$this->translation = (string) $translation;
}
/**
* Gets the translation string
*
* @return string
*/
public function getTranslation()
{
return $this->translation;
}
/**
* Checks if the translation string is empty or not
*
* @return boolean
*/
public function hasTranslation()
{
return ($this->translation !== '') ? true : false;
}
/**
* Sets the plural translation string
*
* @param string $plural
*/
public function setPlural($plural)
{
$this->plural = (string) $plural;
$this->normalizeTranslationCount();
}
/**
* Gets the plural translation string
*
* @return string
*/
public function getPlural()
{
return $this->plural;
}
/**
* Checks if the plural translation string is empty or not
*
* @return boolean
*/
public function hasPlural()
{
return ($this->plural !== '') ? true : false;
}
/**
* Set a new plural translation
*
* @param string $plural The plural string to add
* @param integer $key The key of the plural translation.
*/
public function setPluralTranslation($plural, $key = 0)
{
$this->pluralTranslation[$key] = $plural;
$this->normalizeTranslationCount();
}
/**
* Gets one or all plural translations
*
* @param integer|null $key The key to return. If is null, return all translations
*
* @return string|array
*/
public function getPluralTranslation($key = null)
{
if ($key === null) {
return $this->pluralTranslation;
}
return isset($this->pluralTranslation[$key]) ? (string) $this->pluralTranslation[$key] : '';
}
/**
* Checks if there are any plural translation
*
* @return boolean
*/
public function hasPluralTranslation()
{
return implode('', $this->pluralTranslation) !== '';
}
/**
* Removes all plural translations
*/
public function deletePluralTranslation()
{
$this->pluralTranslation = array();
$this->normalizeTranslationCount();
}
/**
* Set the number of singular + plural translations allowed
*
* @param integer $count
*/
public function setTranslationCount($count)
{
$this->translationCount = is_null($count) ? null : intval($count);
$this->normalizeTranslationCount();
}
/**
* Returns the number of singular + plural translations
* Returns null if this Translation is not a plural one
*
* @return integer|null
*/
public function getTranslationCount()
{
return $this->hasPlural() ? $this->translationCount : null;
}
/**
* Normalizes the translation count
*/
protected function normalizeTranslationCount()
{
if ($this->translationCount === null) {
return;
}
if ($this->hasPlural()) {
$allowed = $this->translationCount - 1;
$current = count($this->pluralTranslation);
if ($allowed > $current) {
$this->pluralTranslation = $this->pluralTranslation + array_fill(0, $allowed, '');
} elseif ($current > $allowed) {
$this->pluralTranslation = array_slice($this->pluralTranslation, 0, $allowed);
}
} else {
$this->pluralTranslation = array();
}
}
/**
* Gets the context of this translation
*
* @return string
*/
public function getContext()
{
return $this->context;
}
/**
* Checks if the context is empty or not
*
* @return boolean
*/
public function hasContext()
{
return (isset($this->context) && ($this->context !== '')) ? true : false;
}
/**
* Adds a new reference for this translation
*
* @param string $filename The file path where the translation has been found
* @param null|integer $line The line number where the translation has been found
*/
public function addReference($filename, $line = null)
{
$key = "{$filename}:{$line}";
$this->references[$key] = array($filename, $line);
}
/**
* Checks if the translation has any reference
*
* @return boolean
*/
public function hasReferences()
{
return !empty($this->references);
}
/**
* Return all references for this translation
*
* @return array
*/
public function getReferences()
{
return array_values($this->references);
}
/**
* Removes all references
*/
public function deleteReferences()
{
$this->references = array();
}
/**
* Adds a new comment for this translation
*
* @param string $comment
*/
public function addComment($comment)
{
$this->comments[] = $comment;
}
/**
* Checks if the translation has any comment
*
* @return boolean
*/
public function hasComments()
{
return isset($this->comments[0]);
}
/**
* Returns all comments for this translation
*
* @return array
*/
public function getComments()
{
return $this->comments;
}
/**
* Removes all comments
*/
public function deleteComments()
{
$this->comments = array();
}
/**
* Adds a new extracted comment for this translation
*
* @param string $comment
*/
public function addExtractedComment($comment)
{
$this->extractedComments[] = $comment;
}
/**
* Checks if the translation has any extracted comment
*
* @return boolean
*/
public function hasExtractedComments()
{
return isset($this->extractedComments[0]);
}
/**
* Returns all extracted comments for this translation
*
* @return array
*/
public function getExtractedComments()
{
return $this->extractedComments;
}
/**
* Removes all extracted comments
*/
public function deleteExtractedComments()
{
$this->extractedComments = array();
}
/**
* Adds a new flat for this translation
*
* @param string $flag
*/
public function addFlag($flag)
{
$this->flags[] = $flag;
}
/**
* Checks if the translation has any flag
*
* @return boolean
*/
public function hasFlags()
{
return isset($this->flags[0]);
}
/**
* Returns all extracted flags for this translation
*
* @return array
*/
public function getFlags()
{
return $this->flags;
}
/**
* Removes all flags
*/
public function deleteFlags()
{
$this->flags = array();
}
/**
* Merges this translation with other translation
*
* @param Translation $translation The translation to merge with
* @param integer|null $method One or various Translations::MERGE_* constants to define how to merge the translations
*/
public function mergeWith(Translation $translation, $method = null)
{
if ($method === null) {
$method = Translations::$mergeDefault;
}
if (!$this->hasTranslation()) {
$this->setTranslation($translation->getTranslation());
}
if (($method & Translations::MERGE_PLURAL) && !$this->hasPlural()) {
$this->setPlural($translation->getPlural());
}
if ($this->hasPlural() && !$this->hasPluralTranslation() && $translation->hasPluralTranslation()) {
$this->pluralTranslation = $translation->getPluralTranslation();
}
if ($method & Translations::MERGE_REFERENCES) {
foreach ($translation->getReferences() as $reference) {
$this->addReference($reference[0], $reference[1]);
}
}
if ($method & Translations::MERGE_COMMENTS) {
$this->comments = array_values(array_unique(array_merge($translation->getComments(), $this->comments)));
$this->extractedComments = array_values(array_unique(array_merge($translation->getExtractedComments(), $this->extractedComments)));
$this->flags = array_values(array_unique(array_merge($translation->getFlags(), $this->flags)));
}
}
}

View File

@@ -0,0 +1,381 @@
<?php
namespace Gettext;
use Gettext\Languages\Language;
/**
* Class to manage a collection of translations
*/
class Translations extends \ArrayObject
{
const MERGE_ADD = 1;
const MERGE_REMOVE = 2;
const MERGE_HEADERS = 4;
const MERGE_REFERENCES = 8;
const MERGE_COMMENTS = 16;
const MERGE_LANGUAGE = 32;
const MERGE_PLURAL = 64;
const HEADER_LANGUAGE = 'Language';
const HEADER_PLURAL = 'Plural-Forms';
const HEADER_DOMAIN = 'X-Domain';
public static $mergeDefault = 93; // self::MERGE_ADD | self::MERGE_HEADERS | self::MERGE_COMMENTS | self::MERGE_REFERENCES | self::MERGE_PLURAL
private $headers;
private $translationCount;
/**
* @see \ArrayObject::__construct()
*/
public function __construct($input = array(), $flags = 0, $iterator_class = 'ArrayIterator')
{
$this->headers = array(
'Project-Id-Version' => '',
'Report-Msgid-Bugs-To' => '',
'Last-Translator' => '',
'Language-Team' => '',
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8',
'Content-Transfer-Encoding' => '8bit',
'POT-Creation-Date' => date('c'),
'PO-Revision-Date' => date('c'),
);
$this->headers[self::HEADER_LANGUAGE] = '';
parent::__construct($input, $flags, $iterator_class);
}
/**
* Magic method to create new instances using extractors
* For example: Translations::fromMoFile($filename);
*
* @return Translations
*/
public static function __callStatic($name, $arguments)
{
if (!preg_match('/^from(\w+)(File|String)$/i', $name, $matches)) {
throw new \Exception("The method $name does not exists");
}
return call_user_func_array('Gettext\\Extractors\\'.$matches[1].'::from'.$matches[2], $arguments);
}
/**
* Magic method to export the translations to a specific format
* For example: $translations->toMoFile($filename);
*
* @return bool|string
*/
public function __call($name, $arguments)
{
if (!preg_match('/^to(\w+)(File|String)$/i', $name, $matches)) {
throw new \Exception("The method $name does not exists");
}
array_unshift($arguments, $this);
return call_user_func_array('Gettext\\Generators\\'.$matches[1].'::to'.$matches[2], $arguments);
}
/**
* Magic method to clone each translation on clone the translations object
*/
public function __clone()
{
$array = array();
foreach ($this as $key => $translation) {
$array[$key] = clone $translation;
}
$this->exchangeArray($array);
}
/**
* Control the new translations added
*
* @param mixed $index
* @param mixed $value
*
* @throws InvalidArgumentException If the value is not an instance of Gettext\Translation
*
* @return Translation
*/
public function offsetSet($index, $value)
{
if (!($value instanceof Translation)) {
throw new \InvalidArgumentException('Only instances of Gettext\\Translation must be added to a Gettext\\Translations');
}
$id = $value->getId();
if ($this->offsetExists($id)) {
$this[$id]->mergeWith($value);
$this[$id]->setTranslationCount($this->translationCount);
return $this[$id];
}
$value->setTranslationCount($this->translationCount);
parent::offsetSet($id, $value);
return $value;
}
/**
* Set the plural definition
*
* @param integer $count
* @param string $rule
*/
public function setPluralForms($count, $rule)
{
$this->setHeader(self::HEADER_PLURAL, "nplurals={$count}; plural={$rule};");
}
/**
* Returns the parsed plural definition
*
* @param null|array [count, rule]
*/
public function getPluralForms()
{
$header = $this->getHeader(self::HEADER_PLURAL);
if ($header && preg_match('/^nplurals\s*=\s*(\d+)\s*;\s*plural\s*=\s*([^;]+)\s*;$/', $header, $matches)) {
return array(intval($matches[1]), $matches[2]);
}
}
/**
* Set a new header.
*
* @param string $name
* @param string $value
*/
public function setHeader($name, $value)
{
$name = trim($name);
$this->headers[$name] = trim($value);
if ($name === self::HEADER_PLURAL) {
if ($forms = $this->getPluralForms()) {
$this->translationCount = $forms[0];
foreach ($this as $t) {
$t->setTranslationCount($this->translationCount);
}
} else {
$this->translationCount = null;
}
}
}
/**
* Returns a header value
*
* @param string $name
*
* @return null|string
*/
public function getHeader($name)
{
return isset($this->headers[$name]) ? $this->headers[$name] : null;
}
/**
* Returns all header for this translations
*
* @return array
*/
public function getHeaders()
{
return $this->headers;
}
/**
* Removes all headers
*/
public function deleteHeaders()
{
$this->headers = array();
}
/**
* Removes one header
*
* @param string $name
*/
public function deleteHeader($name)
{
unset($this->headers[$name]);
}
/**
* Returns the language value
*
* @return string $language
*/
public function getLanguage()
{
return $this->getHeader(self::HEADER_LANGUAGE);
}
/**
* Sets the language and the plural forms
*
* @param string $language
*
* @return boolean Returns true if the plural rules has been updated, false if $language hasn't been recognized
*/
public function setLanguage($language)
{
$this->setHeader(self::HEADER_LANGUAGE, trim($language));
if (($info = Language::getById($language))) {
$this->setPluralForms(count($info->categories), $info->formula);
return true;
}
return false;
}
/**
* Checks whether the language is empty or not
*
* @return boolean
*/
public function hasLanguage()
{
$language = $this->getLanguage();
return (is_string($language) && ($language !== '')) ? true : false;
}
/**
* Set a new domain for this translations
*
* @param string $domain
*/
public function setDomain($domain)
{
$this->setHeader(self::HEADER_DOMAIN, trim($domain));
}
/**
* Returns the domain
*
* @return string
*/
public function getDomain()
{
return $this->getHeader(self::HEADER_DOMAIN);
}
/**
* Checks whether the domain is empty or not
*
* @return boolean
*/
public function hasDomain()
{
$domain = $this->getDomain();
return (is_string($domain) && ($domain !== '')) ? true : false;
}
/**
* Search for a specific translation
*
* @param string|Translation $context The context of the translation or a translation instance
* @param string $original The original string
*
* @return Translation|false
*/
public function find($context, $original = '')
{
if ($context instanceof Translation) {
$id = $context->getId();
} else {
$id = Translation::generateId($context, $original);
}
return $this->offsetExists($id) ? $this[$id] : false;
}
/**
* Creates and insert/merges a new translation
*
* @param string $context The translation context
* @param string $original The translation original string
* @param string $plural The translation original plural string
*
* @return Translation The translation created
*/
public function insert($context, $original, $plural = '')
{
return $this->offsetSet(null, new Translation($context, $original, $plural));
}
/**
* Merges this translations with other translations
*
* @param Translations $translations The translations instance to merge with
* @param integer|null $method One or various Translations::MERGE_* constants to define how to merge the translations
*/
public function mergeWith(Translations $translations, $method = null)
{
if ($method === null) {
$method = self::$mergeDefault;
}
if ($method & self::MERGE_HEADERS) {
foreach ($translations->getHeaders() as $name => $value) {
if (!$this->getHeader($name)) {
$this->setHeader($name, $value);
}
}
}
$add = (boolean) ($method & self::MERGE_ADD);
foreach ($translations as $entry) {
if (($existing = $this->find($entry))) {
$existing->mergeWith($entry, $method);
} elseif ($add) {
$this[] = clone $entry;
}
}
if ($method & self::MERGE_REMOVE) {
$filtered = array();
foreach ($this as $entry) {
if ($translations->find($entry)) {
$filtered[] = $entry;
}
}
$this->exchangeArray($filtered);
}
if ($method & self::MERGE_LANGUAGE) {
$language = $translations->getLanguage();
$pluralForm = $translations->getPluralForms();
if (!$pluralForm) {
if ($language) {
$this->setLanguage($language);
}
} else {
if ($language) {
$this->setHeader(self::HEADER_LANGUAGE, $language);
}
$this->setPluralForms($pluralForm[0], $pluralForm[1]);
}
}
}
}

View File

@@ -0,0 +1,308 @@
<?php
namespace Gettext;
use Gettext\Generators\PhpArray;
class Translator
{
public static $current;
private $domain;
private $dictionary = array();
private $context_glue = "\004";
private $plurals = array();
/**
* Set a translation instance as global, to use it with the gettext functions
*
* @param Translator $translator
*/
public static function initGettextFunctions(Translator $translator)
{
self::$current = $translator;
include_once __DIR__.'/translator_functions.php';
}
/**
* Loads translation from a Translations instance, a file on an array
*
* @param Translations|string|array $translations
*
* @return Translator
*/
public function loadTranslations($translations)
{
if (is_object($translations) && $translations instanceof Translations) {
$translations = PhpArray::toArray($translations);
} elseif (is_string($translations) && is_file($translations)) {
$translations = include $translations;
} elseif (!is_array($translations)) {
throw new \InvalidArgumentException('Invalid Translator: only arrays, files or instance of Translations are allowed');
}
foreach ($translations as $translation) {
$this->addTranslations($translation);
}
return $this;
}
/**
* Set new translations to the dictionary
*
* @param array $translations
*/
public function addTranslations(array $translations)
{
$info = isset($translations['']) ? $translations[''] : null;
unset($translations['']);
$domain = isset($info['domain']) ? $info['domain'] : 'messages';
//Set the first domain loaded as default domain
if (!$this->domain) {
$this->domain = $domain;
}
if (!isset($this->dictionary[$domain])) {
// If a plural form is set we extract those values
$pluralForms = empty($info['plural-forms']) ? 'nplurals=2; plural=(n != 1)' : $info['plural-forms'];
list($count, $code) = explode(';', $pluralForms, 2);
// extract just the expression turn 'n' into a php variable '$n'.
// Slap on a return keyword and semicolon at the end.
$this->plurals[$domain] = array(
'count' => (int) str_replace('nplurals=', '', $count),
'code' => str_replace('plural=', 'return ', str_replace('n', '$n', $code)).';',
);
$this->dictionary[$domain] = $translations;
} else {
$this->dictionary[$domain] = array_replace_recursive($this->dictionary[$domain], $translations);
}
}
/**
* Clear all translations
*/
public function clearTranslations()
{
$this->dictionary = array();
}
/**
* Search and returns a translation
*
* @param string $domain
* @param string $context
* @param string $original
*
* @return array
*/
public function getTranslation($domain, $context, $original)
{
$key = isset($context) ? $context.$this->context_glue.$original : $original;
return isset($this->dictionary[$domain][$key]) ? $this->dictionary[$domain][$key] : false;
}
/**
* Gets a translation using the original string
*
* @param string $original
*
* @return string
*/
public function gettext($original)
{
return $this->dpgettext($this->domain, null, $original);
}
/**
* Gets a translation checking the plural form
*
* @param string $original
* @param string $plural
* @param string $value
*
* @return string
*/
public function ngettext($original, $plural, $value)
{
return $this->dnpgettext($this->domain, null, $original, $plural, $value);
}
/**
* Gets a translation checking the domain and the plural form
*
* @param string $domain
* @param string $original
* @param string $plural
* @param string $value
*
* @return string
*/
public function dngettext($domain, $original, $plural, $value)
{
return $this->dnpgettext($domain, null, $original, $plural, $value);
}
/**
* Gets a translation checking the context and the plural form
*
* @param string $context
* @param string $original
* @param string $plural
* @param string $value
*
* @return string
*/
public function npgettext($context, $original, $plural, $value)
{
return $this->dnpgettext($this->domain, $context, $original, $plural, $value);
}
/**
* Gets a translation checking the context
*
* @param string $context
* @param string $original
*
* @return string
*/
public function pgettext($context, $original)
{
return $this->dpgettext($this->domain, $context, $original);
}
/**
* Gets a translation checking the domain
*
* @param string $domain
* @param string $original
*
* @return string
*/
public function dgettext($domain, $original)
{
return $this->dpgettext($domain, null, $original);
}
/**
* Gets a translation checking the domain and context
*
* @param string $domain
* @param string $context
* @param string $original
*
* @return string
*/
public function dpgettext($domain, $context, $original)
{
$translation = $this->getTranslation($domain, $context, $original);
if (isset($translation[1]) && $translation[1] !== '') {
return $translation[1];
}
return $original;
}
/**
* Gets a translation checking the domain, the context and the plural form
*
* @param string $domain
* @param string $context
* @param string $original
* @param string $plural
* @param string $value
*/
public function dnpgettext($domain, $context, $original, $plural, $value)
{
$key = $this->isPlural($domain, $value);
$translation = $this->getTranslation($domain, $context, $original);
if (isset($translation[$key]) && $translation[$key] !== '') {
return $translation[$key];
}
return ($key === 1) ? $original : $plural;
}
/**
* Executes the plural decision code given the number to decide which
* plural version to take.
*
* @param string $domain
* @param string $n
* @return int
*/
public function isPlural($domain, $n)
{
//Not loaded domain, use a fallback
if (!isset($this->plurals[$domain])) {
return $n == 1 ? 1 : 2;
}
if (!isset($this->plurals[$domain]['function'])) {
$this->plurals[$domain]['function'] = create_function('$n', self::fixTerseIfs($this->plurals[$domain]['code']));
}
if ($this->plurals[$domain]['count'] <= 2) {
return (call_user_func($this->plurals[$domain]['function'], $n)) ? 2 : 1;
}
// We need to +1 because while (GNU) gettext codes assume 0 based,
// this gettext actually stores 1 based.
return (call_user_func($this->plurals[$domain]['function'], $n)) + 1;
}
/**
* This function will recursively wrap failure states in brackets if they contain a nested terse if
*
* This because PHP can not handle nested terse if's unless they are wrapped in brackets.
*
* This code probably only works for the gettext plural decision codes.
*
* return ($n==1 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2);
* becomes
* return ($n==1 ? 0 : ($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2));
*
* @param string $code the terse if string
* @param bool $inner If inner is true we wrap it in brackets
* @return string A formatted terse If that PHP can work with.
*/
private static function fixTerseIfs($code, $inner = false)
{
/**
* (?P<expression>[^?]+) Capture everything up to ? as 'expression'
* \? ?
* (?P<success>[^:]+) Capture everything up to : as 'success'
* : :
* (?P<failure>[^;]+) Capture everything up to ; as 'failure'
*/
preg_match('/(?P<expression>[^?]+)\?(?P<success>[^:]+):(?P<failure>[^;]+)/', $code, $matches);
// If no match was found then no terse if was present
if (!isset($matches[0])) {
return $code;
}
$expression = $matches['expression'];
$success = $matches['success'];
$failure = $matches['failure'];
// Go look for another terse if in the failure state.
$failure = self::fixTerseIfs($failure, true);
$code = $expression.' ? '.$success.' : '.$failure;
if ($inner) {
return "($code)";
}
// note the semicolon. We need that for executing the code.
return "$code;";
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace Gettext\Utils;
use Exception;
use Gettext\Translations;
abstract class FunctionsScanner
{
/**
* Scan and returns the functions and the arguments
*
* @return array
*/
abstract public function getFunctions();
/**
* Search for specific functions and create translations
*
* @param array $functions The gettext functions to search
* @param Translations $translations The translations instance where save the values
* @param string $file The filename used to the reference
*/
public function saveGettextFunctions(array $functions, Translations $translations, $file = '')
{
foreach ($this->getFunctions() as $function) {
list($name, $line, $args) = $function;
if (!isset($functions[$name])) {
continue;
}
switch ($functions[$name]) {
case '__':
if (!isset($args[0])) {
continue 2;
}
$original = $args[0];
$translation = $translations->insert('', $original);
break;
case 'n__':
if (!isset($args[1])) {
continue 2;
}
$original = $args[0];
$plural = $args[1];
$translation = $translations->insert('', $original, $plural);
break;
case 'p__':
if (!isset($args[1])) {
continue 2;
}
$context = $args[0];
$original = $args[1];
$translation = $translations->insert($context, $original);
break;
default:
throw new Exception('Not valid functions');
}
$translation->addReference($file, $line);
}
}
}

View File

@@ -0,0 +1,216 @@
<?php
namespace Gettext\Utils;
class JsFunctionsScanner extends FunctionsScanner
{
protected $code;
protected $status = array();
/**
* Constructor
*
* @param string $code The php code to scan
*/
public function __construct($code)
{
$this->code = $code;
}
/**
* {@inheritDoc}
*/
public function getFunctions()
{
$length = strlen($this->code);
$line = 1;
$buffer = '';
$functions = array();
$bufferFunctions = array();
$char = null;
for ($pos = 0; $pos < $length; $pos++) {
$prev = $char;
$char = $this->code[$pos];
$next = isset($this->code[$pos]) ? $this->code[$pos] : null;
switch ($char) {
case "\n":
++$line;
if ($this->status('line-comment')) {
$this->upStatus();
}
break;
case "/":
switch ($this->status()) {
case 'simple-quote':
case 'double-quote':
case 'line-comment':
break;
case 'block-comment':
if ($prev === '*') {
$this->upStatus();
}
break;
default:
if ($next === '/') {
$this->downStatus('line-comment');
} elseif ($next === '*') {
$this->downStatus('block-comment');
}
break;
}
break;
case "'":
switch ($this->status()) {
case 'simple-quote':
$this->upStatus();
break;
case 'line-comment':
case 'block-comment':
break;
default:
$this->downStatus('simple-quote');
break;
}
break;
case '"':
switch ($this->status()) {
case 'double-quote':
$this->upStatus();
break;
case 'line-comment':
case 'block-comment':
break;
default:
$this->downStatus('double-quote');
break;
}
break;
case '(':
switch ($this->status()) {
case 'double-quote':
case 'line-comment':
case 'block-comment':
break;
default:
if ($buffer && preg_match('/(\w+)$/', $buffer, $matches)) {
$this->downStatus('function');
array_unshift($bufferFunctions, array($matches[1], $line, array()));
$buffer = '';
continue 3;
}
break;
}
break;
case ')':
switch ($this->status()) {
case 'function':
if (($argument = self::prepareArgument($buffer))) {
$bufferFunctions[0][2][] = $argument;
}
if ($bufferFunctions) {
$functions[] = array_shift($bufferFunctions);
}
$buffer = '';
continue 3;
}
case ',':
switch ($this->status()) {
case 'function':
if (($argument = self::prepareArgument($buffer))) {
$bufferFunctions[0][2][] = $argument;
}
$buffer = '';
continue 3;
}
}
switch ($this->status()) {
case 'line-comment':
case 'block-comment':
break;
default:
$buffer .= $char;
break;
}
}
return $functions;
}
/**
* Get the current context of the scan
*
* @param null|string $match To check whether the current status is this value
*
* @return string|boolean
*/
protected function status($match = null)
{
$status = isset($this->status[0]) ? $this->status[0] : null;
if ($match) {
return ($status === $match);
}
return $status;
}
/**
* Add a new status to the stack
*
* @param string $status
*/
protected function downStatus($status)
{
array_unshift($this->status, $status);
}
/**
* Removes and return the current status
*
* @return string|null
*/
protected function upStatus()
{
return array_shift($this->status);
}
/**
* Prepares the arguments found in functions
*
* @param string $argument
*
* @return string
*/
protected static function prepareArgument($argument)
{
if ($argument && ($argument[0] === '"' || $argument[0] === "'")) {
if ($argument[0] === '"') {
$argument = str_replace('\\"', '"', $argument);
} else {
$argument = str_replace("\\'", "'", $argument);
}
return substr($argument, 1, -1);
}
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace Gettext\Utils;
class PhpFunctionsScanner extends FunctionsScanner
{
protected $tokens;
/**
* Constructor
*
* @param string $code The php code to scan
*/
public function __construct($code)
{
$this->tokens = token_get_all($code);
}
/**
* {@inheritDoc}
*/
public function getFunctions()
{
$count = count($this->tokens);
$bufferFunctions = array();
$functions = array();
for ($k = 0; $k < $count; $k++) {
$value = $this->tokens[$k];
//close the current function
if (is_string($value)) {
if ($value === ')' && isset($bufferFunctions[0])) {
$functions[] = array_shift($bufferFunctions);
}
continue;
}
//add an argument to the current function
if (isset($bufferFunctions[0]) && ($value[0] === T_CONSTANT_ENCAPSED_STRING)) {
$val = $value[1];
if ($val[0] === '"') {
$val = str_replace('\\"', '"', $val);
} else {
$val = str_replace("\\'", "'", $val);
}
$bufferFunctions[0][2][] = substr($val, 1, -1);
continue;
}
//new function found
if (($value[0] === T_STRING) && is_string($this->tokens[$k + 1]) && ($this->tokens[$k + 1] === '(')) {
array_unshift($bufferFunctions, array($value[1], $value[2], array()));
$k++;
continue;
}
}
return $functions;
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace Gettext\Utils;
class StringReader
{
public $pos;
public $str;
public $strlen;
/**
* Constructor
*
* @param string $str The string to read
*/
public function __construct($str)
{
$this->str = $str;
$this->strlen = strlen($this->str);
}
/**
* Read and returns a part of the string
*
* @param int $bytes The number of bytes to read
*
* @return string
*/
public function read($bytes)
{
$data = substr($this->str, $this->pos, $bytes);
$this->seekto($this->pos + $bytes);
return $data;
}
/**
* Move the cursor to a specific position
*
* @param int $pos The amount of bytes to move
*
* @return int The new position
*/
public function seekto($pos)
{
$this->pos = ($this->strlen < $pos) ? $this->strlen : $pos;
return $this->pos;
}
}

View File

@@ -0,0 +1,12 @@
<?php
spl_autoload_register(function ($class) {
if (strpos($class, 'Gettext\\') !== 0) {
return;
}
$file = __DIR__.str_replace('\\', DIRECTORY_SEPARATOR, substr($class, strlen('Gettext'))).'.php';
if (is_file($file)) {
require_once $file;
}
});

View File

@@ -0,0 +1,192 @@
<?php
use Gettext\Translator;
/**
* Returns the translation of a string
*
* @param string $original
*
* @return string
*/
function __($original)
{
$text = Translator::$current->gettext($original);
if (func_num_args() === 1) {
return $text;
}
$args = array_slice(func_get_args(), 1);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Returns the singular/plural translation of a string
*
* @param string $original
* @param string $plural
* @param string $value
*
* @return string
*/
function n__($original, $plural, $value)
{
$text = Translator::$current->ngettext($original, $plural, $value);
if (func_num_args() === 3) {
return $text;
}
$args = array_slice(func_get_args(), 3);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Returns the translation of a string in a specific context
*
* @param string $context
* @param string $original
*
* @return string
*/
function p__($context, $original)
{
$text = Translator::$current->pgettext($context, $original);
if (func_num_args() === 2) {
return $text;
}
$args = array_slice(func_get_args(), 2);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Returns the translation of a string in a specific domain
*
* @param string $domain
* @param string $original
*
* @return string
*/
function d__($domain, $original)
{
$text = Translator::dgettext($domain, $original);
if (func_num_args() === 2) {
return $text;
}
$args = array_slice(func_get_args(), 2);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Returns the translation of a string in a specific domain and context
*
* @param string $domain
* @param string $context
* @param string $original
*
* @return string
*/
function dp__($domain, $context, $original)
{
$text = Translator::dpgettext($domain, $context, $original);
if (func_num_args() === 3) {
return $text;
}
$args = array_slice(func_get_args(), 3);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Returns the singular/plural translation of a string in a specific domain and context
*
* @param string $domain
* @param string $context
* @param string $original
* @param string $plural
* @param string $value
*
* @return string
*/
function dnp__($domain, $context, $original, $plural, $value)
{
$text = Translator::dnpgettext($domain, $context, $original, $plural, $value);
if (func_num_args() === 5) {
return $text;
}
$args = array_slice(func_get_args(), 5);
return vsprintf($text, is_array($args[0]) ? $args[0] : $args);
}
/**
* Prints function result
*
* @see __
*/
function __e()
{
echo call_user_func_array('__', func_get_args());
}
/**
* Prints function result
*
* @see n__
*/
function n__e()
{
echo call_user_func_array('n__', func_get_args());
}
/**
* Prints function result
*
* @see p__
*/
function p__e()
{
echo call_user_func_array('p__', func_get_args());
}
/**
* Prints function result
*
* @see d__
*/
function d__e()
{
echo call_user_func_array('d__', func_get_args());
}
/**
* Prints function result
*
* @see dp__
*/
function dp__e()
{
echo call_user_func_array('dp__', func_get_args());
}
/**
* Prints function result
*
* @see dnp__
*/
function dnp__e()
{
echo call_user_func_array('dnp__', func_get_args());
}

View File

@@ -0,0 +1,333 @@
<?php
class InvalidHashException extends Exception {}
class CannotPerformOperationException extends Exception {}
class PasswordStorage
{
// These constants may be changed without breaking existing hashes.
const PBKDF2_HASH_ALGORITHM = "sha1";
const PBKDF2_ITERATIONS = 64000;
const PBKDF2_SALT_BYTES = 24;
const PBKDF2_OUTPUT_BYTES = 18;
// These constants define the encoding and may not be changed.
const HASH_SECTIONS = 5;
const HASH_ALGORITHM_INDEX = 0;
const HASH_ITERATION_INDEX = 1;
const HASH_SIZE_INDEX = 2;
const HASH_SALT_INDEX = 3;
const HASH_PBKDF2_INDEX = 4;
/**
* Hash a password with PBKDF2
*
* @param string $password
* @return string
*/
public static function create_hash($password)
{
// format: algorithm:iterations:outputSize:salt:pbkdf2output
if (!\is_string($password)) {
throw new InvalidArgumentException(
"create_hash(): Expected a string"
);
}
if (\function_exists('random_bytes')) {
try {
$salt_raw = \random_bytes(self::PBKDF2_SALT_BYTES);
} catch (Error $e) {
$salt_raw = false;
} catch (Exception $e) {
$salt_raw = false;
} catch (TypeError $e) {
$salt_raw = false;
}
} else {
$salt_raw = \openssl_random_pseudo_bytes(self::PBKDF2_SALT_BYTES);
}
if ($salt_raw === false) {
throw new CannotPerformOperationException(
"Random number generator failed. Not safe to proceed."
);
}
$PBKDF2_Output = self::pbkdf2(
self::PBKDF2_HASH_ALGORITHM,
$password,
$salt_raw,
self::PBKDF2_ITERATIONS,
self::PBKDF2_OUTPUT_BYTES,
true
);
return self::PBKDF2_HASH_ALGORITHM .
":" .
self::PBKDF2_ITERATIONS .
":" .
self::PBKDF2_OUTPUT_BYTES .
":" .
\base64_encode($salt_raw) .
":" .
\base64_encode($PBKDF2_Output);
}
/**
* Verify that a password matches the stored hash
*
* @param string $password
* @param string $hash
* @return bool
*/
public static function verify_password($password, $hash)
{
if (!\is_string($password) || !\is_string($hash)) {
throw new InvalidArgumentException(
"verify_password(): Expected two strings"
);
}
$params = \explode(":", $hash);
if (\count($params) !== self::HASH_SECTIONS) {
throw new InvalidHashException(
"Fields are missing from the password hash."
);
}
$pbkdf2 = \base64_decode($params[self::HASH_PBKDF2_INDEX], true);
if ($pbkdf2 === false) {
throw new InvalidHashException(
"Base64 decoding of pbkdf2 output failed."
);
}
$salt_raw = \base64_decode($params[self::HASH_SALT_INDEX], true);
if ($salt_raw === false) {
throw new InvalidHashException(
"Base64 decoding of salt failed."
);
}
$storedOutputSize = (int) $params[self::HASH_SIZE_INDEX];
if (self::ourStrlen($pbkdf2) !== $storedOutputSize) {
throw new InvalidHashException(
"PBKDF2 output length doesn't match stored output length."
);
}
$iterations = (int) $params[self::HASH_ITERATION_INDEX];
if ($iterations < 1) {
throw new InvalidHashException(
"Invalid number of iterations. Must be >= 1."
);
}
return self::slow_equals(
$pbkdf2,
self::pbkdf2(
$params[self::HASH_ALGORITHM_INDEX],
$password,
$salt_raw,
$iterations,
self::ourStrlen($pbkdf2),
true
)
);
}
/**
* Compares two strings $a and $b in length-constant time.
*
* @param string $a
* @param string $b
* @return bool
*/
public static function slow_equals($a, $b)
{
if (!\is_string($a) || !\is_string($b)) {
throw new InvalidArgumentException(
"slow_equals(): expected two strings"
);
}
if (\function_exists('hash_equals')) {
return \hash_equals($a, $b);
}
// PHP < 5.6 polyfill:
$diff = self::ourStrlen($a) ^ self::ourStrlen($b);
for($i = 0; $i < self::ourStrlen($a) && $i < self::ourStrlen($b); $i++) {
$diff |= \ord($a[$i]) ^ \ord($b[$i]);
}
return $diff === 0;
}
/*
* PBKDF2 key derivation function as defined by RSA's PKCS #5: https://www.ietf.org/rfc/rfc2898.txt
* $algorithm - The hash algorithm to use. Recommended: SHA256
* $password - The password.
* $salt - A salt that is unique to the password.
* $count - Iteration count. Higher is better, but slower. Recommended: At least 1000.
* $key_length - The length of the derived key in bytes.
* $raw_output - If true, the key is returned in raw binary format. Hex encoded otherwise.
* Returns: A $key_length-byte key derived from the password and salt.
*
* Test vectors can be found here: https://www.ietf.org/rfc/rfc6070.txt
*
* This implementation of PBKDF2 was originally created by https://defuse.ca
* With improvements by http://www.variations-of-shadow.com
*/
public static function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false)
{
// Type checks:
if (!\is_string($algorithm)) {
throw new InvalidArgumentException(
"pbkdf2(): algorithm must be a string"
);
}
if (!\is_string($password)) {
throw new InvalidArgumentException(
"pbkdf2(): password must be a string"
);
}
if (!\is_string($salt)) {
throw new InvalidArgumentException(
"pbkdf2(): salt must be a string"
);
}
// Coerce strings to integers with no information loss or overflow
$count += 0;
$key_length += 0;
$algorithm = \strtolower($algorithm);
if (!\in_array($algorithm, \hash_algos(), true)) {
throw new CannotPerformOperationException(
"Invalid or unsupported hash algorithm."
);
}
// Whitelist, or we could end up with people using CRC32.
$ok_algorithms = array(
"sha1", "sha224", "sha256", "sha384", "sha512",
"ripemd160", "ripemd256", "ripemd320", "whirlpool"
);
if (!\in_array($algorithm, $ok_algorithms, true)) {
throw new CannotPerformOperationException(
"Algorithm is not a secure cryptographic hash function."
);
}
if ($count <= 0 || $key_length <= 0) {
throw new CannotPerformOperationException(
"Invalid PBKDF2 parameters."
);
}
if (\function_exists("hash_pbkdf2")) {
// The output length is in NIBBLES (4-bits) if $raw_output is false!
if (!$raw_output) {
$key_length = $key_length * 2;
}
return \hash_pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output);
}
$hash_length = self::ourStrlen(\hash($algorithm, "", true));
$block_count = \ceil($key_length / $hash_length);
$output = "";
for($i = 1; $i <= $block_count; $i++) {
// $i encoded as 4 bytes, big endian.
$last = $salt . \pack("N", $i);
// first iteration
$last = $xorsum = \hash_hmac($algorithm, $last, $password, true);
// perform the other $count - 1 iterations
for ($j = 1; $j < $count; $j++) {
$xorsum ^= ($last = \hash_hmac($algorithm, $last, $password, true));
}
$output .= $xorsum;
}
if($raw_output) {
return self::ourSubstr($output, 0, $key_length);
} else {
return \bin2hex(self::ourSubstr($output, 0, $key_length));
}
}
/*
* We need these strlen() and substr() functions because when
* 'mbstring.func_overload' is set in php.ini, the standard strlen() and
* substr() are replaced by mb_strlen() and mb_substr().
*/
/**
* Calculate the length of a string
*
* @param string $str
* @return int
*/
private static function ourStrlen($str)
{
static $exists = null;
if ($exists === null) {
$exists = \function_exists('mb_strlen');
}
if (!\is_string($str)) {
throw new InvalidArgumentException(
"ourStrlen() expects a string"
);
}
if ($exists) {
$length = \mb_strlen($str, '8bit');
if ($length === false) {
throw new CannotPerformOperationException();
}
return $length;
} else {
return \strlen($str);
}
}
/**
* Substring
*
* @param string $str
* @param int $start
* @param int $length
* @return string
*/
private static function ourSubstr($str, $start, $length = null)
{
static $exists = null;
if ($exists === null) {
$exists = \function_exists('mb_substr');
}
// Type validation:
if (!\is_string($str)) {
throw new InvalidArgumentException(
"ourSubstr() expects a string"
);
}
if ($exists) {
// mb_substr($str, 0, NULL, '8bit') returns an empty string on PHP
// 5.3, so we have to find the length ourselves.
if (!isset($length)) {
if ($start >= 0) {
$length = self::ourStrlen($str) - $start;
} else {
$length = -$start;
}
}
return \mb_substr($str, $start, $length, '8bit');
}
// Unlike mb_substr(), substr() doesn't accept NULL for length
if (isset($length)) {
return \substr($str, $start, $length);
} else {
return \substr($str, $start);
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
class SaltCellar {
public static function getToken($length = 64) {
if ( ! isset($length) || intval($length) <= 32 ) {
$length = 32;
}
$tokens = array();
if (function_exists('random_bytes')) {
$tokens[] = bin2hex(random_bytes($length));
}
if (function_exists('openssl_random_pseudo_bytes')) {
$tokens[] = bin2hex(openssl_random_pseudo_bytes($length));
}
return $tokens[mt_rand(0, count($tokens) - 1)];
}
public static function getSalt($min = 32, $max = 44) {
return substr(strtr(base64_encode(hex2bin(self::getToken(1024))), '+', '.'), 0, mt_rand($min, $max));
}
}
if( ! function_exists('hex2bin')) {
function hex2bin($hexstr)
{
$n = strlen($hexstr);
$sbin="";
$i=0;
while($i<$n)
{
$a =substr($hexstr,$i,2);
$c = pack("H*",$a);
if ($i==0){$sbin=$c;}
else {$sbin.=$c;}
$i+=2;
}
return $sbin;
}
}

View File

@@ -0,0 +1,31 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Data {
private $_data = array();
/**
* Get data
*
* @param string $key
* @param var $default
* @return var
*/
public function get($key, $default = false) {
return isset($this->_data[$key]) ? $this->_data[$key] : $default;
}
/**
* Set data
*
* @param string $key
* @param string $value
* @return var
*/
public function set($key, $value) {
$this->_data[$key] = $value;
}
}

View File

@@ -0,0 +1,62 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Filesystem {
/**
* Check if file exists
*
* @param string Path to file
* @return boolean
*/
public function exists($path) {
return file_exists($path);
}
/**
* Read file
*
* @param string Path to file
* @return string
*/
public function get_contents($path) {
return file_get_contents($path);
}
/**
* Delete file
*
* @param string Path to file
* @param boolean Is recursive
* @return string
*/
public function delete($path, $recursive = false) {
if (is_dir($path))
{
$dir = opendir($path);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($path . '/' . $file) )
{
if ($recursive)
{
$this->delete($path . '/' . $file, $recursive);
}
}
else
{
unlink($path . '/' . $file);
}
}
}
closedir($dir);
rmdir($path);
}
else
{
unlink($path);
}
}
}

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('BASEPATH')) { exit('No direct script access allowed'); }
class Guzzle
{
public function __construct()
{
// require_once('vendor/autoload.php');
require 'vendor/autoload.php';
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,220 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Plugin {
private $_plugins = null;
private $_activePlugins = null;
/**
* Get plugin dir
*/
public static function getPluginDir() {
return FCPATH . WP_PLUGIN_DIR;
}
public function __construct() {
$plugins = $this->getPlugins();
foreach ($plugins as $key => $plugin) {
list($path) = explode('/', $key);
$path .= '/plugins_included_before.php';
if (file_exists(FCPATH . WP_PLUGIN_DIR . $path)) {
include FCPATH . WP_PLUGIN_DIR . $path;
}
}
}
/**
* Get plugin url
*
* @param string $plugin
* @return string
*/
public function pluginUrl($plugin) {
$path = str_replace(FCPATH, '', $plugin);
$pathInfo = pathinfo($path);
$dirParts = explode(DIRECTORY_SEPARATOR, $pathInfo['dirname']);
$pluginUrl = base_url() . implode('/', array_splice($dirParts, 0, 3));
return $pluginUrl;
}
/**
* Get plugin dir
*
* @param string $plugin
* @return string
*/
public function pluginDir($plugin) {
$pathInfo = pathinfo(str_replace(FCPATH, '', $plugin));
$dirParts = explode(DIRECTORY_SEPARATOR, $pathInfo['dirname']);
$pluginDir = FCPATH . implode(DIRECTORY_SEPARATOR, array_splice($dirParts, 0, 2)) . DIRECTORY_SEPARATOR;
return $pluginDir;
}
/**
* Get plugin name
*
* @param string $plugin
* @return string
*/
public function pluginName($plugin) {
$pathInfo = pathinfo(ltrim($plugin, FCPATH));
$dirParts = explode(DIRECTORY_SEPARATOR, $pathInfo['dirname']);
$pluginName = isset($dirParts[1]) ? $dirParts[1] : '';
return $pluginName;
}
/**
* Get installed plugins list
*
* @return array
*/
public function getPlugins() {
if (is_null($this->_plugins)) {
$this->_plugins = $this->_scanPlugins();
}
return $this->_plugins;
}
/**
* Check if plugin is active
*
* @param string $plugin
* @return boolean
*/
public function isPluginActive($plugin) {
return in_array($plugin, $this->getActivePlugins());
}
/**
* Get list of active plugins
*
* @return array
*/
public function getActivePlugins() {
if (is_null($this->_activePlugins)) {
$activePlugins = get_option('active_plugins');
$this->_activePlugins = $activePlugins ? $activePlugins : array();
}
return $this->_activePlugins;
}
/**
* Activate plugin
*
* @param string $plugin
* @return boolean
*/
public function activatePlugin($plugin) {
$activePlugins = $this->getActivePlugins();
if ( ! in_array($plugin, $activePlugins)) {
$activePlugins[] = $plugin;
$this->_updateActivePlugins($activePlugins);
}
return true;
}
/**
* Deactivate plugin
*
* @param string $plugin
* @return boolean
*/
public function deactivatePlugin($plugin) {
$activePlugins = $this->getActivePlugins();
foreach ($activePlugins as $key => $_plugin) {
if ($plugin == $_plugin) {
unset($activePlugins[$key]);
}
}
$this->_updateActivePlugins($activePlugins);
return true;
}
/**
* Find installed plugins
*
* @return array
*/
private function _scanPlugins() {
$path = FCPATH . WP_PLUGIN_DIR;
$plugins = array();
$pluginDirs = glob($path . '*' , GLOB_ONLYDIR);
if ($pluginDirs)
foreach ($pluginDirs as $dir) {
$dirName = basename($dir);
$fileName = $dirName . '.php';
$filePath = $dir . '/' . $fileName;
if (file_exists($filePath)) {
$plugin = array();
$fileContent = file_get_contents($filePath);
$fileContent = strstr($fileContent, '*/', true);
foreach (explode("\n", $fileContent) as $line) {
$parts = explode(': ', $line);
if (count($parts) == 2) {
switch (trim(strtolower(str_replace('*', '', $parts[0])))) {
case 'plugin name' : $key = 'Name'; break;
case 'plugin uri' : $key = 'PluginURI'; break;
case 'description' : $key = 'Description'; break;
case 'author' : $key = 'Author'; break;
case 'version' : $key = 'Version'; break;
case 'author uri' : $key = 'AuthorURI'; break;
default: $key = str_replace(' ', '', trim($parts[0])); break;
}
$plugin[$key] = trim($parts[1]);
}
}
if (isset($plugin['Name']) && isset($plugin['Version'])) {
$plugin['Network'] = false;
$plugin['Title'] = $plugin['Name'];
$plugin['AuthorName'] = $plugin['Author'];
$plugins[$dirName . '/' . $fileName] = $plugin;
}
}
}
return $plugins;
}
/**
* Update active plugins
*
* @param array $plugins
*/
private function _updateActivePlugins($plugins) {
$this->_activePlugins = $plugins;
update_option('active_plugins', $plugins);
}
/**
* Update plugin
*
* @param string $plugin
* @return boolean
*/
public function updatePlugin($plugin) {
$rslb = new RevSliderLoadBalancer();
$updateUrl = $rslb->get_url('updates');
$url = "$updateUrl/revslider-js-addon/addons/{$plugin}/{$plugin}.zip";
$file = self::getPluginDir() . $plugin . '.zip';
$result = false;
if ($response = wp_remote_post($url, array('timeout' => 45))) {
wp_mkdir_p(dirname($file));
if (@file_put_contents($file, $response['body'])) {
if (unzip_file($file, self::getPluginDir())) {
$result = true;
}
@unlink($file);
}
}
return $result;
}
}

View File

@@ -0,0 +1,367 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Updater {
const ADDON_PRODUCT = 'visual-editor-extension';
const ADDON_CFG_PATH = 'info.cfg';
const ADDON_PATH = 'public/assets/';
const ACTIVATE_URL = 'http://updates.themepunch.tools/activate.php';
const TEMP_URL = 'http://updates.themepunch.tools/temp_activate.php';
const DEACTIVATE_URL = 'http://updates.themepunch.tools/deactivate.php';
const UPDATE_URL = 'http://updates.themepunch.tools/revslider-js-addon/jquery-addon.php';
const UPDATE_FILE = 'visual-editor-extension.zip';
const SVG_DIR = 'public/assets/assets/svg/';
const SVG_FILE = 'svg.zip';
private $_ci;
public function __construct() {
$this->_ci = &get_instance();
$this->_ci->load->library('filesystem');
}
/**
* Check if have valid jQuery addon
*
* return boolean
*/
public function check_jquery_addon() {
$cfg_path = RS_PLUGIN_PATH . self::ADDON_PATH . self::ADDON_CFG_PATH;
if ($this->_ci->filesystem->exists($cfg_path))
{
$cfg = json_decode( $this->_ci->filesystem->get_contents($cfg_path) );
if (isset($cfg->version))
{
update_option('revslider-js-version', $cfg->version);
if (version_compare(RevSliderGlobals::SLIDER_REVISION, $cfg->version, '<=')) {
return array('success' => true);
} else {
return array(
'success' => false,
'message' => __('Installed jQuery Plugin version: ', 'revslider') . $cfg->version .
__(' Required version: ', 'revslider') . RevSliderGlobals::SLIDER_REVISION .
__(' Please install updates', 'revslider')
);
}
}
}
return array(
'success' => false,
'message' => __('Slider Revolution jQuery Plugin NOT installed', 'revslider')
);
}
/**
* Upload and install addon
*/
public function upload_addon() {
try{
switch ($_FILES['addon_file']['error']) {
case UPLOAD_ERR_OK:
break;
case UPLOAD_ERR_NO_FILE:
RevSliderFunctions::throwError(__('No file sent.', 'revslider'));
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
RevSliderFunctions::throwError(__('Exceeded filesize limit.', 'revslider'));
default:
break;
}
$filepath = $_FILES["addon_file"]["tmp_name"];
$this->_install_addon($filepath);
}catch(Exception $e){
$errorMessage = $e->getMessage();
return(array("success"=>false,"error"=>$errorMessage));
}
return(array("success"=>true));
}
/**
* Download and install addon
*/
public function download_addon() {
try {
$data = $this->_ci->input->post('data');
$code = isset($data['code']) ? $data['code'] : '';
if ( ! $code)
{
RevSliderFunctions::throwError(__('Please enter purchase code', 'revslider'));
}
$response = $this->_register_code($code);
if ( ! $response['success'])
{
if (isset($response['message']))
{
RevSliderFunctions::throwError($response['message']);
}
else
{
RevSliderFunctions::throwError(__('Unable to register your purchase code', 'revslider'));
}
}
$request = wp_remote_post($response['download_link'], array(
'timeout' => 45,
'method' => 'GET'
));
if(is_wp_error($request) || $request['body'] == 'invalid')
{
RevSliderFunctions::throwError(__('Unable to download addon. Please try again later', 'revslider'));
}
$upload_dir = wp_upload_dir();
$upload_path = DIRECTORY_SEPARATOR . 'update';
$addon_file = $upload_dir['basedir'] . $upload_path . DIRECTORY_SEPARATOR . self::UPDATE_FILE;
if ( ! is_dir(dirname($addon_file))) {
wp_mkdir_p(dirname($addon_file));
}
$ret = @file_put_contents($addon_file, $request['body']);
if($ret === false)
{
RevSliderFunctions::throwError(__('Unable to save downloaded addon. Please make sure destination path is writable', 'revslider'));
}
$response = $this->_install_addon($addon_file);
@unlink($addon_file);
if ($response === false)
{
RevSliderFunctions::throwError(__('Failed to install addon', 'revslider'));
}
}
catch(Exception $e)
{
return(array("success"=>false,"message"=>$e->getMessage()));
}
return array(
'success' => true,
'is_redirect' => true,
'redirect_url' => RevSliderAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDERS),
'message' => __('Addon has been installed!', 'revslider')
);
}
/**
* Register purchase code
*
* @param string Code
* @return array
*/
private function _register_code($code) {
if ( ! is_jquery_addon_activated()) {
$response = wp_remote_post(self::ACTIVATE_URL, array(
'body' => array(
'code' => urlencode($code),
'version' => urlencode(RevSliderGlobals::SLIDER_REVISION),
'product' => urlencode(self::ADDON_PRODUCT)
)
));
$response_code = wp_remote_retrieve_response_code( $response );
$version_info = wp_remote_retrieve_body( $response );
if ( $response_code != 200 || is_wp_error( $version_info ) ) {
return array('success' => false);
}
if ($version_info == 'valid') {
update_option('jquery-plugin-code-activated', 'true');
update_option('jquery-plugin-code', $code);
update_option('jquery-plugin-temp-active-notice', 'false');
} elseif ($version_info == 'exist') {
return array('success' => false, 'message' => __('Purchase Code already registered!', 'revslider'));
}elseif($version_info == 'temp_valid'){ //only temporary active, rechecking needs to be done soon on the themepunch servers (envato API may be down)
update_option('jquery-plugin-code-activated', 'true');
update_option('jquery-plugin-code', $code);
update_option('jquery-plugin-temp-active', 'true');
update_option('jquery-plugin-temp-active-notice', 'false');
} else {
return array('success' => false);
}
}
$request = wp_remote_post(self::UPDATE_URL, array(
'body' => array(
'code' => urlencode($code),
'product' => urlencode(self::ADDON_PRODUCT)
),
));
if(!is_wp_error($request)) {
if($response = maybe_unserialize($request['body'])) {
if (is_object($response) && isset($response->download_link)) {
$data = array(
'success' => true,
'download_link' => $response->download_link
);
return $data;
}
}
}
return array('success' => false);
}
/**
* Deactivate Addon Purchase Code
*/
public function deactivate_addon() {
$code = get_option('jquery-plugin-code', '');
$response = wp_remote_post(self::DEACTIVATE_URL, array(
'body' => array(
'code' => urlencode($code),
'version' => urlencode(RevSliderGlobals::SLIDER_REVISION),
'product' => urlencode(self::ADDON_PRODUCT)
)
));
$response_code = wp_remote_retrieve_response_code( $response );
$version_info = wp_remote_retrieve_body( $response );
if ($response_code != 200 || is_wp_error( $version_info ) || $version_info != 'valid')
{
return array("success" => false, "message" => __('Failed to deregister addon purchase code'));
}
else
{
update_option('jquery-plugin-code-activated', 'false');
update_option('jquery-plugin-temp-active', 'false');
update_option('jquery-plugin-code', '');
return array(
'success' => true,
'is_redirect' => true,
'redirect_url' => RevSliderAdmin::getViewUrl(RevSliderAdmin::VIEW_SLIDERS),
'message' => __('Addon have been deregistered!', 'revslider')
);
}
}
/**
* Install addon
*
* @param string $filepath
* @return boolean
*/
private function _install_addon($filepath) {
if(file_exists($filepath) == false)
{
RevSliderFunctions::throwError(__('Addon file not found!!!', 'revslider'));
}
if ( ! is_writable(RS_PLUGIN_PATH.'public'))
{
RevSliderFunctions::throwError(__('Plugin public folder is not writable! Addon not installed.', 'revslider'));
}
WP_Filesystem();
global $wp_filesystem;
$upload_dir = wp_upload_dir();
$d_path = $upload_dir['basedir'].DIRECTORY_SEPARATOR.'rstemp'.DIRECTORY_SEPARATOR;
$unzipfile = unzip_file( $filepath, $d_path);
if ($unzipfile) {
$content = ( $wp_filesystem->exists( $d_path.self::ADDON_CFG_PATH ) ) ? $wp_filesystem->get_contents( $d_path.self::ADDON_CFG_PATH ) : '';
$cfg = json_decode( $content );
if ( ! isset($cfg->version)) {
RevSliderFunctions::throwError(__('Invalid or corrupted addon file!', 'revslider'));
}
if (version_compare($cfg->version, RevSliderGlobals::SLIDER_REVISION, '<')) {
RevSliderFunctions::throwError(__('Incorrect addon version! Please download required version ' . RevSliderGlobals::SLIDER_REVISION, 'revslider'));
}
// lets install it
recurse_move($d_path, RS_PLUGIN_PATH.self::ADDON_PATH);
// unpack svg
if (file_exists(RS_PLUGIN_PATH . self::SVG_DIR . self::SVG_FILE)) {
if (unzip_file(RS_PLUGIN_PATH . self::SVG_DIR . self::SVG_FILE, RS_PLUGIN_PATH . self::SVG_DIR)) {
unlink(RS_PLUGIN_PATH . self::SVG_DIR . self::SVG_FILE);
} else {
RevSliderFunctions::throwError(__('Failed to unzip: ') . RS_PLUGIN_PATH . self::SVG_DIR . self::SVG_FILE);
}
}
} else {
RevSliderFunctions::throwError(__('Unzipping failed', 'revslider'));
}
return true;
}
/**
* Check for temporary update status
*
* @param string
*/
public function add_temp_active_check($force = false){
$last_check = get_option('jquery-plugin-activate-temp-short');
if($last_check == false){ //first time called
$last_check = time();
update_option('jquery-plugin-activate-temp-short', $last_check);
}
// Check for updates
if(time() - $last_check > 3600 || $force == true){
$response = wp_remote_post(self::TEMP_URL, array(
'body' => array(
'product' => urlencode(self::ADDON_PRODUCT),
'version' => urlencode(RevSliderGlobals::SLIDER_REVISION),
'code' => urlencode(get_option('jquery-plugin-code', ''))
)
));
$response_code = wp_remote_retrieve_response_code( $response );
$version_info = wp_remote_retrieve_body( $response );
if ( $response_code != 200 || is_wp_error( $version_info ) ) {
//wait, cant connect
}else{
if($version_info == 'valid'){
update_option('jquery-plugin-code-activated', 'true');
update_option('jquery-plugin-temp-active', 'false');
}elseif($version_info == 'temp_valid'){
//do nothing,
}elseif($version_info == 'invalid'){
//invalid, deregister plugin!
update_option('jquery-plugin-code-activated', 'false');
update_option('jquery-plugin-temp-active', 'false');
update_option('jquery-plugin-temp-active-notice', 'true');
}
}
$last_check = time();
update_option('jquery-plugin-activate-temp-short', $last_check);
}
}
}

View File

@@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit396a5844e99ce4e41f188b3edd371501::getLoader();

View File

@@ -0,0 +1,413 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0 class loader
*
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative) {
return false;
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if ($file === null && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if ($file === null) {
// Remember that this class does not exist.
return $this->classMap[$class] = false;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

View File

@@ -0,0 +1,21 @@
Copyright (c) 2015 Nils Adermann, Jordi Boggiano
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.

View File

@@ -0,0 +1,9 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,12 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
$vendorDir . '/guzzlehttp/promises/src/functions_include.php',
$vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
$vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,13 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
);

View File

@@ -0,0 +1,55 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit396a5844e99ce4e41f188b3edd371501
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit396a5844e99ce4e41f188b3edd371501', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit396a5844e99ce4e41f188b3edd371501', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$loader->register(true);
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire396a5844e99ce4e41f188b3edd371501($file);
}
return $loader;
}
}
function composerRequire396a5844e99ce4e41f188b3edd371501($file)
{
require $file;
}

View File

@@ -0,0 +1,230 @@
[
{
"name": "guzzlehttp/promises",
"version": "1.0.2",
"version_normalized": "1.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "97fe7210def29451ec74923b27e552238defd75a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a",
"reference": "97fe7210def29451ec74923b27e552238defd75a",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"time": "2015-08-15 19:37:21",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
]
},
{
"name": "psr/http-message",
"version": "1.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2015-05-04 20:22:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
]
},
{
"name": "guzzlehttp/psr7",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/4ef919b0cf3b1989523138b60163bbcb7ba1ff7e",
"reference": "4ef919b0cf3b1989523138b60163bbcb7ba1ff7e",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"time": "2015-08-15 19:32:36",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "PSR-7 message implementation",
"keywords": [
"http",
"message",
"stream",
"uri"
]
},
{
"name": "guzzlehttp/guzzle",
"version": "6.1.0",
"version_normalized": "6.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/66fd14b4d0b8f2389eaf37c5458608c7cb793a81",
"reference": "66fd14b4d0b8f2389eaf37c5458608c7cb793a81",
"shasum": ""
},
"require": {
"guzzlehttp/promises": "~1.0",
"guzzlehttp/psr7": "~1.1",
"php": ">=5.5.0"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "~4.0",
"psr/log": "~1.0"
},
"time": "2015-09-08 17:36:26",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
]
}
]

View File

@@ -0,0 +1,38 @@
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
before_script:
- curl --version
- composer self-update
- composer install --no-interaction --prefer-source --dev
- ~/.nvm/nvm.sh install v0.6.14
- ~/.nvm/nvm.sh run v0.6.14
script: make test
matrix:
allow_failures:
- php: hhvm
- php: 7.0
fast_finish: true
before_deploy:
- make package
deploy:
provider: releases
api_key:
secure: UpypqlYgsU68QT/x40YzhHXvzWjFwCNo9d+G8KAdm7U9+blFfcWhV1aMdzugvPMl6woXgvJj7qHq5tAL4v6oswCORhpSBfLgOQVFaica5LiHsvWlAedOhxGmnJqMTwuepjBCxXhs3+I8Kof1n4oUL9gKytXjOVCX/f7XU1HiinU=
file:
- build/artifacts/guzzle.phar
- build/artifacts/guzzle.zip
on:
repo: guzzle/guzzle
tags: true
all_branches: true
php: 5.5

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
Copyright (c) 2011-2015 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.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.

Some files were not shown because too many files have changed in this diff Show More