This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(PHP_OS == 'WINNT') { | |
$CONFIG = array ( | |
'datadirectory' => 'D:\owen\Documents\phpstorm\oc2\data', | |
'dbhost' => 'home.lise', | |
// Extra SSL options to be used for configuration | |
'openssl' => array( | |
'config' => 'C:\Program Files (x86)\iis express\PHP\v5.4\extras\openssl.cnf', | |
), | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run | no autoloader cache | APC | |
---|---|---|---|
1 | 0.82526803 | 1.097486973 | |
2 | 0.341663837 | 0.340631008 | |
3 | 0.356065035 | 0.341625929 | |
4 | 0.391163111 | 0.354048967 | |
5 | 0.349993944 | 0.322378874 | |
6 | 0.399251938 | 0.341935158 | |
7 | 0.538627148 | 0.374629021 | |
8 | 0.362586021 | 0.437278986 | |
9 | 0.354948997 | 0.395817995 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $RUNTIME_NOAPPS; | |
$RUNTIME_NOAPPS = true; | |
define('PHPUNIT_RUN', 1); | |
require_once __DIR__.'/lib/base.php'; | |
require_once __DIR__.'/lib/autoloader.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd /c/xampp/htdocs/vdr/master.oc.claire/htdocs | |
rm config/config.php | |
mysqladmin -f -s -uroot drop oc_master | |
mysqladmin -f -s -uroot create oc_master | |
rm -rf data/* | |
rm -rf data/.htaccess | |
#echo "<?php | |
#\$AUTOCONFIG = array( | |
# 'dbtype' => 'mysql', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetEnv MOD_X_SENDFILE_ENABLED 1 | |
XSendFile On | |
XSendFilePath /tmp/oc-noclean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Habari; | |
class MyPlugin extends Plugin | |
{ | |
/* Implementing this function modifies the admin options form */ | |
public function action_modify_form_admin_options(FormUI $form) { | |
// Add a wrapper for a new "example" section before the form buttons |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
public function filter_final_output($buffer) | |
{ | |
$regex = '%http://[^/]+?\.static\.flickr\.com/[0-9a-f/_]+\w?\.(jpg|png|gif)%i'; | |
if(preg_match_all($regex, $buffer, $matches, PREG_SET_ORDER)) { | |
foreach($matches as $match) { | |
$hashfile = 'flickr.static.' . md5($match[0]) . '.' . $match[1]; | |
if(!file_exists(HABARI_PATH . '/user/files/' . $hashfile)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX terms:<http://wiktionary.dbpedia.org/terms/> | |
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dc:<http://purl.org/dc/elements/1.1/> | |
SELECT ?swordRes ?sword ?slang ?spos | |
FROM <http://wiktionary.dbpedia.org> | |
WHERE { | |
?swordRes rdfs:label ?sword . | |
?swordRes dc:language <http://wiktionary.dbpedia.org/terms/English> . | |
?swordRes dc:language ?slang . | |
?swordRes terms:hasPoS ?spos . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test_scrape_allconsuming() { | |
$out = array(); | |
for($x = 1;$x <= 43; $x++) { | |
$p = file_get_contents('http://www.allconsuming.net/person/mikelietz/consumed/book?page=' . $x); | |
$h = \Habari\HTMLDoc::create($p); | |
foreach($h->find('strong a') as $node) { | |
if(preg_match('#^/item/view/#', $node->href, $matches)) { | |
$p = file_get_contents('http://www.allconsuming.net' . $node->href); | |
$h2 = \Habari\HTMLDoc::create($p); | |
$as = $h2->find('a'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function action_before_act_admin( ) { | |
$this->add_template('dashboard', dirname(__FILE__) . '/templates/dash.php', true); | |
} |