Export zu Tripodo-Server (Bisher wurden nur die Daten erzeugt)
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3316 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
b8ec81329a
commit
30b80d660a
1 changed files with 23 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ class TripodoExportCommand extends ContainerAwareCommand
|
||||||
{
|
{
|
||||||
/** @var EntityManager $em */
|
/** @var EntityManager $em */
|
||||||
$em = $this->getContainer()->get('doctrine')->getManager();
|
$em = $this->getContainer()->get('doctrine')->getManager();
|
||||||
|
$logger = $this->getContainer()->get('logger');
|
||||||
$regex = '/(\(\s*)?(((https?:\/\/)?www\.stern-?tours\.de[^\s\)]*)|([^\s]+@stern-?tours\.de)|(030\s*(-\s*)?700\s*94\s*100))(\s*\))?/';
|
$regex = '/(\(\s*)?(((https?:\/\/)?www\.stern-?tours\.de[^\s\)]*)|([^\s]+@stern-?tours\.de)|(030\s*(-\s*)?700\s*94\s*100))(\s*\))?/';
|
||||||
$baseUrl = 'https://www.sterntours.de';
|
$baseUrl = 'https://www.sterntours.de';
|
||||||
$xml = '<?xml version="1.0" encoding="UTF-8"?>' ."\n<travels>\n";
|
$xml = '<?xml version="1.0" encoding="UTF-8"?>' ."\n<travels>\n";
|
||||||
|
|
@ -62,10 +63,28 @@ class TripodoExportCommand extends ContainerAwareCommand
|
||||||
$xml .= '</travels>';
|
$xml .= '</travels>';
|
||||||
|
|
||||||
file_put_contents('travels.xml', $xml);
|
file_put_contents('travels.xml', $xml);
|
||||||
return;
|
|
||||||
$conn = ftp_connect($this->getContainer()->getParameter('tripodo_host'));
|
$host = $this->getContainer()->getParameter('tripodo_host');
|
||||||
if(ftp_login($conn, $this->getContainer()->getParameter('tripodo_user'),
|
if (!$host)
|
||||||
$this->getContainer()->getParameter('tripodo_pass')))
|
{
|
||||||
|
$logger->error('Tripodo export failed. No host specified ("tripodo_host").');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$user = $this->getContainer()->getParameter('tripodo_user');
|
||||||
|
if (!$host)
|
||||||
|
{
|
||||||
|
$logger->error('Tripodo export failed. No user name specified ("tripodo_user").');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$pass = $this->getContainer()->getParameter('tripodo_pass');
|
||||||
|
if (!$pass)
|
||||||
|
{
|
||||||
|
$logger->error('Tripodo export failed. No password specified ("tripodo_pass").');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$conn = ftp_connect($host);
|
||||||
|
if(ftp_login($conn, $user, $pass))
|
||||||
{
|
{
|
||||||
$stream = fopen('travels.xml', 'r');
|
$stream = fopen('travels.xml', 'r');
|
||||||
ftp_fput($conn, 'travels.xml', $stream, FTP_BINARY);
|
ftp_fput($conn, 'travels.xml', $stream, FTP_BINARY);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue