Skip to content

Commit e8012f2

Browse files
committed
first commit to push in github
0 parents  commit e8012f2

File tree

670 files changed

+176663
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

670 files changed

+176663
-0
lines changed

cbxphpspreadsheet.php

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<?php
2+
3+
/**
4+
* The plugin bootstrap file
5+
*
6+
* This file is read by WordPress to generate the plugin information in the plugin
7+
* admin area. This file also includes all of the dependencies used by the plugin,
8+
* registers the activation and deactivation functions, and defines a function
9+
* that starts the plugin.
10+
*
11+
* @link http://codeboxr.com
12+
* @since 1.0.0
13+
* @package cbxphpspreadsheet
14+
*
15+
* @wordpress-plugin
16+
* Plugin Name: CBX PhpSpreadSheet Library
17+
* Plugin URI: https://codeboxr.com/
18+
* Description: A pure PHP library for reading and writing spreadsheet files https://phpspreadsheet.readthedocs.io/
19+
* Version: 1.0.0
20+
* Author: Codeboxr
21+
* Author URI: https://github.com/PHPOffice/PhpSpreadsheet
22+
* License: GPL-2.0+
23+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24+
* Text Domain: cbxphpspreadsheet
25+
* Domain Path: /languages
26+
*/
27+
28+
// If this file is called directly, abort.
29+
if ( ! defined( 'WPINC' ) ) {
30+
die;
31+
}
32+
33+
defined( 'CBXPHPSPREADSHEET_PLUGIN_NAME' ) or define( 'CBXPHPSPREADSHEET_PLUGIN_NAME', 'cbxphpspreadsheet' );
34+
defined( 'CBXPHPSPREADSHEET_PLUGIN_VERSION' ) or define( 'CBXPHPSPREADSHEET_PLUGIN_VERSION', '1.0.0' );
35+
defined( 'CBXPHPSPREADSHEET_BASE_NAME' ) or define( 'CBXPHPSPREADSHEET_BASE_NAME', plugin_basename( __FILE__ ) );
36+
defined( 'CBXPHPSPREADSHEET_ROOT_PATH' ) or define( 'CBXPHPSPREADSHEET_ROOT_PATH', plugin_dir_path( __FILE__ ) );
37+
defined( 'CBXPHPSPREADSHEET_ROOT_URL' ) or define( 'CBXPHPSPREADSHEET_ROOT_URL', plugin_dir_url( __FILE__ ) );
38+
39+
40+
register_activation_hook( __FILE__, array( 'CBXPhpSpreadSheet', 'activation' ) );
41+
42+
/**
43+
* Class CBXPhpSpreadSheet
44+
*/
45+
class CBXPhpSpreadSheet {
46+
function __construct() {
47+
//load text domain
48+
load_plugin_textdomain('cbxphpspreadsheet', false, dirname(plugin_basename(__FILE__)) . '/languages/');
49+
}
50+
51+
/**
52+
* Activation hook
53+
*/
54+
public static function activation() {
55+
/*$requirements = array(
56+
'PHP 5.6.0' => version_compare(PHP_VERSION, '5.6.0', '>='),
57+
'PHP extension XML' => extension_loaded('xml'),
58+
'PHP extension xmlwriter' => extension_loaded('xmlwriter'),
59+
'PHP extension mbstring' => extension_loaded('mbstring'),
60+
'PHP extension ZipArchive' => extension_loaded('zip'),
61+
'PHP extension GD (optional)' => extension_loaded('gd'),
62+
'PHP extension dom (optional)' => extension_loaded('dom'),
63+
);*/
64+
65+
66+
if (!CBXPhpSpreadSheet::php_version_check()) {
67+
68+
// Deactivate the plugin
69+
deactivate_plugins(__FILE__);
70+
71+
// Throw an error in the wordpress admin console
72+
$error_message = __('This plugin requires PHP version 5.6 or newer', 'cbxphpspreadsheet');
73+
die($error_message);
74+
}
75+
76+
77+
if (!CBXPhpSpreadSheet::php_zip_enabled_check()) {
78+
79+
// Deactivate the plugin
80+
deactivate_plugins(__FILE__);
81+
82+
// Throw an error in the wordpress admin console
83+
$error_message = __('This plugin requires PHP php_zip extension installed and enabled', 'cbxphpspreadsheet');
84+
die($error_message);
85+
}
86+
87+
if (!CBXPhpSpreadSheet::php_xml_enabled_check()) {
88+
89+
// Deactivate the plugin
90+
deactivate_plugins(__FILE__);
91+
92+
// Throw an error in the wordpress admin console
93+
$error_message = __('This plugin requires PHP php_xml extension installed and enabled', 'cbxphpspreadsheet');
94+
die($error_message);
95+
}
96+
97+
if (!CBXPhpSpreadSheet::php_gd_enabled_check()) {
98+
99+
// Deactivate the plugin
100+
deactivate_plugins(__FILE__);
101+
102+
// Throw an error in the wordpress admin console
103+
$error_message = __('This plugin requires PHP php_gd2 extension installed and enabled', 'cbxphpspreadsheet');
104+
die($error_message);
105+
}
106+
107+
}//end method activation
108+
109+
/**
110+
* PHP version compatibility check
111+
*
112+
* @return bool
113+
*/
114+
public static function php_version_check(){
115+
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
116+
return false;
117+
}
118+
119+
return true;
120+
}//end method php_version_check
121+
122+
/**
123+
* php_zip enabled check
124+
*
125+
* @return bool
126+
*/
127+
public static function php_zip_enabled_check(){
128+
if (extension_loaded('zip')) {
129+
return true;
130+
}
131+
return false;
132+
}//end method php_zip_enabled_check
133+
134+
/**
135+
* php_xml enabled check
136+
*
137+
* @return bool
138+
*/
139+
public static function php_xml_enabled_check(){
140+
if (extension_loaded('xml')) {
141+
return true;
142+
}
143+
return false;
144+
}//end method php_xml_enabled_check
145+
146+
/**
147+
* php_gd2 enabled check
148+
*
149+
* @return bool
150+
*/
151+
public static function php_gd_enabled_check(){
152+
if (extension_loaded('gd')) {
153+
return true;
154+
}
155+
return false;
156+
}//end method php_gd_enabled_check
157+
158+
}//end method CBXPhpSpreadSheet
159+
160+
161+
function cbxphpspreadsheet_load_plugin() {
162+
new CBXPhpSpreadSheet();
163+
}
164+
165+
add_action( 'plugins_loaded', 'cbxphpspreadsheet_load_plugin', 5 );

