The best way to learn how to use the WebCore is by example. See the documentation for more information.

The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.

00 <?php
01   include_once ('software/webcore_init.php');
02  
03   $Page->title->subject = 'Install';
04   $Page->location->append ('WebCore', './');
05   $Page->location->append ('Install');
06  
07   $Page->start_display ();
08 ?>
09 <div class="top-box">
10   <div class="button-content">
11     <a href="download.php" class="button">&lt; Download</a>
12     <a href="first_run.php" class="button">First run &gt;</a>
13   </div>
14 </div>
15 <div class="main-box">
16   <div class="columns text-flow">
17     <div>
18       <p>After you've made sure that your system meets the <a href="requirements.php">requirements</a>,
19         you're ready to install. If you have an existing installation, use the <a href="update.php">upgrade</a>
20         instructions instead.</p>
21       <h2>Install</h2>
22       <p>The following instructions assume that you've <a href="download.php">downloaded</a>
23         the <a href="app_albums.php">Albums</a> application with the WebCore included. Simply
24         substitute the name of the application you downloaded for 'albums' to set up other
25         applications. If you downloaded the Suite, the instructions are pretty much the same,
26         except you have to customize the settings for all four applications.</p>
27       <h3 id="extract-files"><?php echo $Page->get_icon_with_text('{icons}indicators/working', Twenty_px, 'Extract Files'); ?></h3>
28       <ol>
29         <li>Extract the zip archive to a location* on your website.</li>
30       </ol>
31       <p class="notes">*Referred to as [earthli] throughout the rest of the manual</p>
32       <p>WebCore and application files will also be extracted here. See
33         <a href="#php_library_paths">PHP library paths</a> for help moving these files out
34         of your document root.</p>
35       <?php
36       $Page->show_message('If you\'re installing the WebCore Suite, you\'ll have to adjust the php include path in the .htaccess file. See <a href="#php_library_paths">PHP library paths</a> for more information.', 'info');
37       ?>
38       <h3 id="configure-database"><?php echo $Page->get_icon_with_text('{icons}indicators/working', Twenty_px, 'Configure the Database'); ?></h3>
39       <p>The instructions below are for PHPMyAdmin. Database setup basically entails executing SQL
40         scripts against a database.</p>
41       <ol>
42         <li>Select the database you want from the list on the left</li>
43         <li>Select the <span class="field">SQL</span> tab</li>
44         <li>Import <code>[earthli]/sql/icon_themes.sql</code> (once per database)</li>
45         <li>Import <code>[earthli]/sql/shared_users.sql</code> (once per database)</li>
46         <li>Import <code>[earthli]/sql/albums.sql</code></li>
47       </ol>
48       <p>If you install to an existing database and there are table name conflicts, see
49         <a href="#non_standard_tables">non-standard table names</a> for more information.</p>
50       <p>The scripts will create two WebCore users by default: 'root' and 'publisher';
51         see <a href="#users_and_logins">users and logins</a> for information on changing their
52         names and passwords.</p>
53       <h3 id="configure-application"><?php echo $Page->get_icon_with_text('{icons}indicators/working', Twenty_px, 'Configure the Application'); ?></h3>
54       <p>The earthli WebCore splits configuration into two areas: page/environment configuration and application
55         configuration. All configuration files are found in the <code>[earthli]/plugins/</code> folder and are PHP files.
56         Most configuration is done at the page level &mdash; most deployments will use the defaults for appliation deployment.
57         The primary configuration sections are:</p>
58       <ul>
59         <li>Site name, copyright, logo and other identification.</li>
60         <li>File and path locations, domain name and configured URLs.</li>
61         <li>Email address and publishing configuration.</li>
62         <li>Database connection details.</li>
63         <li>Log filtering and storage.</li>
64       </ul>
65       <p>See the <code>[earthli]/plugins/com.earthli.webcore.init.php</code> and
66         <code>[earthli]/plugins/com.earthli.albums.init.php</code> files for more detailed instructions on configuration options.</p>
67       <h3 id="file-permissions"><?php echo $Page->resolve_icon_as_html ('{icons}indicators/working', Twenty_px, ''); ?> Configure File Permissions</h3>
68       <p>The server needs to be able to write files into the document root in order to upload files. In most installations, the
69         upload folders are <code>common/temp/uploads/</code> and the <code>attachments</code> folders. The easiest way to let
70         the web server process write to these is to set the group to "www" (OS X) or
71         "www-data" (Linux) or any group in which the server is a member. Make sure to give the group
72         rights to write in that folder and all sub-folders. Windows machines are exempt
73         as they usually have no default write restrictions on files in the document root.</p>
74       <p>Set permissions on Unix-style operating systems (Mac OS X, Linux, etc.) with the following commands:</p>
75       <p class="quote-block"><code>
76       chown -R your-user:www-data ./news/attachments<br>
77       chmod -R 775 ./news/attachments
78       </code></p>
79       <p class="notes">The -R applies the operation to the folder and all files and sub-folders.</p>
80       <h3 id="ready-to-run"><?php echo $Page->get_icon_with_text ('{icons}indicators/working', Twenty_px, 'Ready to Run!'); ?></h3>
81       <p>Installation is complete! You're ready to <a href="first_run.php">run</a> your application
82         for the first time.</p>
83       <h2>Advanced settings</h2>
84       <h3 id="php_library_paths">PHP library paths</h3>
85       <p>Each earthli application distribution has an .htaccess file. The first line sets
86         the PHP include path. For simple applications, the default path is simply the
87         current directory (.). If your library files are in folder other than the current
88         directory, simply add that path here. PHP will find the required files in this
89         path.</p>
90       <p>The WebCore suite, for example, has its entire library in a 'php' subfolder. If you
91         installed to a folder called <code>/webroot/suite</code>, then your path should look
92         like:</p>
93       <p class="quote-block">
94         <code>php_value include_path ".:/webroot/suite/php"</code> (Linux)<br>
95         <code>php_value include_path ".;C:\webroot\suite\php"</code> (Windows)
96       </p>
97       <p class="notes">Note that Windows uses a semicolon separator and Linux uses a colon separator.</p>
98       <?php
99       $Page->show_message('These instructions only work for Apache servers that have .htaccess files enabled. If you have another server or can\'t use .htaccess files, see your server manual for instructions on setting the PHP include path.', 'info');
100       ?>
101       <h3 id="non_standard_tables">Non-standard table names</h3>
102       <p>All of the sql files are sets of SQL commands that create tables in your selected
103         database. If there is a naming conflict, simply search for the <code>CREATE TABLE</code>
104         statement and change the name of the table.</p>
105       <p>Once you've created the database successfully, you'll have to update the
106         application configuration file so that earthli looks for data in the renamed
107         tables.</p>
108       <p>In the application's <code>com.earthli.[app].init.php</code> file, scroll
109         to the bottom to find a comment block detailing how to change table names. For
110         each table that you renamed (say 'album_folders' to 'earthli_album_folder'), make
111         an entry like this:</p>
112       <p class="quote-block">
113         <code>$Result-&gt;table_names-&gt;folders = 'earthli_album_folders';</code>
114       </p>
115       <p class="notes">Find the exact property name for each table in the
116         <a href="documentation.php">documentation</a>. Most are documented in
117         <a href="<?php echo $Page->resolve_file_for_alias (Folder_name_root, 'software/webcore/docs/developer/webcore/config/APPLICATION_TABLE_NAMES.html'); ?>">APPLICATION_TABLE_NAMES</a>,
118         but application-specific tables are documented with the application.</p>
119       <h3>Users and logins<a name="users_and_logins"></a></h3>
120       <p>The <code>shared_users.sql</code> file is a set of SQL commands that creates the basic WebCore
121         tables and objects. If you scroll to the end of the file, you'll find two <code>INSERT</code>
122         statements that create the default 'root' and 'publisher' users.</p>
123       <p>Here you can change the root user name and password.</p>
124       <?php
125       $Page->show_message('Keep the MD5 function around the password or you won\'t be able to log in.', 'info');
126       ?>
127     </div>
128     <div class="right-sidebar">
129       <h2>Install</h2>
130       <ul>
131         <li><a href="#extract-files">Extract Files</a></li>
132         <li><a href="#configure-database">Configure the Database</a></li>
133         <li><a href="#configure-application">Configure the Application</a></li>
134         <li><a href="#file-permissions">Configure File Permissions</a></li>
135         <li><a href="#ready-to-run">Ready to Run!</a></li>
136       </ul>
137       <h2>Upgrade</h2>
138       <p>Already have an installation? You need the <a href="update.php">upgrade</a> instructions.</p>
139       <p>
140         <?php
141         $renderer = $Page->make_controls_renderer ();
142         echo $renderer->button_as_html ('Upgrade', 'update.php', '{icons}buttons/upgrade', Thirty_two_px);
143         ?>
144       </p>
145     </div>
146   </div>
147 </div>
148 <?php $Page->finish_display (); ?>
149