[FLOW3-general] PHP Parse error: syntax error, unexpected $end

Regine Rosewich regine.rosewich at hoellenberg.biz
Fri Mar 18 16:56:53 CET 2011


Hi folks,

some espressos taken, several hairs drawn out and I got the blog example
with Doctrine2 persistence running. The many many compile errors had to do
with wrong database structures, fields, indexes, which the FLOW3 persistence
layer tried to amend. Obviously this part of FLOW3 is not yet stable because
it still throws some consequence errors, e. g. trying to delete a field
which is part of a foreign key before dropping the foreign key. 

So I tried to interpret the messages of the Development-log in order to help
FLOW3 getting the table into the correct form. And it worked.

If you take the following database schema it should work for you as well,
provided you have the most actual source from git.typo3.org.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

- phpMyAdmin SQL Dump
-- version 3.3.9.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 18. März 2011 um 16:43
-- Server Version: 5.5.9
-- PHP-Version: 5.3.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Datenbank: `flow3_beta1`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `abstractparty`
--

DROP TABLE IF EXISTS `abstractparty`;
CREATE TABLE IF NOT EXISTS `abstractparty` (
  `artificialId` int(11) NOT NULL AUTO_INCREMENT,
  `dtype` varchar(255) NOT NULL,
  PRIMARY KEY (`artificialId`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `account`
--

DROP TABLE IF EXISTS `account`;
CREATE TABLE IF NOT EXISTS `account` (
  `artificialId` int(11) NOT NULL AUTO_INCREMENT,
  `accountIdentifier` varchar(255) DEFAULT NULL,
  `authenticationProviderName` varchar(255) DEFAULT NULL,
  `credentialsSource` varchar(255) DEFAULT NULL,
  `creationDate` datetime DEFAULT NULL,
  `expirationDate` datetime DEFAULT NULL,
  `roles` longtext COMMENT '(DC2Type:array)',
  `party_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`artificialId`),
  KEY `IDX_7D3656A4213C1059` (`party_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `blog`
--

DROP TABLE IF EXISTS `blog`;
CREATE TABLE IF NOT EXISTS `blog` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(80) NOT NULL,
  `description` varchar(150) NOT NULL,
  `blurb` text NOT NULL,
  `twitterUsername` varchar(80) NOT NULL,
  `authorPicture_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `authorPicture_id` (`authorPicture_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;



-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `category`
--

DROP TABLE IF EXISTS `category`;
CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(80) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `category`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `comment`
--

DROP TABLE IF EXISTS `comment`;
CREATE TABLE IF NOT EXISTS `comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` datetime DEFAULT NULL,
  `post_id` int(11) DEFAULT NULL,
  `author` varchar(80) NOT NULL,
  `emailAddress` varchar(255) DEFAULT NULL,
  `content` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `post_id` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `comment`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `electronicAddress`
--

DROP TABLE IF EXISTS `electronicAddress`;
CREATE TABLE IF NOT EXISTS `electronicAddress` (
  `artificialId` int(11) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(255) DEFAULT NULL,
  `type` varchar(20) NOT NULL,
  `approved` tinyint(1) DEFAULT NULL,
  `usagetype` varchar(20) NOT NULL,
  PRIMARY KEY (`artificialId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `electronicAddress`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `image`
--

DROP TABLE IF EXISTS `image`;
CREATE TABLE IF NOT EXISTS `image` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL,
  `originalResource_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_C53D045F152951E` (`originalResource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `image`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `person`
--

DROP TABLE IF EXISTS `person`;
CREATE TABLE IF NOT EXISTS `person` (
  `name_id` int(11) DEFAULT NULL,
  `primaryElectronicAddress_id` int(11) DEFAULT NULL,
  `artificialId` int(11) NOT NULL,
  PRIMARY KEY (`artificialId`),
  UNIQUE KEY `UNIQ_34DCD17671179CD6` (`name_id`),
  KEY `IDX_34DCD1761D3EAF53` (`primaryElectronicAddress_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `personName`
--

DROP TABLE IF EXISTS `personName`;
CREATE TABLE IF NOT EXISTS `personName` (
  `artificialId` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `firstName` varchar(255) DEFAULT NULL,
  `middleName` varchar(255) DEFAULT NULL,
  `lastName` varchar(255) DEFAULT NULL,
  `otherName` varchar(255) DEFAULT NULL,
  `alias` varchar(255) DEFAULT NULL,
  `fullName` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`artificialId`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;



-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `person_electronicaddress`
--

DROP TABLE IF EXISTS `person_electronicaddress`;
CREATE TABLE IF NOT EXISTS `person_electronicaddress` (
  `person_id` int(11) NOT NULL,
  `electronicaddress_id` int(11) NOT NULL,
  PRIMARY KEY (`person_id`,`electronicaddress_id`),
  KEY `IDX_D8AB6A13217BBB47` (`person_id`),
  KEY `IDX_D8AB6A1342718CD8` (`electronicaddress_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `person_electronicaddress`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `post`
--

DROP TABLE IF EXISTS `post`;
CREATE TABLE IF NOT EXISTS `post` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `blog_id` int(11) DEFAULT NULL,
  `title` varchar(100) NOT NULL,
  `linkTitle` varchar(100) NOT NULL,
  `date` datetime DEFAULT NULL,
  `author` varchar(50) NOT NULL,
  `content` text NOT NULL,
  `image_id` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `blog_id` (`blog_id`),
  KEY `category_id` (`category_id`),
  KEY `IDX_5A8A6C8D3DA5256D` (`image_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;



-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `post_tag`
--

DROP TABLE IF EXISTS `post_tag`;
CREATE TABLE IF NOT EXISTS `post_tag` (
  `post_id` int(11) NOT NULL,
  `tag_id` int(11) NOT NULL,
  PRIMARY KEY (`post_id`,`tag_id`),
  KEY `IDX_5ACE3AF04B89032C` (`post_id`),
  KEY `IDX_5ACE3AF0BAD26311` (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `post_tag`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `related_posts`
--

DROP TABLE IF EXISTS `related_posts`;
CREATE TABLE IF NOT EXISTS `related_posts` (
  `post_id` int(11) NOT NULL,
  `related_id` int(11) NOT NULL,
  PRIMARY KEY (`post_id`,`related_id`),
  KEY `related_id` (`related_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `related_posts`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `resource`
--

DROP TABLE IF EXISTS `resource`;
CREATE TABLE IF NOT EXISTS `resource` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resourcePointer_id` varchar(255) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `fileExtension` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_BC91F416B16B1D3E` (`resourcePointer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `resource`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `resourcePointer`
--

DROP TABLE IF EXISTS `resourcePointer`;
CREATE TABLE IF NOT EXISTS `resourcePointer` (
  `hash` varchar(255) NOT NULL,
  PRIMARY KEY (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `resourcePointer`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `role`
--

DROP TABLE IF EXISTS `role`;
CREATE TABLE IF NOT EXISTS `role` (
  `identifier` varchar(255) NOT NULL,
  PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Daten für Tabelle `role`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `securitypublishingconfiguration`
--

DROP TABLE IF EXISTS `securitypublishingconfiguration`;
CREATE TABLE IF NOT EXISTS `securitypublishingconfiguration` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `allowedRoles` longtext COMMENT '(DC2Type:array)',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `securitypublishingconfiguration`
--


-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `tag`
--

DROP TABLE IF EXISTS `tag`;
CREATE TABLE IF NOT EXISTS `tag` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Daten für Tabelle `tag`
--


--
-- Constraints der exportierten Tabellen
--

--
-- Constraints der Tabelle `account`
--
ALTER TABLE `account`
  ADD CONSTRAINT `account_ibfk_1` FOREIGN KEY (`party_id`) REFERENCES
`abstractparty` (`artificialId`);

--
-- Constraints der Tabelle `blog`
--
ALTER TABLE `blog`
  ADD CONSTRAINT `blog_ibfk_1` FOREIGN KEY (`authorPicture_id`) REFERENCES
`resource` (`id`);

--
-- Constraints der Tabelle `comment`
--
ALTER TABLE `comment`
  ADD CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `post`
(`id`);

--
-- Constraints der Tabelle `image`
--
ALTER TABLE `image`
  ADD CONSTRAINT `image_ibfk_1` FOREIGN KEY (`originalResource_id`)
REFERENCES `resource` (`id`);

--
-- Constraints der Tabelle `person`
--
ALTER TABLE `person`
  ADD CONSTRAINT `person_ibfk_1` FOREIGN KEY (`name_id`) REFERENCES
`personname` (`artificialId`),
  ADD CONSTRAINT `person_ibfk_2` FOREIGN KEY (`primaryElectronicAddress_id`)
REFERENCES `electronicaddress` (`artificialId`),
  ADD CONSTRAINT `person_ibfk_3` FOREIGN KEY (`artificialId`) REFERENCES
`abstractparty` (`artificialId`) ON DELETE CASCADE;

--
-- Constraints der Tabelle `person_electronicaddress`
--
ALTER TABLE `person_electronicaddress`
  ADD CONSTRAINT `person_electronicaddress_ibfk_2` FOREIGN KEY
(`electronicaddress_id`) REFERENCES `electronicaddress` (`artificialId`),
  ADD CONSTRAINT `person_electronicaddress_ibfk_1` FOREIGN KEY (`person_id`)
REFERENCES `person` (`artificialId`);

--
-- Constraints der Tabelle `post`
--
ALTER TABLE `post`
  ADD CONSTRAINT `post_ibfk_4` FOREIGN KEY (`image_id`) REFERENCES `image`
(`id`),
  ADD CONSTRAINT `post_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog`
(`id`),
  ADD CONSTRAINT `post_ibfk_3` FOREIGN KEY (`category_id`) REFERENCES
`category` (`id`);

--
-- Constraints der Tabelle `post_tag`
--
ALTER TABLE `post_tag`
  ADD CONSTRAINT `post_tag_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tag`
(`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `post_tag_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `post`
(`id`) ON DELETE CASCADE;

--
-- Constraints der Tabelle `related_posts`
--
ALTER TABLE `related_posts`
  ADD CONSTRAINT `related_posts_ibfk_2` FOREIGN KEY (`related_id`)
REFERENCES `post` (`id`),
  ADD CONSTRAINT `related_posts_ibfk_4` FOREIGN KEY (`post_id`) REFERENCES
`post` (`id`);

--
-- Constraints der Tabelle `resource`
--
ALTER TABLE `resource`
  ADD CONSTRAINT `resource_ibfk_1` FOREIGN KEY (`resourcePointer_id`)
REFERENCES `resourcepointer` (`hash`);

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Have fun.

Regine

-----Ursprüngliche Nachricht-----
Von: flow3-general-bounces at lists.typo3.org
[mailto:flow3-general-bounces at lists.typo3.org] Im Auftrag von Marcus
'biesior' Biesioroff
Gesendet: Freitag, 18. März 2011 15:03
An: flow3-general at lists.typo3.org
Betreff: [FLOW3-general] PHP Parse error: syntax error, unexpected $end

ellou' List!

I can confirm Regine's problem with files generated by compiler
http://forge.typo3.org/issues/13796

What happens:
'./flow3 compile' command creates perfectly valid files, but without PHP 
closing tag ?> (which is valid as well). Omitting closing tag is the 
reason... but... I've no idea why...

I used regexp search & replace function of my IDE to insert the tag and 
after that operation it ran, I think that's fastest way to fix it is 
change compiler behaviour to insert this tag by default...

However I'm wondering why it doesn't work as omitting closing tag is 
fully allowed and even preferred way to ending the scripts, maybe 
something about php.ini ? any ideas?




-- 
Marcus 'biesior' Biesioroff
http://www.typo3.pl | TYPO3 Polish Community
T3CI
_______________________________________________
FLOW3-general mailing list
FLOW3-general at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general




More information about the FLOW3-general mailing list