public function getPackageXML(PackageConfig $config) { $xml = new \SimpleXMLElement('<package/>'); $xml->addChild('name', $config->getName()); $xml->addChild('version', $config->getVersion()); $xml->addChild('stability', $config->getStability()); $xml->addChild('license', $config->getLicense()); $xml->addChild('channel', $config->getChannel()); $xml->addChild('extends', $config->getExtends()); $xml->addChild('summary', $config->getSummary()); $xml->addChild('description', $config->getDescription()); $xml->addChild('notes', $config->getNotes()); $authors = $xml->addChild('authors'); foreach ($config->getAuthors() as $singleAuthor) { $author = $authors->addChild('author'); $author->addChild('name', $singleAuthor['name']); $author->addChild('user', $singleAuthor['user']); $author->addChild('email', $singleAuthor['email']); } $xml->addChild('date', date('Y-m-d', $config->getTime())); $xml->addChild('date', date('H:i:s', $config->getTime())); $contents = $php = $xml->addChild('contents'); $this->addContents($contents, $config->getContent()); $xml->addChild('compatible', $config->getCompatible()); $dependencies = $xml->addChild('dependencies'); $required = $dependencies->addChild('required'); $php = $required->addChild('php'); $php->addChild('min', $config->getPHPMinVersion()); $php->addChild('max', $config->getPHPMaxVersion()); return $xml->asXML(); }
#!/usr/bin/php <?php ini_set('include_path', '/so/sites/blorgy/pear/lib'); proc_nice(10); set_time_limit(130000); ini_set('memory_limit', '-1'); @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('conversion'); PackageConfig::addPackage('blorg'); PackageConfig::addPackage('admin'); PackageConfig::addPackage('site'); } require_once 'Conversion/ConversionProcess.php'; $process = new ConversionProcess(); $process->src_dsn = 'pgsql://php@dancy/blogs'; $process->dst_dsn = 'pgsql://php@zest/BlorgyNew'; $process->instance = 1; if ($_SERVER['argc'] < 1) { exit; } $args = $_SERVER['argv']; array_shift($args); $clear_data = false; foreach ($args as $arg) { switch ($arg) { case '-C': $clear_data = true; break; default:
<?php @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('site'); PackageConfig::addPackage('pinhole'); } require_once '../include/Application.php'; $config_filename = dirname(__FILE__) . '/../demo.ini'; $app = new Application('pinhole-demo', $config_filename); $app->run();
<?php ini_set('include_path', '.:/so/sites/veseys2/pear/lib:/usr/share/zend/library'); @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPath('/so/packages/pear/pear/Date'); } require_once '../AtomFeed/AtomFeed.php'; require_once 'Date.php'; $feed = new AtomFeed(); $feed->title = 'My test feed'; $feed->addNameSpace('g', 'http://base.google.com/ns/1.0'); $feed->addAuthor(new AtomFeedAuthor('Nick Burka', '*****@*****.**', 'http://www.silverorange.com')); $feed->link = new AtomFeedLink('http://www.silverorange.com', 'self'); $feed->updated = new Date(); for ($i = 0; $i <= 10; $i++) { $entry = new AtomFeedEntry('entry' . $i, 'Entry ' . $i, new Date()); $entry->contributor = new AtomFeedAuthor('Nick Burka', '*****@*****.**', 'http://www.silverorange.com'); $entry->addAuthor(new AtomFeedAuthor('Nick Burka', '*****@*****.**', 'http://www.silverorange.com')); $feed->addEntry($entry); } $feed->display(); header("Content-type: text/xml");
#!/usr/bin/php <?php ini_set('include_path', '.:/so/sites/blorgy/pear/lib'); @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('site'); PackageConfig::addPackage('blorg'); } ini_set('memory_limit', -1); set_time_limit(9000); proc_nice(19); require_once 'LinkFixer.php'; $config_filename = dirname(__FILE__) . '/../../blorgy.ini'; $fixer = new LinkFixer('blorgy_link_fixer', $config_filename, 'Link Fixer', 'Fixes bad links in the comments table the Blorgy site. Should only ' . 'need to be run once.'); $fixer->run();
<?php @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('site'); PackageConfig::addPackage('admin'); PackageConfig::addPackage('blorg'); PackageConfig::addPackage('hot-date'); PackageConfig::addPackage('net-notifier'); } require_once '../../include/admin/BlorgyAdminApplication.php'; $config_filename = dirname(__FILE__) . '/../../blorgy.ini'; $app = new BlorgyAdminApplication('blorgyadmin', $config_filename); $app->run();
<?php require_once 'PackageConfig.php'; PackageConfig::addPackage('pinhole', 'work-gauthierm'); PackageConfig::addPackage('swat', 'work-gauthierm'); PackageConfig::addPackage('site', 'work-gauthierm'); require_once 'MDB2.php'; require_once 'SwatDB/SwatDB.php'; require_once 'Pinhole/PinholeTagFactory.php'; $dsn = 'pgsql://php@192.168.0.26/gallery?sslmode=disable'; $connection = MDB2::connect($dsn); $instance = new PinholeInstance(); $instance->setDatabase($connection); $instance->load(1); PinholeTagFactory::setDefaultDatabase($connection); PinholeTagFactory::setDefaultInstance($instance); function test_tag($string) { $tag = PinholeTagFactory::get($string); if ($tag) { echo "=> ", $tag, ': "', $tag->getTitle(), "\"\n"; echo " Photos: "; foreach ($tag->getPhotos() as $photo) { echo $photo->id, ' '; } echo "\n"; if ($tag instanceof PinholeIterableTag) { echo " Iterable: ", $tag->prev()->getTitle(), " <=> ", $tag->next()->getTitle(), "\n"; } } else { echo "=> {$string}: *** error loading tag ***\n";
#!/usr/bin/php <?php /** * Builds and updates the NateGoSearch index for Blorgy * * OPTIONS * -a or --all * Indexes all content rather than just queued content. * * -v or --verbose level * Sets the level of verbosity of the indexer. Pass 0 to turn off all * output. */ ini_set('include_path', '.:/so/sites/blorgy/pear/lib'); @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('site'); PackageConfig::addPackage('blorg'); PackageConfig::addPackage('nate-go-search'); } ini_set('memory_limit', -1); set_time_limit(9000); proc_nice(19); require_once 'Blorg/BlorgNateGoSearchIndexer.php'; $config_filename = dirname(__FILE__) . '/../../blorgy.ini'; $indexer = new BlorgNateGoSearchIndexer('blorgy_search_indexer', $config_filename, 'Search Indexer', 'Builds and updates the NateGoSearch index for the Blorgy site'); $indexer->run();
#!/usr/bin/php <?php @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('creation'); } require 'Creation/CreationProcess.php'; $process = new CreationProcess(); if ($_SERVER['argc'] < 2) { echo "Usage ./create.php <dsn> <sql files>...\n"; exit; } $args = $_SERVER['argv']; array_shift($args); $process->dsn = array_shift($args); foreach ($args as $arg) { if (substr($arg, -3) === 'sql') { $process->addFile($arg); } else { echo "{$arg}: does not end with sql, ignoring\n"; } } $process->run();
<?php @(include_once 'PackageConfig.php'); if (class_exists('PackageConfig')) { PackageConfig::addPackage('swat'); PackageConfig::addPackage('site'); PackageConfig::addPackage('admin'); PackageConfig::addPackage('blorg'); PackageConfig::addPackage('xml-atom'); PackageConfig::addPackage('hot-date'); PackageConfig::addPackage('nate-go-search'); PackageConfig::addPackage('concentrate'); } /* function shutdownDebug() { $usage = getrusage(); if ($usage["ru_utime.tv_sec"] >= 29) { error_log('Timeout! '.$usage["ru_utime.tv_sec"]."s - ". $_SERVER['SCRIPT_URI']." - ". $_SERVER['HTTP_USER_AGENT']." - ". date("F j, Y, g:i a")); } } register_shutdown_function('shutdownDebug'); */ require_once '../include/Application.php'; $config_filename = dirname(__FILE__) . '/../blorgy.ini'; $app = new Application('blorgy', $config_filename); $app->run();