public function init() { Zoop::loadLib('zone'); Zoop::loadLib('db'); // if(php_sapi_name() != "cli" || $name != 'session') // Zoop::loadLib('session'); // register classess in the application that extend Zoop classes Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php'); Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php'); }
public function init() { Zoop::loadLib('zone'); Zoop::loadLib('db'); Zoop::loadLib('session'); // register classess in the application that extend Zoop classes Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php'); Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php'); // register the classes that define your domain logic Zoop::registerClass('Person', dirname(__FILE__) . '/domain/Person.php'); Zoop::registerClass('Content', dirname(__FILE__) . '/domain/Content.php'); Zoop::registerClass('Entry', dirname(__FILE__) . '/domain/Entry.php'); // register the zones // Zoop::registerClass('ZoneTest', dirname(__file__) . '/zones/ZoneTest.php'); Zoop::registerClass('ZoneAdmin', dirname(__FILE__) . '/zones/ZoneAdmin.php'); Zoop::registerClass('ZoneEntry', dirname(__FILE__) . '/zones/ZoneEntry.php'); }
public function init() { Zoop::loadLib('zone'); Zoop::loadLib('db'); Zoop::loadLib('session'); Zoop::loadLib('zend'); Zoop::loadLib('form'); // register classess in the application that extend Zoop classes Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php'); Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php'); // register domain classess in the application Zoop::registerClass('RequestApp', dirname(__FILE__) . '/domain/RequestApp.php'); Zoop::registerClass('Person', dirname(__FILE__) . '/domain/Person.php'); Zoop::registerClass('Request', dirname(__FILE__) . '/domain/Request.php'); Zoop::registerClass('Filter', dirname(__FILE__) . '/domain/Filter.php'); Zoop::registerClass('Attachment', dirname(__FILE__) . '/domain/Attachment.php'); Zoop::registerClass('Comment', dirname(__FILE__) . '/domain/Comment.php'); // register the zones Zoop::registerClass('ZoneFilter', dirname(__FILE__) . '/zones/ZoneFilter.php'); }
<?php include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('db'); $map = SqlFetchSimpleMap('select * from test', 'name', 'value', array()); echo_r($map); $rows = SqlFetchRows('select * from test', array()); echo_r($rows); $rows = SqlFetchRows('select * from test where name = :name', array('name' => 'one')); echo_r($rows);
<?php include zoop_dir . '/Zoop.php'; Zoop::loadLib('zone'); Zoop::loadLib('couch'); // register classess in the application that extend Zoop classes Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php'); Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php');
<?php include zoop_dir . '/Zoop.php'; Zoop::loadLib('zone'); Zoop::loadLib('db'); Zoop::loadLib('session'); // register classess in the application that extend Zoop classes Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php'); Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php'); // register the classes that define your domain logic Zoop::registerClass('Person', dirname(__FILE__) . '/domain/Person.php'); Zoop::registerClass('Content', dirname(__FILE__) . '/domain/Content.php'); Zoop::registerClass('Entry', dirname(__FILE__) . '/domain/Entry.php'); // register the zones Zoop::registerClass('ZoneAdmin', dirname(__FILE__) . '/zones/ZoneAdmin.php');
// /** * Automatic class loading handler. This automatically loads a class using the path * information that was registered using the Zoop::registerClass or ::registerDomain * method * * @param string $className Name of the class to load */ static function autoload($className) { if (headers_sent()) { echo_r($className); die('here'); } $classPath = Zoop::getClassPath($className); if ($classPath) { require_once $classPath; } if (substr($className, 0, 5) == 'Zend_') { $parts = explode('_', $className); $modName = $parts[1]; require_once zoop_dir . "/Zend/{$modName}.php"; } } } Zoop::registerLib('boot'); Zoop::registerLib('core'); Zoop::registerLib('experimental'); Zoop::registerLib('vendor'); Zoop::loadLib('boot');
<?php die('this example does not work. Graphic support is currently experimental'); include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('zend'); Zoop::loadLib('graphic'); $parser = new GraphicParser('ZendPdf'); $xml = file_get_contents('content.html'); /* $xml = <<<EOT <meta name="pagesize" content="300:600"/> Lorem ipsum dolor <b>sit amet</b>, consectetuer adipiscing elit. Donec quis eros non neque porta molestie. Duis hendrerit. Nullam vitae elit. Donec id odio ut erat tristique condimentum. Cras quis magna. Mauris condimentum porttitor velit. Mauris scelerisque mollis metus. Fusce aliquam, augue eu molestie ultricies, libero odio vehicula pede, nec sollicitudin tortor ante ac mi. Ut eleifend porta nulla. Nulla elit EOT; */ /* nisl, lacinia et, mollis non, lacinia in, nisl. */ // echo "string = " . htmlentities($xml) . '<br>'; $document = $parser->parseText($xml); // echo "<br>object tree:<br>"; // $document->getObjectTree(); // // echo "<br>render tree:<br>"; // $document->drawRenderTree(); // die(); $document->draw(); $context = $document->getContext();
<?php include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('zone'); ZoneApplication::handleRequest();
<?php // include('config.php'); // include('includes.php'); SqlBeginTransaction(); Zoop::loadLib('zend'); $mailConfig = Config::get('app.importer'); $mail = new Zend_Mail_Storage_Pop3(array('host' => $mailConfig['host'], 'user' => $mailConfig['username'], 'password' => $mailConfig['password'], 'ssl' => $mailConfig['ssl'] ? 'SSL' : '')); // $mail = new Zend_Mail_Storage_Imap(array('host' => $mailConfig['host'], // 'user' => $mailConfig['username'], // 'password' => $mailConfig['password'], // 'ssl' => $mailConfig['ssl'] ? 'SSL' : '')); // var_dump($mail); var_dump($count = $mail->countMessages()); foreach ($mail as $message) { // spit out a little info about the message being processed echo "{$message->from}: {$message->to}: {$message->subject}\n"; // see if the from field is like "John Doe <*****@*****.**>" // and if it is parse out the individual fields preg_match('/([\\w ]*)<(\\w.+)@([\\w.]+)>/', $message->from, $matches); if (count($matches) == 4) { $name = trim($matches[1]); $parts = explode(' ', $name); $firstname = array_shift($parts); $lastname = array_pop($parts); $user = trim($matches[2]); $domain = trim($matches[3]); $username = $email = "{$user}@{$domain}"; } else { die("unhandled address format in the 'From' field\n\n"); }
#!/usr/bin/env php <?php define('zoop_dir', dirname(__FILE__) . '/../../framework'); define('app_dir', dirname(__FILE__)); include zoop_dir . '/Zoop.php'; Zoop::loadLib('Pherver'); $chatserver = new ChatServer(); $chatserver->run('127.0.0.1', 9050);
<?php include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('Zend'); // Create new PDF $pdf = new Zend_Pdf(); // Add new page to the document $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); $pdf->pages[] = $page; // Set font $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 20); // Draw text $page->drawText('Hello world!', 100, 510); // Get PDF document as a string $pdfData = $pdf->render(); //We send to a browser Header('Content-Type: application/pdf'); echo $pdfData;
#!/usr/bin/env php <?php define('zoop_dir', dirname(__FILE__) . '/../../framework'); define('app_dir', dirname(__FILE__)); include zoop_dir . '/Zoop.php'; Zoop::loadLib('app'); echo "I am the parent\n"; // trigger_error('stuff'); $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", "/tmp/error-output.txt", "a")); $process = proc_open('./child.php', $descriptorspec, $pipes, getcwd(), array()); assert(is_resource($process)); while (true) { static $i = 1; echo "writing to the stream {$i}\n"; fwrite($pipes[0], "Message : parent {$i}\n"); //fflush($pipes[0]); echo "getting the stream {$i}\n"; $response = fgets($pipes[1], 4096); echo "printing the stream {$i}\n"; echo "{$response}"; // echo stream_get_contents($pipes[1]); echo "printed the stream {$i}\n\n"; $i++; } fclose($pipes[0]); fclose($pipes[1]); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); echo "command returned {$return_value}\n";
<?php include 'config.php'; include zoop_dir . '/Zoop.php'; Zoop::loadLib('mizithra'); $gui = new Mizithra(); $gui->display('test.miz');