Exemplo n.º 1
0
<?php

function __autoload($classname)
{
    $filename = str_replace("_", DIRECTORY_SEPARATOR, $classname) . '.php';
    include $filename;
    if (!file_exists($filename)) {
        return false;
    }
}
$textInput = new Text_Input();
$memoryReader = new Memory_Reader();
$fileReader = new File_Reader();
echo $textInput->toString(), "<br/>";
echo $memoryReader->toString(), "<br/>";
echo $fileReader->toString();
Exemplo n.º 2
0
	protected function checkSources(){
		$fileName	= 'config/modules/sources.json';
		if( !file_exists( $fileName ) ){
			if( file_exists( 'config/modules/sources.ini' ) ){
				$json	= json_encode( parse_ini_file( 'config/modules/sources.ini', TRUE ) );
				File_Writer::save( $fileName, ADT_JSON_Formater::format( $json ) );
				@rename( 'config/modules/sources.ini', 'config/modules/sources.ini.old' );
			}
			else
				copy( $fileName.'.dist', $fileName );
		}
		$data	= json_decode( File_Reader::load( $fileName ), TRUE );
		if( empty( $data['Local_CM_Public']['path'] ) ){
			$data['Local_CM_Public']['path']	= realpath( 'vendor/ceus-media/hydrogen-modules/' ).'/';
			$json	= ADT_JSON_Formater::format( json_encode( $data ) );
			File_Writer::save( $fileName, $json );
		}
	}