这可能是一个非常明显的问题,但它让我疯狂.
我们有一个drupal安装,我们需要更改site_name和site_slogan变量.这听起来应该很简单,但我无法在管理面板中的任何地方找到选项来执行此操作.我能找到的唯一地方是初始安装脚本
我知道我可以编写一些代码来调用variable_set('site_name',...)来完成它,但这似乎是一个最后的解决方案; 我宁愿以正确的方式去做.
谁能指出我正确的方向?
谢谢.
我正在编写一个CakePHP应用程序,并试图将经常显示(或特别长)的文本保存在我们可以轻松编辑的配置文件中.
我应该把这个文件放在哪里,如何访问它?
当我们需要显示文本以及从能够使用它的其他进程锁定时,我也担心读取此文件的速度权衡.这是我应该担心的问题还是框架处理的问题?
我想找到一种在.properties不同部署配置的多个文件之间切换的权宜之计.
我最初的倾向是创建一个单独的文件selector.properties,其单个属性用于确定正确的文件:
properties.file=deploymentConfiguration1.properties
...对于一个部署,或:
properties.file=deploymentConfiguration2.properties
...用于下一次部署.
我团队的另一位开发人员有一个ApplicationProperties班级,其中:
private static final String PROP_FILE="someFileName.properties";
......是做到这一点的手段.但是,我想切换属性文件而不重建!提前感谢您的意见.
编辑:也许我最初应该更清楚,但这是针对一组打包为AAR的Web服务.我将它放入Web服务器,让Tomcat和Axis2做他们的事情.
所以,我不认为命令行参数的一些答案将在这种情况下起作用.
我正在尝试使用hibernate注释实现我的模型.我有3个班级,图像,人物和标签.标签是由4个字段组成的表,id,personId,imageId和createdDate.Person有字段名,id,birthdate等.我的图像类定义如下:
@Entity
@Table(name="Image")
public class Image {
private Integer imageId;
private Set<Person> persons = new HashSet<Person>();
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
public Integer getImageId() {
return imageId;
}
public void setImageId(Integer imageId) {
this.imageId = imageId;
}
@ManyToMany
@JoinTable(name="Tags",
joinColumns = {@JoinColumn(name="imageId", nullable=false)},
inverseJoinColumns = {@JoinColumn(name="personId", nullable=false)})
public Set<Person> getPersons() {
return persons;
}
public void setPersons(Set<Person> persons) {
this.persons = persons;
}
Run Code Online (Sandbox Code Playgroud)
如果我删除了getPersons()方法上的注释,我可以使用这些类并添加和删除记录.我想用图像获取所有标签,我正在尝试使用一组.我一直收到以下错误:
org.hibernate.LazyInitializationException - failed to lazily initialize a collection of role: com.exmaple.persons, no session or …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用hibernate插入记录.当数据库usernanme和密码与所有其他属性一起在hibernate配置文件中时,它工作正常.
但是当我从配置文件中删除用户名和密码时,我无法插入.我能做错什么?
Configuration c = new Configuration();
c.configure();
c.setProperty("connection.username", "abc" );
c.setProperty("connection.password", "secret" );
SessionFactory sessFact = c.buildSessionFactory();
Session sess = sessFact.openSession();
Transaction tx = sess.beginTransaction();
sess.save(inf);
tx.commit();
sess.close();
Run Code Online (Sandbox Code Playgroud)
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection
Run Code Online (Sandbox Code Playgroud)
....
Caused by: java.sql.SQLException: invalid arguments in call
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
Run Code Online (Sandbox Code Playgroud)
我想从xml配置文件中选择大多数属性,除了uid和密码.
提前致谢
这有可能吗?例如,通过命名appSettings部分,或嵌套在其他命名部分的appSettings.
我希望实现以下内容:
<section name="development">
<appSettings>
</appSettings>
</section>
<section name="test">
<appSettings>
</appSettings>
</section>
string connectionString
= ConfigurationManager.GetSection("test").AppSettings["connectionString"];
Run Code Online (Sandbox Code Playgroud)
这个模式是什么?
我刚写了一个Magento模块,但它没有被加载,我想调试它.
我正在使用企业库进行日志记录.所以,为了保持我的配置,我正在使用客户端的app.config.该要求已更改为"拆分EL配置和UI配置".我使用enterpriseLibrary.ConfigurationSource做到了.将配置拆分为app.config(对于UI)和EL.config(对于EL).
现在我想从app.cpnfig中隐藏对这个EL.config的引用,这样就不会对用户隐藏这个EL> config的存在.
App.config代码:
<enterpriseLibrary.ConfigurationSource selectedSource="EntLib Configuration Source">
<sources>
<add name="EntLib Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
filePath="C:\My.CommonServices.Logging\My.CommonServices.Logging\EL.config" />
</sources>
Run Code Online (Sandbox Code Playgroud)
我有一个数组来存储这样的配置
$config = array (
'db' => array(
'db1' => array(
'dbname' => 'mydatabase',
'user' => 'myusername',
'pass' => 'mypassword',
'host' => 'myhost'
)
),
'url' => array(
'homeUrl' => 'http://www.example.com'
)
)
Run Code Online (Sandbox Code Playgroud)
我正在编写一个函数来通过传入一个类似的字符串从数组中检索数据,db.db1.dbname并且它假设给我'mydatabase'
我试图将字符串分解为数组以获取密钥,db, db1, and dbname.但在那之后,我有点坚持我应该如何使用它们$config -> db -> db1 -> dbname或者$config['db']['db1']['dbname']为了获得它们'mydatabase'.
理想情况下,假设我有名为的函数read($arg, $array),我想检索这样的结果
read('db.db1.dbname', $config), returns 'mydatabase'
read('url.homeUrl', $config), returns 'http://www.example.com'
Run Code Online (Sandbox Code Playgroud)
由于我不知道字符串中包含多少个键,因此我需要更加动态.提前致谢
我在Magento(/ admin>系统>配置)上的多个扩展中遇到404错误,我通过Magento Connect 2.0安装.我认为这不是扩展的问题,但更多的是我的安装问题.
你有这样的经历吗?
提前致谢
configuration ×10
java ×3
hibernate ×2
magento ×2
php ×2
.net ×1
abstraction ×1
annotations ×1
appsettings ×1
arrays ×1
cakephp ×1
collections ×1
config ×1
debugging ×1
deployment ×1
drupal ×1
drupal-6 ×1
module ×1
properties ×1
split ×1
text ×1
web-config ×1