This file contains 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 | |
//http://d.hatena.ne.jp/technohippy/20081121#1227285803 | |
class Acme_ArrayOrdinalAccesser implements ArrayAccess { | |
public function __construct(array $array) { | |
foreach($array as $k => $v ) $this->offsetSet($k, $v); | |
} | |
public function __set($offset, $value) { |
This file contains 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
string(102) "http://translate.google.co.jp/translate_t#ja|en|%E3%81%AA%E3%81%8A%E3%81%A3%E3%81%A6%E3%81%AD%E3%81%88" | |
exception 'Zend_Uri_Exception' with message 'Invalid URI supplied' in /usr/share/phplib/Zend/Uri/Http.php:156 | |
Stack trace: | |
#0 /usr/share/phplib/Zend/Uri.php(132): Zend_Uri_Http->__construct('http', '//translate.goo...') | |
#1 /usr/share/phplib/Zend/Http/Client.php(257): Zend_Uri::factory('http://translat...') | |
#2 /usr/share/phplib/Zend/Http/Client.php(243): Zend_Http_Client->setUri('http://translat...') | |
#3 /home/kazusuke/dev/php/misc/googletranslate.php(10): Zend_Http_Client->__construct('http://translat...') | |
#4 {main}% |
This file contains 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 | |
define ("XOOPS_ROOT_PATH", '/var/www/xoops/html'); | |
require_once 'Zend/Loader/Autoloader/Interface.php'; | |
class Zoops_Autoloader implements Zend_Loader_Autoloader_Interface | |
{ | |
const CLASS_PATH = '/class/%s.php'; | |
const XCUBE_PATH = '/core/%s.class.php'; | |
const LEGACY_PATH = '/modules/legacy/class/%s.class.php'; |
This file contains 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
#!/usr/bin/php | |
<?php | |
//extphp | |
//@see http://fuba.jottit.com/exthtml | |
//how to use : あとで | |
require_once 'Zend/Loader.php'; | |
Zend_Loader::registerAutoload(); | |
$console = new Zend_Console_Getopt( |
This file contains 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
//memo for wedata | |
url ^http://www\.zftalk\.com/logs/view/zftalk\.dev/[0-9]{4}/[0-9]{2}/[0-9]{2}/ | |
nextLink //div[@id="paginationControl"]//a[last()] | |
pageElement //table[@id="log"] | |
exampleUrl http://www.zftalk.com/logs/view/zftalk.dev/2009/03/16/ |
This file contains 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 | |
/** | |
* Webservices for Hanako-san | |
* | |
* PHP version 5 | |
* | |
* LICENSE: This source file is subject to version 3.01 of the PHP license | |
* that is available through the world-wide-web at the following URI: | |
* http://www.php.net/license/3_01.txt. If you did not receive a copy |
This file contains 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 | |
require_once 'PHPUnit/Framework.php'; | |
require_once 'Hanako.php'; | |
/** | |
* Test class for Services_Hanako. | |
* Generated by PHPUnit on 2009-03-21 at 20:12:07. | |
*/ | |
class Www_Kankyosho_HanakoTest extends PHPUnit_Framework_TestCase |
This file contains 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 | |
//php scraperHanko.php -a 03 -m 50810100 | |
require_once 'Zend/Loader.php'; | |
Zend_Loader::registerautoload(); | |
try { | |
$getOpt = new Zend_Console_Getopt(array('mastercode|m=s' =>'mastercode', 'areacode|a=s' => 'arecode')); | |
$getOpt->parse(); |
This file contains 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
package WWW::Hanako; | |
use 5.010000; | |
use strict; | |
use warnings; | |
use Carp; | |
use LWP::UserAgent; | |
use WWW::Mechanize; | |
use Web::Scraper; |
This file contains 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 | |
$pear_conf = new PEAR_Config; | |
$clientConfig = array(); | |
// check proxy | |
if ($http_proxy = $pear_conf->get('http_proxy')) { | |
$uri = Zend_Uri_Http::fromString($http_proxy); | |
if ($uri->getUsername()) $config['proxy_username'] = $uri->getUsername(); | |
if ($uri->getHost()) $config['proxy_host'] = $uri->getHost(); | |
if ($uri->getPort()) $config['proxy_port'] = $uri->getPort(); |
OlderNewer