"How to" with Credox Framework
Creating of Basic HTTP authentication
$oAuth = new cHTTPBasicAuth( $authTitle, 'Access denied!' );
$oAuth->addAuthorisedUser( 'admin', '7215ee9c7d9dc229d2921a40e899ec5f', eHash::MD5 );
$oAuth->addAuthorisedUser( 'user', '8e15625d6c158ec48f374efb77bd2714', eHash::MD5 );
$oAuth->start();
Determination of Google PageRank and Alexa rank for a web site
$URI = 'credox.org';
$GooglePR = cSEOTools::googlePR( $URI );
$alexaRank = cSEOTools::alexaRank( $URI );
Creation of valid XHTML web page
$oHTMLPage = new cHTMLPage( eDoctype::XHTML10StrictURI );
$oHTMLPage->addCSSFile( 'layout.css' );
$oHTMLPage->addJSFile( 'credox.framework.js' );
$oHTMLPage->outHeader( 'Title of my web page' );
Connecting to MySQL database
$oDBDriver = new cDBDriverMySQL( 'localhost', 3306, 'user', 'pass' );
if( !$oDBDriver->connect() ||
!$oDBDriver->setDBEncoding( eMySQLCharset::utf8 ) ||
!$oDBDriver->setSchema( 'shema' )
)
cDebug::show( $oDBDriver->getErrors() );
$oDBTable = new cDBTable( 'table_name', $oDBDriver );
Determination of MIME type of a file
$filename = 'readme.txt';
$MIMEType = cMIMEType::fromFileContent( $filename );
// $MIMEType = cMIMEType::fromFileExtension( $filename );