Sources for file docs/gettingstarted.txt in version 3.0
Click on a comment to hide it. Click here to show all comments.
Now that you've installed xnyo it is time to tell your scripts where to find it and how to use it.
The following example shows how easy it is to start xnyo.
// include the xnyo class
include_once '/path/to/xnyo.class.php';
// make a new instance of xnyo
$xnyo = new xnyo;
// change xnyo configuration variables if you want
$xnyo->load_smarty = true;
// start xnyo
$xnyo->start();
?>
This will start your scripts using xnyo. Of course you can use any variable you like instead of
$xnyo.
If your application has multiple scrips/pages (as most do), we recommend loading xnyo in a seperate
include/prepend file. This keeps the xnyo configuraton the same across the application.
If you wish to change the configuration you must do so before you call $xnyo->start() if you want
the automatically started services (caching/input filtering) to be affected. This means that if you
are using an include/prepend file you should load the class/object and do global configuration in
that file, then per-page configuration and starting xnyo back in the main page.
SETTING UP REQUIRED SMARTY DIRS
If you wish to use Smarty you will need to create the following additional directories.
If you are not using Smarty skip this!
Smarty's default settings tell it to look for templates in a directory relative to the current
directory. This means templates/ It will also look to store its compiled templates in templates_c/
This directory must allow the webserver to write to it.
Smarty Directories:
templates/
templates_c/
These directories need not be called "templates" and "templates_c". You can call them whatever you
want, and just change the values in the xnyo: Configuring Smarty section.
You can make the templates_c directory writable by the webserver by either:
* Changing ownership of the directory to the same as the webserver user.
* Changing group ownership of the directory to the same as the webserver group and allow group
write access to the directory.
* Allowing everyone to write to the directory (not recommended for security reasons).
SETTING UP PLUGIN DIRECTORIES
We recommend, for easier upgrading, that you keep your own plugins seperate from the ones that come
with xnyo. You can create this directory anywhere you wish, but you will need to tell xnyo that it
is there. This is explained in Configuring: Miscellaneous
Plugin directory structure
The plugin directory structure always needs to be the same, however you only need to create
subdirectories for plugin types you will actually use.
Plugin Directory Structure:
plugins/auth/
plugins/cache/
plugins/config/
plugins/class/
plugins/database/
plugins/dbspec/
plugins/errors/
plugins/smarty/
