public function __construct($sandbox, $obj_path, $params = NULL)
 {
     Charcoal_ParamTrait::validateSandbox(1, $sandbox);
     Charcoal_ParamTrait::validateStringOrObjectPath(1, $obj_path);
     Charcoal_ParamTrait::validateHashMap(2, $params, TRUE);
     parent::__construct(p(array()));
     $this->_sandbox = $sandbox;
     $this->_obj_path = is_string(us($obj_path)) ? new Charcoal_ObjectPath($obj_path) : $obj_path;
     $this->_params = $params ? $params : m(array());
 }
Ejemplo n.º 2
0
 public static function makeAbsoluteURL($sandbox, $obj_path, $params = NULL)
 {
     Charcoal_ParamTrait::validateSandbox(1, $sandbox);
     Charcoal_ParamTrait::validateStringOrObject(2, 'Charcoal_ObjectPath', $obj_path);
     Charcoal_ParamTrait::validateHashMap(3, $params, TRUE);
     // サーバ名
     $url = 'http://' . $_SERVER['SERVER_NAME'];
     // サーバのパス
     $url .= dirname($_SERVER['SCRIPT_NAME']);
     // 相対部分を追加
     $url .= self::makeRelativeURL($sandbox, $obj_path, $params);
     return $url;
 }
Ejemplo n.º 3
0
 private static function getEncodingStringFromCode($sandbox, $encoding)
 {
     Charcoal_ParamTrait::validateSandbox(1, $sandbox);
     //        Charcoal_ParamTrait::validateString( 2, $encoding );
     $encoding_string = null;
     $encoding = strtoupper($encoding);
     switch ($encoding) {
         // MAIL
         case 'MAIL':
             $encoding_string = 'ISO-2022-JP';
             break;
         case 'JIS':
             $encoding_string = 'JIS';
             break;
         case 'SJIS':
         case 'SHIFT_JIS':
             $encoding_string = 'SJIS';
             break;
         case 'UTF8':
             $encoding_string = 'UTF8';
             break;
         default:
             $encoding_string = $sandbox->getProfile()->getString($encoding . '_CODE');
             break;
     }
     if (empty($encoding_string)) {
         _throw(new Charcoal_InvalidEncodingCodeException($encoding));
     }
     return $encoding_string;
 }