我需要创建一个PHP脚本,从亚马逊检索和更新我的库存到我的个人网页.这可以用MWS或任何WS完成吗?并且还需要在我的网站前面显示我在亚马逊的所有产品,并显示用户通过亚马逊购买此项目的链接.
有帮助吗?
欢呼和许多提前感谢
我有两个Symfony应用程序映射到相同的PgSQL数据库.两个应用程序都使用FOSUserBundle,所以我试图处理不同模式的用户.阅读并对Google进行一些研究我按照以下方式构建我的实体:
/**
* @ORM\Entity
* @ORM\Table(name="internal_users", schema="internal")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
*/
class InternalUser extends BaseUser
{
...
}
Run Code Online (Sandbox Code Playgroud)
然后我从Symofny2 shell尝试了以下内容:
Symfony > doctrine:schema:validate
[Mapping] OK - The mapping files are correct.
[Database] FAIL - The database schema is not in sync with the current mapping file.
The command terminated with an error status (2)
Symfony > doctrine:schema:update --force
Updating database schema...
Database schema updated successfully! "14" queries were executed
Symfony >
Run Code Online (Sandbox Code Playgroud)
但是表格是在public架构上生成的,而不是internal我想要的架构,我做错了什么?有什么方法可以在不同的模式中创建表吗?
所以,我有这个 HTML 代码:
<input type="checkbox" id="orders_lives_in_ccs" name="orders[lives_in_ccs]" class="lives_in_ccs">
<select id="orders_shipping_from" name="orders[shipping_from]" required="required" class="shipping_from toSelect2">
<option value="" selected="selected">-- SELECCIONAR --</option>
<option value="MRW">MRW - COBRO EN DESTINO</option>
<option value="DOMESA">DOMESA - COBRO EN DESTINO</option>
<option value="ZOOM">GRUPO ZOOM - COBRO EN DESTINO</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我需要MRW在.lives_in_ccs选中复选框时删除该选项,因此我编写了以下代码:
$(function () {
$('.toSelect2').select2();
var detachedMember;
$('.lives_in_ccs').click(function () {
if (this.checked) {
detachedMember = $('.shipping_from option[value="MRW"]').detach();
} else {
$('.shipping_from option[value=""]').after(detachedMember);
}
$(".secure_shipping").toggle(this.checked);
});
});
Run Code Online (Sandbox Code Playgroud)
该代码有效,但我遇到了问题并且没有找到解决方法。让这个jsFiddle 做这个测试:
--SELECCIONAR--在左侧标记复选标记,这将起作用并将MRW从主 …我有一段时间怀疑,但现在是时候问一下了.请参阅下面的代码并包含大量项目$someVar,例如200项:
// First approach
foreach($someVar as $item) {
$item = $em->getRepository('someEntity')->find($item['value']);
$em->remove($item);
$em->flush();
}
// Second approach
foreach($someVar as $item) {
$item = $em->getRepository('someEntity')->find($item['value']);
$em->remove($item);
}
$em->flush();
Run Code Online (Sandbox Code Playgroud)
用真实案例进行测试
在答案中提供了很好的信息,我仍然怀疑.看看这段代码:
foreach ($request->request->get( 'items' ) as $item) {
$items = $em->getRepository( 'AppBundle:FacturaProductoSolicitud' )->find( $item['value'] );
try {
$em->remove( $items );
$em->flush();
array_push($itemsRemoved, $item['value']);
$response['itemsRemoved'] = $itemsRemoved;
$response['success'] = true;
} catch ( \Exception $e ) {
dump( $e->getMessage() );
array_push($itemsNonRemoved, $item['value']);
$response['itemsNonRemoved'] = $itemsNonRemoved;
$response['success'] = …Run Code Online (Sandbox Code Playgroud) 我在尝试清除Docker创建的图像时遇到了一个奇怪的问题.这就是我做的:
删除所有容器
$ docker rm $(docker ps -a -q)
bb3927e956bf
3e2eeb6287c4
Run Code Online (Sandbox Code Playgroud)检查是否有任何容器在运行或创建后:
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Run Code Online (Sandbox Code Playgroud)删除所有图像:第一次尝试失败,因为图像被引用
$ docker rmi $(docker images -q)
Error response from daemon: conflict: unable to delete 2f21ea981017 (must be forced) - image is referenced in one or more repositories
Error response from daemon: conflict: unable to delete 2f21ea981017 (must be forced) - image is referenced in one or more repositories
Run Code Online (Sandbox Code Playgroud)使用-f选项删除所有图像:
$ docker rmi -f …Run Code Online (Sandbox Code Playgroud)我有以下docker-compose.yml文件:
version: '2'
services:
php-apache:
image: reynierpm/php55-dev
ports:
- "80:80"
environment:
PHP_ERROR_REPORTING: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE'
volumes:
- ~/data:/data
Run Code Online (Sandbox Code Playgroud)
每次运行以下命令时,docker-compose up -d它都会一直创建一个具有相同名称的容器,例如php55devwork_php-apache_1,该文件所在的文件夹加上服务名称.例如:
[rperez@dev php55-dev-work] $ tree
.
??? composer.json
??? docker-compose.yml
??? Dockerfile
Run Code Online (Sandbox Code Playgroud)
有没有办法随机更改此名称?现在我想在同一个容器中测试另一个应用程序但是另一个实例,我唯一的解决方案就是将内容复制到另一个文件夹中.
什么是最好的解决方案?
我一直在尝试使用Docker和Docker Compose构建一个PHP cli容器,我想让它保持活着而不需要在其中运行任何PHP脚本.
我试过自己的Dockerfile:
FROM ubuntu:16.04
ENV PATH="/root/.composer/vendor/bin:${PATH}"
RUN apt-get update && \
apt-get -y -qq install software-properties-common \
xvfb \
locales && \
locale-gen en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
add-apt-repository ppa:ondrej/php && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated install \
php7.1-curl \
php7.1-cli \
php7.1-bcmath \
php7.1-json \
php7.1-intl \
php7.1-mbstring \
php7.1-mcrypt \
php7.1-mysql \
php7.1-xml \
php7.1-xsl \
php7.1-zip \
curl \
git \
wget \ …Run Code Online (Sandbox Code Playgroud) Let's said that I have installed PHP 5.5.x in Ubuntu and it comes with a default configuration. I would like to overwrite a few configurations but I do not want to (this is how I know it's possible):
php.ini file.php file to overwrite them.htaccess files and directivesI would like to create a file named custom-php.ini with the following lines (as an example):
; Basic configuration override
expose_php …Run Code Online (Sandbox Code Playgroud) 我以rperez. 我已经设置了 Docker 以便能够通过这个用户运行,所以我正在运行一个容器,如下所示:
$ docker run -d \
-it \
-e HOST_IP=192.168.1.66 \
-e PHP_ERROR_REPORTING='E_ALL & ~E_STRICT' \
-p 80:80 \
-v ~/var/www:/var/www \
--name php55-dev reypm/php55-dev
Run Code Online (Sandbox Code Playgroud)
请注意该$符号表示我以非 root 用户身份运行命令(使用#)。上面的命令创建以下目录:/home/rperez/var/www但所有者设置为root我相信这是因为docker在root后台以用户身份运行。
有了这个设置,我无法在下面创建文件~/var/www,rperez因为所有者是root如此......
处理这个问题的正确方法是什么?我已经阅读了这个和这个,但不是很有帮助。
有什么帮助吗?
我有以下代码:
<ul class="ul" id="selected_conditions">
<li data-field="asset_locations_name" data-condition="in">
<i class="fa fa-minus-circle delete_condition" aria-hidden="true" title="Click to remove this condition from the list"></i> WHERE asset_locations_name IN(
<span class="condition_item" data-id="1213381233">
<i class="fa fa-minus-circle delete" title="Click to remove this item from the list" aria-hidden="true"></i> 1213381233
</span>,
<span class="condition_item" data-id="1212371897">
<i class="fa fa-minus-circle delete" title="Click to remove this item from the list" aria-hidden="true"></i> 1212371897
</span> )
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
每次我点击小图标.delete我应该删除当前值,我可以使用以下代码实现:
$(function() {
$('#selected_conditions').on('click', '.delete', function(ev) {
var item_id = $(this).parent().data('id');
$('.condition_item[data-id="'+ item_id +'"]').remove();
});
}); …Run Code Online (Sandbox Code Playgroud) php ×5
docker ×4
doctrine-orm ×2
javascript ×2
jquery ×2
linux ×2
symfony ×2
amazon-mws ×1
docker-image ×1
inventory ×1
php-5.5 ×1
postgresql ×1