cbxphpspreadsheet.pot

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#, fuzzy
2+
msgid ""
3+
msgstr ""
4+
"Project-Id-Version: CBX PhpSpreadSheet Library\n"
5+
"Report-Msgid-Bugs-To: \n"
6+
"POT-Creation-Date: 2019-05-22 20:12+0000\n"
7+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"Language-Team: \n"
10+
"Language: \n"
11+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12+
"MIME-Version: 1.0\n"
13+
"Content-Type: text/plain; charset=UTF-8\n"
14+
"Content-Transfer-Encoding: 8bit\n"
15+
"X-Generator: Loco https://localise.biz/\n"
16+
"X-Loco-Version: 2.2.2; wp-5.2"
17+
18+
#. Description of the plugin
19+
msgid ""
20+
"A pure PHP library for reading and writing spreadsheet files https:"
21+
"//phpspreadsheet.readthedocs.io/"
22+
msgstr ""
23+
24+
#. Name of the plugin
25+
msgid "CBX PhpSpreadSheet Library"
26+
msgstr ""
27+
28+
#. Author of the plugin
29+
msgid "Codeboxr"
30+
msgstr ""
31+
32+
#. URI of the plugin
33+
msgid "https://codeboxr.com/"
34+
msgstr ""
35+
36+
#. Author URI of the plugin
37+
msgid "https://github.com/PHPOffice/PhpSpreadsheet"
38+
msgstr ""
39+
40+
#: cbxphpspreadsheet.php:103
41+
msgid "This plugin requires PHP php_gd2 extension installed and enabled"
42+
msgstr ""
43+
44+
#: cbxphpspreadsheet.php:93
45+
msgid "This plugin requires PHP php_xml extension installed and enabled"
46+
msgstr ""
47+
48+
#: cbxphpspreadsheet.php:83
49+
msgid "This plugin requires PHP php_zip extension installed and enabled"
50+
msgstr ""
51+
52+
#: cbxphpspreadsheet.php:72
53+
msgid "This plugin requires PHP version 5.6 or newer"
54+
msgstr ""

languages/cbxphpspreadsheet.pot

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#, fuzzy
2+
msgid ""
3+
msgstr ""
4+
"Project-Id-Version: CBX PhpSpreadSheet Library\n"
5+
"Report-Msgid-Bugs-To: \n"
6+
"POT-Creation-Date: 2019-05-22 20:12+0000\n"
7+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"Language-Team: \n"
10+
"Language: \n"
11+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12+
"MIME-Version: 1.0\n"
13+
"Content-Type: text/plain; charset=UTF-8\n"
14+
"Content-Transfer-Encoding: 8bit\n"
15+
"X-Generator: Loco https://localise.biz/\n"
16+
"X-Loco-Version: 2.2.2; wp-5.2"
17+
18+
#. Description of the plugin
19+
msgid ""
20+
"A pure PHP library for reading and writing spreadsheet files https:"
21+
"//phpspreadsheet.readthedocs.io/"
22+
msgstr ""
23+
24+
#. Name of the plugin
25+
msgid "CBX PhpSpreadSheet Library"
26+
msgstr ""
27+
28+
#. Author of the plugin
29+
msgid "Codeboxr"
30+
msgstr ""
31+
32+
#. URI of the plugin
33+
msgid "https://codeboxr.com/"
34+
msgstr ""
35+
36+
#. Author URI of the plugin
37+
msgid "https://github.com/PHPOffice/PhpSpreadsheet"
38+
msgstr ""
39+
40+
#: cbxphpspreadsheet.php:103
41+
msgid "This plugin requires PHP php_gd2 extension installed and enabled"
42+
msgstr ""
43+
44+
#: cbxphpspreadsheet.php:93
45+
msgid "This plugin requires PHP php_xml extension installed and enabled"
46+
msgstr ""
47+
48+
#: cbxphpspreadsheet.php:83
49+
msgid "This plugin requires PHP php_zip extension installed and enabled"
50+
msgstr ""
51+
52+
#: cbxphpspreadsheet.php:72
53+
msgid "This plugin requires PHP version 5.6 or newer"
54+
msgstr ""

lib/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"phpoffice/phpspreadsheet": "^1.6"
4+
}
5+
}

0 commit comments

Comments
 (0)