我正在开展即将开展的项目,但团队需要在线访问它.我使用以下设置(现在)基本身份验证:
<Directory /var/www/html>
AuthType Basic
AuthName "Staging"
AuthUserFile /etc/passwd
Require valid-user
</Directory>
Run Code Online (Sandbox Code Playgroud)
但是,我需要一个文件可以公开访问(第三方服务需要ping它,但不能处理基本身份验证.是否可以"关闭"特定文件的身份验证("specific-file.php") ?
我在调查:
<Files "/var/www/html/specific-file.php">
### SOMETHING
</Files>
Run Code Online (Sandbox Code Playgroud)
但我不清楚如何禁用保护.
谢谢!
我正在构建一个Web应用程序,其中产品可以是几种不同类型(实际上是家具类型),并且根据这些类型,产品具有与之相关的某些字段.
快速背景:我使用MySQL和PHP与CakePHP作为我的框架.我正在寻找的答案不一定需要像"CakePHP一样"; 我更喜欢一般的MySQL最佳数据库设计答案和formost.
所以,我可以想到两个选择:
单表选项 - 我有一个products包含所有可能字段的表,只留下未用于该特定产品的字段null.这是我认为最简单的设计,但会采取在整合了一下鞋赫宁的(因为我的模型将需要跟踪型的,哪些字段被实际更新基于对这种类型的.)
多个产品表选项 - 每个产品都有自己的表,其中包含该特定产品类型的正确字段.有一个主表(products)至少有三个字段id(主键),productType(找到正确的表)和productTypeId(将产品表连接到特定的产品表).
我非常依赖#1,但想得到其他人的想法.
如果您需要更多详细信息,请告诉我们!谢谢!
更新:我只期待一套小型的家具类型(<10开始,最大可能是20).
我正在尝试将rspec_api_documentation(https://github.com/zipmark/rspec_api_documentation)集成到我的sinatra应用程序中。我遇到以下错误。我显然已将错误简化为一个简单的测试,因为我认为一旦我弄清配置中有什么问题,将其重新集成到我的大型应用程序中就可以使用。
谢谢!
在app.rb中:
require 'rubygems'
require 'sinatra'
get '/index' do
"hewoah!"
end
Run Code Online (Sandbox Code Playgroud)
在spec.rb中:
require "rspec_api_documentation"
require "rspec_api_documentation/dsl"
RspecApiDocumentation.configure do |config|
# config.app = App
end
resource "Users" do
get "/index" do
example "Returns text" do
do_request
status.should be_ok
end
end
end
Run Code Online (Sandbox Code Playgroud)
rspec spec/acceptance/spec.rb --require ./app.rb
F的结果
Failures:
1) Users GET /index Returns text
Failure/Error: do_request
NoMethodError:
undefined method `call' for nil:NilClass
# ./spec/acceptance/spec.rb:11:in `block (3 levels) in <top (required)>'
Finished in 0.02234 seconds
1 example, 1 failure
Failed examples: …Run Code Online (Sandbox Code Playgroud) 我有一个viewController(Planner),它在应用程序启动时加载两个视图控制器(InfoEditor和MonthlyPlan).MonthlyPlan隐藏在InfoEditor后面(加载时).
所以我的问题是当我为MonthlyPlan交换InfoEditor时(MonthlyPlan被带到顶部)我如何才能更新MonthlyPlan视图的数据.应用程序启动时正在调用viewDidLoad中的NSLog(这是有道理的.)viewDidAppear和viewWillAppear中的NSLogs没有做任何事情.
有任何想法吗?
谢谢!
- 添加更多细节 -
我自己创建了视图层次结构.一个简单的viewController,只是加载另外两个viewControllers.两个子viewControllers同时加载(在启动应用程序时.)要交换两个视图,我正在使用此代码:
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:0];
Run Code Online (Sandbox Code Playgroud)
交换意见很好.缺少的部分只是告诉子视图的一些方式,你在前面,更新一些属性.
我正在研究一个简单JOIN的两个表(urls和companies).我正在使用此查询调用:
print $this->_db->select()->from(array('u' => 'urls'),
array('id', 'url', 'company_id'))
->join(array('c' => 'companies'),
'u.company_id = c.id');
Run Code Online (Sandbox Code Playgroud)
这是出于这个问题:
SELECT `u`.`id`, `u`.`url`, `u`.`company_id`, `c`.* FROM `urls` AS `u` INNER JOIN `companies` AS `c` ON u.company_id = c.id
Run Code Online (Sandbox Code Playgroud)
现在,我宁愿c.*不实际出现,但无论哪种方式都没关系.ZF死于这个错误:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
Run Code Online (Sandbox Code Playgroud)
但我可以在MySQL CLI中完美地运行该查询.任何想法如何解决这个问题?