admin

Respuestas de foro creadas

Viendo 15 respuestas - de la 31 a la 45 (de un total de 59)

0 ANSWERS

16 febrero, 2017 a las 10:08 am admin

If a proxy cache is out of the question, and you’re serving complete HTML files, you’ll get the best performance by bypassing PHP altogether. Study how WP Super Cache works.

Uncached pages are copied to a cache folder with similar URL structure as your site. On later requests, mod_rewrite notes the existence of the cached file and serves it instead. other RewriteCond directives are used to make sure commenters/logged in users see live PHP requests, but the majority of visitors will be served by Apache directly.

16 febrero, 2017 a las 10:07 am admin

No. PHP does what is called automatic type conversion.

In your example

$int = (int)123;
the “(int)” just assures that at that exact moment 123 will be handled as an int.

I think your best bet would be to use a class to provide some sort of type safety.

16 febrero, 2017 a las 10:07 am admin

No, the type LongBlob is specific to MySQL. In PHP it is seen as binary data (usually characters), if you tried to convert it to an int it would take the first 32 bits of data (platform dependent) and push that into the variable.

16 febrero, 2017 a las 10:06 am admin

HTML time-savers are useful, but they’re only useful when they’re intuitive and easy-to-understand. Having to instantiate a new Draw just doesn’t sound very natural. Furthermore, wideHeaderBox and left will only have significance to someone who intimately knows the system. And what if there is a redesign, like your co-worker muses? What if the wideHeaderBox becomes very narrow? Will you change the markup (and styles, presumable) generated by the PHP method but leave a very inaccurate method name to call the code?

If you guys just have to use HTML generation, you should use it interspersed in view files, and you should use it where it’s really necessary/useful, such as something like this:

HTML::link("Wikipedia", "http://en.wikipedia.org");
HTML::bulleted_list(array(
    HTML::list_item("Dogs"),
    HTML::list_item("Cats"),
    HTML::list_item("Armadillos")
));

In the above example, the method names actually make sense to people who aren’t familiar with your system. They’ll also make more sense to you guys when you go back into a seldom-visited file and wonder what the heck you were doing.

16 febrero, 2017 a las 10:04 am admin

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

#activate_pack, .topic-pack {
    background-color: #1ABC9C;
    color:#fff;
    padding:10px 20px;
    cursor:pointer;
    display: inline-block;
}
.knowledge .breadcrumbs {
    background-color: #00a4ef;
    color: #ffffff;
    height: 70px;
    width: 100%;
}

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.
Thanks

16 febrero, 2017 a las 10:04 am admin

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

#activate_pack, .topic-pack {
    background-color: #1ABC9C;
    color:#fff;
    padding:10px 20px;
    cursor:pointer;
    display: inline-block;
}
.knowledge .breadcrumbs {
    background-color: #00a4ef;
    color: #ffffff;
    height: 70px;
    width: 100%;
}

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.
Thanks

16 febrero, 2017 a las 10:03 am admin

Not every framework needs things installed or configured via the command line or even the php.ini file. I believe CodeIgnitor is like this – you can just put the path to the base CI directory in the path and off you go. I’m sure there’s documentation about how to use symfony on a hosting solution. In fact, this document explains how to use symfony on shared hosting.

16 febrero, 2017 a las 10:00 am admin

The filename argument for parse_ini_file is a standard php filename, so the same rules will apply as opening a file using fopen.

You must either specify an absolute file path (“/path/to/my.ini”) or a path relative to your current working directory (“my.ini”). See getcwd for your current working directory.

Unlike the default fopen command, if a relative path is specified (“my.ini”) parse_ini_file will search include paths after searching your current working directory. I verified this in php 5.2.6.

16 febrero, 2017 a las 10:00 am admin

I would imagine it only looks in the current working directory – See http://uk3.php.net/manual/en/function.getcwd.php if you want to know what that is.

You can always find a path relative to your application by basing it on $_SERVER[‘DOCUMENT_ROOT’]

16 febrero, 2017 a las 9:57 am admin

I’d rather provide configuration examples than real config files. In my project there is setup.default.php file in root directory that every user need to copy as setup.php and amend to match local environment. Additionally, to prevent checking in back customised setup files there is a rule for it in .svnignore.

$ echo 'setup.php' > .svnignore
$ svn propset svn:ignore -F .svnignore .
16 febrero, 2017 a las 9:57 am admin

What you are asking is inherently impossible. The game runs on the client and is therefore completely at the user’s mercy. Only way to be sure is running a real time simulation of the game on the server based on user’s input (mouse movement, keypresses), which is absolutely ridiculous.

16 febrero, 2017 a las 9:55 am admin

phing is pretty much ant written in PHP where phpUnderControl adds support for PHP projects to CruiseControl and uses phing or ant on the backend to parse the build.xml file and run commands.

I just set up CruiseControl and phpUnderControl and it’s been working great. It checks out my SVN, runs it through phpDocumentor, PHP_CodeSniffer, and PHPUnit whenever we do a check in. Since it’s all based off of the build.xml file you can run just about any software you want through it.

16 febrero, 2017 a las 9:55 am admin

We’ve been using Phing, and the cost to set it up has been very low; it’s really easy to learn even if you don’t know ANT. I’ve had very bad experiences with CruiseControl (instability – going down randomly) – so I like the simplicity of Phing. Plus, it’s easily extensible using PHP (in case you have a custom task that they don’t support out of the box).

16 febrero, 2017 a las 9:52 am admin

Consider that users might only use one specific syntax element in a posting, so you’d have to check for everything. Looking for “h1.” obviously only works if the user uses exactly that element.

It’s pretty easy with things like headers, but consider that markdown formats *this* as this and Textile will convert that to this instead. So you’d have ambiguous syntax constructs that would yield different results in each language.

I’d suggest going with a user choice. Try to find out what syntax is generally preferred by your users (or you), offer an “use x instead of y” checkbox for those who want the other choice.

16 febrero, 2017 a las 9:52 am admin

Auto-detection, I don’t know, both are based on “natural” typing.
Perhaps you can ask the user to choose a format, with a pair of radio-buttons or something.

Viendo 15 respuestas - de la 31 a la 45 (de un total de 59)