/**
	     * Set current Adapter
	     *
	     * @param string $adapterName
	     * @param string $append
	     * @static 
	     * @return bool
	     */
        static public function SetAdapter($adapterName, $append = false)
        {
            if (!class_exists("{$adapterName}ScriptingAdapter"))
	           Core::Load("NET/ScriptingClient/Adapters/{$adapterName}ScriptingAdapter");
	           
	        $reflect = new ReflectionClass("{$adapterName}ScriptingAdapter");
	        if ($reflect && $reflect->isInstantiable())
			{
			    if ($append)
			     $args[] = $append;
			    
				if (count($args) > 0)
					self::$Adapter = $reflect->newInstanceArgs($args);
				else 
					self::$Adapter = $reflect->newInstance(true);						
			}
			else 
				Core::RaiseError(_("Object '{$type}ScriptingAdapter' not instantiable."));
				
		    if (self::$Adapter)
                return true;
		    else 
                return false;
		      
        }
        function __construct($process_classes_folder)
        {
            $processes = @glob("{$process_classes_folder}/class.*Process.php");
            
           $jobs = array();
            if (count($processes) > 0)
            {
                foreach ($processes as $process)
                {
                    $filename = basename($process);
                    $directory = dirname($process);
                    Core::Load($filename, $directory);
                    preg_match("/class.(.*)Process.php/s", $filename, $tmp);
                    $process_name = $tmp[1];
                    if (class_exists("{$process_name}Process"))
                    {
                        $reflect = new ReflectionClass("{$process_name}Process");
                        if ($reflect)
                        {
                            if ($reflect->implementsInterface("IProcess"))
                            {
                                $job = array(
                                                "name"          => $process_name,
                                                "description"   => $reflect->getProperty("ProcessDescription")->getValue($reflect->newInstance())
                                            );
                                array_push($jobs, $job);    
                            }
                            else 
                                Core::RaiseError("Class '{$process_name}Process' doesn't implement 'IProcess' interface.", E_ERROR);
                        }
                        else 
                            Core::RaiseError("Cannot use ReflectionAPI for class '{$process_name}Process'", E_ERROR);
                    }
                    else
                        Core::RaiseError("'{$process}' does not contain definition for '{$process_name}Process'", E_ERROR);
                }
            }
            else 
                Core::RaiseError(_("No job classes found in {$ProcessClassesFolder}"), E_ERROR);
             
            $options = array();
            foreach($jobs as $job)
                $options[$job["name"]] = $job["description"];

            $options["help"] = "Print this help";
                           
            $Getopt = new Getopt($options);
            $opts = $Getopt->getOptions();
            
            if (in_array("help", $opts) || count($opts) == 0 || !$options[$opts[0]])
            {
                print $Getopt->getUsageMessage();    
                exit();
            }
            else
            {                               
                $this->ProcessName = $opts[0];
            }
        }
Exemple #3
0
 function testIO_Logging_Log()
 {
     Core::Load("IO/Logging/Log");
     // message to log
     $message = "Some Message";
     $level = 1;
     $file = "/tmp/logger.txt";
     $tablename = "temp";
     // register logger for screen log
     Log::RegisterLogger("Console", "ScreenLog");
     // register logger for file log
     Log::RegisterLogger("File", "FileLog", $file);
     // register logger for db log
     Log::RegisterLogger("DB", "DBLog", $tablename);
     // register Null log
     Log::RegisterLogger("Null", "NullLog");
     // register Email log
     Log::RegisterLogger("EMail", "EmailLog", "*****@*****.**");
     //
     // Logging to screen
     //
     ob_start();
     Log::Log($message, $level, "ScreenLog");
     Log::Log($message, $level, "ScreenLog");
     $content = ob_get_contents();
     ob_end_clean();
     $this->asserttrue(stristr($content, "Some Message "), "Log To console returned true.");
     //
     // Loggin to File
     //
     @unlink($file);
     Log::Log($message, $level, "FileLog");
     $content = @file_get_contents($file);
     $this->assertEqual($content, "{$message}, {$level}\n", "Log To File returned true.");
     //
     // Logging to DB
     //
     /*
     $db = Core::GetDBInstance();
     $db->Execute("CREATE TABLE IF NOT EXISTS `$tablename` (`message` TEXT NOT NULL DEFAULT '', `level` INT(3) NOT NULL DEFAULT 0);");
     Log::Log($message, $level, "DBLog");
     $content = $db->GetOne("SELECT `message` FROM `$tablename` WHERE `level` = ?", array($level));
     $db->Execute("DROP TABLE `$tablename`");
     $this->assertEqual($content, $message, "Log To DB returned true. Content '$content'");	
     */
     //
     // Logging to null
     //
     ob_start();
     Log::Log($message, $level, "NullLog");
     $content = ob_get_contents();
     ob_end_clean();
     $this->assertEqual($content, "", "Log To Null Dev returned true.");
     //
     // Logging to Email
     //
     //$result = Log::Log($message, $level, "EmailLog");
     //$this->assertTrue($result, "Logging To Email returned true");
 }
