本文整理匯總了PHP中Config::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::__construct方法的具體用法?PHP Config::__construct怎麽用?PHP Config::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Config
的用法示例。
在下文中一共展示了Config::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(array $config)
{
parent::__construct($config);
$this->debug = $this->getItem('debug', null, true);
$this->templateDir = realpath($this->getItem('templateDir', null, true));
$this->mediaPath = preg_replace('/\\/\\//', '/', $this->getItem('mediaPath', null, true));
}
示例2: printf
function __construct()
{
parent::__construct();
if (isset($_POST['id'])) {
$id = $_POST['id'];
}
$sql = "SELECT z.id, klad.name kladbishe, kv.name kvartal, z.uchastok, z.shirota, z.dolgota, z.surname, z.name, z.patronymic, z.vid_zahoron, z.otvetstvenniy, z.telefon_otvetstvennogo, z.date_of_birth, z.date_of_death, z.date_create\nFROM zahoron z\nINNER JOIN kvartals kv ON kv . id = z . id_kvartala\nINNER JOIN kladbisha klad ON klad . id = z . id_kladbisha WHERE z.id={$id}";
if (self::$mysqli->connect_errno) {
printf("Не удалось подключиться: %s\n", $mysqli->connect_error);
exit;
}
echo "<table class=' col-md-6 table-responsive'>";
echo "<h2>Карточка умершего</h2>";
$row = self::$mysqli->query($sql);
while ($res = mysqli_fetch_array($row)) {
echo "<tr><td>id</td><td>{$res['id']}</td></tr>";
echo "<tr><td>кладбище</td><td>{$res['kladbishe']}</td></tr>";
echo "<tr><td>квартал</td><td>{$res['kvartal']}</td></tr>";
echo "<tr><td>участок</td><td>{$res['uchastok']}</td></tr>";
echo "<tr><td>фамилия</td><td>{$res['surname']}</td></tr>";
echo "<tr><td>имя</td><td>{$res['name']}</td></tr>";
echo "<tr><td>отчество</td><td>{$res['patronymic']}</td></tr>";
echo "<tr><td>отчество</td><td>{$res['shirota']}</td></tr>";
echo "<tr><td>отчество</td><td>{$res['dolgota']}</td></tr>";
echo "<tr><td>вид захоронения</td><td>{$res['vid_zahoron']}</td></tr>";
echo "<tr><td>ответственный</td><td>{$res['otvetstvenniy']}</td></tr>";
echo "<tr><td>телефон</td><td>{$res['telefon_otvetstvennogo']}</td></tr>";
echo "<tr><td>дата рождения</td><td>{$res['date_of_birth']}</td></tr>";
echo "<tr><td>дата смерти</td><td>{$res['date_of_death']}</td></tr>";
echo "<tr><td>дата создания записи</td><td>{$res['date_create']}</td></tr>";
}
echo "</tr></table>";
}
示例3: __construct
public function __construct()
{
parent::__construct();
if ($_POST['id']) {
$this->returnKvartals($_POST['id']);
}
}
示例4: __construct
/**
* Create a new Config Instance
* @param $configPath - path to configuraiton file.
*/
public function __construct($configPath)
{
// Call Config.php constructor to include $settings and $outputBaseDir.
parent::__construct($configPath);
$this->wsUrl = $this->settings['API']['ws_url'];
$this->mappingCSVpath = $this->settings['INPUT']['mapping_csv_path'];
$this->includeMigratedFromUri = $this->settings['METADATA']['include_migrated_from_uri'];
}
示例5: __construct
public function __construct(){
parent::__construct( DIRECTORY_SEPARATOR, 'afterthought.conf' );
$this->db = new Database( $this->config['db']['user'],
$this->config['db']['pass'],
$this->config['db']['dbname'],
$this->config['db']['host'],
'mysql'
);
}
示例6: __construct
public function __construct($registry, $options = null)
{
if ($options['sync'] && is_bool($options['sync'])) {
$this->sync = $options['sync'];
}
if ($options['protected_mode'] && is_bool($options['protected_mode'])) {
$this->protected_mode = $options['protected_mode'];
}
parent::__construct($registry, $options);
}
示例7: __construct
public function __construct($dbarr = array())
{
parent::__construct($this);
if ($dbarr) {
$this->myhost = $dbarr['myhost'];
$this->dbname = $dbarr['dbname'];
$this->dbport = $dbarr['dbport'];
$this->dbroot = $dbarr['dbroot'];
$this->dbpwd = $dbarr['dbpwd'];
$this->dbcharset = isset($dbarr['dbcharset']) ? $dbarr['dbcharset'] : 'gb2312';
$this->linkstyle = isset($dbarr['linkstyle']) ? $dbarr['linkstyle'] : 0;
$this->dbstyle = isset($dbarr['dbstyle']) ? $dbarr['dbstyle'] : 'mysql';
}
$this->db = $this->connectDb();
}
示例8: __construct
/**
* @param Config $config OPTIONAL override default config
*/
public function __construct(Config $config = null)
{
parent::__construct();
if ($config) {
foreach ($config as $key => $value) {
$this->{$key} = $value;
}
}
$this->config = $config ?: $this;
$this->logger = new Logger($this->debug);
$this->cache = new Cache($this->config, $this->logger);
$this->pages = new Pages($this->config, $this->cache, $this->logger);
if ($this->storecache && $this->cache_expire > 0) {
$this->cache->purge();
}
}
示例9: __construct
/**
* Конструктор.
* @param array $source данные конфигурации
* @param string $alias символическое имя
*/
public function __construct(array &$source, $alias)
{
$this->alias = $alias;
parent::__construct($source);
}
示例10: __construct
public function __construct($sConfigFile = 'config.json')
{
parent::__construct($sConfigFile);
$this->setup();
}
示例11: __construct
/**
* Most importantly, this constructor initializes the full set of
* settings and options that afect Quickmail.
*
* As important, it sets the configured value for the Scenario to which
* this QMConfig object belongs.
* @see Scenario::$config Scenario::$config
* @see QMConfig::initSettings() initSettings()
*
* @TODO Check whether we need to call parent constructor..
* @param type $params
* @throws Exception
*/
public function __construct($params = array())
{
parent::__construct($params);
foreach (self::settings() as $setting) {
$s = new Setting($setting['setting']);
foreach ($setting['options'] as $o) {
$s->addOption($o);
}
$this->settings[$s->key] = $s;
}
}
示例12: __construct
/**
* Loads the section $section from the config file (or string $xml for
* access facilitated by nested object properties.
*
* Sections are defined in the XML as children of the root element.
*
* In order to extend another section, a section defines the "extends"
* attribute having a value of the section name from which the extending
* section inherits values.
*
* Note that the keys in $section will override any keys of the same
* name in the sections that have been included via "extends".
*
* @param string $xml XML file or string to process
* @param mixed $section Section to process
* @param boolean $options Whether modifications are allowed at runtime
* @throws \Zend\Config\Exception When xml is not set or cannot be loaded
* @throws \Zend\Config\Exception When section $sectionName cannot be found in $xml
*/
public function __construct($xml, $section = null, $options = false)
{
if (empty($xml)) {
throw new Exception\InvalidArgumentException('Filename is not set');
}
$allowModifications = false;
if (is_bool($options)) {
$allowModifications = $options;
} elseif (is_array($options)) {
if (isset($options['allowModifications'])) {
$allowModifications = (bool) $options['allowModifications'];
}
if (isset($options['skipExtends'])) {
$this->_skipExtends = (bool) $options['skipExtends'];
}
}
// load XML and throw exception of each failure using previous exception
$oldUseInternalErrors = libxml_use_internal_errors(true);
if ($oldUseInternalErrors) {
libxml_clear_errors();
}
if (strstr($xml, '<' . '?xml')) {
// string concat to fix syntax highlighting
$config = simplexml_load_string($xml);
} else {
$config = simplexml_load_file($xml);
}
$xmlErrors = libxml_get_errors();
if (!$oldUseInternalErrors) {
libxml_use_internal_errors(false);
}
if (count($xmlErrors)) {
libxml_clear_errors();
// create and throw exception stack
$e = null;
foreach ($xmlErrors as $xmlError) {
$msg = trim($xmlError->message);
$line = $xmlError->line;
$col = $xmlError->column;
$e = new Exception\RuntimeException($msg . ' @ line/column ' . $line . '/' . $col, 0, $e);
}
throw $e;
}
if ($section === null) {
$dataArray = array();
foreach ($config as $sectionName => $sectionData) {
$dataArray[$sectionName] = $this->_processExtends($config, $sectionName);
}
parent::__construct($dataArray, $allowModifications);
} else {
if (is_array($section)) {
$dataArray = array();
foreach ($section as $sectionName) {
if (!isset($config->{$sectionName})) {
throw new Exception\InvalidArgumentException("Section '{$sectionName}' cannot be found in {$xml}");
}
$dataArray = array_merge($this->_processExtends($config, $sectionName), $dataArray);
}
parent::__construct($dataArray, $allowModifications);
} else {
if (!isset($config->{$section})) {
throw new Exception\InvalidArgumentException("Section '{$section}' cannot be found in {$xml}");
}
$dataArray = $this->_processExtends($config, $section);
if (!is_array($dataArray)) {
// Section in the XML file contains just one top level string
$dataArray = array($section => $dataArray);
}
parent::__construct($dataArray, $allowModifications);
}
}
$this->_loadedSection = $section;
}
示例13: __construct
/**
* Create a new Config Instance
* @param $configPath - path to configuraiton file.
*/
public function __construct($configPath)
{
// Call Config.php constructor to include $settings and $outputBaseDir.
parent::__construct($configPath);
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->connection = parent::getconnection();
}
示例15: __construct
public function __construct($page_title, $body_id){
parent::__construct( DIRECTORY_SEPARATOR, 'afterthought.conf' );
$this->page_title = $page_title;
$this->body_id = $body_id;
}