Create all basic files and folders in BASEDIR to use it as Wombat-based web-site. A proper set up BASEDIR is essential for any Wombat site.
Many features of Wombat are database driven. Therefore, Wombat requires access to a MySQL database and a set of tables.
The database driven CMS allows you to alter and translate content using a WYSIWIG editor while browsing you site.
Wombat's Virtual File System (VFS) brings multimedia content to your site. Among others, videos and photos are supported. VFS features displaying those files, make them downloadable. On the other hand user may upload multimedia content and organize it in folder based (virtual) file system.
This tool helps setting up a new web site based on the Wombat framework.
EOF; } private function runMkbasedir() { $base = $this->base; echo <<Create basic files and folders in "$base" Check output below for errors!
In case everything went fine, that's all you need to use Wombat as framework for your own site.
Please check ownership and permissions of your files in BASEDIR. It is recommended to set all files to read-only. Still, the web-server needs write access to "var" and subfolders. Hence it's probably a good idea to change owner and permissions:
sudo chown -R USER:GROUP $base chmod -R go-w $base chmod -R go+w $base/var
Why not just create BASEDIR next to SYSTEMDIR?
EOF; return; } if (!is_dir($this->base)) { if (!@mkdir($this->base, 0777, true)) { echo <<Try to create this folder manually (via FTP or something) and make it writable for everyone.
mkdir $base chmod 777 $baseEOF; return; } } if (!is_writeable($this->base)) { echo <<
Change permissions of this folder.
chmod 777 $baseEOF; return; } $folders = array( 'etc', 'etc-default', 'etc-default/event', 'etc-default/site', 'etc-default/site/page', 'etc-default/site/event', 'include', 'include/WB', 'include/patEx', 'template', 'htdoc', 'htdoc/s', 'resource', 'resource/css', 'resource/js', 'template', 'template/Composite', 'template/Static', 'template/Rss', 'var', 'var/log', 'var/cache', 'var/tmp' ); $this->mkDir($folders); $files = array( 'wbLoader.php', 'etc-default/config.xml', 'etc-default/event.xml', 'etc-default/locale.xml', 'etc-default/log.xml', 'etc-default/locale.xml', 'etc-default/table.xml', 'etc-default/site.xml', 'etc-default/site/content.xml', 'etc-default/site/page/__index.xml', 'etc-default/site/page/sitemap.xml', 'etc-default/site/page/robots.txt.xml', 'etc-default/site/page/blank.xml', 'htdoc/site.php', 'htdoc/css.php', 'htdoc/js.php', 'htdoc/ajax.php', 'htdoc/captcha.php', 'htdoc/file.php', 'htdoc/rest.php', 'resource/css/main.css', 'resource/css/form.css', 'resource/css/window.css', 'resource/css/highlight.css', 'resource/css/icon.css', 'resource/css/lightbox.css', 'resource/css/tool.css', 'resource/css/vfs.css', 'template/site.tmpl', 'template/formError.tmpl', 'template/Composite/site.tmpl', 'template/Static/menu.tmpl', 'template/Static/home.tmpl', 'template/Static/blank.tmpl', 'template/Rss/broken.tmpl', 'template/Rss/list.tmpl', 'template/Rss/headline.tmpl', ); $this->copy($files); echo "
Establish database connection and install tables.
EOF; if (!$this->testBasedir()) { return; } $files = array( 'etc-default/table.xml', ); $this->copy($files); // test database credentials if (empty($this->post['dbhost']) || empty($this->post['dbdb']) || empty($this->post['dbuser']) || empty($this->post['dbpassword']) ) { echo <<Error connection to database: ' . $this->dbc->connect_error . '
'; echo <<CREATE DATABASE `$dbdb` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; GRANT USAGE ON *.* TO `$dbuser`@`$dbhost`; SET PASSWORD FOR `$dbuser`@`$dbhost` = password("$dbpassword"); GRANT ALL PRIVILEGES ON `$dbdb`.* TO `$dbuser`@`$dbhost`;EOF; return; } // write database config echo "
Prepare everything to use CMS.
EOF; if (!$this->testBasedir()) { return; } $folders = array( 'etc-default/xinha', 'etc-default/wxml', 'template/Wxml', 'template/Xinha', 'template/Xinha/dialog', 'template/Xinha/dialog/', 'template/Xinha/dialog/smiley', 'template/Xinha/dialog/specialchar', 'template/Xinha/dialog/url', 'template/Xinha/dialog/vfsfile', ); $this->mkDir($folders); $files = array( 'etc-default/wxml/config.xml', 'etc-default/wxml/form/edit.xml', 'etc-default/wxml/form/translate.xml', ); $this->copy($files); } private function runMkVFS() { $base = $this->base; echo <<Prepare everything to use VFS
EOF; if (!$this->testBasedir()) { return; } } /** * create folders * * * @param array $folders */ private function mkDir($folders = array()) { echo '