Skip to content

Commit d8bbfa4

Browse files
Refactor
1 parent e7283c2 commit d8bbfa4

File tree

7 files changed

+47
-13
lines changed

7 files changed

+47
-13
lines changed

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"bmewburn.vscode-intelephense-client",
4+
"editorconfig.editorconfig",
5+
"mehedidracula.php-namespace-resolver",
6+
"valeryanm.vscode-phpsab",
7+
]
8+
}

.vscode/settings.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"editor.formatOnPaste": true,
3+
"editor.formatOnSave": true,
4+
"editor.formatOnType": false,
5+
"editor.detectIndentation": false,
6+
"editor.insertSpaces": false,
7+
"editor.useTabStops": false,
8+
"files.trimFinalNewlines": true,
9+
"files.trimTrailingWhitespace": true,
10+
"files.associations": {
11+
".*intrc": "json"
12+
},
13+
"json.format.enable": true,
14+
"intelephense.environment.documentRoot": "./live/",
15+
"intelephense.format.enable": false,
16+
"phpsab.fixerEnable": true,
17+
"phpsab.executablePathCBF": "./vendor/bin/phpcbf",
18+
"phpsab.executablePathCS": "./vendor/bin/phpcs",
19+
"phpsab.snifferEnable": true,
20+
"phpcs.standard": "PSR2",
21+
"phpsab.snifferMode": "onSave",
22+
"phpsab.debug": true,
23+
"[json]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode"
25+
},
26+
"[markdown]": {
27+
"editor.acceptSuggestionOnEnter": "off"
28+
},
29+
"[php]": {
30+
"editor.defaultFormatter": "valeryanm.vscode-phpsab"
31+
}
32+
}

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Preview](preview.png)
1+
![Magento EC - Scripts + Snippets](teaser.png)
22

33
# Magento E-Commerce CE
44

@@ -12,15 +12,13 @@
1212
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TheRemoteCoder_Magento-Ecommerce-CE--Scripts-Snippets&metric=alert_status)](https://sonarcloud.io/dashboard?id=TheRemoteCoder_Magento-Ecommerce-CE--Scripts-Snippets)
1313
![Maintenance](https://img.shields.io/badge/maintained-no-lightgrey.svg)
1414

15-
1615
<br><br>
1716

1817
## About
1918

2019
Magento CE scripts and code snippets for various administrative purposes.
2120
They aren't considered production ready and should be carefully examined and configured.
2221

23-
2422
<br><br>
2523

2624
## Features
@@ -32,11 +30,9 @@ Note: Set store ID and database connection in the script.
3230
- Export opted-in newsletter subscribers per store.
3331
- Render output as plain text (exemplary).
3432

35-
3633
### Export Stock – Excel
3734

3835
Read inline code documentation about the workflow.
3936

4037
- Get profile export results from Admin panel in Frontend.
4138
- Render output as plain text (exemplary).
42-

export-newsletter-subscribers/classes/Database.php renamed to src/export-newsletter-subscribers/classes/Database.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Database
7979
public function __construct () {}
8080

8181
/**
82-
* Set database access.
82+
* Set database access.
8383
* Could be done in constructor but keeps this class independent to use.
8484
*
8585
* @param string $location Server location.
@@ -94,7 +94,7 @@ public function setDbAccess ($location, $pass, $db, $user = '')
9494
$this->_pass = $pass;
9595
$this->_db = $db;
9696
$this->_user = $user ? $user : $db;
97-
97+
9898
return $this;
9999
}
100100

@@ -128,7 +128,7 @@ public function close ()
128128
// Close connection
129129
if ($this->Connection !== null) {
130130
mysql_close($this->Connection);
131-
131+
132132
$this->_connectionOk = false;
133133
$this->Connection = null;
134134
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22
/**
33
* Export opted-in newsletter subscribers from DB.
44
* This example simply renders a plain text output.
@@ -70,4 +70,3 @@
7070
// header('Content-type:application/octet-stream');
7171
// header('Content-Disposition:attachment; filename="newsletter_subscribers.csv"');
7272
// ...
73-
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22
/**
33
* Get profile export from Magento Admin and download it directly.
4-
*
4+
*
55
* Export the data first via admin panel before calling the script:
66
* System -> Import/Export -> Dataflow -> Profile -> 'Stock Excel'
77
*
8-
* This workaround was required for Magento 1.5.1.0 because /var/export/
8+
* This workaround was required for Magento 1.5.1.0 because /var/export/
99
* is not publicly accessible and one can't use the /media/ folders anymore.
1010
*/
1111
$file = '/var/export/export_stock_excel.xml';
@@ -19,4 +19,3 @@
1919
header('Content-Type:text/plain, charset=utf-8');
2020
echo "File not found - Run export profile via admin panel first.";
2121
}
22-
File renamed without changes.

0 commit comments

Comments
 (0)