Exemple #4
0
 function __construct() 
 {
 	
     $this->UnitTestCase('PE test');
     
     Core::Load("PE/ManagedProcess");
     Core::Load("PE/PipedChain");
     
 }
 /**
  * Return shell insrtance
  *
  * @static 
  * @return object
  */
 public static function GetShellInstance()
 {
     // Yeah, no much stuff here now
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         Core::Load("System/Windows/Shell/Shell");
         return new WinShell();
     } else {
         Core::Load("System/Unix/Shell/Shell");
         return new Shell();
     }
 }
Exemple #6
0
 function __construct() 
 {
 	
 	$this->ImageDir = dirname(__FILE__) . "/tests";
 	
     $this->UnitTestCase('ImageMagick Core test');
     
     // Go hellaz
     Core::Load("Graphics/ImageMagick/ImageMagickLite");
     Core::Load("Graphics/ImageMagick/PhotoFilter");
     $this->ImageMagickLite = new ImageMagickLite();
 }
 /**
  * Return all avaiable transports
  *
  * @static 
  * @return array
  */
 public static function GetAvaiableTransports()
 {
     $retval = array();
     $transports = glob(dirname(__FILE__) . "/Transports/class.*Transport.php");
     foreach ((array) $transports as $transport) {
         $pi = pathinfo($transport);
         Core::Load($pi["basename"], $pi["dirname"]);
         preg_match("/class\\.([A-Za-z0-9_]+)\\.php/si", $pi["basename"], $matches);
         if (class_exists($matches[1]) && self::IsTransport($matches[1])) {
             $retval[] = substr($matches[1], 0, -9);
         }
     }
     return $retval;
 }
Exemple #8
0
 function testCore_Test_Core()
 {
     //
     // Core load() function
     //
     // Load single class
     Core::Load("Core");
     $this->assertTrue(class_exists("Core"), "Core class is loaded");
     // Load single class
     Core::Load("NET/API/WHM");
     $this->assertTrue(class_exists("WHM") && class_exists("CPanel"), "WHM and CPanel classes loaded");
     $memory_start = @memory_get_usage();
     //Check GetInstance
     $class = Core::GetInstance("WHM", array("hostname" => "test", "login" => "login"));
     $this->assertTrue($class instanceof WHM && $class->Host == "test", "WHM instance created");
     for ($i = 0; $i < 5000; $i++) {
         $class = Core::GetInstance("WHM", array("hostname" => "test", "login" => "login"));
     }
     $memory_end = @memory_get_usage();
     $change = abs(round(($memory_start - $memory_end) / $memory_start * 100, 2));
     $this->assertTrue($change < 50, "No memory leaks detected. Memory before test {$memory_start}, after test {$memory_end}");
 }
Exemple #9
0
 /**
  * Get Validator instance
  * @return Validator
  * @static 
  */
 public static function GetValidatorInstance()
 {
     if (!class_exists("Validator")) {
         Core::Load("Data/Validation");
     }
     if (!self::$Validator) {
         self::$Validator = new Validator();
     }
     return self::$Validator;
 }
