Ejemplo n.º 1
0
 function __construct()
 {
     $config = GuiModule::sGetConfig();
     $tmpPath = Zoop::getTmpDir();
     //	call the parent contructor
     parent::__construct();
     $this->template_dir = array();
     //	set the default for the base template dir
     //	this should be using the new config stuff, not defines
     if (!defined("gui_template_dir")) {
         define("gui_template_dir", app_dir . "/templates");
     }
     //	set the standard template directory and any others registerd with zoop
     $this->addTemplateDir(gui_template_dir);
     //	set the compile directory
     $this->setCompileDir($tmpPath . "/smarty2");
     //	set the cache_dir directory
     //	what does this even do?  I'm pretty sure that is not set up
     $this->setCacheDir($tmpPath . "/guicache");
     //	set the config directory
     //	what does this even do?  I'm pretty sure that is not set up
     $this->setConfigDir(app_dir . "/guiconfig");
     //	set the plugin directories
     $this->addPluginsDir(dirname(__FILE__) . '/plugins');
     //	one for plugins added into gui
     $this->addPluginsDir(app_dir . "/guiplugins");
     //	one or plugins specific to the app
 }
Ejemplo n.º 2
0
 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');
 }
Ejemplo n.º 3
0
 public function loadMod($name)
 {
     //	if this library doesn't have this module then Zoop will have to figure out which one does
     if (!$this->hasMod($name)) {
         return Zoop::loadMod($name);
     }
     if (isset($this->mods[$name]) && $this->mods[$name]) {
         return;
     }
     $modName = ucfirst($name) . 'Module';
     include "{$this->path}/{$name}/{$modName}.php";
     $this->mods[$name] = new $modName("{$this->path}/{$name}", $this);
 }
Ejemplo n.º 4
0
Archivo: App.php Proyecto: rgigger/zinc
 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');
 }
Ejemplo n.º 5
0
 public static function init()
 {
     //	make sure the db exists
     $dbdir = Zoop::getTmpDir() . '/db';
     if (!file_exists($dbdir)) {
         mkdir($dbdir, 0777, true);
     }
     $dbfile = "{$dbdir}/data.db";
     if (!file_exists($dbfile)) {
         copy(app_dir . '/var/data.db', $dbfile);
     }
     //	make sure tmp/gui exists
     $compiledir = Zoop::getTmpDir() . '/gui';
     if (!file_exists($compiledir)) {
         mkdir($compiledir, 0777, true);
     }
 }
Ejemplo n.º 6
0
 function __construct()
 {
     $config = GuiModule::sGetConfig();
     $tmpPath = Zoop::getTmpDir();
     //	call the parent contructor
     $this->Smarty();
     $this->template_dir = array();
     //	set the default for the base template dir
     //	this should be using the new config stuff, not defines
     if (!defined("gui_template_dir")) {
         define("gui_template_dir", app_dir . "/templates");
     }
     //	set the standard template directory and any others registerd with zoop
     $this->addTemplateDir(gui_template_dir);
     //	set the compile directory
     $modTmpDir = $tmpPath . '/smarty2';
     if (!is_dir($modTmpDir)) {
         mkdir($modTmpDir);
     }
     $this->setCompileDir($modTmpDir);
     //	set the cache_dir directory
     //	what does this even do?  I'm pretty sure that is not set up
     $this->setCacheDir($tmpPath . "/guicache");
     //	set the config directory
     //	what does this even do?  I'm pretty sure that is not set up
     $this->setConfigDir(app_dir . "/guiconfig");
     //	set the plugin directories
     $this->addPluginDir(zoop_dir . '/vendor/smarty2/plugins');
     //	one for plugins added into gui
     $this->addPluginDir(app_dir . "/guiplugins");
     //	one or plugins specific to the app
     //	we shouldn't use the blanket app_status define any more, we should use specific varabiles
     //	for each behavior, and it should use the new config system
     // $smarty->debugging = defined('app_status') && app_status == 'dev' ? true : false;
     // $smarty->compile_check = defined('app_status') && app_status == 'dev' ? true : false;
     //	we want to run this filter on every single smarty script that we execute
     //	it finds all places where we echo out a simple variable and escapes the html
     //
     //	unfortunately this filters everything.  The entire contents if the template.  I think it is escaping include.
     //	If we can get it to not do that then we can put this back in.
     //
     //$this->autoload_filters = array('pre' => array("strip_html"));
 }
Ejemplo n.º 7
0
Archivo: App.php Proyecto: rgigger/zinc
 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');
 }
Ejemplo n.º 8
0
<?php

