diff --git a/.gitignore b/.gitignore index c3950df8..7f66b376 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules build/ -config.php +config.my.php diff --git a/README.md b/README.md index 6537493b..1ef74744 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # Hedera -Hedera is the main page for Verdnatura. +Hedera is the main web page for Verdnatura. + +## Getting Started + +Required dependencies. + * PHP >= 7.0 + * Node.js >= 8.0 + +Launch command line client. +``` +$ php hedera-web.php -m method_path +``` + +## Built with + + * [Webpack](https://webpack.js.org/) + * [MooTools](https://mootools.net/) + * [TinyMCE](https://www.tinymce.com/) diff --git a/conf/apache.conf b/apache.conf similarity index 100% rename from conf/apache.conf rename to apache.conf diff --git a/conf/config.php b/config.php similarity index 76% rename from conf/config.php rename to config.php index e237a29c..34619d3a 100644 --- a/conf/config.php +++ b/config.php @@ -14,16 +14,14 @@ * - http://test.mydomain.org -> config.test.php */ return [ - -/** - * Database parameters. - **/ -'db' => [ - 'host' => 'localhost' - ,'port' => 3306 - ,'schema' => 'hedera-web' - ,'user' => 'hedera-web' - ,'pass' => '' -] - + /** + * Database parameters. + */ + 'db' => [ + 'host' => 'localhost' + ,'port' => 3306 + ,'schema' => 'hedera-web' + ,'user' => 'hedera-web' + ,'pass' => '' + ] ]; diff --git a/debian/changelog b/debian/changelog index eb584afe..b92cf031 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.406.04) stable; urgency=low +hedera-web (1.406.05) stable; urgency=low * Initial Release. diff --git a/debian/install b/debian/install index 68a9ca27..0e06a782 100644 --- a/debian/install +++ b/debian/install @@ -1,4 +1,5 @@ -conf/* etc/hedera-web +apache.conf etc/hedera-web +config.php etc/hedera-web web usr/share/php/vn doc/* usr/share/doc/hedera-web hedera-web.php usr/share/hedera-web diff --git a/index.php b/index.php index 65eaed97..f72a25cf 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,8 @@ query('SELECT name, content FROM metatag'); - + diff --git a/rest/core/account.php b/rest/core/account.php index 1ea87b23..abccea46 100644 --- a/rest/core/account.php +++ b/rest/core/account.php @@ -114,7 +114,7 @@ class Account { $modifs = []; $curAttrs = ldap_get_attributes($ds, $entry); - foreach($attrs as $attribute => $value) + foreach ($attrs as $attribute => $value) if (!empty($value)) { $modifs[] = [ 'attrib' => $attribute, @@ -132,7 +132,7 @@ class Account { } else { $addAttrs = []; - foreach($attrs as $attribute => $value) + foreach ($attrs as $attribute => $value) if (!empty($value)) $addAttrs[$attribute] = $value; diff --git a/rest/edi/clean.php b/rest/edi/clean.php index 88823a76..ce40a27f 100644 --- a/rest/edi/clean.php +++ b/rest/edi/clean.php @@ -18,10 +18,10 @@ class Clean extends Edi\Method { ,$this->imapConf['error_folder'] ]; - foreach($folders as $folder) + foreach ($folders as $folder) if (imap_reopen($imap, "{$this->mailbox}$folder")) { if ($messages = imap_search($imap, $filter)) { - foreach($messages as $message) + foreach ($messages as $message) imap_delete($imap, $message); imap_expunge($imap); diff --git a/rest/edi/lib/section.php b/rest/edi/lib/section.php index 9c36aafa..786fb9b5 100644 --- a/rest/edi/lib/section.php +++ b/rest/edi/lib/section.php @@ -11,7 +11,7 @@ class Section { var $childs = []; function getValue($name, $key, $type = NULL, $subname = NULL) { - foreach($this->segments as $segment) + foreach ($this->segments as $segment) if ($segment->name == $name &&(!$subname || $segment->values[1] == $subname)) return $segment->getValue($key, $type); diff --git a/rest/edi/load.php b/rest/edi/load.php index 50f110ec..663cfc0a 100644 --- a/rest/edi/load.php +++ b/rest/edi/load.php @@ -18,7 +18,7 @@ class Load extends Edi\Method { $inbox = imap_search($this->imap, 'ALL'); if ($inbox) { - foreach($inbox as $msg) + foreach ($inbox as $msg) $this->loadMail($db, $msg); $inboxCount = count($inbox); @@ -55,7 +55,7 @@ class Load extends Edi\Method { $count = 0; $error = NULL; - foreach($result as $msgSection) + foreach ($result as $msgSection) try { $part = imap_bodystruct($imap, $msg, $msgSection); $ediString = imap_fetchbody($imap, $msg, $msgSection); @@ -87,8 +87,8 @@ class Load extends Edi\Method { $unb = $ediMessage->section; $unhs = $unb->childs['UNH']; - foreach($unhs as $unh) - foreach($lins = $unh->childs['LIN'] as $lin) { + foreach ($unhs as $unh) + foreach ($lins = $unh->childs['LIN'] as $lin) { $ediValues = []; // Gets the exchange params @@ -194,7 +194,7 @@ class Load extends Edi\Method { else $result[] = '1'; } elseif ($part->type == TYPEMULTIPART) - foreach($part->parts as $i => $subpart) { + foreach ($part->parts as $i => $subpart) { array_push($section, $i + 1); $this->imapFindParts($subpart, $matchTypes, $section, $result); array_pop($section); diff --git a/rest/edi/update.php b/rest/edi/update.php index 71352ac3..f11a0b17 100644 --- a/rest/edi/update.php +++ b/rest/edi/update.php @@ -71,7 +71,7 @@ class Update extends Vn\Lib\Method { unlink($zipFile); } - foreach(glob("$ucDir/$baseName*.txt") as $fileName) + foreach (glob("$ucDir/$baseName*.txt") as $fileName) break; if (!$fileName) diff --git a/rest/image/sync.php b/rest/image/sync.php index eb73090a..dfb504d2 100644 --- a/rest/image/sync.php +++ b/rest/image/sync.php @@ -75,7 +75,7 @@ class Sync extends Vn\Lib\Method { $this->cleanImages($schema, 'full', $map); - foreach($info['sizes'] as $size => $i) + foreach ($info['sizes'] as $size => $i) $this->cleanImages($schema, $size, $map); } diff --git a/rest/image/upload.php b/rest/image/upload.php index ba72c29f..fd921d9a 100644 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -84,7 +84,7 @@ class Upload extends Vn\Web\JsonRequest { $image = Image::create($tmpName); Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']); - foreach($info['sizes'] as $size => $i) { + foreach ($info['sizes'] as $size => $i) { $dstFile = "$schemaPath/$size/$fileName"; Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc); } diff --git a/rest/misc/exchange-rate.php b/rest/misc/exchange-rate.php index f76fa3a9..75d839d9 100644 --- a/rest/misc/exchange-rate.php +++ b/rest/misc/exchange-rate.php @@ -16,13 +16,13 @@ class ExchangeRate extends Vn\Lib\Method { $date = $db->getValue("SELECT MAX(date) fecha FROM reference_rate"); $maxDate = $date ? DateTime::createFromFormat('Y-m-d', $date) : NULL; - foreach($xml->Cube[0]->Cube as $cube) { + foreach ($xml->Cube[0]->Cube as $cube) { $xmlDate = new DateTime($cube['time']); // Si existen datos más recientes de la máxima fecha los añade if ($maxDate <= $xmlDate) - foreach($cube->Cube as $subCube) + foreach ($cube->Cube as $subCube) if ($subCube['currency'] == 'USD') { $params = [ 'date' => $xmlDate, diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php index fda13b4b..28f1f6d4 100644 --- a/rest/tpv/confirm-mail.php +++ b/rest/tpv/confirm-mail.php @@ -30,14 +30,14 @@ class ConfirmMail extends Vn\Lib\Method { $inbox = imap_search($imap, 'ALL'); if ($inbox) - foreach($inbox as $msg) { + foreach ($inbox as $msg) { // Decodes the mail body $params = []; $body = imap_fetchbody($imap, $msg, '1'); $strings = explode(';', $body); - foreach($strings as $string) { + foreach ($strings as $string) { $x = explode(':', $string); $params[trim($x[0])] = trim($x[1]); } @@ -81,10 +81,10 @@ class ConfirmMail extends Vn\Lib\Method { $date->sub(new \DateInterval($imapConf->cleanPeriod)); $filter = sprintf('BEFORE "%s"', $date->format('D, j M Y')); - foreach($folders as $folder) + foreach ($folders as $folder) if (imap_reopen($imap, $mailbox.'.'.$folder)) if ($messages = imap_search($imap, $filter)) { - foreach($messages as $message) + foreach ($messages as $message) imap_delete($imap, $message); imap_expunge($imap); diff --git a/web/html.php b/web/html.php index 8635d2a5..b529040a 100644 --- a/web/html.php +++ b/web/html.php @@ -38,7 +38,7 @@ function getWebpackAssets() { unset($wpAssets->manifest); unset($wpAssets->main); - foreach($wpAssets as $name => $asset) + foreach ($wpAssets as $name => $asset) if (property_exists($asset, 'js')) $assets->$name = $asset->js; } else { @@ -48,14 +48,14 @@ function getWebpackAssets() { unset($wpConfig->entry->main); - foreach($wpConfig->entry as $asset => $files) + foreach ($wpConfig->entry as $asset => $files) $assets->$asset = "$devServerPath/$asset.js"; } $jsFiles = []; $jsFiles[] = $manifestJs; - foreach($assets as $jsFile) + foreach ($assets as $jsFile) $jsFiles[] = $jsFile; $jsFiles[] = $mainJs; diff --git a/web/mailer.php b/web/mailer.php index cba3a0df..464db10b 100644 --- a/web/mailer.php +++ b/web/mailer.php @@ -43,7 +43,7 @@ class Mailer { $mailList = explode(',', $mailTo); - foreach($mailList as $to) + foreach ($mailList as $to) $mail->AddAddress($to); return $mail; diff --git a/web/service.php b/web/service.php index 70baf3ed..588a345a 100644 --- a/web/service.php +++ b/web/service.php @@ -64,7 +64,7 @@ abstract class Service { preg_match_all($regexp, $_SERVER['HTTP_ACCEPT_LANGUAGE'], $languages); - foreach($languages[1] as $lang) + foreach ($languages[1] as $lang) if (TRUE || stream_resolve_include_path("locale/$lang")) { $_SESSION['lang'] = $lang; break;