mirror of
https://github.com/jimeh/zynapse.git
synced 2026-02-18 23:06:38 +00:00
* Initial directory structure.
* First parts of boot process works.
This commit is contained in:
37
config/init/boot.php
Normal file
37
config/init/boot.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Main Boot File
|
||||
- find zynapse libs and set paths
|
||||
|
||||
*/
|
||||
|
||||
// set zynapse root path
|
||||
if ( !defined('ZNAP_ROOT') ) {
|
||||
define('ZNAP_ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
}
|
||||
|
||||
// set zynapse config path
|
||||
define("ZNAP_CONFIG", ZNAP_ROOT . "/config");
|
||||
|
||||
|
||||
// include boot configuration
|
||||
require_once(ZNAP_CONFIG . "/init/boot_config.php");
|
||||
|
||||
|
||||
// find zynapse libs
|
||||
if ( !empty($zynapse_libs) && is_file($zynapse_libs . "/zynapse.php") ) {
|
||||
define("ZNAP_LIB_ROOT", $zynapse_libs);
|
||||
} elseif ( is_file(ZNAP_ROOT . "/vendor/zynapse/zynapse.php") ) {
|
||||
define("ZNAP_LIB_ROOT", ZNAP_ROOT . "/vendor/zynapse");
|
||||
} elseif ( is_file(dirname(ZNAP_ROOT) . "/vendor/zynapse/zynapse.php") ) {
|
||||
define("ZNAP_LIB_ROOT", dirname(ZNAP_ROOT) . "/vendor/zynapse");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// require main zynapse class
|
||||
require_once(ZNAP_LIB_ROOT . "/zynapse.php");
|
||||
|
||||
|
||||
?>
|
||||
16
config/init/boot_config.php
Normal file
16
config/init/boot_config.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Boot Configuration
|
||||
- settings specific to the boot process
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
# specify a custom path to Zynapse libs
|
||||
// $zynapse_libs = '';
|
||||
|
||||
|
||||
|
||||
?>
|
||||
12
public/.htaccess
Normal file
12
public/.htaccess
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
RewriteRule ^.*\.svn.*$ /404
|
||||
|
||||
RewriteRule ^$ index.html [QSA]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !favicon.ico
|
||||
RewriteCond %{REQUEST_FILENAME} !robots.txt
|
||||
RewriteRule ^(.*)$ /dispatch.php [QSA,L]
|
||||
|
||||
21
public/dispatch.php
Normal file
21
public/dispatch.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Dispatch Zynapse
|
||||
- the first step
|
||||
|
||||
*/
|
||||
|
||||
|
||||
# path to config directory
|
||||
$config_path = dirname(dirname(__FILE__)).'/config';
|
||||
|
||||
|
||||
// initial boot and environment setup
|
||||
require_once($config_path.'/init/boot.php');
|
||||
|
||||
|
||||
// initialize zynapse
|
||||
Zynapse::init();
|
||||
|
||||
?>
|
||||
42
vendor/zynapse/dispatcher.php
vendored
Normal file
42
vendor/zynapse/dispatcher.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Zynapse Dispatcher - start zynapse
|
||||
|
||||
|
||||
http://www.zynapse.org/
|
||||
Copyright (c) 2009 Jim Myhrberg.
|
||||
|
||||
----------
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class Dispatcher {
|
||||
|
||||
function run () {
|
||||
echo "hello world";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
44
vendor/zynapse/zynapse.php
vendored
Normal file
44
vendor/zynapse/zynapse.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Zynapse - main class
|
||||
|
||||
|
||||
http://www.zynapse.org/
|
||||
Copyright (c) 2009 Jim Myhrberg.
|
||||
|
||||
----------
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
----------
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class Zynapse {
|
||||
|
||||
function init () {
|
||||
echo "hello world";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user