Exemple #10
0
        function testDNSZone2()
        {
			Core::Load("NET/DNS/class.DNSZone2.php");
			Core::Load("NET/DNS/class.DNSRecord.php");
			
			$dnszone = new DNSZone();
			
			/////
			// Test SOA DNS Record
			//
			Core::Load("NET/DNS/class.SOADNSRecord.php");
			
			// Valid SOA
			$SOA = new SOADNSRecord("test.com","ns.hostdad.com", "*****@*****.**");			
			$this->assertWantedPattern("/@\s+IN\s+SOA[\s\t]+/msi", $SOA->__toString(), "Generated SOA Record");
			$dnszone->AddRecord($SOA);
			
			// Invalid SOA
			$soa = new SOADNSRecord("test", "ns.hostdad.com", "*****@*****.**");
			$this->assertFalse($soa->__toString(), "SOA Record NOT generated with invalid params");
			
			/////
			// Test A DNS Record
			//
			Core::Load("NET/DNS/class.ADNSRecord.php");
			
			// subdomain record
			$a1 = new ADNSRecord("test", "192.168.1.1");
			$this->assertWantedPattern("/[A-Za-z0-9]+\s+IN\s+A[\s\t]+/msi", $a1->__toString(), "Generated A Record");
			$dnszone->AddRecord($a1);
			
			//domain record
			$a2 = new ADNSRecord("test.com", "192.168.1.2");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+A[\s\t]+/msi", $a2->__toString(), "Generated A Record");
			$dnszone->AddRecord($a2);
			
			//dottify domain record
			$a3 = new ADNSRecord("test.com.", "192.168.1.3");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+A[\s\t]+/msi", $a3->__toString(), "Generated A Record");
			$dnszone->AddRecord($a3);
			
			//@ domain record
			$a4 = new ADNSRecord("@", "192.168.1.100");
			$this->assertWantedPattern("/@\s+[0-9]*\sIN\s+A[\s\t]+/msi", $a4->__toString(), "Generated A Record");
			$dnszone->AddRecord($a4);
			
			//invalid record
			$record = new ADNSRecord("-1test.com", "192.168.1");
			$this->assertFalse($record->__toString(), "A Record NOT generated with invalid params");
			
			//////
			// Test MX DNS Record
			//
			Core::Load("NET/DNS/class.MXDNSRecord.php");
			
			//domain record
			$record = new MXDNSRecord("mail", "test.com");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+MX[\s\t]+/msi", $record->__toString(), "Generated MX Record");
			$dnszone->AddRecord($record);
			
			//dottify domain record
			$record = new MXDNSRecord("test.com.", "mailtest.com");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+MX[\s\t]+/msi", $record->__toString(), "Generated MX Record");
			$dnszone->AddRecord($record);
			
			//@ domain record
			$record = new MXDNSRecord("@", "mail2.test.com");
			
			$this->assertWantedPattern("/@\s+[0-9]*\sIN\s+MX[\s\t]+/msi", $record->__toString(), "Generated MX Record");
			$dnszone->AddRecord($record);
			
			//invalid record
			$record = new MXDNSRecord("-1test.com", "test2");
			$this->assertFalse($record->__toString(), "MX Record NOT generated with invalid params");
			
			///////
			// Test NS DNS Record
			//
			Core::Load("NET/DNS/class.NSDNSRecord.php");
			
			// subdomain record
	
			//domain record
			$record = new NSDNSRecord("test.com", "ns1.test.com");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+NS[\s\t]+/msi", $record->__toString(), "Generated NS Record");
			$dnszone->AddRecord($record);
			
			//dottify domain record
			$record = new NSDNSRecord("test.com.", "ns2.test.com");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+NS[\s\t]+/msi", $record->__toString(), "Generated NS Record");
			$dnszone->AddRecord($record);
			
			//sub domain record
			$record = new NSDNSRecord("name.com", "ns1");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+[0-9]*\sIN\s+NS[\s\t]+/msi", $record->__toString(), "Generated NS Record");
			$dnszone->AddRecord($record);
			
			//invalid record
			$record = new NSDNSRecord("-1test.com", "asdasda");
			$this->assertFalse($record->__toString(), "NS Record NOT generated with invalid params");
			
			///////
			// Test CNAME DNS Record
			//
			Core::Load("NET/DNS/class.CNAMEDNSRecord.php");
			
			//domain record
			$record = new CNAMEDNSRecord("test", "ns2.test.com");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+IN\s+CNAME[\s\t]+/msi", $record->__toString(), "Generated CNAME Record");
			$dnszone->AddRecord($record);
			
			//sub domain record
			$record = new CNAMEDNSRecord("name", "ns1", 28800);
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+[0-9]+\sIN\s+CNAME[\s\t]+/msi", $record->__toString(), "Generated CNAME Record");
			$dnszone->AddRecord($record);
			
			//invalid record
			$record = new CNAMEDNSRecord("-1test.com", "192.168.1.1");
			$this->assertFalse($record->__toString(), "CNAME Record NOT generated with invalid params");
			
			///////
			// Test TXT DNS Record
			//
			Core::Load("NET/DNS/class.TXTDNSRecord.php");
			
			$record = new TXTDNSRecord("example.com.", "This is a test TXT record");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+[0-9]*\sIN\s+TXT[\s\t]+\"([^\"]+)\"/si", $record->__toString(), "Generated TXT record");
			
			$record = new TXTDNSRecord("test", "This is a test TXT record");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+[0-9]*\sIN\s+TXT[\s\t]+\"([^\"]+)\"/si", $record->__toString(), "Generated TXT record");
			
			$record = new CNAMEDNSRecord("192.168.1.20", "This is a test TXT record");
			$this->assertFalse($record->__toString(), "TXT Record NOT generated with invalid params");
			
			////////
			// Test SPF DNS Record
			//
			Core::Load("NET/DNS/class.SPFDNSRecord.php");
			
			
			// Test data
			$basics = array(
			                 array("?", "include:test.com"),
			                 array("-", "all")
			               );
			$sender_a    = array(
			                     array("", "a"),
			                     array("+", "a:test.com"), 
			                     array("~", "a:test.com/16"), 
			                     array("?", "a/16")
			                     );
			
			$sender_mx   = array(
			                     array("+", "mx"), 
			                     array("-", "mx:test.com"), 
			                     array("~", "mx:test.com/16"), 
			                     array("?", "mx/16")
			                     );
			
			$sender_ptr  = array(
			                     array("+", "ptr"), 
			                     array("", "ptr:test.com")
			                    );
			
			$sender_ip4  = array(
			                     array("~", "ip4:192.168.1.1"),
			                     array("", "ip4:192.168.1.1/16")
			                    );
			
			$sender_ip6  = array(
			                     array("?", "ip6:2001:db8::10"), 
			                     array("", "ip6:2001:db8::10/16")
			                    );
			
			$sender_exists  = array(
			                         array("-", "exists:test.com")
			                       );
			
			$mods = array(array("redirect", "test.net"), array("exp", "test.test.com"));
			
			$record = new SPFDNSRecord("test.com.", $sender_a, $basics, $mods);
			$this->assertTrue($record->__toString(), "Generated SPF TXT Record Width A rules");
			
			$record = new SPFDNSRecord("test.com.", $sender_mx, $basics, $mods);
			$this->assertTrue($record->__toString(), "Generated SPF TXT Record Width MX rules");
			
			$record = new SPFDNSRecord("test.com.", $sender_ptr, $basics, $mods);
			$this->assertTrue($record->__toString(), "Generated SPF TXT Record Width PTR rules");
			
			$record = new SPFDNSRecord("test.com.", $sender_ip4, $basics, $mods);
			$this->assertTrue($record->__toString(), "Generated SPF TXT Record Width IP4 rules");
			
			$record = new SPFDNSRecord("test.com.", $sender_exists, $basics, $mods);
			$this->assertTrue($record->__toString(), "Generated SPF TXT Record Width EXISTS rules");
			
			$record = new SPFDNSRecord("-test.com.", $sender_exists, $basics, $mods);
			$this->assertFalse($record->__toString(), "SPF TXT Record NOT generated Width invalid name");
			
			// Custom SPF record
			$basics = array(
			                 array("", "include:webmail.pair.com"),
			                 array("?", "include:spf.trusted-forwarder.org"),
			                 array("-", "all")
			               );
			$sender = array(
			                 array("", "ip4:72.81.252.18"),
			                 array("", "ip4:72.81.252.19"),
			                 array("", "ip4:70.91.79.100"),
			                 array("?", "a:relay.pair.com")
			               );
            $record = new SPFDNSRecord("kitterman.com.", $sender, $basics);
            $this->assertTrue($record->__toString(), "Custom SPF TXT Record generated");
			
            // Test SPF With macroses
            $basics = array(
			                 array("-", "include:ip4._spf.%{d}"),
			                 array("-", "include:include:ip4._spf.%{d}"),
			                 array("+", "all")
			               );
			$sender = array(
			                 array("", "exists:%{l1r+}.%{d}"),
			                 array("", "exists:%{l1r+}.%{d}")
			               );
            $record = new SPFDNSRecord("kitterman.com.", $sender, $basics);
            $this->assertTrue($record->__toString(), "Custom SPF TXT Record with macroses generated");
            
            // Test SPF With bad macroses
            $basics = array(
			                 array("-", "include:ip4._spf.%{dfhsd}"),
			                 array("-", "include:include:ip4._spf.%{asdfklj}"),
			                 array("+", "all")
			               );
			$sender = array(
			                 array("", "exists:%{l1r+}.%{32}"),
			                 array("", "exists:%{l1r+}.%{sdaf}")
			               );
            $record = new SPFDNSRecord("kitterman.com.", $sender, $basics);
            $this->assertFalse($record->__toString(), "Custom SPF TXT Record with bad macroses NOT generated");
            
			///////
			// Test PTR DNS Record
			//
			Core::Load("NET/DNS/class.PTRDNSRecord.php");
			
			//domain record
			$record = new PTRDNSRecord("2", "c1.test.com");
			$this->assertWantedPattern("/[0-9]+\s+[0-9]*\s+IN\s+PTR[\s\t]+/msi", $record->__toString(), "Generated PTR Record");
			
			//dotify domain record
			$record = new PTRDNSRecord("245", "c2.test.com.");
			$this->assertWantedPattern("/[A-Za-z0-9\.]+\s+[0-9]*\sIN\s+PTR[\s\t]+/msi", $record->__toString(), "Generated PTR Record");

			//invalid record
			$record = new PTRDNSRecord("370", "192.168.1.1");
			$this->assertFalse($record->__toString(), "PTR Record NOT generated with invalid params");

			$content = $dnszone->__toString();  
			$this->assertWantedPattern("/test.com/msi", $content, "Generated DNS zone contains at least SOA name");
			$this->assertWantedPattern("/IN\s+A[\s\t]+192\.168\.1\.100/msi", $content, "Generated DNS zone contains added A record");
        }
	 * Any other uses are strictly prohibited without the written permission    
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET_API
     * @subpackage Google
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */
	
	Core::Load("NET/API/Google/class.GoogleService.php");
	
	/**
     * @name       GoogleCalendar
     * @category   LibWebta
     * @package    NET_API
     * @subpackage Google
     * @version 1.0
     * @author Igor Savchenko <http://webta.net/company.html>
     */
	class GoogleCalendar extends GoogleService 
	{
		
		/**
		 * Constuct
		 *
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET
     * @subpackage Mail
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */
	
	Core::Load("NET/Mail/PHPMailer");
	Core::Load("Observable");
	
	/**
	 * @name PHPSmartyMailer
	 * @category LibWebta
	 * @package NET
	 * @subpackage Mail
	 * @todo Enable in HTTP Client socket connections if curl functions are disabled
	 * @author Igor Savchenko <http://webta.net/company.html>
	 */
	class PHPSmartyMailer extends PHPMailer
	{
		
		 /**
		* Sets the Body of the message.  This can be either an HTML or text body.
		* If HTML then run IsHTML(true).
Exemple #13
0
 /**
  * Return the current set of options and parameters seen in Json format.
  *
  * @return string
  */
 public function toJson()
 {
     if (!$this->_parsed) {
         $this->parse();
     }
     $j = array();
     foreach ($this->_options as $flag => $value) {
         $j['options'][] = array('option' => array('flag' => $flag, 'parameter' => $value));
     }
     Core::Load("Data/JSON/JSON.php");
     if (class_exists("Services_JSON")) {
         $json = new Services_JSON();
         return $json->encode($j);
     } else {
         return false;
     }
 }
	 * Any other uses are strictly prohibited without the written permission    
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET
     * @subpackage NNTP
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */
    
	Core::Load("NET/NNTP/NNTPClient");
	
	/**
     * @name NNTPServerStatus
     * @category   LibWebta
     * @package    NET
     * @subpackage NNTP
     * @version 1.0
     * @author Igor Savchenko <http://webta.net/company.html>
     */
	class NNTPServerStatus extends NNTPClient
	{
		
	    /**
	     * Constructor
	     *
Exemple #15
0
 * Any other uses are strictly prohibited without the written permission    
 * of "Webta" and all other rights are reserved.                            
 * This notice may not be removed from this source code file.               
 * This source file is subject to version 1.1 of the license,               
 * that is bundled with this package in the file LICENSE.                   
 * If the backage does not contain LICENSE file, this source file is   
 * subject to general license, available at http://webta.net/license.html
 *
 * @category   LibWebta
 * @package    System_Unix
 * @subpackage Stats
 * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
 * @license    http://webta.net/license.html
 * @filesource
 */
Core::Load("/System/Unix/Stats/SystemStats");
/**
 * @category   LibWebta
 * @package    System_Unix
 * @subpackage Stats
 * @name System_Unix_Stats_Test
 *
 */
class System_Unix_Stats_Test extends UnitTestCase
{
    function System_Unix_Stats_Test()
    {
        $this->UnitTestCase('System/Unix/Stats Test');
    }
    function testSystemStats()
    {
 * @package    NET
 * @subpackage DNS
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 */
Core::Load("NET/DNS/DNSZone2");
Core::Load("NET/DNS/DNSRecord");
Core::Load("NET/DNS/SOADNSRecord");
Core::Load("NET/DNS/NSDNSRecord");
Core::Load("NET/DNS/PTRDNSRecord");
Core::Load("NET/DNS/ADNSRecord");
Core::Load("NET/DNS/CNAMEDNSRecord");
Core::Load("NET/DNS/MXDNSRecord");
Core::Load("NET/DNS/TXTDNSRecord");
Core::Load("NET/DNS/SPFDNSRecord");
Core::Load("NET/DNS/SRVDNSRecord");
/**
 * @name       DNSZoneParser
 * @category   LibWebta
 * @package    NET
 * @subpackage DNS
 * @version 1.0
 * @author Alex Kovalyov <http://webta.net/company.html>
 * @author Igor Savchenko <http://webta.net/company.html>
 */
class DNSZoneParser extends Core
{
    /**
     * Bind time format
     * 
     * Example: 2003080800, 1d12h, 3W12h
Exemple #17
0
 *
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    IO
 * @subpackage Transports
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 * @filesource
 */
Core::Load("IO/Transports/class.TransportFactory.php");
/**
 * Tests for IO/Transports
 * 
 * @category   LibWebta
 * @package    IO
 * @subpackage Transports
 * @name IO_Transports_Test
 *
 */
class IO_Transports_Test extends UnitTestCase
{
    function __construct()
    {
        $this->UnitTestCase('IO/Transports Tests');
    }
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    IO
     * @subpackage Logging
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */

	/**
	 * Load LogAdapter
	 */
	Core::Load("IO/Logging/Adapters/interface.LogAdapter.php");

	/**
     * @name NullLogAdapter
     * @category   LibWebta
     * @package    IO
     * @subpackage Logging
     * @version 1.0
     * @author Alex Kovalyov <http://webta.net/company.html>
     * @author Sergey Koksharov <http://webta.net/company.html>
     */
	class NullLogAdapter extends Core implements LogAdapter
	{
	    /**
	    * Class Constructor
	    *@ignore 
<?php

Core::Load("Data/RRD");
class MEMSNMPWatcher
{
    private $RRD;
    /**
     * Watcher Name
     *
     * @var string
     */
    public $WatcherName = "RAM Usage (SNMP)";
    const COLOR_MEM_SHRD = "#00FFFF";
    const COLOR_MEM_BUFF = "#3399FF";
    const COLOR_MEM_CACH = "#0000FF";
    const COLOR_MEM_FREE = "#99FF00";
    const COLOR_MEM_REAL = "#00CC00";
    const COLOR_MEM_SWAP = "#FF0000";
    /**
     * Constructor
     *
     */
    function __construct($SNMPTree, $path)
    {
        $this->Path = $path;
        $this->SNMPTree = $SNMPTree;
    }
    /**
     * This method is called after watcher assigned to node
     *
     */
Exemple #20
0
 * This file is a part of LibWebta, PHP class library.
 *
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    NET_API
 * @subpackage AWS
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 */
Core::Load("NET/API/AWS/WSSESoapClient");
class EbsBlockDeviceType
{
    public $deleteOnTermination;
    public $snapshotId;
    public $volumeSize;
    public function _construct($deleteOnTermination = true, $snapshotId = false, $volumeSize = false)
    {
        $this->deleteOnTermination = $deleteOnTermination;
        $this->snapshotId = $snapshotId;
        $this->volumeSize = $volumeSize;
    }
}
class BlockDeviceMappingItemType
{
    public $deviceName;
Exemple #21
0
 *
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    Data
 * @subpackage Validation
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 * @filesource
 */
Core::Load("Data/Validation");
/**
 * @category   LibWebta
 * @package    Data
 * @subpackage Validation
 * @name Data_Validation_Test
 */
class Data_Validation_Test extends UnitTestCase
{
    function __construct()
    {
        $this->UnitTestCase('Data/Validation Tests');
    }
    function testValidation()
    {
        $Validator = new Validator();
Exemple #22
0
	 * Any other uses are strictly prohibited without the written permission    
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET
     * @subpackage DNS
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */
		
	Core::Load("Data/Validation/Validator");
	
	/**
     * @name       DNSRecord
     * @category   LibWebta
     * @package    NET
     * @subpackage DNS
     * @version 1.0
     * @author Igor Savchenko <http://webta.net/company.html>
     * @author Alex Kovalyov <http://webta.net/company.html>
     */
	class DNSRecord extends Core
	{
		
		/**
		 * Validator 
 * This file is a part of LibWebta, PHP class library.
 *
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    IO
 * @subpackage Upload
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 */
Core::Load("IO/Basic");
/**
 * @name UploadManager
 * @category   LibWebta
 * @package    IO
 * @subpackage Upload
 * @version 1.0
 * @author Alex Kovalyov <http://webta.net/company.html>
 * @author Sergey Koksharov <http://webta.net/company.html>
 * @author Igor Savchenko <http://webta.net/company.html>
 */
class UploadManager extends Core
{
    /**
     * Minimum file size to upload (in Kb)
     *
 * agreement included as part of this distribution archive.                 
 * Any other uses are strictly prohibited without the written permission    
 * of "Webta" and all other rights are reserved.                            
 * This notice may not be removed from this source code file.               
 * This source file is subject to version 1.1 of the license,               
 * that is bundled with this package in the file LICENSE.                   
 * If the backage does not contain LICENSE file, this source file is   
 * subject to general license, available at http://webta.net/license.html
 *
 * @category   LibWebta
 * @package    Graphics
 * @subpackage PhotoFilter
 * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
 * @license    http://webta.net/license.html
 */
Core::Load("Graphics/ImageMagick/ImageMagickLite");
/**
 * Image Filter
 * @name ImageFilter
 * @author Alex Kovalyov <http://webta.net/company.html>
 */
class PhotoFilter extends ImageMagickLite
{
    /**
     * Constructor
     */
    function __construct($bin_path = null, $textures_path = null)
    {
        parent::__construct($bin_path);
        $this->TexturesPath = $textures_path;
    }
Exemple #25
0
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET_API
     * @subpackage Ventrilo
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     * @filesource
     */

	Core::Load("NET/API/Ventrilo");
	
	/**
	 * @category   LibWebta
     * @package    NET_API
     * @subpackage Ventrilo
     * @name NET_API_Ventrilo_Test
	 *
	 */
	class NET_API_Ventrilo_Test extends UnitTestCase 
	{
        function NET_API_Ventrilo_Test() 
        {
            $this->UnitTestCase('NET/API/Ventrilo test');
        }
        
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET
     * @subpackage NNTP
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */
	
	Core::Load("NET/NNTP/class.UsenetCrawler.php");
	Core::Load("NET/NNTP/class.UsenetPostingManager.php");
	
	/**
     * @name NNTPProccess
     * @category   LibWebta
     * @package    NET
     * @subpackage NNTP
     * @version 1.0
     * @author Igor Savchenko <http://webta.net/company.html>
     */
	class NNTPProccess extends NNTPCore
	{
		/**
		 * UsenetCrawler instanse
		 *
		 * @var UsenetCrawler
Exemple #27
0
	 * Any other uses are strictly prohibited without the written permission    
	 * of "Webta" and all other rights are reserved.                            
	 * This notice may not be removed from this source code file.               
	 * This source file is subject to version 1.1 of the license,               
	 * that is bundled with this package in the file LICENSE.                   
	 * If the backage does not contain LICENSE file, this source file is   
	 * subject to general license, available at http://webta.net/license.html
     *
     * @category   LibWebta
     * @package    NET
     * @subpackage RPC
     * @copyright  Copyright (c) 2003-2009 Webta Inc, http://webta.net/copyright.html
     * @license    http://webta.net/license.html
     */

	Core::Load("NET/HTTP/HTTPClient");

	/**
	 * @name RPCClient
	 * @package NET
	 * @subpackage RPC
	 * @version 1.0
     * @author Sergey Koksharov <http://webta.net/company.html>
	 *
	 */
	class RPCClient extends HTTPClient
	{
		/**
		 * XML RPC Host
		 * with username, password if needed
		 * @var string Host
Exemple #28
0
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package NET_API
 * @subpackage AWS
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 * @filesource
 */
Core::Load("NET/API/AWS/AmazonEC2");
Core::Load("NET/API/AWS/AmazonS3");
/**
 * @category   LibWebta
 * @package NET_API
 * @subpackage AWS 
 * @name NET_API_AWS_Test
 */
class NET_API_AWS_Test extends UnitTestCase
{
    public $AmazonEC2;
    public $AWSAccountID;
    function __construct()
    {
        $this->UnitTestCase('AWS tests');
        $this->AmazonEC2 = new AmazonEC2(APPPATH . "/etc/pk-.pem", APPPATH . "/etc/cert-.pem");
        $this->AWSAccountID = "";
Exemple #29
0
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    System_Unix
 * @subpackage IO
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 * @filesource
 */
Core::Load("System/Unix/IO/FileSystem");
Core::Load("System/Unix/IO/QuotaManager");
/**
 * @category   LibWebta
 * @package    System_Unix
 * @subpackage IO
 * @name System_Unix_IO_Test
 *
 */
class System_Unix_IO_Test extends UnitTestCase
{
    function System_Unix_IO_Test()
    {
        $this->UnitTestCase('System/Unix/IO test');
    }
    function testFileSystem()
    {
Exemple #30
0
 *
 * LICENSE
 *
 * This source file is subject to version 2 of the GPL license,
 * that is bundled with this package in the file license.txt and is
 * available through the world-wide-web at the following url:
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @category   LibWebta
 * @package    NET
 * @subpackage SSH
 * @copyright  Copyright (c) 2003-2007 Webta Inc, http://www.gnu.org/licenses/gpl.html
 * @license    http://www.gnu.org/licenses/gpl.html
 * @filesource
 */
Core::Load("NET/SSH/class.SSH2.php");
/**
 * @category   LibWebta
 * @package    NET
 * @subpackage SSH
 * @name  NET_SSH_Test
 */
class NET_SSH_Test extends UnitTestCase
{
    function __construct()
    {
        $this->UnitTestCase('SSH2 Class Test');
        $this->tmp = ini_get("session.save_path");
    }
    function testSSH2Remote()
    {