include zoop_dir . '/Zoop.php';
//	load zoop modules
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::loadLib('session');
//	start the session
session::start();
//	register "extend" classes
Zoop::registerClass('AppZone', dirname(__FILE__) . '/extend/AppZone.php');
Zoop::registerClass('AppGui', dirname(__FILE__) . '/extend/AppGui.php');
Zoop::registerClass('AppMainGui', dirname(__FILE__) . '/extend/AppMainGui.php');
//	register "domain" classes
Zoop::registerClass('Time', dirname(__FILE__) . '/domain/Time.php');
Zoop::registerClass('Person', dirname(__FILE__) . '/domain/Person.php');
Zoop::registerClass('Entry', dirname(__FILE__) . '/domain/Entry.php');
Ejemplo n.º 9
0
#!/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);
Ejemplo n.º 10
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::registerClass('AppZone', app_dir . '/extend/AppZone.php');
Zoop::registerClass('ZonePerson', app_dir . '/zones/ZonePerson.php');
Zoop::registerClass('Person', app_dir . '/domain/Person.php');
ZoneApplication::handleRequest();
Ejemplo n.º 11
0
 public static function getFilePath($configPath)
 {
     $config = self::get($configPath);
     assert(is_string($config));
     return Zoop::expandPath($config);
 }
Ejemplo n.º 12
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
include 'domain/DbObjectExample.php';
DbObjectExample::init();
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::registerDomain('PersonStuff');
Zoop::registerDomain('GuidPerson');
Zoop::registerDomain('MultiPerson');
ZoneApplication::handleRequest();
Ejemplo n.º 13
0
    }
    //	deprecated stuff
    /**
     * static -- Register a class for auto-loading with the name of the class
     * and the full path of the file that contains it.
     *
     * @param string $className
     * @param string $fullPath
     */
    static function registerClass($className, $fullPath)
    {
        ZoopLoader::addClass($className, $fullPath);
    }
    /**
     * Register a "domain" class for autoload (a domain class is a
     * class that is located in the "domains" directory under
     * the project root with the filename <classname>.php)
     *
     * @param unknown_type $className
     */
    public static function registerDomain($className)
    {
        self::registerClass($className, app_dir . '/domain/' . $className . '.php');
    }
}
Zoop::registerLib('boot');
Zoop::registerLib('core');
Zoop::registerLib('experimental');
Zoop::registerLib('vendor');
Zoop::loadLib('boot');
Ejemplo n.º 14
0
<?php

Zoop::registerClass('Migration', dirname(__FILE__) . '/Migration.php');
Ejemplo n.º 15
0
#!/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";
Ejemplo n.º 16
0
<?php

include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::loadLib('session');
Zoop::loadLib('zend');
//	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');
//	register the zones
Zoop::registerClass('ZoneFilter', dirname(__FILE__) . '/zones/ZoneFilter.php');
Ejemplo n.º 17
0
<?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");
    }
Ejemplo n.º 18
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
ZoneApplication::handleRequest();
Ejemplo n.º 19
0
 /**
  * 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";
     }
 }
Ejemplo n.º 20
0
<?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();
Ejemplo n.º 21
0
<?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('ZoneTest', dirname(__file__) . '/zones/ZoneTest.php');
Zoop::registerClass('ZoneAdmin', dirname(__FILE__) . '/zones/ZoneAdmin.php');
Zoop::registerClass('ZoneEntry', dirname(__FILE__) . '/zones/ZoneEntry.php');
Ejemplo n.º 22
0
<?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');
Ejemplo n.º 23
0
<?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;
Ejemplo n.º 24
0
<?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');
Ejemplo n.º 25
0
<?php

include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::loadLib('session');
session::start();
//	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('Client', dirname(__FILE__) . '/domain/Client.php');
Zoop::registerClass('Invoice', dirname(__FILE__) . '/domain/Invoice.php');
//	list the zones that need to be included
ZoneApplication::loadZone('client');
ZoneApplication::loadZone('invoice');
Ejemplo n.º 26
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::registerClass('Learn', app_dir . '/domain/Learn.php');
Zoop::registerClass('Board', app_dir . '/domain/Board.php');
Zoop::registerClass('Cell', app_dir . '/domain/Cell.php');
ZoneApplication::handleRequest();
Ejemplo n.º 27
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
Zoop::loadLib('zone');
Zoop::loadLib('db');
Zoop::loadLib('session');
session::start();
ZoneApplication::handleRequest();
Ejemplo n.º 28
0
<?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);
Ejemplo n.º 29
0
<?php

include 'config.php';
include zoop_dir . '/Zoop.php';
Zoop::loadLib('mizithra');
$gui = new Mizithra();
$gui->display('test.miz');