コード例 #1
0
ファイル: ErrorHandel.php プロジェクト: aoyel/pinst
 public function init()
 {
     parent::init();
     \Pinst::$app->registerShutdownFunction(function ($app) {
         $app->errorHandel->unregister();
     });
 }
コード例 #2
0
 /**
  * Sets an order as the current order.
  * @param Int | Order $order
  * @return Boolean
  */
 public function loadOrder($order)
 {
     //TODO: how to handle existing order
     //TODO: permission check - does this belong to another member? ...or should permission be assumed already?
     if (is_numeric($order)) {
         $this->order = DataObject::get_by_id('Order', $order);
     } elseif ($order instanceof Order) {
         $this->order = $order;
     }
     if ($this->order) {
         if ($this->order->canView()) {
             $this->order->init(true);
             $sessionVariableName = $this->sessionVariableName("OrderID");
             Session::set($sessionVariableName, $this->order->ID);
             $this->addMessage(_t("ShoppingCart.LOADEDEXISTING", "Order loaded."), 'good');
             return true;
         } else {
             $this->addMessage(_t("ShoppingCart.NOPERMISSION", "You do not have permission to view this order."), 'bad');
             return false;
         }
     } else {
         $this->addMessage(_t("ShoppingCart.NOORDER", "Order can not be found."), 'bad');
         return false;
     }
 }
コード例 #3
0
ファイル: SFXService.php プロジェクト: TAMULib/CORAL-Terms
 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
     //determine the full URL
     //change the string sent to SFX depending on whether ISBN or ISSN was passed in
     if ($this->isbn) {
         $stringAppend = "&isbn=" . $this->isbn;
     } else {
         $stringAppend = "&issn=" . $this->issn;
     }
     //get the sfx open URL out of the config settings
     $open_url = $this->config->settings->open_url;
     //check if there is already a ? in the URL so that we don't add another when appending the parms
     if (strpos($open_url, "?") > 0) {
         $open_url .= "&";
     } else {
         $open_url .= "?";
     }
     $sid = $this->config->settings->sid;
     if ($sid) {
         $open_url .= "rfr_id=info:sid/" . $sid;
     }
     $this->open_url = $open_url . "&sfx.ignore_date_threshold=1&sfx.response_type=simplexml" . $stringAppend;
 }
コード例 #4
0
ファイル: TermsService.php プロジェクト: TAMULib/CORAL-Terms
 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
 }
コード例 #5
0
 /**
  * Sets an order as the current order.
  * @param Int | Order $order
  * @return Boolean
  */
 public function loadOrder($order)
 {
     //TODO: how to handle existing order
     //TODO: permission check - does this belong to another member? ...or should permission be assumed already?
     if (is_numeric($order)) {
         $this->order = Order::get()->byID($order);
     } elseif (is_a($order, Object::getCustomClass("Order"))) {
         $this->order = $order;
     } else {
         user_error("Bad order provided as parameter to ShoppingCart::loadOrder()");
     }
     if ($this->order) {
         if ($this->order->canView()) {
             $this->order->init(true);
             $sessionVariableName = $this->sessionVariableName("OrderID");
             Session::set($sessionVariableName, $this->order->ID);
             $this->addMessage(_t("Order.LOADEDEXISTING", "Order loaded."), 'good');
             return true;
         } else {
             $this->addMessage(_t("Order.NOPERMISSION", "You do not have permission to view this order."), 'bad');
             return false;
         }
     } else {
         $this->addMessage(_t("Order.NOORDER", "Order can not be found."), 'bad');
         return false;
     }
 }
コード例 #6
0
ファイル: Logger.php プロジェクト: aoyel/pinst
 public function init()
 {
     parent::init();
     \Pinst::$app->registerShutdownFunction(function ($app) {
         $app->logger->save();
     });
 }
コード例 #7
0
 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
     //determine the full open URL
     //change the string sent depending on whether ISBN or ISSN was passed in
     if ($this->isbn) {
         $stringAppend = "&rft.isbn=" . $this->isbn;
     } else {
         $stringAppend = "&rft.issn=" . $this->issn;
     }
     //get the client identifier out of the config settings
     $client_identifier = $this->config->settings->client_identifier;
     $this->open_url = "http://" . $client_identifier . ".openurl.xml.serialssolutions.com/openurlxml?version=1.0&url_ver=Z39.88-2004" . $stringAppend;
 }
コード例 #8
0
ファイル: AutoLoader.php プロジェクト: mpf-soft/mpf
 /**
  * When initiating set value for self::$_self; so that it can be called from ::get();
  * Multiple values will be set for that, one for each config variant that is initiated.
  * @param string[] $config Config values that were used when the object was instantiated.
  */
 protected function init($config)
 {
     $this->addNamespace(self::APP_DEVELOPER_VENDORKEY, APP_ROOT);
     self::$_self[md5(serialize($config))] = $this;
     return parent::init();
 }
コード例 #9
0
ファイル: Object.php プロジェクト: euro-ix/ixf-client-php
            $params[$k] = $v;
        }
        return $params;
    }
    public function getType()
    {
        return substr($this->_id, 0, strpos($this->_id, "."));
    }
    public function __toJSON()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode($this->__toArray(true), JSON_PRETTY_PRINT);
        } else {
            return json_encode($this->__toArray(true));
        }
    }
    public function __toString()
    {
        return $this->__toJSON();
    }
    public function __toArray($recursive = false)
    {
        if ($recursive) {
            return Util::convertIxfObjectToArray($this->_values);
        } else {
            return $this->_values;
        }
    }
}
Object::init();
コード例 #10
0
ファイル: Map.php プロジェクト: EMerino236/afiperudrupal
 /**
  * {@inheritdoc}
  */
 public function init(array $data)
 {
     parent::init($data);
     $this->setOption('target', $this->getId());
 }
コード例 #11
0
ファイル: Db.php プロジェクト: aoyel/pinst
 public function init()
 {
     parent::init();
 }